From 9e6c750e6f8e2f04113b325c2bb067076c0f3313 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Mon, 2 Sep 2019 09:50:12 -0500 Subject: [PATCH] Minor - Flint fixes --- main/cron/import_csv.php | 2 +- main/exercise/exercise.class.php | 12 +++-- main/mySpace/access_details_session.php | 61 ++++++++++++------------- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/main/cron/import_csv.php b/main/cron/import_csv.php index 4bdd6970ee..b942d9c53b 100755 --- a/main/cron/import_csv.php +++ b/main/cron/import_csv.php @@ -1440,7 +1440,7 @@ class ImportCsv $externalCareerIds = []; if (substr($externalCareerIdList, 0, 1) === '[') { $externalCareerIdList = substr($externalCareerIdList, 1, -1); - $externalCareerIds = preg_split('/,/',$externalCareerIdList); + $externalCareerIds = preg_split('/,/', $externalCareerIdList); } else { $externalCareerIds = [$externalCareerIdList]; } diff --git a/main/exercise/exercise.class.php b/main/exercise/exercise.class.php index f71975219f..76a5d871f7 100755 --- a/main/exercise/exercise.class.php +++ b/main/exercise/exercise.class.php @@ -7939,6 +7939,7 @@ class Exercise if (empty($this->exerciseCategoryId)) { return null; } + return (int) $this->exerciseCategoryId; } @@ -7948,7 +7949,7 @@ class Exercise public function setExerciseCategoryId($value) { if (!empty($value)) { - $this->exerciseCategoryId = (int)$value; + $this->exerciseCategoryId = (int) $value; } } @@ -8372,6 +8373,7 @@ class Exercise * Return an HTML table of exercises for on-screen printing, including * action icons. If no exercise is present and the user can edit the * course, show a "create test" button. + * * @param int $categoryId * @param string $keyword * @@ -8459,7 +8461,7 @@ class Exercise $categoryCondition $keywordCondition ORDER BY title"; - // LIMIT $from , $limit"; + // LIMIT $from , $limit"; } else { // Only for students $total_sql = "SELECT count(iid) as count @@ -8477,7 +8479,7 @@ class Exercise $condition_session $categoryCondition $keywordCondition "; - // ORDER BY title LIMIT $from , $limit"; + // ORDER BY title LIMIT $from , $limit"; } $result = Database::query($sql); $result_total = Database::query($total_sql); @@ -9179,7 +9181,7 @@ class Exercise d.c_id = $courseId AND (d.path LIKE '%htm%') AND d.path LIKE '".Database :: escape_string($uploadPath.'/%/%')."' "; - // LIMIT $from , $limit"; // only .htm or .html files listed + // LIMIT $from , $limit"; // only .htm or .html files listed } else { $sql = "SELECT d.iid, d.path as path, d.comment as comment FROM $TBL_DOCUMENT d @@ -9187,7 +9189,7 @@ class Exercise d.c_id = $courseId AND (d.path LIKE '%htm%') AND d.path LIKE '".Database :: escape_string($uploadPath.'/%/%')."' "; - // LIMIT $from , $limit"; + // LIMIT $from , $limit"; } $result = Database::query($sql); diff --git a/main/mySpace/access_details_session.php b/main/mySpace/access_details_session.php index eb1afc2219..90b3d1c5b2 100644 --- a/main/mySpace/access_details_session.php +++ b/main/mySpace/access_details_session.php @@ -155,17 +155,17 @@ if ($form->validate()) { // Partials $partialDuration += $item['duration']; -/* - if (empty($partialMinLogin)) { - $partialMinLogin = api_strtotime($item['login'], 'UTC'); - } - if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) { - $partialMinLogin = api_strtotime($item['login'], 'UTC'); - } - if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) { - $partialMaxLogin = api_strtotime($item['logout'], 'UTC'); - } - */ + /* + if (empty($partialMinLogin)) { + $partialMinLogin = api_strtotime($item['login'], 'UTC'); + } + if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) { + $partialMinLogin = api_strtotime($item['login'], 'UTC'); + } + if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) { + $partialMaxLogin = api_strtotime($item['logout'], 'UTC'); + } + */ $report[$sessionId]['courses'][$course['real_id']][] = $record; $report[$sessionId]['name'][$course['real_id']] = $courseInfo['title'].'  ('.$session['session_name'].')'; } @@ -222,34 +222,33 @@ if ($form->validate()) { // Partials $partialDuration += $item['duration']; -/* - if (empty($partialMinLogin)) { - $partialMinLogin = api_strtotime($item['login'], 'UTC'); - } - if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) { - $partialMinLogin = api_strtotime($item['login'], 'UTC'); - } - if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) { - $partialMaxLogin = api_strtotime($item['logout'], 'UTC'); - } - */ - } + /* + if (empty($partialMinLogin)) { + $partialMinLogin = api_strtotime($item['login'], 'UTC'); + } + if ($partialMinLogin > api_strtotime($item['login'], 'UTC')) { + $partialMinLogin = api_strtotime($item['login'], 'UTC'); + } + if (api_strtotime($item['logout'], 'UTC') > $partialMaxLogin) { + $partialMaxLogin = api_strtotime($item['logout'], 'UTC'); + } + */ + } if (!empty($result)) { -/* + /* + $record = [ + customDate($partialMinLogin, true), + customDate($partialMaxLogin, true), + api_format_time($partialDuration, 'js'), + ]; + */ $record = [ - customDate($partialMinLogin, true), - customDate($partialMaxLogin, true), - api_format_time($partialDuration, 'js'), - ]; - */ - $record = [ "", "", api_format_time($partialDuration, 'js'), ]; - $report[0]['courses'][$course['course_id']][] = $record; $report[0]['name'][$course['course_id']] = $course['title']; }