Update and adjust code to match new database current settings - refs #7538

1.10.x
Yannick Warnier 10 years ago
parent b990fc7965
commit 9acc02090b
  1. 7
      certificates/index.php
  2. 6
      custompages/language.php
  3. 4
      index.php
  4. 16
      main/admin/add_users_to_usergroup.php
  5. 4
      main/admin/index.php
  6. 5
      main/admin/skill_badge.php
  7. 6
      main/admin/subscribe_user2course.php
  8. 3
      main/admin/user_list.php
  9. 4
      main/attendance/attendance_controller.php
  10. 4
      main/attendance/attendance_list.php
  11. 4
      main/auth/courses.php
  12. 8
      main/auth/courses_controller.php
  13. 29
      main/course_home/activity.php
  14. 6
      main/course_info/infocours.php
  15. 4
      main/course_info/maintenance_coach.php
  16. 2
      main/document/upload.php
  17. 4
      main/dropbox/dropbox_functions.inc.php
  18. 6
      main/exercice/exercise_report.php
  19. 10
      main/exercice/exercise_result.class.php
  20. 2
      main/exercice/exercise_show.php
  21. 5
      main/gradebook/get_badges.php
  22. 7
      main/gradebook/gradebook_display_certificate.php
  23. 7
      main/gradebook/lib/be/category.class.php
  24. 2
      main/gradebook/lib/be/studentpublicationlink.class.php
  25. 8
      main/group/member_settings.php
  26. 12
      main/group/tutor_settings.php
  27. 2
      main/inc/ajax/document.ajax.php
  28. 8
      main/inc/ajax/model.ajax.php
  29. 25
      main/inc/lib/CoursesAndSessionsCatalog.class.php
  30. 9
      main/inc/lib/add_course.lib.inc.php
  31. 6
      main/inc/lib/api.lib.php
  32. 4
      main/inc/lib/attendance.lib.php
  33. 23
      main/inc/lib/course.lib.php
  34. 22
      main/inc/lib/course_category.lib.php
  35. 16
      main/inc/lib/groupmanager.lib.php
  36. 10
      main/inc/lib/pdf.lib.php
  37. 6
      main/inc/lib/redirect.class.php
  38. 6
      main/inc/lib/sessionmanager.lib.php
  39. 3
      main/inc/lib/template.lib.php
  40. 6
      main/inc/lib/usermanager.lib.php
  41. 4
      main/inc/local.inc.php
  42. 8
      main/install/data.sql
  43. 12
      main/newscorm/lp_controller.php
  44. 10
      main/newscorm/lp_list.php
  45. 4
      main/newscorm/lp_stats.php
  46. 26
      main/session/add_users_to_session.php
  47. 8
      main/session/session_add.php
  48. 14
      main/webservices/registration.soap.php
  49. 34
      src/Chamilo/CoreBundle/Migrations/Schema/V110/Version20150522222222.php
  50. 4
      user_portal.php

@ -13,10 +13,9 @@ $certificate = new Certificate($_GET['id']);
switch ($action) { switch ($action) {
case 'export': case 'export':
if ( $hideExportLink = api_get_setting('hide_certificate_export_link');
api_get_configuration_value('hide_certificate_export_link') || $hideExportLinkStudent = api_get_setting('hide_certificate_export_link_students');
(api_is_student() && api_get_configuration_value('hide_certificate_export_link_students')) if ($hideExportLink === 'true' || (api_is_student() && $hideExportLinkStudent === 'true') ) {
) {
api_not_allowed(true); api_not_allowed(true);
} }

@ -51,10 +51,8 @@ if (isset($_REQUEST['lang']) && !empty($_REQUEST['lang']) && in_array($_REQUEST[
$lang_match = $chamilo_langs[$_REQUEST['lang']]; $lang_match = $chamilo_langs[$_REQUEST['lang']];
} }
global $_configuration; $detect = api_get_setting('auto_detect_language_custom_pages');
if (isset($_configuration['auto_detect_language_custom_pages']) && if ($detect === 'true') {
$_configuration['auto_detect_language_custom_pages'] == true
) {
// Auto detect // Auto detect
$_user['language'] = $lang_match; $_user['language'] = $lang_match;
$_SESSION['user_language_choice'] = $lang_match; $_SESSION['user_language_choice'] = $lang_match;

@ -135,8 +135,8 @@ $announcements_block = null;
// Display the Site Use Cookie Warning Validation // Display the Site Use Cookie Warning Validation
$useCookieValidation = api_get_configuration_value('cookie_warning'); $useCookieValidation = api_get_setting('cookie_warning');
if ($useCookieValidation) { if ($useCookieValidation === 'true') {
if (isset($_POST['acceptCookies'])) { if (isset($_POST['acceptCookies'])) {
api_set_site_use_cookie_warning_cookie(); api_set_site_use_cookie_warning_cookie();
} else if (!api_site_use_cookie_warning_cookie_exist()) { } else if (!api_site_use_cookie_warning_cookie_exist()) {

@ -203,10 +203,8 @@ if (api_is_western_name_order()) {
$order = array('firstname'); $order = array('firstname');
} }
global $_configuration; $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
if (isset($_configuration['order_user_list_by_official_code']) && if ($orderListByOfficialCode === 'true') {
$_configuration['order_user_list_by_official_code']
) {
$order = array('official_code', 'lastname'); $order = array('official_code', 'lastname');
} }
@ -249,9 +247,8 @@ if (!empty($complete_user_list)) {
$item['lastname'] $item['lastname']
).' ('.$item['username'].') '.$officialCode; ).' ('.$item['username'].') '.$officialCode;
if (isset($_configuration['order_user_list_by_official_code']) && $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
$_configuration['order_user_list_by_official_code'] if ($orderListByOfficialCode === 'true') {
) {
$officialCode = !empty($item['official_code']) ? $item['official_code'].' - ' : '? - '; $officialCode = !empty($item['official_code']) ? $item['official_code'].' - ' : '? - ';
$person_name = $officialCode.api_get_person_name( $person_name = $officialCode.api_get_person_name(
$item['firstname'], $item['firstname'],
@ -297,9 +294,8 @@ if (!empty($user_list)) {
$item['lastname'] $item['lastname']
).' ('.$item['username'].') '.$officialCode; ).' ('.$item['username'].') '.$officialCode;
if (isset($_configuration['order_user_list_by_official_code']) && $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
$_configuration['order_user_list_by_official_code'] if ($orderListByOfficialCode === 'true') {
) {
$officialCode = !empty($item['official_code']) ? $item['official_code'].' - ' : '? - '; $officialCode = !empty($item['official_code']) ? $item['official_code'].' - ' : '? - ';
$person_name = $officialCode.api_get_person_name( $person_name = $officialCode.api_get_person_name(
$item['firstname'], $item['firstname'],

@ -454,8 +454,8 @@ $admin_ajax_url = api_get_path(WEB_AJAX_PATH) . 'admin.ajax.php';
$tpl = new Template(); $tpl = new Template();
// Display the Site Use Cookie Warning Validation // Display the Site Use Cookie Warning Validation
$useCookieValidation = api_get_configuration_value('cookie_warning'); $useCookieValidation = api_get_setting('cookie_warning');
if ($useCookieValidation) { if ($useCookieValidation === 'true') {
if (isset($_POST['acceptCookies'])) { if (isset($_POST['acceptCookies'])) {
api_set_site_use_cookie_warning_cookie(); api_set_site_use_cookie_warning_cookie();
} else if (!api_site_use_cookie_warning_cookie_exist()) { } else if (!api_site_use_cookie_warning_cookie_exist()) {

@ -16,8 +16,9 @@ if (!api_is_platform_admin() || api_get_setting('allow_skills_tool') !== 'true')
} }
$backpack = 'https://backpack.openbadges.org/'; $backpack = 'https://backpack.openbadges.org/';
if (array_key_exists('openbadges_backpack', $_configuration)) { $configBackpack = api_get_seeting('openbadges_backpack');
$backpack = $_configuration['openbadges_backpack']; if (strcmp($backpack, $configBackpack) !== 0) {
$backpack = $configBackpack;
} }
$interbreadcrumb = array( $interbreadcrumb = array(

@ -168,10 +168,8 @@ if ($use_extra_fields) {
$target_name = api_sort_by_first_name() ? 'firstname' : 'lastname'; $target_name = api_sort_by_first_name() ? 'firstname' : 'lastname';
$orderBy = $target_name; $orderBy = $target_name;
$showOfficialCode = false; $showOfficialCode = false;
global $_configuration; $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
if (isset($_configuration['order_user_list_by_official_code']) && if ($orderListByOfficialCode === 'true') {
$_configuration['order_user_list_by_official_code']
) {
$showOfficialCode = true; $showOfficialCode = true;
$orderBy = " official_code, firstname, lastname"; $orderBy = " official_code, firstname, lastname";
} }

@ -411,7 +411,8 @@ function get_user_data($from, $number_of_items, $column, $direction) {
$from = intval($from); $from = intval($from);
$number_of_items = intval($number_of_items); $number_of_items = intval($number_of_items);
if (api_is_session_admin() && api_get_setting('prevent_session_admins_to_manage_all_users') == 'true') { $preventSessionAdminsToManageAllUsers = api_get_setting('prevent_session_admins_to_manage_all_users');
if (api_is_session_admin() && $preventSessionAdminsToManageAllUsers === 'true') {
$sql .= " WHERE u.creator_id = ".api_get_user_id(); $sql .= " WHERE u.creator_id = ".api_get_user_id();
} }

@ -156,8 +156,8 @@ class AttendanceController
*/ */
public function attendance_delete($attendance_id) public function attendance_delete($attendance_id)
{ {
$allowDeleteAttendance = api_get_configuration_value('allow_delete_attendance'); $allowDeleteAttendance = api_get_setting('allow_delete_attendance');
if ($allowDeleteAttendance == false) { if ($allowDeleteAttendance !== 'true') {
$this->attendance_list(); $this->attendance_list();
return false; return false;
} }

@ -47,8 +47,8 @@ if (api_is_allowed_to_edit(null, true)) {
'attendance_set_visible_select' => get_lang('SetVisible') 'attendance_set_visible_select' => get_lang('SetVisible')
); );
$allow = api_get_configuration_value('allow_delete_attendance'); $allow = api_get_setting('allow_delete_attendance');
if ($allow) { if ($allow === 'true') {
$actions['attendance_delete_select'] = get_lang('DeleteAllSelectedAttendances'); $actions['attendance_delete_select'] = get_lang('DeleteAllSelectedAttendances');
} }
$table->set_form_actions($actions); $table->set_form_actions($actions);

@ -235,8 +235,8 @@ switch ($action) {
$courses_controller->sessionsList($action, $nameTools, $limit); $courses_controller->sessionsList($action, $nameTools, $limit);
break; break;
case 'subscribe_to_session': case 'subscribe_to_session':
$registrationAllowed = api_get_configuration_value('catalog_allow_session_auto_subscription'); $registrationAllowed = api_get_setting('catalog_allow_session_auto_subscription');
if ($registrationAllowed) { if ($registrationAllowed === 'true') {
SessionManager::suscribe_users_to_session( SessionManager::suscribe_users_to_session(
$_GET['session_id'], $_GET['session_id'],
array($_GET['user_id']) array($_GET['user_id'])

@ -139,8 +139,9 @@ class CoursesController
$data['catalogShowCoursesSessions'] = 0; $data['catalogShowCoursesSessions'] = 0;
if (isset($_configuration['catalog_show_courses_sessions'])) { $showCoursesSessions = intval('catalog_show_courses_sessions');
$data['catalogShowCoursesSessions'] = $_configuration['catalog_show_courses_sessions']; if ($showCoursesSessions > 0) {
$data['catalogShowCoursesSessions'] = $showCoursesSessions;
} }
// render to the view // render to the view
@ -570,7 +571,8 @@ class CoursesController
$key = 'name'; $key = 'name';
$catalogSessionAutoSubscriptionAllowed = false; $catalogSessionAutoSubscriptionAllowed = false;
if (api_get_configuration_value('catalog_allow_session_auto_subscription')) { $catalogSessionAutoSubscription = api_get_setting('catalog_allow_session_auto_subscription');
if ($catalogSessionAutoSubscription === 'true') {
$key = 'id'; $key = 'id';
$catalogSessionAutoSubscriptionAllowed = true; $catalogSessionAutoSubscriptionAllowed = true;
} }

@ -113,23 +113,22 @@ if ($session_id == 0 && api_is_course_admin() && api_is_allowed_to_edit(null, tr
$content .= CourseHome::show_tools_category($my_list); $content .= CourseHome::show_tools_category($my_list);
$content .= '</div>'; $content .= '</div>';
if (isset($_configuration['allow_session_course_copy_for_teachers'])) { $sessionsCopy = api_get_setting('allow_session_course_copy_for_teachers');
if ($_configuration['allow_session_course_copy_for_teachers']) { if ($sessionsCopy === 'true') {
// Adding only maintenance for coaches. // Adding only maintenance for coaches.
$myList = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM); $myList = CourseHome::get_tools_category(TOOL_ADMIN_PLATFORM);
$onlyMaintenanceList = array(); $onlyMaintenanceList = array();
foreach ($myList as $item) { foreach ($myList as $item) {
if ($item['name'] == 'course_maintenance') { if ($item['name'] == 'course_maintenance') {
$item['link'] = 'course_info/maintenance_coach.php'; $item['link'] = 'course_info/maintenance_coach.php';
$onlyMaintenanceList[] = $item;
}
}
$items = CourseHome::show_tools_category($onlyMaintenanceList); $onlyMaintenanceList[] = $item;
$content .= return_block(get_lang('Administration'), $items); }
} }
$items = CourseHome::show_tools_category($onlyMaintenanceList);
$content .= return_block(get_lang('Administration'), $items);
} }
} else { } else {
$tools = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); $tools = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);

@ -309,10 +309,8 @@ if (api_get_setting('allow_course_theme') == 'true') {
$form->addGroup($group, '', array(get_lang("AllowLearningPathTheme")), ''); $form->addGroup($group, '', array(get_lang("AllowLearningPathTheme")), '');
} }
global $_configuration; $allowLPReturnLink = api_get_setting('allow_lp_return_link');
if (isset($_configuration['allow_lp_return_link']) && if ($allowLPReturnLink === 'true') {
$_configuration['allow_lp_return_link']
) {
$group = array( $group = array(
$form->createElement( $form->createElement(
'radio', 'radio',

@ -20,8 +20,8 @@ $nameTools = get_lang('Maintenance');
api_protect_course_script(true); api_protect_course_script(true);
api_block_anonymous_users(); api_block_anonymous_users();
if (!isset($_configuration['allow_session_course_copy_for_teachers']) $sessionsCopy = api_get_setting('allow_session_course_copy_for_teachers');
|| !$_configuration['allow_session_course_copy_for_teachers']){ if ($sessionsCopy !== 'true') {
api_not_allowed(true); api_not_allowed(true);
} }

@ -285,7 +285,7 @@ $form->addElement('html', '</div>');
$form->addButtonSend(get_lang('SendDocument'), 'submitDocument'); $form->addButtonSend(get_lang('SendDocument'), 'submitDocument');
$form->add_real_progress_bar('DocumentUpload', 'file'); $form->add_real_progress_bar('DocumentUpload', 'file');
$fileExistsOption = api_get_configuration_value('document_if_file_exists_option'); $fileExistsOption = api_get_setting('document_if_file_exists_option');
$defaultFileExistsOption = 'rename'; $defaultFileExistsOption = 'rename';
if (!empty($fileExistsOption)) { if (!empty($fileExistsOption)) {

@ -519,9 +519,9 @@ function display_add_form($dropbox_unid, $viewReceivedCategory, $viewSentCategor
); );
} }
$hideCoach = api_get_configuration_value('dropbox_hide_course_coach'); $hideCoach = api_get_setting('dropbox_hide_course_coach');
if ($hideCoach == false) { if ($hideCoach !== 'true') {
$complete_user_list2 = CourseManager::get_coach_list_from_course_code( $complete_user_list2 = CourseManager::get_coach_list_from_course_code(
$course_info['code'], $course_info['code'],
api_get_session_id() api_get_session_id()

@ -395,7 +395,7 @@ if (!empty($group_parameters)) {
$group_parameters = implode(';', $group_parameters); $group_parameters = implode(';', $group_parameters);
} }
$officialCodeInList = api_get_configuration_value('show_official_code_exercise_result_list'); $officialCodeInList = api_get_setting('show_official_code_exercise_result_list');
if ($is_allowedToEdit || $is_tutor) { if ($is_allowedToEdit || $is_tutor) {
@ -416,7 +416,7 @@ if ($is_allowedToEdit || $is_tutor) {
get_lang('Actions') get_lang('Actions')
); );
if ($officialCodeInList == true) { if ($officialCodeInList === 'true') {
$columns = array_merge(array(get_lang('OfficialCode')), $columns); $columns = array_merge(array(get_lang('OfficialCode')), $columns);
} }
@ -448,7 +448,7 @@ if ($is_allowedToEdit || $is_tutor) {
array('name' => 'actions', 'index' => 'actions', 'width' => '60', 'align' => 'left', 'search' => 'false') array('name' => 'actions', 'index' => 'actions', 'width' => '60', 'align' => 'left', 'search' => 'false')
); );
if ($officialCodeInList == true) { if ($officialCodeInList == 'true') {
$officialCodeRow = array('name' => 'official_code', 'index' => 'official_code', 'width' => '50', 'align' => 'left', 'search' => 'true'); $officialCodeRow = array('name' => 'official_code', 'index' => 'official_code', 'width' => '50', 'align' => 'left', 'search' => 'true');
$column_model = array_merge(array($officialCodeRow), $column_model); $column_model = array_merge(array($officialCodeRow), $column_model);
} }

@ -308,8 +308,8 @@ class ExerciseResult
$data .= get_lang('FirstName').';'; $data .= get_lang('FirstName').';';
} }
} }
$officialCodeInList = api_get_configuration_value('show_official_code_exercise_result_list'); $officialCodeInList = api_get_setting('show_official_code_exercise_result_list');
if ($officialCodeInList) { if ($officialCodeInList === 'true') {
$data .= get_lang('OfficialCode').';'; $data .= get_lang('OfficialCode').';';
} }
@ -432,7 +432,7 @@ class ExerciseResult
} }
} }
$officialCodeInList = api_get_configuration_value('show_official_code_exercise_result_list'); $officialCodeInList = api_get_setting('show_official_code_exercise_result_list');
if ($with_column_user) { if ($with_column_user) {
if (api_is_western_name_order()) { if (api_is_western_name_order()) {
@ -447,7 +447,7 @@ class ExerciseResult
$column++; $column++;
} }
if ($officialCodeInList) { if ($officialCodeInList === 'true') {
$worksheet->write($line, $column, get_lang('OfficialCode')); $worksheet->write($line, $column, get_lang('OfficialCode'));
$column++; $column++;
} }
@ -504,7 +504,7 @@ class ExerciseResult
$column++; $column++;
} }
if ($officialCodeInList) { if ($officialCodeInList === 'true') {
$worksheet->write($line, $column,api_html_entity_decode(strip_tags($row['official_code']), ENT_QUOTES, $charset)); $worksheet->write($line, $column,api_html_entity_decode(strip_tags($row['official_code']), ENT_QUOTES, $charset));
$column++; $column++;
} }

@ -64,7 +64,7 @@ if (api_is_course_session_coach(
} }
} }
$maxEditors = isset($_configuration['exercise_max_ckeditors_in_page']) ? $_configuration['exercise_max_ckeditors_in_page'] : 0; $maxEditors = intval(api_get_setting('exercise_max_ckeditors_in_page'));
$is_allowedToEdit = api_is_allowed_to_edit(null, true) || $is_courseTutor || api_is_session_admin() || api_is_drh() || api_is_student_boss(); $is_allowedToEdit = api_is_allowed_to_edit(null, true) || $is_courseTutor || api_is_session_admin() || api_is_drh() || api_is_student_boss();
//Getting results from the exe_id. This variable also contain all the information about the exercise //Getting results from the exe_id. This variable also contain all the information about the exercise

@ -44,8 +44,9 @@ foreach ($userSkills as $skill) {
$backpack = 'https://backpack.openbadges.org/'; $backpack = 'https://backpack.openbadges.org/';
if (array_key_exists('openbadges_backpack', $_configuration)) { $configBackpack = api_get_seeting('openbadges_backpack');
$backpack = $_configuration['openbadges_backpack']; if (strcmp($backpack, $configBackpack) !== 0) {
$backpack = $configBackpack;
} }
$htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>'; $htmlHeadXtra[] = '<script src="' . $backpack . 'issuer.js"></script>';

@ -143,11 +143,11 @@ if (!empty($cats)) {
} }
} }
$filter = api_get_configuration_value('certificate_filter_by_official_code'); $filter = api_get_setting('certificate_filter_by_official_code');
$userList = array(); $userList = array();
$filterForm = null; $filterForm = null;
$certificate_list = array(); $certificate_list = array();
if ($filter) { if ($filter === 'true') {
echo '<br />'; echo '<br />';
$options = UserManager::getOfficialCodeGrouped(); $options = UserManager::getOfficialCodeGrouped();
$options =array_merge(array('all' => get_lang('All')), $options); $options =array_merge(array('all' => get_lang('All')), $options);
@ -187,7 +187,8 @@ echo Display::url(get_lang('GenerateCertificates'), $url, array('class' => 'btn
$url = api_get_self().'?action=delete_all_certificates'.'&'.api_get_cidReq().'&cat_id='.$cat_id.'&filter='.$filterOfficialCode; $url = api_get_self().'?action=delete_all_certificates'.'&'.api_get_cidReq().'&cat_id='.$cat_id.'&filter='.$filterOfficialCode;
echo Display::url(get_lang('DeleteAllCertificates'), $url, array('class' => 'btn btn-default')); echo Display::url(get_lang('DeleteAllCertificates'), $url, array('class' => 'btn btn-default'));
if (count($certificate_list) > 0 && !api_get_configuration_value('hide_certificate_export_link')) { $hideCertificateExport = api_get_setting('hide_certificate_export_link');
if (count($certificate_list) > 0 && $hideCertificateExport !== 'true') {
$url = api_get_self().'?action=export_all_certificates'.'&'.api_get_cidReq().'&cat_id='.$cat_id.'&filter='.$filterOfficialCode; $url = api_get_self().'?action=export_all_certificates'.'&'.api_get_cidReq().'&cat_id='.$cat_id.'&filter='.$filterOfficialCode;
echo Display::url(get_lang('ExportAllCertificatesToPDF'), $url, array('class' => 'btn btn-default')); echo Display::url(get_lang('ExportAllCertificatesToPDF'), $url, array('class' => 'btn btn-default'));
} }

@ -1870,10 +1870,9 @@ class Category implements GradebookItem
"$url&action=export" "$url&action=export"
); );
if ( $hideExportLink = api_get_setting('hide_certificate_export_link');
api_get_configuration_value('hide_certificate_export_link') || $hideExportLinkStudent = api_get_setting('hide_certificate_export_link_students');
(api_is_student() && api_get_configuration_value('hide_certificate_export_link_students')) if ($hideExportLink === 'true' || (api_is_student() && $hideExportLinkStudent === 'true') ) {
) {
$exportToPDF = null; $exportToPDF = null;
} }

@ -185,7 +185,7 @@ class StudentPublicationLink extends AbstractLink
$sql .= " AND user_id = $stud_id "; $sql .= " AND user_id = $stud_id ";
} }
$order = api_get_configuration_value('student_publication_to_take_in_gradebook'); $order = api_get_setting('student_publication_to_take_in_gradebook');
switch ($order) { switch ($order) {
case 'last': case 'last':

@ -53,10 +53,8 @@ function search_members_keyword($firstname, $lastname, $username, $official_code
*/ */
function sort_users($user_a, $user_b) function sort_users($user_a, $user_b)
{ {
global $_configuration; $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
if (isset($_configuration['order_user_list_by_official_code']) && if ($orderListByOfficialCode === 'true') {
$_configuration['order_user_list_by_official_code']
) {
$cmp = api_strcmp($user_a['official_code'], $user_b['official_code']); $cmp = api_strcmp($user_a['official_code'], $user_b['official_code']);
if ($cmp !== 0) { if ($cmp !== 0) {
return $cmp; return $cmp;
@ -131,7 +129,7 @@ $form->addElement('hidden', 'action');
$form->addElement('hidden', 'max_student', $current_group['max_student']); $form->addElement('hidden', 'max_student', $current_group['max_student']);
$complete_user_list = GroupManager::fill_groups_list($current_group['id']); $complete_user_list = GroupManager::fill_groups_list($current_group['id']);
$orderUserListByOfficialCode = api_get_configuration_value('order_user_list_by_official_code'); $orderUserListByOfficialCode = api_get_setting('order_user_list_by_official_code');
$possible_users = array(); $possible_users = array();
$userGroup = new UserGroup(); $userGroup = new UserGroup();

@ -55,10 +55,8 @@ function search_members_keyword($firstname, $lastname, $username, $official_code
*/ */
function sort_users($user_a, $user_b) function sort_users($user_a, $user_b)
{ {
global $_configuration; $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
if (isset($_configuration['order_user_list_by_official_code']) && if ($orderListByOfficialCode === 'true') {
$_configuration['order_user_list_by_official_code']
) {
$cmp = api_strcmp($user_a['official_code'], $user_b['official_code']); $cmp = api_strcmp($user_a['official_code'], $user_b['official_code']);
if ($cmp !== 0) { if ($cmp !== 0) {
return $cmp; return $cmp;
@ -133,10 +131,8 @@ if (!empty($complete_user_list)) {
$user['lastname'] $user['lastname']
).' ('.$user['username'].')'.$officialCode; ).' ('.$user['username'].')'.$officialCode;
global $_configuration; $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
if (isset($_configuration['order_user_list_by_official_code']) && if ($orderListByOfficialCode === 'true') {
$_configuration['order_user_list_by_official_code']
) {
$officialCode = !empty($user['official_code']) ? $user['official_code']." - " : '? - '; $officialCode = !empty($user['official_code']) ? $user['official_code']." - " : '? - ';
$name = $officialCode." ".api_get_person_name( $name = $officialCode." ".api_get_person_name(
$user['firstname'], $user['firstname'],

@ -24,7 +24,7 @@ switch ($action) {
exit; exit;
} }
$fileExistsOption = api_get_configuration_value('document_if_file_exists_option'); $fileExistsOption = api_get_setting('document_if_file_exists_option');
$defaultFileExistsOption = 'rename'; $defaultFileExistsOption = 'rename';
if (!empty($fileExistsOption)) { if (!empty($fileExistsOption)) {
$defaultFileExistsOption = $fileExistsOption; $defaultFileExistsOption = $fileExistsOption;

@ -363,8 +363,8 @@ switch ($action) {
$keyword = isset($_REQUEST['keyword']) ? $_REQUEST['keyword'] : ''; $keyword = isset($_REQUEST['keyword']) ? $_REQUEST['keyword'] : '';
$description = ''; $description = '';
$setting = api_get_configuration_value('show_session_description'); $setting = api_get_setting('show_session_description');
if ($setting) { if ($setting === 'true') {
$description = $keyword; $description = $keyword;
} }
@ -761,8 +761,8 @@ switch ($action) {
$columns = array( $columns = array(
'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score', 'user_ip', 'status', 'lp', 'actions' 'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score', 'user_ip', 'status', 'lp', 'actions'
); );
$officialCodeInList = api_get_configuration_value('show_official_code_exercise_result_list'); $officialCodeInList = api_get_setting('show_official_code_exercise_result_list');
if ($officialCodeInList == true) { if ($officialCodeInList === 'true') {
$columns = array_merge(array('official_code'), $columns); $columns = array_merge(array('official_code'), $columns);
} }
} }

@ -16,12 +16,9 @@ class CoursesAndSessionsCatalog
*/ */
public static function is($value = CATALOG_COURSES) public static function is($value = CATALOG_COURSES)
{ {
global $_configuration; $showCoursesSessions = intval(api_get_setting('catalog_show_courses_sessions'));
if ($showCoursesSessions == $value) {
if (isset($_configuration['catalog_show_courses_sessions'])) { return true;
if ($_configuration['catalog_show_courses_sessions'] == $value) {
return true;
}
} }
return false; return false;
@ -35,13 +32,7 @@ class CoursesAndSessionsCatalog
*/ */
public static function showSessions() public static function showSessions()
{ {
global $_configuration; $catalogShow = intval(api_get_setting('catalog_show_courses_sessions'));
$catalogShow = CATALOG_COURSES;
if (isset($_configuration['catalog_show_courses_sessions'])) {
$catalogShow = $_configuration['catalog_show_courses_sessions'];
}
if ($catalogShow == CATALOG_SESSIONS || $catalogShow == CATALOG_COURSES_SESSIONS) { if ($catalogShow == CATALOG_SESSIONS || $catalogShow == CATALOG_COURSES_SESSIONS) {
return true; return true;
@ -58,13 +49,7 @@ class CoursesAndSessionsCatalog
*/ */
public static function showCourses() public static function showCourses()
{ {
global $_configuration; $catalogShow = intval(api_get_setting('catalog_show_courses_sessions'));
$catalogShow = CATALOG_COURSES;
if (isset($_configuration['catalog_show_courses_sessions'])) {
$catalogShow = $_configuration['catalog_show_courses_sessions'];
}
if ($catalogShow == CATALOG_COURSES || $catalogShow == CATALOG_COURSES_SESSIONS) { if ($catalogShow == CATALOG_COURSES || $catalogShow == CATALOG_COURSES_SESSIONS) {
return true; return true;

@ -660,10 +660,11 @@ class AddCourse
); );
$defaultEmailExerciseAlert = 1; $defaultEmailExerciseAlert = 1;
if (isset($_configuration['email_alert_manager_on_new_quiz'])) { $alert = api_get_setting('email_alert_manager_on_new_quiz');
$defaultEmailExerciseAlert = intval( if ($alert === 'true') {
$_configuration['email_alert_manager_on_new_quiz'] $defaultEmailExerciseAlert = 1;
); } else {
$defaultEmailExerciseAlert = 0;
} }
/* course_setting table (courseinfo tool) */ /* course_setting table (courseinfo tool) */

@ -7866,10 +7866,8 @@ function api_protect_course_group($tool, $showHeader = true)
*/ */
function api_protect_limit_for_session_admin() function api_protect_limit_for_session_admin()
{ {
if ( $limitAdmin = api_get_setting('limit_session_admin_role');
api_is_session_admin() && if (api_is_session_admin() && $limitAdmin === 'true') {
api_get_configuration_value('limit_session_admin_role')
) {
api_not_allowed(true); api_not_allowed(true);
} }
} }

@ -143,7 +143,7 @@ class Attendance
$param_gradebook = '&gradebook='.$_SESSION['gradebook']; $param_gradebook = '&gradebook='.$_SESSION['gradebook'];
} }
$user_info = api_get_user_info(); $user_info = api_get_user_info();
$allowDelete = api_get_configuration_value('allow_delete_attendance'); $allowDelete = api_get_setting('allow_delete_attendance');
while ($attendance = Database::fetch_row($res)) { while ($attendance = Database::fetch_row($res)) {
@ -220,7 +220,7 @@ class Attendance
Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL).'</a>'; Display::return_icon('invisible.png', get_lang('Show'), array(), ICON_SIZE_SMALL).'</a>';
$attendance[2] = '<span class="muted">'.$attendance[2].'</span>'; $attendance[2] = '<span class="muted">'.$attendance[2].'</span>';
} }
if ($allowDelete) { if ($allowDelete === 'true') {
$actions .= ' <a href="index.php?' . api_get_cidreq() . '&action=attendance_delete&attendance_id=' . $attendance[0] . $param_gradebook . '">' . $actions .= ' <a href="index.php?' . api_get_cidreq() . '&action=attendance_delete&attendance_id=' . $attendance[0] . $param_gradebook . '">' .
Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>'; Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
} }

@ -3651,7 +3651,7 @@ class CourseManager
$html = ''; $html = '';
$course_list = array(); $course_list = array();
$showCustomIcon = api_get_configuration_value('course_images_in_courses_list'); $showCustomIcon = api_get_setting('course_images_in_courses_list');
$courseCount = 0; $courseCount = 0;
// Browse through all courses. // Browse through all courses.
while ($course = Database::fetch_array($result)) { while ($course = Database::fetch_array($result)) {
@ -3685,7 +3685,7 @@ class CourseManager
); );
$iconName = basename($course_info['course_image']); $iconName = basename($course_info['course_image']);
if ($showCustomIcon == true && $iconName != 'course.png') { if ($showCustomIcon === 'true' && $iconName != 'course.png') {
$status_icon = Display::img( $status_icon = Display::img(
$course_info['course_image'], $course_info['course_image'],
api_htmlentities($course_info['title']), api_htmlentities($course_info['title']),
@ -3950,9 +3950,9 @@ class CourseManager
$session_title = $course_info['name']; $session_title = $course_info['name'];
} }
$showCustomIcon = api_get_configuration_value('course_images_in_courses_list'); $showCustomIcon = api_get_setting('course_images_in_courses_list');
$iconName = basename($course_info['course_image']); $iconName = basename($course_info['course_image']);
if ($showCustomIcon && $iconName != 'course.png') { if ($showCustomIcon === 'true' && $iconName != 'course.png') {
$params['icon'] = Display::img( $params['icon'] = Display::img(
$course_info['course_image'], $course_info['course_image'],
api_htmlentities($course_info['name']), api_htmlentities($course_info['name']),
@ -4769,12 +4769,11 @@ class CourseManager
$visibilityCondition = null; $visibilityCondition = null;
if (isset($_configuration['course_catalog_hide_private'])) { $hidePrivate = api_get_setting('course_catalog_hide_private');
if ($_configuration['course_catalog_hide_private'] == true) { if ($hidePrivate === 'true') {
$courseInfo = api_get_course_info(); $courseInfo = api_get_course_info();
$courseVisibility = $courseInfo['visibility']; $courseVisibility = $courseInfo['visibility'];
$visibilityCondition = ' AND c.visibility <> 1'; $visibilityCondition = ' AND c.visibility <> 1';
}
} }
if (!empty($accessUrlId) && $accessUrlId == intval($accessUrlId)) { if (!empty($accessUrlId) && $accessUrlId == intval($accessUrlId)) {
$sql = "SELECT count(c.id) FROM $tableCourse c, $tableCourseRelAccessUrl u $sql = "SELECT count(c.id) FROM $tableCourse c, $tableCourseRelAccessUrl u
@ -5004,8 +5003,8 @@ class CourseManager
'show_system_folders' 'show_system_folders'
); );
global $_configuration; $allowLPReturnLink = api_get_setting('allow_lp_return_link');
if (isset($_configuration['allow_lp_return_link']) && $_configuration['allow_lp_return_link']) { if ($allowLPReturnLink === 'true') {
$courseSettings[] = 'lp_return_link'; $courseSettings[] = 'lp_return_link';
} }

@ -544,12 +544,11 @@ function countCoursesInCategory($category_code="", $searchTerm = '')
} }
$visibilityCondition = null; $visibilityCondition = null;
if (isset($_configuration['course_catalog_hide_private'])) { $hidePrivate = api_get_setting('course_catalog_hide_private');
if ($_configuration['course_catalog_hide_private'] == true) { if ($hidePrivate === 'true') {
$courseInfo = api_get_course_info(); $courseInfo = api_get_course_info();
$courseVisibility = $courseInfo['visibility']; $courseVisibility = $courseInfo['visibility'];
$visibilityCondition = ' AND course.visibility <> 1'; $visibilityCondition = ' AND course.visibility <> 1';
}
} }
if ($categoryCode == 'ALL') { if ($categoryCode == 'ALL') {
@ -618,12 +617,11 @@ function browseCoursesInCategory($category_code, $random_value = null, $limit =
$without_special_courses = ' AND course.code NOT IN (' . implode(',', $specialCourseList) . ')'; $without_special_courses = ' AND course.code NOT IN (' . implode(',', $specialCourseList) . ')';
} }
$visibilityCondition = null; $visibilityCondition = null;
if (isset($_configuration['course_catalog_hide_private'])) { $hidePrivate = api_get_setting('course_catalog_hide_private');
if ($_configuration['course_catalog_hide_private'] == true) { if ($hidePrivate === 'true') {
$courseInfo = api_get_course_info(); $courseInfo = api_get_course_info();
$courseVisibility = $courseInfo['visibility']; $courseVisibility = $courseInfo['visibility'];
$visibilityCondition = ' AND course.visibility <> 1'; $visibilityCondition = ' AND course.visibility <> 1';
}
} }
if (!empty($random_value)) { if (!empty($random_value)) {
$random_value = intval($random_value); $random_value = intval($random_value);

@ -1422,10 +1422,8 @@ class GroupManager
$table_user = Database :: get_main_table(TABLE_MAIN_USER); $table_user = Database :: get_main_table(TABLE_MAIN_USER);
$table_group_user = Database :: get_course_table(TABLE_GROUP_USER); $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
$order_clause = api_sort_by_first_name() ? ' ORDER BY u.firstname, u.lastname' : ' ORDER BY u.lastname, u.firstname'; $order_clause = api_sort_by_first_name() ? ' ORDER BY u.firstname, u.lastname' : ' ORDER BY u.lastname, u.firstname';
global $_configuration; $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
if (isset($_configuration['order_user_list_by_official_code']) && if ($orderListByOfficialCode === 'true') {
$_configuration['order_user_list_by_official_code']
) {
$order_clause = " ORDER BY u.official_code, u.firstname, u.lastname"; $order_clause = " ORDER BY u.official_code, u.firstname, u.lastname";
} }
@ -1468,10 +1466,8 @@ class GroupManager
$table_group_tutor = Database :: get_course_table(TABLE_GROUP_TUTOR); $table_group_tutor = Database :: get_course_table(TABLE_GROUP_TUTOR);
$order_clause = api_sort_by_first_name() ? ' ORDER BY u.firstname, u.lastname' : ' ORDER BY u.lastname, u.firstname'; $order_clause = api_sort_by_first_name() ? ' ORDER BY u.firstname, u.lastname' : ' ORDER BY u.lastname, u.firstname';
global $_configuration; $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
if (isset($_configuration['order_user_list_by_official_code']) && if ($orderListByOfficialCode === 'true') {
$_configuration['order_user_list_by_official_code']
) {
$order_clause = " ORDER BY u.official_code, u.firstname, u.lastname"; $order_clause = " ORDER BY u.official_code, u.firstname, u.lastname";
} }
@ -2169,7 +2165,7 @@ class GroupManager
$orig = isset($origin) ? $origin : null; $orig = isset($origin) ? $origin : null;
$hideGroup = api_get_configuration_value('hide_course_group_if_no_tools_available'); $hideGroup = api_get_setting('hide_course_group_if_no_tools_available');
foreach ($group_list as $this_group) { foreach ($group_list as $this_group) {
@ -2213,7 +2209,7 @@ class GroupManager
$group_name .= $session_img; $group_name .= $session_img;
$row[] = $group_name.'<br />'.stripslashes(trim($this_group['description'])); $row[] = $group_name.'<br />'.stripslashes(trim($this_group['description']));
} else { } else {
if ($hideGroup) { if ($hideGroup === 'true') {
continue; continue;
} }
$row[] = $this_group['name'].'<br />'.stripslashes(trim($this_group['description'])); $row[] = $this_group['name'].'<br />'.stripslashes(trim($this_group['description']));

@ -90,12 +90,12 @@ class PDF
} }
// Use custom logo image. // Use custom logo image.
if (isset($_configuration['pdf_logo_header']) && $pdfLogo = api_get_setting('pdf_logo_header');
$_configuration['pdf_logo_header'] if ($pdfLogo === 'true') {
) { $visualTheme = api_get_visual_theme();
$img = api_get_path(SYS_CODE_PATH).'css/'.api_get_visual_theme().'/images/pdf_logo_header.png'; $img = api_get_path(SYS_CODE_PATH).'css/'.$visualTheme.'/images/pdf_logo_header.png';
if (file_exists($img)) { if (file_exists($img)) {
$img = api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/pdf_logo_header.png'; $img = api_get_path(WEB_CODE_PATH) . 'css/' . $visualTheme . '/images/pdf_logo_header.png';
$organization = "<img src='$img'>"; $organization = "<img src='$img'>";
} }
} }

@ -92,10 +92,8 @@ class Redirect
break; break;
} }
} }
global $_configuration; $redirect = api_get_setting('redirect_admin_to_courses_list');
if (!isset($_configuration['redirect_admin_to_courses_list']) || if ($redirect !== 'true') {
$_configuration['redirect_admin_to_courses_list'] === 'false'
) {
// If the user is a platform admin, redirect to the main admin page // If the user is a platform admin, redirect to the main admin page
if (api_is_multiple_url_enabled()) { if (api_is_multiple_url_enabled()) {
// if multiple URLs are enabled, make sure he's admin of the // if multiple URLs are enabled, make sure he's admin of the

@ -5194,10 +5194,8 @@ class SessionManager
*/ */
public static function orderCourseIsEnabled() public static function orderCourseIsEnabled()
{ {
global $_configuration; $sessionCourseOrder = api_get_setting('session_course_ordering');
if (isset($_configuration['session_course_ordering']) && if ($sessionCourseOrder === 'true') {
$_configuration['session_course_ordering']
) {
return true; return true;
} }

@ -809,7 +809,8 @@ class Template
//Preparing values for the menu //Preparing values for the menu
//Logout link //Logout link
if (isset($_configuration['hide_logout_button']) && $_configuration['hide_logout_button'] == 'true') { $hideLogout = api_get_setting('hide_logout_button');
if ($hideLogout === 'true') {
$this->assign('logout_link', null); $this->assign('logout_link', null);
} else { } else {
$this->assign('logout_link', api_get_path(WEB_PATH).'index.php?logout=logout&uid='.api_get_user_id()); $this->assign('logout_link', api_get_path(WEB_PATH).'index.php?logout=logout&uid='.api_get_user_id());

@ -1462,13 +1462,13 @@ class UserManager
break; break;
} }
$gravatarEnabled = api_get_configuration_value('gravatar_enabled'); $gravatarEnabled = api_get_setting('gravatar_enabled');
if ($gravatarEnabled) { if ($gravatarEnabled === 'true') {
$file = self::getGravatar( $file = self::getGravatar(
$imageWebPath['email'], $imageWebPath['email'],
$gravatarSize, $gravatarSize,
api_get_configuration_value('gravatar_type') api_get_setting('gravatar_type')
); );
if ($addRandomId) { if ($addRandomId) {

@ -572,8 +572,8 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) {
} elseif (!$logout) { } elseif (!$logout) {
// Handle cookie from Master Server // Handle cookie from Master Server
$forceSsoRedirect = api_get_configuration_value('force_sso_redirect'); $forceSsoRedirect = api_get_setting('sso_force_redirect');
if ($forceSsoRedirect) { if ($forceSsoRedirect === 'true') {
// all users to be redirected unless they are connected (removed req on sso_cookie) // all users to be redirected unless they are connected (removed req on sso_cookie)
$redirectToMasterConditions = !isset($_GET['sso_referer']) && !isset($_GET['loginFailed']); $redirectToMasterConditions = !isset($_GET['sso_referer']) && !isset($_GET['loginFailed']);
} else { } else {

@ -346,7 +346,7 @@ VALUES
('hide_certificate_export_link_students', NULL, 'radio', 'Gradebook', 'false', 'CertificateHideExportLinkStudentTitle', 'CertificateHideExportLinkStudentComment', NULL, NULL, 1), ('hide_certificate_export_link_students', NULL, 'radio', 'Gradebook', 'false', 'CertificateHideExportLinkStudentTitle', 'CertificateHideExportLinkStudentComment', NULL, NULL, 1),
('hide_certificate_export_link', NULL, 'radio', 'Gradebook', 'false', 'CertificateHideExportLinkTitle', 'CertificateHideExportLinkComment', NULL, NULL, 1), ('hide_certificate_export_link', NULL, 'radio', 'Gradebook', 'false', 'CertificateHideExportLinkTitle', 'CertificateHideExportLinkComment', NULL, NULL, 1),
('dropbox_hide_course_coach', NULL, 'radio', 'Tools', 'false', 'DropboxHideCourseCoachTitle', 'DropboxHideCourseCoachComment', NULL, NULL, 1), ('dropbox_hide_course_coach', NULL, 'radio', 'Tools', 'false', 'DropboxHideCourseCoachTitle', 'DropboxHideCourseCoachComment', NULL, NULL, 1),
('force_sso_redirect', NULL, 'radio', 'Security', 'false', 'SSOForceRedirectTitle', 'SSOForceRedirectComment', NULL, NULL, 1), ('sso_force_redirect', NULL, 'radio', 'Security', 'false', 'SSOForceRedirectTitle', 'SSOForceRedirectComment', NULL, NULL, 1),
('session_course_ordering', NULL, 'radio', 'Session', 'false', 'SessionCourseOrderingTitle', 'SessionCourseOrderingComment', NULL, NULL, 1), ('session_course_ordering', NULL, 'radio', 'Session', 'false', 'SessionCourseOrderingTitle', 'SessionCourseOrderingComment', NULL, NULL, 1),
('chamilo_database_version', NULL, 'textfield', NULL, '0', 'DatabaseVersion', '', NULL, NULL, 0); ('chamilo_database_version', NULL, 'textfield', NULL, '0', 'DatabaseVersion', '', NULL, NULL, 0);
@ -728,7 +728,7 @@ VALUES
('allow_delete_attendance', 'false', 'No'), ('allow_delete_attendance', 'false', 'No'),
('gravatar_enabled', 'true', 'Yes'), ('gravatar_enabled', 'true', 'Yes'),
('gravatar_enabled', 'false', 'No'), ('gravatar_enabled', 'false', 'No'),
('gravatar_type', 'mm', 'mm'), ('gravatar_type', 'mm', 'mistery-man'),
('gravatar_type', 'identicon', 'identicon'), ('gravatar_type', 'identicon', 'identicon'),
('gravatar_type', 'monsterid', 'monsterid'), ('gravatar_type', 'monsterid', 'monsterid'),
('gravatar_type', 'wavatar', 'wavatar'), ('gravatar_type', 'wavatar', 'wavatar'),
@ -742,8 +742,8 @@ VALUES
('hide_certificate_export_link', 'false', 'No'), ('hide_certificate_export_link', 'false', 'No'),
('dropbox_hide_course_coach', 'true', 'Yes'), ('dropbox_hide_course_coach', 'true', 'Yes'),
('dropbox_hide_course_coach', 'false', 'No'), ('dropbox_hide_course_coach', 'false', 'No'),
('force_sso_redirect', 'true', 'Yes'), ('sso_force_redirect', 'true', 'Yes'),
('force_sso_redirect', 'false', 'No'), ('sso_force_redirect', 'false', 'No'),
('session_course_ordering', 'true', 'Yes'), ('session_course_ordering', 'true', 'Yes'),
('session_course_ordering', 'false', 'No'); ('session_course_ordering', 'false', 'No');

@ -713,8 +713,8 @@ switch ($action) {
api_not_allowed(true); api_not_allowed(true);
} }
global $_configuration; $hideScormCopyLink = api_get_setting('hide_scorm_copy_link');
if (isset($_configuration['hide_scorm_copy_link']) && $_configuration['hide_scorm_copy_link']) { if ($hideScormCopyLink === 'true') {
api_not_allowed(true); api_not_allowed(true);
} }
@ -729,8 +729,8 @@ switch ($action) {
if (!$is_allowed_to_edit) { if (!$is_allowed_to_edit) {
api_not_allowed(true); api_not_allowed(true);
} }
global $_configuration; $hideScormExportLink = api_get_setting('hide_scorm_export_link');
if (isset($_configuration['hide_scorm_export_link']) && $_configuration['hide_scorm_export_link']) { if ($hideScormExportLink === 'true') {
api_not_allowed(true); api_not_allowed(true);
} }
if ($debug > 0) error_log('New LP - export action triggered', 0); if ($debug > 0) error_log('New LP - export action triggered', 0);
@ -745,8 +745,8 @@ switch ($action) {
if (!learnpath::is_lp_visible_for_student($_SESSION['oLP']->lp_id, api_get_user_id())) { if (!learnpath::is_lp_visible_for_student($_SESSION['oLP']->lp_id, api_get_user_id())) {
api_not_allowed(); api_not_allowed();
} }
global $_configuration; $hideScormPdfLink = api_get_setting('hide_scorm_pdf_link');
if (isset($_configuration['hide_scorm_pdf_link']) && $_configuration['hide_scorm_pdf_link']) { if ($hideScormPdfLink === 'true') {
api_not_allowed(true); api_not_allowed(true);
} }

@ -450,16 +450,18 @@ if (!empty($flat_list)) {
Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL).'</a>'; Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL).'</a>';
} }
global $_configuration; $hideScormExportLink = api_get_setting('hide_scorm_export_link');
if (isset($_configuration['hide_scorm_export_link']) && $_configuration['hide_scorm_export_link']) { if ($hideScormExportLink === 'true') {
$dsp_disk = null; $dsp_disk = null;
} }
if (isset($_configuration['hide_scorm_copy_link']) && $_configuration['hide_scorm_copy_link']) { $hideScormCopyLink = api_get_setting('hide_scorm_copy_link');
if ($hideScormCopyLink === 'true') {
$copy = null; $copy = null;
} }
if (isset($_configuration['hide_scorm_pdf_link']) && $_configuration['hide_scorm_pdf_link']) { $hideScormPdfLink = api_get_setting('hide_scorm_pdf_link');
if ($hideScormPdfLink === 'true') {
$export_icon = null; $export_icon = null;
} }

@ -26,9 +26,9 @@ $extendedAttempt = isset($_GET['extend_attempt']) ? $_GET['extend_attempt'] : nu
$extendedAll = isset($_GET['extend_all']) ? $_GET['extend_all'] : null; $extendedAll = isset($_GET['extend_all']) ? $_GET['extend_all'] : null;
$export = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false; $export = isset($_GET['export']) && $_GET['export'] == 'csv' ? true : false;
$lpReportType = api_get_configuration_value('lp_show_reduced_report'); $lpReportType = api_get_setting('lp_show_reduced_report');
$type = 'classic'; $type = 'classic';
if ($lpReportType) { if ($lpReportType === 'true') {
$type = 'simple'; $type = 'simple';
} }
$courseInfo = api_get_course_info($courseCode); $courseInfo = api_get_course_info($courseCode);

@ -80,10 +80,8 @@ function search_users($needle, $type)
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
$showOfficialCode = false; $showOfficialCode = false;
global $_configuration; $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
if (isset($_configuration['order_user_list_by_official_code']) && if ($orderListByOfficialCode === 'true') {
$_configuration['order_user_list_by_official_code']
) {
$showOfficialCode = true; $showOfficialCode = true;
$order_clause = ' ORDER BY official_code, firstname, lastname, username'; $order_clause = ' ORDER BY official_code, firstname, lastname, username';
} }
@ -230,14 +228,14 @@ function search_users($needle, $type)
$officialCode = !empty($user['official_code']) ? $user['official_code'].' - ' : '? - '; $officialCode = !empty($user['official_code']) ? $user['official_code'].' - ' : '? - ';
$person_name = $officialCode.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; $person_name = $officialCode.api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')';
} }
$return .= '<option value="'.$user['id'].'">'.$person_name.' </option>'; $return .= '<option value="'.$user['id'].'">'.$person_name.' </option>';
} }
$return .= '</select>'; $return .= '</select>';
$xajax_response -> addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return)); $xajax_response -> addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return));
} }
} }
return $xajax_response; return $xajax_response;
} }
$xajax->processRequests(); $xajax->processRequests();
@ -328,10 +326,8 @@ $ajax_search = $add_type == 'unique' ? true : false;
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
$showOfficialCode = false; $showOfficialCode = false;
global $_configuration; $orderListByOfficialCode = api_get_setting('order_user_list_by_official_code');
if (isset($_configuration['order_user_list_by_official_code']) && if ($orderListByOfficialCode === 'true') {
$_configuration['order_user_list_by_official_code']
) {
$showOfficialCode = true; $showOfficialCode = true;
$order_clause = ' ORDER BY official_code, firstname, lastname, username'; $order_clause = ' ORDER BY official_code, firstname, lastname, username';
} }

@ -141,10 +141,10 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
} }
global $_configuration; global $_configuration;
$defaultBeforeDays = isset($_configuration['session_days_before_coach_access']) ? $before = api_get_setting('session_days_before_coach_access');
$_configuration['session_days_before_coach_access'] : 0; $defaultBeforeDays = $before ? $before : 0;
$defaultAfterDays = isset($_configuration['session_days_after_coach_access']) $after = api_get_setting('session_days_after_coach_access');
? $_configuration['session_days_after_coach_access'] : 0; $defaultAfterDays = $after ? $after : 0;
$nb_days_acess_before = $defaultBeforeDays; $nb_days_acess_before = $defaultBeforeDays;
$nb_days_acess_after = $defaultAfterDays; $nb_days_acess_after = $defaultAfterDays;

@ -6113,7 +6113,8 @@ $server->register(
function WSCertificatesList($startingDate = '', $endingDate = '') function WSCertificatesList($startingDate = '', $endingDate = '')
{ {
global $_configuration; global $_configuration;
if ($_configuration['add_gradebook_certificates_cron_task_enabled']) { $certificatesCron = api_get_setting('add_gradebook_certificates_cron_task_enabled');
if ($certificatesCron === 'true') {
require_once api_get_path(SYS_CODE_PATH).'cron/add_gradebook_certificates.php'; require_once api_get_path(SYS_CODE_PATH).'cron/add_gradebook_certificates.php';
} }
$result = array(); $result = array();
@ -6494,11 +6495,10 @@ if (!empty($hook)) {
// Use the request to (try to) invoke the service // Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
// If you send your data in utf8 then this value must be false. // If you send your data in utf8 then this value must be false.
if (isset($_configuration['registration.soap.php.decode_utf8'])) { $decodeUTF8 = api_get_setting('registration.soap.php.decode_utf8');
if ($_configuration['registration.soap.php.decode_utf8']) { if ($decodeUTF8 === 'true') {
$server->decode_utf8 = true; $server->decode_utf8 = true;
} else { } else {
$server->decode_utf8 = false; $server->decode_utf8 = false;
}
} }
$server->service($HTTP_RAW_POST_DATA); $server->service($HTTP_RAW_POST_DATA);

@ -501,26 +501,6 @@ class Version20150522222222 extends AbstractMigrationChamilo
[0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']] [0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
); );
// Filters administration users lists by the session admin who created them.
// Change to true to restrict the visibility
//$_configuration['prevent_session_admins_to_manage_all_users'] = false;
$value = api_get_configuration_value('prevent_session_admins_to_manage_all_users');
$this->addSettingCurrent(
'prevent_session_admins_to_manage_all_users',
'',
'radio',
'Session',
($value?$value:'false'),
'PreventSessionAdminsToManageAllUsersTitle',
'PreventSessionAdminsToManageAllUsersComment',
null,
'',
1,
true,
false,
[0 => ['value' => 'true', 'text' => 'Yes'], 1 => ['value' => 'false', 'text' => 'No']]
);
// If there are any tool available and the user is not registered hide the group // If there are any tool available and the user is not registered hide the group
//$_configuration['hide_course_group_if_no_tools_available'] = false; //$_configuration['hide_course_group_if_no_tools_available'] = false;
$value = api_get_configuration_value('hide_course_group_if_no_tools_available'); $value = api_get_configuration_value('hide_course_group_if_no_tools_available');
@ -541,16 +521,16 @@ class Version20150522222222 extends AbstractMigrationChamilo
); );
// Allow student to enroll into a session without an approval needing // Allow student to enroll into a session without an approval needing
//$_configuration['catalog_allow_session_auto_subscription'] = true; //$_configuration['catalog_allow_session_auto_subscription'] = false;
$value = api_get_configuration_value('catalog_allow_session_auto_subscription'); $value = api_get_configuration_value('catalog_allow_session_auto_subscription');
$this->addSettingCurrent( $this->addSettingCurrent(
'catalog_allow_session_auto_subscription', 'catalog_allow_session_auto_subscription',
'', '',
'radio', 'radio',
'Session', 'Session',
($value?$value:'true'), ($value?$value:'false'),
'CatalogueAllowSessionAutoSubscriptionTitle',
'CatalogueAllowSessionAutoSubscriptionTitle', 'CatalogueAllowSessionAutoSubscriptionTitle',
'CatalogueAllowSessionAutoSubscriptionComment',
null, null,
'', '',
1, 1,
@ -634,7 +614,7 @@ class Version20150522222222 extends AbstractMigrationChamilo
true, true,
false, false,
[ [
0 => ['value' => 'mm', 'text' => 'mm'], 0 => ['value' => 'mm', 'text' => 'mystery-man'],
1 => ['value' => 'identicon', 'text' => 'identicon'], 1 => ['value' => 'identicon', 'text' => 'identicon'],
2 => ['value' => 'monsterid', 'text' => 'monsterid'], 2 => ['value' => 'monsterid', 'text' => 'monsterid'],
3 => ['value' => 'wavatar', 'text' => 'wavatar'] 3 => ['value' => 'wavatar', 'text' => 'wavatar']
@ -742,7 +722,7 @@ class Version20150522222222 extends AbstractMigrationChamilo
//$_configuration['force_sso_redirect'] = false; //$_configuration['force_sso_redirect'] = false;
$value = api_get_configuration_value('force_sso_redirect'); $value = api_get_configuration_value('force_sso_redirect');
$this->addSettingCurrent( $this->addSettingCurrent(
'force_sso_redirect', 'sso_force_redirect',
'', '',
'radio', 'radio',
'Security', 'Security',
@ -789,8 +769,8 @@ class Version20150522222222 extends AbstractMigrationChamilo
*/ */
public function down(Schema $schema) public function down(Schema $schema)
{ {
$this->addSql("DELETE FROM settings_options WHERE variable IN ('session_course_ordering', 'force_sso_redirect', 'dropbox_hide_course_coach', 'hide_certificate_export_link', 'hide_certificate_export_link_students', 'show_session_description', 'limit_session_admin_role', 'gravatar_type', 'gravatar_enabled', 'allow_delete_attendance', 'registration.soap.php.decode_utf8', 'catalog_allow_session_auto_subscription', 'hide_course_group_if_no_tools_available', 'prevent_session_admins_to_manage_all_users', 'cookie_warning', 'openbadges_backpack', 'add_gradebook_certificates_cron_task_enabled', 'document_if_file_exists_option', 'exercise_max_ckeditors_in_page', 'certificate_filter_by_official_code', 'student_publication_to_take_in_gradebook', 'course_images_in_courses_list', 'redirect_admin_to_courses_list', 'hide_logout_button', 'allow_session_course_copy_for_teachers', 'lp_show_reduced_report', 'auto_detect_language_custom_pages', 'catalog_show_courses_sessions', 'course_catalog_hide_private', 'show_official_code_exercise_result_list', 'allow_lp_return_link', 'hide_scorm_export_link', 'hide_scorm_copy_link', 'hide_scorm_pdf_link', 'session_days_before_coach_access', 'session_days_after_coach_access', 'pdf_logo_header', 'order_user_list_by_official_code', 'email_alert_manager_on_new_quiz')"); $this->addSql("DELETE FROM settings_options WHERE variable IN ('session_course_ordering', 'sso_force_redirect', 'dropbox_hide_course_coach', 'hide_certificate_export_link', 'hide_certificate_export_link_students', 'show_session_description', 'limit_session_admin_role', 'gravatar_type', 'gravatar_enabled', 'allow_delete_attendance', 'registration.soap.php.decode_utf8', 'catalog_allow_session_auto_subscription', 'hide_course_group_if_no_tools_available', 'cookie_warning', 'openbadges_backpack', 'add_gradebook_certificates_cron_task_enabled', 'document_if_file_exists_option', 'exercise_max_ckeditors_in_page', 'certificate_filter_by_official_code', 'student_publication_to_take_in_gradebook', 'course_images_in_courses_list', 'redirect_admin_to_courses_list', 'hide_logout_button', 'allow_session_course_copy_for_teachers', 'lp_show_reduced_report', 'auto_detect_language_custom_pages', 'catalog_show_courses_sessions', 'course_catalog_hide_private', 'show_official_code_exercise_result_list', 'allow_lp_return_link', 'hide_scorm_export_link', 'hide_scorm_copy_link', 'hide_scorm_pdf_link', 'session_days_before_coach_access', 'session_days_after_coach_access', 'pdf_logo_header', 'order_user_list_by_official_code', 'email_alert_manager_on_new_quiz')");
$this->addSql("DELETE FROM settings_current WHERE variable IN ('session_course_ordering', 'force_sso_redirect', 'dropbox_hide_course_coach', 'hide_certificate_export_link', 'hide_certificate_export_link_students', 'show_session_description', 'limit_session_admin_role', 'gravatar_type', 'gravatar_enabled', 'allow_delete_attendance', 'registration.soap.php.decode_utf8', 'catalog_allow_session_auto_subscription', 'hide_course_group_if_no_tools_available', 'prevent_session_admins_to_manage_all_users', 'cookie_warning', 'openbadges_backpack', 'add_gradebook_certificates_cron_task_enabled', 'document_if_file_exists_option', 'exercise_max_ckeditors_in_page', 'certificate_filter_by_official_code', 'student_publication_to_take_in_gradebook', 'course_images_in_courses_list', 'redirect_admin_to_courses_list', 'hide_logout_button', 'allow_session_course_copy_for_teachers', 'lp_show_reduced_report', 'auto_detect_language_custom_pages', 'catalog_show_courses_sessions', 'course_catalog_hide_private', 'show_official_code_exercise_result_list', 'allow_lp_return_link', 'hide_scorm_export_link', 'hide_scorm_copy_link', 'hide_scorm_pdf_link', 'session_days_before_coach_access', 'session_days_after_coach_access', 'pdf_logo_header', 'order_user_list_by_official_code', 'email_alert_manager_on_new_quiz')"); $this->addSql("DELETE FROM settings_current WHERE variable IN ('session_course_ordering', 'sso_force_redirect', 'dropbox_hide_course_coach', 'hide_certificate_export_link', 'hide_certificate_export_link_students', 'show_session_description', 'limit_session_admin_role', 'gravatar_type', 'gravatar_enabled', 'allow_delete_attendance', 'registration.soap.php.decode_utf8', 'catalog_allow_session_auto_subscription', 'hide_course_group_if_no_tools_available', 'cookie_warning', 'openbadges_backpack', 'add_gradebook_certificates_cron_task_enabled', 'document_if_file_exists_option', 'exercise_max_ckeditors_in_page', 'certificate_filter_by_official_code', 'student_publication_to_take_in_gradebook', 'course_images_in_courses_list', 'redirect_admin_to_courses_list', 'hide_logout_button', 'allow_session_course_copy_for_teachers', 'lp_show_reduced_report', 'auto_detect_language_custom_pages', 'catalog_show_courses_sessions', 'course_catalog_hide_private', 'show_official_code_exercise_result_list', 'allow_lp_return_link', 'hide_scorm_export_link', 'hide_scorm_copy_link', 'hide_scorm_pdf_link', 'session_days_before_coach_access', 'session_days_after_coach_access', 'pdf_logo_header', 'order_user_list_by_official_code', 'email_alert_manager_on_new_quiz')");
$this->addSql('ALTER TABLE user DROP COLUMN last_login'); $this->addSql('ALTER TABLE user DROP COLUMN last_login');
$this->addSql(" $this->addSql("

@ -148,8 +148,8 @@ if (api_get_setting('allow_browser_sniffer') == 'true') {
} }
// Display the Site Use Cookie Warning Validation // Display the Site Use Cookie Warning Validation
$useCookieValidation = api_get_configuration_value('cookie_warning'); $useCookieValidation = api_get_setting('cookie_warning');
if ($useCookieValidation) { if ($useCookieValidation === 'true') {
if (isset($_POST['acceptCookies'])) { if (isset($_POST['acceptCookies'])) {
api_set_site_use_cookie_warning_cookie(); api_set_site_use_cookie_warning_cookie();
} else { } else {

Loading…
Cancel
Save