diff --git a/main/gradebook/index.php b/main/gradebook/index.php index cabc0c8713..92f4cf8aa9 100644 --- a/main/gradebook/index.php +++ b/main/gradebook/index.php @@ -815,7 +815,7 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) { if (!empty($cats)) { - if (api_is_allowed_to_edit(null, true)) { + if (api_is_allowed_to_edit(null, true) && api_get_setting('teachers_can_change_grade_model_settings') == 'true') { //Getting grade models $obj = new GradeModel(); $grade_models = $obj->get_all(); diff --git a/main/gradebook/lib/fe/catform.class.php b/main/gradebook/lib/fe/catform.class.php index 54535fee14..70d16dcae2 100644 --- a/main/gradebook/lib/fe/catform.class.php +++ b/main/gradebook/lib/fe/catform.class.php @@ -193,7 +193,7 @@ class CatForm extends FormValidator { $this->addElement('hidden','hid_parent_id'); $this->addElement('textarea', 'description', get_lang('Description'),array('class'=>'span3','cols' => '34')); - if (isset($this->category_object) && $this->category_object->get_parent_id() == 0) { + if (isset($this->category_object) && $this->category_object->get_parent_id() == 0 && api_get_setting('teachers_can_change_grade_model_settings') == 'true') { //Getting grade models $obj = new GradeModel(); $grade_models = $obj->get_all(); diff --git a/main/install/db_main.sql b/main/install/db_main.sql index 88cdc10050..43a5c3e808 100644 --- a/main/install/db_main.sql +++ b/main/install/db_main.sql @@ -852,7 +852,9 @@ VALUES ('allow_browser_sniffer', NULL, 'radio', 'Tuning', 'false', 'AllowBrowserSnifferTitle', 'AllowBrowserSnifferComment', NULL, NULL, 0), ('enable_wami_record',NULL,'radio','Tools','false','EnableWamiRecordTitle','EnableWamiRecordComment',NULL,NULL, 0), ('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 0), -('chamilo_database_version',NULL,'textfield',NULL, '1.9.0.17752','DatabaseVersion','', NULL, NULL, 0); +('teachers_can_change_score_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeScoreSettingsTitle', 'TeachersCanChangeScoreSettingsComment', NULL, NULL, 1), +('teachers_can_change_grade_model_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeGradeModelSettingsTitle', 'TeachersCanChangeGradeModelSettingsComment', NULL, NULL, 1), +('chamilo_database_version',NULL,'textfield',NULL, '1.9.0.17759','DatabaseVersion','', NULL, NULL, 0); /* ('show_tabs', 'custom_tab_1', 'checkbox', 'Platform', 'true', 'ShowTabsTitle', 'ShowTabsComment', NULL, 'TabsCustom1', 1), @@ -1188,7 +1190,9 @@ VALUES ('enable_wami_record', 'true', 'Yes'), ('enable_wami_record', 'false', 'No'), ('teachers_can_change_score_settings', 'true', 'Yes'), -('teachers_can_change_score_settings', 'false', 'No'); +('teachers_can_change_score_settings', 'false', 'No'), +('teachers_can_change_grade_model_settings', 'true', 'Yes'), +('teachers_can_change_grade_model_settings', 'false', 'No'); UNLOCK TABLES; /* ('activate_send_event_by_mail', 'true', 'Yes'), diff --git a/main/install/migrate-db-1.8.8-1.9.0-pre.sql b/main/install/migrate-db-1.8.8-1.9.0-pre.sql index acad86c891..1d89882058 100755 --- a/main/install/migrate-db-1.8.8-1.9.0-pre.sql +++ b/main/install/migrate-db-1.8.8-1.9.0-pre.sql @@ -96,6 +96,10 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value, INSERT INTO settings_options (variable, value, display_text) VALUES ('teachers_can_change_score_settings', 'true', 'Yes'); INSERT INTO settings_options (variable, value, display_text) VALUES ('teachers_can_change_score_settings', 'false', 'No'); +INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('teachers_can_change_grade_model_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeGradeModelSettingsTitle', 'TeachersCanChangeGradeModelSettingsComment', NULL, NULL, 1); +INSERT INTO settings_options (variable, value, display_text) VALUES ('teachers_can_change_grade_model_settings', 'true', 'Yes'); +INSERT INTO settings_options (variable, value, display_text) VALUES ('teachers_can_change_grade_model_settings', 'false', 'No'); + INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('allow_users_to_change_email_with_no_password', NULL, 'radio', 'User', 'false', 'AllowUsersToChangeEmailWithNoPasswordTitle', 'AllowUsersToChangeEmailWithNoPasswordComment', NULL, NULL, 0); INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_users_to_change_email_with_no_password', 'true', 'Yes'); INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_users_to_change_email_with_no_password', 'false', 'No'); @@ -184,7 +188,7 @@ DELETE FROM settings_current WHERE variable = 'use_document_title'; DELETE FROM settings_options WHERE variable = 'use_document_title'; -- Do not move this query -UPDATE settings_current SET selected_value = '1.9.0.17752' WHERE variable = 'chamilo_database_version'; +UPDATE settings_current SET selected_value = '1.9.0.17759' WHERE variable = 'chamilo_database_version'; -- xxSTATSxx ALTER TABLE track_e_exercices ADD COLUMN questions_to_check TEXT NOT NULL DEFAULT '';