diff --git a/main/admin/index.php b/main/admin/index.php index 5493fd8883..18469e492f 100644 --- a/main/admin/index.php +++ b/main/admin/index.php @@ -154,7 +154,7 @@ if (api_is_platform_admin()) { /* Sessions */ -if (api_get_setting('use_session_mode') == 'true') { +if (api_get_setting('use_session_mode') == 'true') { $blocks['sessions']['icon'] = Display::return_icon('session.png', get_lang('Sessions'), array(), 22); $blocks['sessions']['label'] = api_ucfirst(get_lang('Sessions')); @@ -239,9 +239,23 @@ if (api_is_platform_admin()) { $items[] = array('url'=>'configure_extensions.php?display=serverstats', 'label' => get_lang('ServerStatistics')); $items[] = array('url'=>'configure_extensions.php?display=bandwidthstats', 'label' => get_lang('BandWidthStatistics')); $blocks['extensions']['items'] = $items; + + + //Skills + + $blocks['skills']['icon'] = Display::return_icon('logo.gif', get_lang('Skills')); + $blocks['skills']['label'] = get_lang('Skills'); + + $items = array(); + $items[] = array('url'=>'skills.php', 'label' => get_lang('SkillsTree')); + $items[] = array('url'=>'skills_profile.php', 'label' => get_lang('SkillsProfile')); + $items[] = array('url'=>'skills_gradebook.php', 'label' => get_lang('SkillsGradebook')); + + $blocks['skills']['items'] = $items; + - /* Extensions */ + /* Chamilo.org */ $blocks['chamilo']['icon'] = Display::return_icon('logo.gif', 'Chamilo.org'); $blocks['chamilo']['label'] = 'Chamilo.org'; @@ -258,6 +272,9 @@ if (api_is_platform_admin()) { $items[] = array('url'=>'http://www.chamilo.org/extensions', 'label' => get_lang('ChamiloExtensions')); $blocks['chamilo']['items'] = $items; + + + // Try to display a maximum before we check the chamilo version and all that. //session_write_close(); //close session to avoid blocking concurrent access diff --git a/main/admin/skills_gradebook.php b/main/admin/skills_gradebook.php index 431ce65e07..184c329cfa 100644 --- a/main/admin/skills_gradebook.php +++ b/main/admin/skills_gradebook.php @@ -19,11 +19,22 @@ api_protect_admin_script(); //Adds the JS needed to use the jqgrid $htmlHeadXtra[] = api_get_jquery_ui_js(true); -Display::display_header(); +$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'display'; + // setting breadcrumbs + +$tool_name = get_lang('SkillGradebook'); $interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); -$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions')); +if ($action == 'add_skill') { + $interbreadcrumb[]=array('url' => 'skills_gradebook.php','name' => get_lang('SkillGradebook')); + $tool_name = get_lang('Add'); +} + + +Display::display_header($tool_name); + + //jqgrid will use this URL to do the selects @@ -60,7 +71,7 @@ $(function() { display(); diff --git a/main/admin/skills_profile.php b/main/admin/skills_profile.php index 573b94dd7d..a6a99a7a0a 100644 --- a/main/admin/skills_profile.php +++ b/main/admin/skills_profile.php @@ -17,28 +17,27 @@ api_protect_admin_script(); $htmlHeadXtra[] = ''; $htmlHeadXtra[] = ''; - $htmlHeadXtra[] = api_get_jquery_ui_js(); +$interbreadcrumb[] = array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); + $skill = new Skill(); $skill_profile = new SkillProfile(); $skill_rel_user = new SkillRelUser(); $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php'; -$tpl = new Template(); +$tpl = new Template(get_lang('Skills')); $form = new FormValidator('profile_search'); $form->addElement('select', 'skills', null, null, array('id'=>'skills')); $form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="a_button blue "'); - $profiles = $skill_profile->get_all(); $tpl->assign('profiles', $profiles); - $total_skills_to_search = array(); if ($form->validate()) { diff --git a/main/inc/ajax/model.ajax.php b/main/inc/ajax/model.ajax.php index e7ff15e745..ccd7817825 100644 --- a/main/inc/ajax/model.ajax.php +++ b/main/inc/ajax/model.ajax.php @@ -83,6 +83,9 @@ switch ($action) { $result = Database::select('*', $obj->table, array('order'=>"$sidx $sord", 'LIMIT'=> "$start , $limit")); $new_result = array(); foreach($result as $item) { + if ($item['parent_id'] != 0) { + continue; + } $skills = $obj->get_skills_by_gradebook($item['id']); //Fixes bug when gradebook doesn't have names if (empty($item['name'])) { diff --git a/main/inc/ajax/skill.ajax.php b/main/inc/ajax/skill.ajax.php index adc1c2a414..e2bf43bd8e 100644 --- a/main/inc/ajax/skill.ajax.php +++ b/main/inc/ajax/skill.ajax.php @@ -37,19 +37,20 @@ switch ($action) { break; case 'get_gradebooks': $gradebooks = $gradebook_list = $gradebook->get_all(); - /*$gradebook_list = array(); + $gradebook_list = array(); + //only course gradebook if (!empty($gradebooks)) { foreach($gradebooks as $gradebook) { if ($gradebook['parent_id'] == 0) { - $gradebook['name'] = $gradebook['name']; + //$gradebook['name'] = $gradebook['name']; $gradebook_list[] = $gradebook; } else { // $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name']; - $gradebook_list[] = $gradebook; + //$gradebook_list[] = $gradebook; } } - }*/ + } echo json_encode($gradebook_list); break; case 'get_skills': diff --git a/main/inc/lib/gradebook.lib.php b/main/inc/lib/gradebook.lib.php index c33e72c8d7..7129fd8132 100644 --- a/main/inc/lib/gradebook.lib.php +++ b/main/inc/lib/gradebook.lib.php @@ -129,10 +129,12 @@ class Gradebook extends Model { */ public function display() { // action links + /* echo '
'; + */ echo Display::grid_html('gradebooks'); } diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 67c0ab4521..71993b614b 100644 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -393,12 +393,12 @@ class IndexManager { function return_skills_links() { $content = '