From 3743e267cbc286e9cb9bee104155488021e77ff8 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Wed, 4 Apr 2018 09:23:05 +0200 Subject: [PATCH] Minor - format code --- main/inc/ajax/chat.ajax.php | 2 -- main/inc/ajax/model.ajax.php | 8 -------- main/inc/lib/AnnouncementManager.php | 3 --- main/inc/lib/agenda.lib.php | 1 - main/inc/lib/course.lib.php | 7 +++---- main/inc/lib/events.lib.php | 6 ------ main/inc/lib/fileUpload.lib.php | 1 + main/inc/lib/message.lib.php | 6 +++--- main/lp/lp_final_item.php | 1 - main/lp/scorm_api.php | 4 ---- main/webservices/webservice_user.php | 14 -------------- 11 files changed, 7 insertions(+), 46 deletions(-) diff --git a/main/inc/ajax/chat.ajax.php b/main/inc/ajax/chat.ajax.php index 38e096f0f6..56a003ea51 100755 --- a/main/inc/ajax/chat.ajax.php +++ b/main/inc/ajax/chat.ajax.php @@ -35,7 +35,6 @@ if (!isset($_SESSION['openChatBoxes'])) { } $chat = new Chat(); - if (Chat::disableChat()) { exit; } @@ -44,7 +43,6 @@ if ($chat->isChatBlockedByExercises()) { $chat->setUserStatus(0); exit; } - switch ($action) { case 'chatheartbeat': $chat->heartbeat(); diff --git a/main/inc/ajax/model.ajax.php b/main/inc/ajax/model.ajax.php index e380e6d122..77c637e516 100755 --- a/main/inc/ajax/model.ajax.php +++ b/main/inc/ajax/model.ajax.php @@ -624,10 +624,6 @@ switch ($action) { break; case 'get_sessions': $list_type = isset($_REQUEST['list_type']) ? $_REQUEST['list_type'] : 'simple'; - /*$courseId = isset($_GET['course_id']) && !empty($_GET['course_id']) ? (int) $_GET['course_id'] : 0; - if (!empty($courseId)) { - $whereCondition .= " c.id = $courseId"; - }*/ if ($list_type === 'simple') { $count = SessionManager::get_sessions_admin( ['where' => $whereCondition, 'extra' => $extra_fields], @@ -2096,13 +2092,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/lib/AnnouncementManager.php b/main/inc/lib/AnnouncementManager.php index b35d470e40..9be675d866 100755 --- a/main/inc/lib/AnnouncementManager.php +++ b/main/inc/lib/AnnouncementManager.php @@ -1586,7 +1586,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 @@ -1605,8 +1604,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 98122c6eea..85f8b389fe 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -3922,7 +3922,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.lib.php b/main/inc/lib/course.lib.php index 14662fdd20..4ccd43631b 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -84,16 +84,15 @@ class CourseManager $params['wanted_code'] = self::generate_course_code($substring); } } + // Create the course keys $keys = AddCourse::define_course_keys($params['wanted_code']); - $params['exemplary_content'] = isset($params['exemplary_content']) ? $params['exemplary_content'] : false; if (count($keys)) { $params['code'] = $keys['currentCourseCode']; $params['visual_code'] = $keys['currentCourseId']; $params['directory'] = $keys['currentCourseRepository']; - $course_info = api_get_course_info($params['code']); if (empty($course_info)) { $course_id = AddCourse::register_course($params); @@ -3820,7 +3819,7 @@ class CourseManager course_rel_user.status status, course.code as course_code, user_course_cat, - course_rel_user.sort + course_rel_user.sort FROM $TABLECOURS course INNER JOIN $TABLECOURSUSER course_rel_user ON (course.id = course_rel_user.c_id) @@ -5027,7 +5026,7 @@ class CourseManager $my_course['is_registered'] = $userRegistered; $my_course['title_cut'] = cut($course_info['title'], 45); - //Course visibility + // Course visibility if ($access_link && in_array('register', $access_link)) { $my_course['register_button'] = Display::url( get_lang('Subscribe').' '. diff --git a/main/inc/lib/events.lib.php b/main/inc/lib/events.lib.php index 21c24f737d..379b242175 100644 --- a/main/inc/lib/events.lib.php +++ b/main/inc/lib/events.lib.php @@ -2091,17 +2091,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/fileUpload.lib.php b/main/inc/lib/fileUpload.lib.php index c8f679dd3b..423ccc7501 100755 --- a/main/inc/lib/fileUpload.lib.php +++ b/main/inc/lib/fileUpload.lib.php @@ -2055,6 +2055,7 @@ function add_all_documents_in_folder_to_database( $whatIfFileExists ); } else { + // Rename $uploadedFile = [ 'name' => $file, 'tmp_name' => $sysFolderPath, diff --git a/main/inc/lib/message.lib.php b/main/inc/lib/message.lib.php index 4b275a8079..d2ebf25088 100755 --- a/main/inc/lib/message.lib.php +++ b/main/inc/lib/message.lib.php @@ -558,9 +558,9 @@ class MessageManager if (!empty($drhList)) { foreach ($drhList as $drhInfo) { $message = sprintf( - get_lang('CopyOfMessageSentToXUser'), - $userInfo['complete_name'] - ).'
'.$message; + get_lang('CopyOfMessageSentToXUser'), + $userInfo['complete_name'] + ).'
'.$message; self::send_message_simple( $drhInfo['user_id'], diff --git a/main/lp/lp_final_item.php b/main/lp/lp_final_item.php index 57bf6a7b69..0342031713 100644 --- a/main/lp/lp_final_item.php +++ b/main/lp/lp_final_item.php @@ -117,7 +117,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_api.php b/main/lp/scorm_api.php index 09b479f4e7..43592f21c0 100755 --- a/main/lp/scorm_api.php +++ b/main/lp/scorm_api.php @@ -2034,7 +2034,6 @@ function xajax_save_objectives(lms_lp_id,lms_user_id,lms_view_id,lms_item_id,ite * @uses lp_ajax_switch_item.php */ function xajax_switch_item_details(lms_lp_id,lms_user_id,lms_view_id,lms_item_id,next_item) { - var params = { 'lid': lms_lp_id, 'uid': lms_user_id, @@ -2157,7 +2156,6 @@ function attach_glossary_into_scorm(type) { var complex_array = new Array(); $("iframe").contents().find("body").on("click", ".glossary-ajax", function() { - div_show_id="div_show_id"; div_content_id="div_content_id"; @@ -2260,7 +2258,6 @@ function attach_glossary_into_scorm(type) { objects.each(function (value, obj) { var dialogId = this.id +'_dialog'; var openerId = this.id +'_opener'; - var link = ''+ '

If video does not work, try clicking here.
'; var embed = $("iframe").contents().find("#"+this.id).find('embed').first(); @@ -2373,6 +2370,5 @@ function attach_glossary_into_scorm(type) { }); }); } - } } diff --git a/main/webservices/webservice_user.php b/main/webservices/webservice_user.php index 29bd14d9fa..30d46a9a60 100755 --- a/main/webservices/webservice_user.php +++ b/main/webservices/webservice_user.php @@ -567,15 +567,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; } @@ -649,11 +640,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;