diff --git a/app/Migrations/Schema/V110/Version20150813143000.php b/app/Migrations/Schema/V110/Version20150813143000.php index 80a122831b..a2a2594c3f 100644 --- a/app/Migrations/Schema/V110/Version20150813143000.php +++ b/app/Migrations/Schema/V110/Version20150813143000.php @@ -27,8 +27,8 @@ class Version20150813143000 extends AbstractMigrationChamilo null, null, 1, - true, false, + true, [ 0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No'] @@ -52,6 +52,24 @@ class Version20150813143000 extends AbstractMigrationChamilo 1 => ['value' => 'false', 'text' => 'No'] ] ); + $this->addSettingCurrent( + 'course_catalog_published', + null, + 'radio', + 'Course', + 'false', + 'CourseCatalogIsPublicTitle', + 'CourseCatalogIsPublicComment', + null, + null, + 1, + false, + true, + [ + 0 => ['value' => 'true', 'text' => 'Yes'], + 1 => ['value' => 'false', 'text' => 'No'] + ] + ); } /** @@ -70,7 +88,8 @@ class Version20150813143000 extends AbstractMigrationChamilo 'o.variable', [ 'prevent_multiple_simultaneous_login', - 'gradebook_detailed_admin_view' + 'gradebook_detailed_admin_view', + 'course_catalog_published' ] ) ); @@ -82,7 +101,8 @@ class Version20150813143000 extends AbstractMigrationChamilo 's.variable', [ 'prevent_multiple_simultaneous_login', - 'gradebook_detailed_admin_view' + 'gradebook_detailed_admin_view', + 'course_catalog_published' ] ) ); diff --git a/main/auth/courses.php b/main/auth/courses.php index cdd55b7db8..09f2553a43 100755 --- a/main/auth/courses.php +++ b/main/auth/courses.php @@ -23,7 +23,7 @@ $limit = getLimitArray(); // Section for the tabs. $this_section = SECTION_COURSES; -if (api_get_configuration_value('course_catalog_published') !== 'true') { +if (api_get_setting('course_catalog_published') !== 'true') { // Access rights: anonymous users can't do anything useful here. api_block_anonymous_users(); } diff --git a/main/install/configuration.dist.php b/main/install/configuration.dist.php index 773eeab4fb..9416f39162 100755 --- a/main/install/configuration.dist.php +++ b/main/install/configuration.dist.php @@ -205,8 +205,6 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE; // E-mail accounts to send notifications to when executing cronjobs - works for main/cron/import_csv.php //$_configuration['cron_notification_mails'] = array('email@example.com', 'email2@example.com'); -// Allow anonymous users to see the courses/sessions catalogue -//$_configuration['course_catalog_published'] = 'false'; // Only shows the fields in this list /*$_configuration['allow_fields_inscription'] = [ 'official_code', diff --git a/main/install/data.sql b/main/install/data.sql index 2f07104b2f..43992bfb9e 100644 --- a/main/install/data.sql +++ b/main/install/data.sql @@ -1720,8 +1720,9 @@ VALUES ('sso_force_redirect', NULL, 'radio', 'Security', 'false', 'SSOForceRedirectTitle', 'SSOForceRedirectComment', NULL, NULL, 1), ('session_course_ordering', NULL, 'radio', 'Session', 'false', 'SessionCourseOrderingTitle', 'SessionCourseOrderingComment', NULL, NULL, 1), ('gamification_mode', NULL, 'radio', 'Platform', '0', 'GamificationModeTitle', 'GamificationModeComment', NULL, NULL, 1), -('prevent_multiple_simultaneous_login', NULL, 'radio', 'Security', 'false', 'PreventMultipleSimultaneousLoginTitle', 'PreventMultipleSimultaneousLoginComment', NULL, NULL, 1), -('gradebook_detailed_admin_view', NULL, 'radio', 'Gradebook', 'false', 'ShowAdditionalColumnsInStudentResultsPageTitle', 'ShowAdditionalColumnsInStudentResultsPageComment', NULL, NULL, 1); +('prevent_multiple_simultaneous_login', NULL, 'radio', 'Security', 'false', 'PreventMultipleSimultaneousLoginTitle', 'PreventMultipleSimultaneousLoginComment', NULL, NULL, 0), +('gradebook_detailed_admin_view', NULL, 'radio', 'Gradebook', 'false', 'ShowAdditionalColumnsInStudentResultsPageTitle', 'ShowAdditionalColumnsInStudentResultsPageComment', NULL, NULL, 1), +('course_catalog_published', NULL, 'radio', 'Course', 'false', 'CourseCatalogIsPublicTitle', 'CourseCatalogIsPublicComment', NULL, NULL, 0); INSERT INTO settings_options (variable, value, display_text) VALUES @@ -1798,9 +1799,11 @@ VALUES ('session_course_ordering', 'false', 'No'), ('gamification_mode', '1', 'Yes'), ('gamification_mode', '0', 'No'), -('prevent_multiple_simultaneous_login', '1', 'Yes'), -('prevent_multiple_simultaneous_login', '0', 'No'), -('gradebook_detailed_admin_view', '1', 'Yes'), -('gradebook_detailed_admin_view', '0', 'No'); - -UPDATE settings_current SET selected_value = '1.10.0.46' WHERE variable = 'chamilo_database_version'; +('prevent_multiple_simultaneous_login', 'true', 'Yes'), +('prevent_multiple_simultaneous_login', 'false', 'No'), +('gradebook_detailed_admin_view', 'true', 'Yes'), +('gradebook_detailed_admin_view', 'false', 'No'), +('course_catalog_published', 'true', 'Yes'), +('course_catalog_published', 'false', 'No'); + +UPDATE settings_current SET selected_value = '1.10.0.47' WHERE variable = 'chamilo_database_version'; diff --git a/main/template/default/auth/catalog_layout.php b/main/template/default/auth/catalog_layout.php index 62a22ebe9b..4b564cb660 100644 --- a/main/template/default/auth/catalog_layout.php +++ b/main/template/default/auth/catalog_layout.php @@ -6,7 +6,7 @@ * @package chamilo.auth */ -if (api_get_configuration_value('course_catalog_published') !== 'true') { +if (api_get_setting('course_catalog_published') !== 'true') { // Acces rights: anonymous users can't do anything usefull here. api_block_anonymous_users(); }