Move my_courses_view_by_session setting to database - refs #7794

1.10.x
Yannick Warnier 10 years ago
parent a740f7ff03
commit 98d0cf7828
  1. 20
      app/Migrations/Schema/V110/Version20150813143000.php
  2. 2
      main/inc/lib/template.lib.php
  3. 2
      main/install/configuration.dist.php
  4. 10
      main/install/data.sql
  5. 2
      user_portal.php

@ -100,7 +100,21 @@ class Version20150813143000 extends AbstractMigrationChamilo
null,
1,
false,
true
);
$this->addSettingCurrent(
'my_courses_view_by_session',
null,
'radio',
'Session',
'false',
'ViewMyCoursesListBySessionTitle',
'ViewMyCoursesListBySessionComment',
null,
null,
1,
true,
false,
[
0 => ['value' => 'true', 'text' => 'Yes'],
1 => ['value' => 'false', 'text' => 'No']
@ -127,7 +141,8 @@ class Version20150813143000 extends AbstractMigrationChamilo
'gradebook_detailed_admin_view',
'course_catalog_published',
'user_reset_password',
'user_reset_password_token_limit'
'user_reset_password_token_limit',
'my_courses_view_by_session'
]
)
);
@ -141,7 +156,8 @@ class Version20150813143000 extends AbstractMigrationChamilo
'prevent_multiple_simultaneous_login',
'gradebook_detailed_admin_view',
'course_catalog_published',
'user_reset_password'
'user_reset_password',
'my_courses_view_by_session'
]
)
);

@ -610,7 +610,7 @@ class Template
'chosen/chosen.jquery.min.js',
);
$viewBySession = api_get_configuration_value('my_courses_view_by_session');
$viewBySession = api_get_setting('my_courses_view_by_session') === 'true';
if (api_is_global_chat_enabled() || $viewBySession) {
// Do not include the global chat in LP

@ -214,5 +214,3 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE;
'extra_fields'
];*/
// Show Default view and Session view link in My Courses tab
//$_configuration['my_courses_view_by_session'] = false;

@ -1724,8 +1724,8 @@ VALUES
('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),
('user_reset_password', NULL, 'radio', 'Security', 'false', 'ResetPasswordTokenTitle', 'ResetPasswordTokenComment', NULL, NULL, 0),
('user_reset_password_token_limit', NULL, 'text', 'Security', '3600', 'ResetPasswordTokenLimitTitle', 'ResetPasswordTokenLimitComment', NULL, NULL, 0);
('user_reset_password_token_limit', NULL, 'text', 'Security', '3600', 'ResetPasswordTokenLimitTitle', 'ResetPasswordTokenLimitComment', NULL, NULL, 0),
('my_courses_view_by_session', NULL, 'radio', 'Session', 'false', 'ViewMyCoursesListBySessionTitle', 'ViewMyCoursesListBySessionComment', NULL, NULL, 0);
INSERT INTO settings_options (variable, value, display_text)
VALUES
@ -1809,6 +1809,8 @@ VALUES
('course_catalog_published', 'true', 'Yes'),
('course_catalog_published', 'false', 'No'),
('user_reset_password', 'true', 'Yes'),
('user_reset_password', 'false', 'No');
('user_reset_password', 'false', 'No'),
('my_courses_view_by_session', 'true', 'Yes'),
('my_courses_view_by_session', 'false', 'No');
UPDATE settings_current SET selected_value = '1.10.0.48' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.49' WHERE variable = 'chamilo_database_version';

@ -35,7 +35,7 @@ $userId = api_get_user_id();
/* Constants and CONFIGURATION parameters */
$load_dirs = api_get_setting('show_documents_preview');
$displayMyCourseViewBySessionLink = api_get_configuration_value('my_courses_view_by_session');
$displayMyCourseViewBySessionLink = api_get_setting('my_courses_view_by_session') === 'true';
$nameTools = get_lang('MyCourses');

Loading…
Cancel
Save