diff --git a/app/Migrations/Schema/V110/Version20150813143000.php b/app/Migrations/Schema/V110/Version20150813143000.php index 7d505377a1..0fe2a869eb 100644 --- a/app/Migrations/Schema/V110/Version20150813143000.php +++ b/app/Migrations/Schema/V110/Version20150813143000.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' ] ) ); diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index a2cd8ab452..22be065f5a 100755 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -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 diff --git a/main/install/configuration.dist.php b/main/install/configuration.dist.php index c32e96b751..1f64b08868 100755 --- a/main/install/configuration.dist.php +++ b/main/install/configuration.dist.php @@ -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; diff --git a/main/install/data.sql b/main/install/data.sql index ea129eb117..0201561a3f 100644 --- a/main/install/data.sql +++ b/main/install/data.sql @@ -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'; diff --git a/user_portal.php b/user_portal.php index 9af6522c54..f032732542 100755 --- a/user_portal.php +++ b/user_portal.php @@ -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');