Move course_catalog_published setting to database - refs #7794

1.10.x
Yannick Warnier 10 years ago
parent 9ed26091d2
commit ea94df0669
  1. 26
      app/Migrations/Schema/V110/Version20150813143000.php
  2. 2
      main/auth/courses.php
  3. 2
      main/install/configuration.dist.php
  4. 19
      main/install/data.sql
  5. 2
      main/template/default/auth/catalog_layout.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'
]
)
);

@ -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();
}

@ -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',

@ -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';

@ -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();
}

Loading…
Cancel
Save