diff --git a/main/admin/settings.lib.php b/main/admin/settings.lib.php index 063af6847a..82a7379ac1 100755 --- a/main/admin/settings.lib.php +++ b/main/admin/settings.lib.php @@ -1448,9 +1448,10 @@ function generateSettingsForm($settings, $settings_by_access_list) ['maxlength' => '5', 'aria-label' => get_lang($row['title'])] ); $form->applyFilter($row['variable'], 'html_filter'); - $default_values[$row['variable']] = $row['selected_value']; - // For platform character set selection: Conversion of the textfield to a select box with valid values. + // For platform character set selection: + // Conversion of the textfield to a select box with valid values. + $default_values[$row['variable']] = $row['selected_value']; } elseif ($row['variable'] == 'platform_charset') { continue; } else { diff --git a/main/course_home/vertical_activity.php b/main/course_home/vertical_activity.php index 3198588067..ba97977676 100755 --- a/main/course_home/vertical_activity.php +++ b/main/course_home/vertical_activity.php @@ -100,12 +100,11 @@ if (api_is_allowed_to_edit(null, true) && !api_is_coach()) { } $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); - + // TOOLS AUTHORING $blocks[] = [ 'class' => 'Authoringview', 'content' => CourseHome::show_tools_category($my_list) ]; - // TOOLS AUTHORING } else { $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW); if (count($my_list) > 0) { diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php index ce9663dea1..fc0763cde9 100755 --- a/main/exercise/exercise.class.php +++ b/main/exercise/exercise.class.php @@ -5588,7 +5588,6 @@ class Exercise } elseif (in_array($answerType, [UNIQUE_ANSWER, UNIQUE_ANSWER_IMAGE, UNIQUE_ANSWER_NO_OPTION, READING_COMPREHENSION])) { $answer = $choice; Event::saveQuestionAttempt($questionScore, $answer, $quesId, $exeId, 0, $this->id); - // } elseif ($answerType == HOT_SPOT || $answerType == HOT_SPOT_DELINEATION) { } elseif ($answerType == HOT_SPOT || $answerType == ANNOTATION) { $answer = []; if (isset($exerciseResultCoordinates[$questionId]) && !empty($exerciseResultCoordinates[$questionId])) { diff --git a/main/exercise/exercise_admin.php b/main/exercise/exercise_admin.php index 2393c92e9b..9eb788cb40 100755 --- a/main/exercise/exercise_admin.php +++ b/main/exercise/exercise_admin.php @@ -189,8 +189,8 @@ if ($form->validate()) { } else { if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])) { if (!empty($_POST['lp_id'])) { - $lp_id = intval($_POST['lp_id']); //TODO:this remains to be implemented after press the first post + $lp_id = intval($_POST['lp_id']); } else { $lp_id = intval($_GET['lp_id']); } diff --git a/main/exercise/hotpotatoes_exercise_report.php b/main/exercise/hotpotatoes_exercise_report.php index b56f17339d..a3752dea6c 100755 --- a/main/exercise/hotpotatoes_exercise_report.php +++ b/main/exercise/hotpotatoes_exercise_report.php @@ -99,17 +99,11 @@ $nameTools = get_lang('Results'); if ($is_allowedToEdit || $is_tutor) { $nameTools = get_lang('StudentScore'); - $interbreadcrumb[] = ["url" => "exercise.php", "name" => get_lang('Exercises')]; + $interbreadcrumb[] = ["url" => "exercise.php".api_get_cidreq(), "name" => get_lang('Exercises')]; $objExerciseTmp = new Exercise(); - /*if ($objExerciseTmp->read($exercise_id)) { - $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name); - }*/ } else { - $interbreadcrumb[] = ["url" => "exercise.php", "name" => get_lang('Exercises')]; + $interbreadcrumb[] = ["url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises')]; $objExerciseTmp = new Exercise(); - /*if ($objExerciseTmp->read($exercise_id)) { - $nameTools = get_lang('Results').': '.$objExerciseTmp->name; - }*/ } Display :: display_header($nameTools); diff --git a/main/forum/viewforumcategory.php b/main/forum/viewforumcategory.php index 5457c9cf57..78eced67d8 100755 --- a/main/forum/viewforumcategory.php +++ b/main/forum/viewforumcategory.php @@ -273,20 +273,15 @@ if ($action != 'add') { $show_forum = true; } else { // it is a group forum - //echo '-groepsforum'; // it is a group forum but it is public => show if ($forum['forum_group_public_private'] == 'public') { $show_forum = true; - //echo '-publiek'; } else { // it is a group forum and it is private - //echo '-prive'; // it is a group forum and it is private but the user is member of the group if (in_array($forum['forum_of_group'], $groups_of_user)) { - //echo '-is lid'; $show_forum = true; } else { - //echo '-is GEEN lid'; $show_forum = false; } } diff --git a/main/gradebook/lib/be/category.class.php b/main/gradebook/lib/be/category.class.php index d6861bff95..8e2ef8b546 100755 --- a/main/gradebook/lib/be/category.class.php +++ b/main/gradebook/lib/be/category.class.php @@ -1844,13 +1844,13 @@ class Category implements GradebookItem if (api_is_allowed_to_edit() && !api_is_platform_admin()) { // root if ($this->id == 0) { + // inside a course return $this->get_root_categories_for_teacher( api_get_user_id(), $course_code, $session_id, false ); - // inside a course } elseif (!empty($this->course_code)) { return self::load( null, diff --git a/main/inc/ajax/model.ajax.php b/main/inc/ajax/model.ajax.php index ddba2386b8..6aa8d827dc 100755 --- a/main/inc/ajax/model.ajax.php +++ b/main/inc/ajax/model.ajax.php @@ -2084,13 +2084,9 @@ switch ($action) { if ($obj->usergroup_was_added_in_course($group['id'], $course_id)) { $url = 'class.php?action=remove_class_from_course&id='.$group['id'].'&'.api_get_cidreq(); $icon = Display::return_icon('delete.png', get_lang('Remove')); - //$class = 'btn btn-danger'; - //$text = get_lang('Remove'); } else { $url = 'class.php?action=add_class_to_course&id='.$group['id'].'&'.api_get_cidreq().'&type=not_registered'; - //$class = 'btn btn-primary'; $icon = Display::return_icon('add.png', get_lang('Add')); - //$text = get_lang('Add'); } switch ($group['group_type']) { diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index 5e8b100498..b1d0557ed4 100755 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -580,8 +580,8 @@ if (!isset($_SESSION['login_as']) && isset($_user)) { if ($res_logout_date < time() - $lifeTime) { // it isn't, we should create a fresh entry - Event::eventLogin($_user['user_id']); // now that it's created, we can get its ID and carry on + Event::eventLogin($_user['user_id']); } else { $sql = "UPDATE $tbl_track_login SET logout_date = '$now' WHERE login_id = '$i_id_last_connection'"; diff --git a/main/inc/lib/AnnouncementManager.php b/main/inc/lib/AnnouncementManager.php index b14282d46e..92041f0e46 100755 --- a/main/inc/lib/AnnouncementManager.php +++ b/main/inc/lib/AnnouncementManager.php @@ -1537,7 +1537,6 @@ class AnnouncementManager $extraGroupCondition $groupBy ORDER BY display_order DESC"; - //GROUP BY ip.ref } else { // A.3 you are a course admin without any group or user filter // A.3.a you are a course admin without user or group filter but WITH studentview @@ -1556,8 +1555,6 @@ class AnnouncementManager $searchCondition $groupBy ORDER BY display_order DESC"; - - //GROUP BY ip.ref } else { // A.3.a you are a course admin without user or group filter and WTIHOUT studentview (= the normal course admin view) // => see all the messages of all the users and groups with editing possibilities diff --git a/main/inc/lib/agenda.lib.php b/main/inc/lib/agenda.lib.php index 6d4a9f1de9..e7f0e2f082 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -3907,7 +3907,6 @@ class Agenda ); $result .= ''; $html .= $result; - //echo Display::div($content, array('id'=>'main_'.$value['calendar_type'].'_'.$value['id'], 'class' => 'dialog')); } else { $html .= $result .= $icon.''; } diff --git a/main/inc/lib/course_home.lib.php b/main/inc/lib/course_home.lib.php index f9f41f5bb7..76e27c0b2d 100755 --- a/main/inc/lib/course_home.lib.php +++ b/main/inc/lib/course_home.lib.php @@ -168,11 +168,11 @@ class CourseHome if (strpos($tool['name'], 'visio_') !== false) { $cell_content .= ''.$tool_name.''.$tool_name.''; } elseif (strpos($tool['name'], 'chat') !== false && api_get_course_setting('allow_open_chat_window')) { - $cell_content .= ''.$tool_name.''.$tool_name.''; // don't replace img with display::return_icon because $tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'] + $cell_content .= ''.$tool_name.''.$tool_name.''; } else { - $cell_content .= ''.$tool_name.''.$tool_name.''; // don't replace img with display::return_icon because $tool['img'] = api_get_path(WEB_IMG_PATH).$tool['img'] + $cell_content .= ''.$tool_name.''.$tool_name.''; } } else { // INVISIBLE diff --git a/main/inc/lib/events.lib.php b/main/inc/lib/events.lib.php index 39a892dac8..7d47c29b5f 100644 --- a/main/inc/lib/events.lib.php +++ b/main/inc/lib/events.lib.php @@ -2030,17 +2030,11 @@ class Event if (Database::num_rows($result) > 0) { $row = Database::fetch_array($result, 'ASSOC'); $courseAccessId = $row['course_access_id']; - /*$logout = $row['logout_course_date']; - $now = time(); - $logout = api_strtotime($logout, 'UTC'); - */ - //if ($now - $logout < $sessionLifetime) { $sql = "UPDATE $tableCourseAccess SET logout_course_date = '$currentDate', counter = counter + 1 WHERE course_access_id = $courseAccessId"; Database::query($sql); - //} } else { $insert = true; } diff --git a/main/inc/lib/myspace.lib.php b/main/inc/lib/myspace.lib.php index eb11f1539e..d353873e33 100644 --- a/main/inc/lib/myspace.lib.php +++ b/main/inc/lib/myspace.lib.php @@ -2321,11 +2321,11 @@ class MySpace } else { $is_session_avail = self::user_available_in_session($user['UserName'], $course_list, $id_session); if ($is_session_avail == 0) { + // This should be the ID because the user exists. $user_name = $user['UserName']; $sql_select = "SELECT user_id FROM $table_user WHERE username ='$user_name' "; $rs = Database::query($sql_select); $user['create'] = Database::result($rs, 0, 0); - // This should be the ID because the user exists. } else { $user['create'] = $is_session_avail; } diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index a0f8ba2651..08c537aa7f 100755 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -538,7 +538,6 @@ if (!empty($_SESSION['_user']['user_id']) && !($login || $logout)) { /* >>>>>>>> External authentication modules <<<<<<<<< */ // see configuration.php to define these include_once($extAuthSource[$key]['login']); - /* >>>>>>>> External authentication modules <<<<<<<<< */ } else { // no standard Chamilo login - try external authentification //huh... nothing to do... we shouldn't get here error_log( diff --git a/main/lp/lp_final_item.php b/main/lp/lp_final_item.php index eb121a69f7..d28e8c7967 100644 --- a/main/lp/lp_final_item.php +++ b/main/lp/lp_final_item.php @@ -108,6 +108,7 @@ if ($accessGranted == false) { ); // If not gradebook has been defined if (empty($catLoad)) { + // TODO: Missing validation of learning path completion $finalItemTemplate = generateLPFinalItemTemplate( $id, $courseCode, @@ -115,7 +116,6 @@ if ($accessGranted == false) { $downloadCertificateLink, $badgeLink ); - // TODO: Missing validation of learning path completion } else { // A gradebook was found, proceed... /** @var Category $category */ diff --git a/main/lp/scorm.class.php b/main/lp/scorm.class.php index 7f27d83ba2..eeb145b817 100755 --- a/main/lp/scorm.class.php +++ b/main/lp/scorm.class.php @@ -217,8 +217,8 @@ class scorm extends learnpath } } } - unset($doc); // End parsing using PHP5 DOMXML methods. + unset($doc); } else { if ($this->debug > 1) { error_log('New LP - Could not open/read file '.$file); diff --git a/main/webservices/http-auth.php b/main/webservices/http-auth.php index f735208df7..e5ac06d4ce 100755 --- a/main/webservices/http-auth.php +++ b/main/webservices/http-auth.php @@ -40,8 +40,8 @@ function getDigest() { // mod_php if (isset($_SERVER['PHP_AUTH_DIGEST'])) { - $digest = $_SERVER['PHP_AUTH_DIGEST']; // most other servers + $digest = $_SERVER['PHP_AUTH_DIGEST']; } elseif (isset($_SERVER['HTTP_AUTHENTICATION'])) { if (strpos( strtolower($_SERVER['HTTP_AUTHENTICATION']), diff --git a/main/webservices/registration.soap.php b/main/webservices/registration.soap.php index 4c983f4100..f4d9185138 100755 --- a/main/webservices/registration.soap.php +++ b/main/webservices/registration.soap.php @@ -329,12 +329,10 @@ function WSCreateUsers($params) $userManager->updateUser($user, true); $results[] = $user_id; continue; - //return $r_check_user[0]; } else { + // user id already exits. $results[] = 0; continue; - //return 0; - // user id already exits. } } diff --git a/main/webservices/webservice_user.php b/main/webservices/webservice_user.php index 3837a418bc..71f182b1bf 100755 --- a/main/webservices/webservice_user.php +++ b/main/webservices/webservice_user.php @@ -318,15 +318,6 @@ class WSUser extends WS ); if (!$result) { return new WSError(104, 'There was an error creating the user'); - - /*$failure = $api_failureList[0]; - if($failure == 'login-pass already taken') { - return new WSError(102, 'This username is already taken'); - } else if($failure == 'encrypt_method invalid') { - return new WSError(103, 'The encryption of the password is invalid'); - } else { - return new WSError(104, 'There was an error creating the user'); - }*/ } else { return $result; } @@ -520,11 +511,6 @@ class WSUser extends WS $encrypt_method ); if (!$result) { - /*if($failure == 'encrypt_method invalid') { - return new WSError(103, 'The encryption of the password is invalid'); - } else { - return new WSError(105, 'There was an error updating the user'); - }*/ return new WSError(105, 'There was an error updating the user'); } else { return $result; diff --git a/main/work/work.lib.php b/main/work/work.lib.php index f386feb3e3..66d2e0c280 100755 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -2031,8 +2031,8 @@ function get_work_user_list( if (!empty($work_data)) { if (!empty($group_id)) { - $extra_conditions = " work.post_group_id = '".intval($groupIid)."' "; // set to select only messages posted by the user's group + $extra_conditions = " work.post_group_id = '".intval($groupIid)."' "; } else { $extra_conditions = " (work.post_group_id = '0' OR work.post_group_id is NULL) "; } diff --git a/src/CoreBundle/Controller/Admin/AdminController.php b/src/CoreBundle/Controller/Admin/AdminController.php index 42dac19507..abcea84139 100644 --- a/src/CoreBundle/Controller/Admin/AdminController.php +++ b/src/CoreBundle/Controller/Admin/AdminController.php @@ -109,8 +109,6 @@ class AdminController extends BaseController 'url' => $adminUrl.'extra_fields.php?type=user', 'label' => get_lang('ManageUserFields'), ]; - /*$items[] = array('url'=> api_get_path(WEB_PUBLIC_PATH) - .'admin/administrator/roles', 'label' => get_lang('Roles'));*/ } else { $items = [ [ diff --git a/src/CourseBundle/Component/CourseCopy/CourseBuilder.php b/src/CourseBundle/Component/CourseCopy/CourseBuilder.php index 3a87bf4e3a..a9783b3bc1 100644 --- a/src/CourseBundle/Component/CourseCopy/CourseBuilder.php +++ b/src/CourseBundle/Component/CourseCopy/CourseBuilder.php @@ -583,13 +583,13 @@ class CourseBuilder true ); } + //select only quizzes with active = 0 or 1 (not -1 which is for deleted quizzes) $sql = "SELECT * FROM $table_qui WHERE c_id = $courseId AND active >=0 $session_condition"; - //select only quizzes with active = 0 or 1 (not -1 which is for deleted quizzes) } else { + //select only quizzes with active = 0 or 1 (not -1 which is for deleted quizzes) $sql = "SELECT * FROM $table_qui WHERE c_id = $courseId AND active >=0 AND (session_id = 0 OR session_id IS NULL)"; - //select only quizzes with active = 0 or 1 (not -1 which is for deleted quizzes) } $sql .= 'ORDER BY title';