Adding switch on/off for the skills management

skala
Julio Montoya 14 years ago
parent f646c332f4
commit bd5165f0cd
  1. 23
      main/admin/index.php
  2. 4
      main/admin/skills.php
  3. 5
      main/admin/skills_gradebook.php
  4. 4
      main/admin/skills_profile.php
  5. 19
      main/gradebook/lib/fe/catform.class.php
  6. 4
      main/inc/lib/template.lib.php
  7. 2
      main/inc/lib/usermanager.lib.php
  8. 11
      main/inc/lib/userportal.lib.php
  9. 7
      main/install/db_main.sql
  10. 8
      main/install/migrate-db-1.8.8-1.9.0-pre.sql
  11. 59
      main/social/home.php
  12. 4
      main/social/skills_tree.php
  13. 6
      main/template/default/layout/head.tpl

@ -268,19 +268,20 @@ if (api_is_platform_admin()) {
//Skills
$blocks['skills']['icon'] = Display::return_icon('logo.gif', get_lang('Skills'), array(), ICON_SIZE_SMALL, false);
$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('SkillsAndGradebooks'));
$blocks['skills']['items'] = $items;
$blocks['skills']['extra'] = null;
$blocks['skills']['search_form'] = null;
if (api_get_setting('allow_skills_tool') == 'true') {
$blocks['skills']['icon'] = Display::return_icon('logo.gif', get_lang('Skills'), array(), ICON_SIZE_SMALL, false);
$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('SkillsAndGradebooks'));
$blocks['skills']['items'] = $items;
$blocks['skills']['extra'] = null;
$blocks['skills']['search_form'] = null;
}
/* Chamilo.org */

@ -17,6 +17,10 @@ $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
if (api_get_setting('allow_skills_tool') != 'true') {
api_not_allowed();
}
//Adds the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_js('jquery.jsPlumb.all.js');
$htmlHeadXtra[] = api_get_js('skills.js');

@ -16,6 +16,11 @@ require_once api_get_path(LIBRARY_PATH).'gradebook.lib.php';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
if (api_get_setting('allow_skills_tool') != 'true') {
api_not_allowed();
}
//Adds the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js();

@ -15,6 +15,10 @@ $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
if (api_get_setting('allow_skills_tool') != 'true') {
api_not_allowed();
}
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/jquery.fcbkcomplete.js" type="text/javascript" language="javascript"></script>';
$htmlHeadXtra[] = '<link href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css" rel="stylesheet" type="text/css" />';

@ -168,16 +168,19 @@ class CatForm extends FormValidator {
$this->addRule('weight',get_lang('ThisFieldIsRequired'),'required');
if (api_is_platform_admin() || api_is_drh()) {
//the magic should be here
$skills = $this->category_object->get_skills();
$this->addElement('select', 'skills', array(get_lang('Skills'), get_lang('SkillsAchievedWhenAchievingThisGradebook')), null, array('id'=>'skills', 'multiple'=>'multiple'));
$content = '';
if (!empty($skills)) {
foreach($skills as $skill) {
$content .= Display::tag('li', $skill['name'].'<a id="deleteskill_'.$skill['id'].'" class="closebutton" href="#"></a>', array('id'=>'skill_'.$skill['id'], 'class'=>'bit-box'));
if (api_get_setting('allow_skills_tool') == 'true') {
//the magic should be here
$skills = $this->category_object->get_skills();
$this->addElement('select', 'skills', array(get_lang('Skills'), get_lang('SkillsAchievedWhenAchievingThisGradebook')), null, array('id'=>'skills', 'multiple'=>'multiple'));
$content = '';
if (!empty($skills)) {
foreach($skills as $skill) {
$content .= Display::tag('li', $skill['name'].'<a id="deleteskill_'.$skill['id'].'" class="closebutton" href="#"></a>', array('id'=>'skill_'.$skill['id'], 'class'=>'bit-box'));
}
}
$this->addElement('label', null, Display::tag('ul', $content, array('class'=>'holder holder_simple')));
}
$this->addElement('label', null, Display::tag('ul', $content, array('class'=>'holder holder_simple')));
}
if (isset($this->category_object) && $this->category_object->get_parent_id() == 0) {

@ -5,10 +5,7 @@
* @todo better organization of the class, methods and variables
*
**/
require_once api_get_path(LIBRARY_PATH).'course_home.lib.php';
require_once api_get_path(LIBRARY_PATH).'banner.lib.php';
require_once api_get_path(LIBRARY_PATH).'plugin.lib.php';
require_once api_get_path(LIBRARY_PATH).'symfony/Twig/Autoloader.php';
class Template {
@ -289,6 +286,7 @@ class Template {
$_p = array('web' => api_get_path(WEB_PATH),
'web_course' => api_get_path(WEB_COURSE_PATH),
'web_main' => api_get_path(WEB_CODE_PATH),
'web_css' => api_get_path(WEB_CSS_PATH),
'web_ajax' => api_get_path(WEB_AJAX_PATH),
'web_img' => api_get_path(WEB_IMG_PATH),
'web_plugin' => api_get_path(WEB_PLUGIN_PATH),

@ -2947,7 +2947,7 @@ class UserManager {
public static function get_search_form($query) {
return '
<form method="GET" class="well form-search" action="'.api_get_path(WEB_PATH).'main/social/search.php">
<input placeholder="'.get_lang('UsersGroups').'" type="text" size="25" value="'.api_htmlentities(Security::remove_XSS($query)).'" name="q"/> &nbsp;
<input placeholder="'.get_lang('UsersGroups').'" type="text" class="input-medium" value="'.api_htmlentities(Security::remove_XSS($query)).'" name="q"/> &nbsp;
<button class="btn" type="submit" value="search">'.get_lang('Search').'</button>
</form>';
}

@ -353,10 +353,13 @@ class IndexManager {
}
function return_skills_links() {
$content = '<ul class="menulist">';
$content .= Display::tag('li', Display::url(get_lang('MySkills'), api_get_path(WEB_CODE_PATH).'social/skills_tree.php'));
$content .= '</ul>';
$html = self::show_right_block(get_lang("Skills"), $content, 'skill_block');
$html = '';
if (api_get_setting('allow_skills_tool') == 'true') {
$content = '<ul class="menulist">';
$content .= Display::tag('li', Display::url(get_lang('MySkills'), api_get_path(WEB_CODE_PATH).'social/skills_tree.php'));
$content .= '</ul>';
$html = self::show_right_block(get_lang("Skills"), $content, 'skill_block');
}
return $html;
}

@ -862,7 +862,8 @@ VALUES
('gradebook_locking_enabled', NULL, 'radio', 'Gradebook', 'false', 'GradebookEnableLockingTitle', 'GradebookEnableLockingComment', NULL, NULL, 0),
('gradebook_default_grade_model_id', NULL, 'select', 'Gradebook', '', 'GradebookDefaultGradeModelTitle', 'GradebookDefaultGradeModelComment', NULL, NULL, 1),
('allow_session_admins_to_see_all_sessions', NULL, 'radio', 'Session', 'false', 'AllowSessionAdminsToSeeAllSessionsTitle', 'AllowSessionAdminsToSeeAllSessionsComment', NULL, NULL, 1),
('chamilo_database_version',NULL,'textfield',NULL, '1.9.0.18035','DatabaseVersion','', NULL, NULL, 0);
('allow_skills_tool', NULL, 'radio', 'Platform', 'false', 'AllowSkillsToolTitle', 'AllowSkillsToolComment', NULL, NULL, 1),
('chamilo_database_version',NULL,'textfield',NULL, '1.9.0.18037','DatabaseVersion','', NULL, NULL, 0);
/*
('show_tabs', 'custom_tab_1', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom1', 1),
@ -1206,7 +1207,9 @@ VALUES
('gradebook_enable_grade_model', 'true', 'Yes'),
('gradebook_enable_grade_model', 'false', 'No'),
('allow_session_admins_to_see_all_sessions', 'true', 'Yes'),
('allow_session_admins_to_see_all_sessions', 'false', 'No');
('allow_session_admins_to_see_all_sessions', 'false', 'No'),
('allow_skills_tool', 'true', 'Yes'),
('allow_skills_tool', 'false', 'No');
UNLOCK TABLES;
/*

@ -203,7 +203,11 @@ INSERT INTO settings_options(variable,value,display_text) VALUES ('page_after_lo
ALTER TABLE settings_current ADD COLUMN access_url_locked INTEGER NOT NULL DEFAULT 0;
-- skills
-- Skills
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('allow_skills_tool', NULL, 'radio', 'Platform', 'false', 'AllowSkillsToolTitle', 'AllowSkillsToolComment', NULL, NULL, 1);
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_skills_tool', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_skills_tool', 'false', 'No');
CREATE TABLE IF NOT EXISTS skill ( id int NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, short_code varchar(100) NOT NULL, description TEXT NOT NULL, access_url_id int NOT NULL, icon varchar(255) NOT NULL, PRIMARY KEY (id));
INSERT INTO skill (name) VALUES ('Root');
@ -224,7 +228,7 @@ ALTER TABLE course MODIFY COLUMN disk_quota bigint unsigned DEFAULT NULL;
ALTER TABLE user MODIFY COLUMN username VARCHAR(100) NOT NULL;
-- Do not move this query
UPDATE settings_current SET selected_value = '1.9.0.18035' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.9.0.18037' WHERE variable = 'chamilo_database_version';
-- xxSTATSxx
ALTER TABLE track_e_exercices ADD COLUMN questions_to_check TEXT NOT NULL DEFAULT '';

@ -59,42 +59,45 @@ if (api_get_setting('profile', 'picture') == 'true') {
$user_info = UserManager :: get_user_info_by_id(api_get_user_id());
$social_left_content = SocialManager::show_social_menu('home');
$social_right_content .= '<div class="span5">';
$social_left_content = SocialManager::show_social_menu('home');
$social_right_content .= '<div class="span5">';
$social_right_content .= '<div class="social-groups-home-title">'.get_lang('ContactInformation').'</div>';
$list = array(
array('title' => get_lang('Name'), 'content' => api_get_person_name($user_info['firstname'], $user_info['lastname'])),
array('title' => get_lang('Email'), 'content' => $user_info['email']),
);
// information current user
$social_right_content .= '<div>
<p><strong>'.get_lang('Name').'</strong><br />
<span class="social-groups-text4">'.api_get_person_name($user_info['firstname'], $user_info['lastname']).'</span></p>
</div>
<div>
<p><strong>'.get_lang('Email').'</strong><br /><span class="social-groups-text4">'.($user_info['email']?$user_info['email']:'').'</span></p>
</div>
<div class="box_description_group_actions">
$social_right_content .= '<div>'.Display::description($list).'</div>';
$social_right_content .= '
<div class="form-actions">
<a class="btn" href="'.api_get_path(WEB_PATH).'main/auth/profile.php">
'.get_lang('EditProfile').'
</a>
</div>';
$skill = new Skill();
$skills = $skill->get_user_skills(api_get_user_id(), true);
$social_right_content .= '<div class="clear"></div>';
$social_right_content .= '<div class="social-groups-home-title">'.get_lang('Skills').'</div>';
$lis = '';
if (!empty($skills)) {
foreach($skills as $skill) {
$lis .= Display::tag('li', Display::span($skill['name'], array('class'=>'label_tag skill')));
}
$social_right_content .= Display::tag('ul', $lis);
}
$url = api_get_path(WEB_CODE_PATH).'social/skills_tree.php';
$social_right_content .= Display::url(get_lang('ViewSkillsTree'), $url);
$social_right_content .= '</div>';
if (api_get_setting('allow_skills_tool') == 'true') {
$skill = new Skill();
$skills = $skill->get_user_skills(api_get_user_id(), true);
$social_right_content .= '<div class="social-groups-home-title">'.get_lang('Skills').'</div>';
$lis = '';
if (!empty($skills)) {
foreach($skills as $skill) {
$lis .= Display::tag('li', Display::span($skill['name'], array('class'=>'label_tag skill')));
}
$social_right_content .= Display::tag('ul', $lis);
}
$url = api_get_path(WEB_CODE_PATH).'social/skills_tree.php';
$social_right_content .= Display::url(get_lang('ViewSkillsTree'), $url);
}
$social_right_content .= '</div>';
//Search box
$social_right_content .= '<div class="span4">';
$social_right_content .= '<div class="span4">';
$social_right_content .= UserManager::get_search_form('');
$social_right_content .= '<br />';

@ -17,6 +17,10 @@ $this_section = SECTION_MYPROFILE;
api_block_anonymous_users();
if (api_get_setting('allow_skills_tool') != 'true') {
api_not_allowed();
}
//Adds the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js();
$htmlHeadXtra[] = api_get_js('jquery.jsPlumb.all.js');

@ -7,17 +7,13 @@
<link rel="apple-touch-icon" sizes="72x72" href="{{ _p.web}}apple-touch-icon-72x72-precomposed.png" />
<link rel="apple-touch-icon" sizes="114x114" href="{{ _p.web}}apple-touch-icon-114x114-precomposed.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
{# This fires some HTML5 errors #}
{# <link rel="top" href="{{ _p.web_main}}index.php" title="" />
<link rel="courses" href="{{ _p.web_main}}auth/courses.php" title="{{"OtherCourses"|get_lang}}"/>
<link rel="profil" href="{{ _p.web_main}}auth/profile.php" title="{{"ModifyProfile"|get_lang}}"/> #}
<meta name="Generator" content="{{ _s.software_name }} {{ _s.system_version|slice(0,1) }}" />
{# Use the latest engine in ie8/ie9 or use google chrome engine if available #}
{# Improve usability in portal devices #}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if ie]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
<title>{{ title_string }}</title>
<style type="text/css" media="screen">
<style type="text/css" media="screen">
/*<![CDATA[*/
{{ css_style }}
/*]]>*/

Loading…
Cancel
Save