@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | return $msg; |
183 | 183 | } |
184 | 184 | } else { |
185 | - $rs = Database::query("SELECT 1 FROM $tbl_session WHERE name='" . $name . "'"); |
|
185 | + $rs = Database::query("SELECT 1 FROM $tbl_session WHERE name='".$name."'"); |
|
186 | 186 | if (Database::num_rows($rs)) { |
187 | 187 | $msg = get_lang('SessionNameAlreadyExists'); |
188 | 188 | return $msg; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | public static function session_name_exists($name) |
296 | 296 | { |
297 | 297 | $name = Database::escape_string($name); |
298 | - $sql = "SELECT COUNT(*) as count FROM " . Database::get_main_table(TABLE_MAIN_SESSION) . " |
|
298 | + $sql = "SELECT COUNT(*) as count FROM ".Database::get_main_table(TABLE_MAIN_SESSION)." |
|
299 | 299 | WHERE name = '$name'"; |
300 | 300 | $result = Database::fetch_array(Database::query($sql)); |
301 | 301 | |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $where .= " AND ( |
327 | 327 | s.session_admin_id = $user_id OR |
328 | 328 | sru.user_id = '$user_id' AND |
329 | - sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' |
|
329 | + sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' |
|
330 | 330 | ) |
331 | 331 | "; |
332 | 332 | |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $where_condition = str_replace('category_name', 'sc.name', $where_condition); |
345 | 345 | $where_condition = str_replace( |
346 | 346 | array("AND session_active = '1' )", " AND ( session_active = '1' )"), |
347 | - array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " ) |
|
347 | + array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ") |
|
348 | 348 | , $where_condition |
349 | 349 | ); |
350 | 350 | $where_condition = str_replace( |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | |
390 | 390 | $access_url_id = api_get_current_access_url_id(); |
391 | 391 | if ($access_url_id != -1) { |
392 | - $where.= " AND ar.access_url_id = $access_url_id "; |
|
392 | + $where .= " AND ar.access_url_id = $access_url_id "; |
|
393 | 393 | |
394 | 394 | $sql = "SELECT count(id) as total_rows FROM ( |
395 | 395 | SELECT DISTINCT |
@@ -439,14 +439,14 @@ discard block |
||
439 | 439 | if (api_is_session_admin() && |
440 | 440 | api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false' |
441 | 441 | ) { |
442 | - $where .=" AND s.session_admin_id = $user_id "; |
|
442 | + $where .= " AND s.session_admin_id = $user_id "; |
|
443 | 443 | } |
444 | 444 | } |
445 | 445 | |
446 | 446 | if (!api_is_platform_admin() && api_is_teacher() && |
447 | 447 | api_get_setting('allow_teachers_to_create_sessions') == 'true' |
448 | 448 | ) { |
449 | - $where .=" AND s.id_coach = $user_id "; |
|
449 | + $where .= " AND s.id_coach = $user_id "; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | $extra_field = new ExtraFieldModel('session'); |
@@ -498,10 +498,10 @@ discard block |
||
498 | 498 | $query = "$select FROM $tbl_session s $inject_joins $where $inject_where"; |
499 | 499 | |
500 | 500 | if (api_is_multiple_url_enabled()) { |
501 | - $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
501 | + $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
502 | 502 | $access_url_id = api_get_current_access_url_id(); |
503 | 503 | if ($access_url_id != -1) { |
504 | - $where.= " AND ar.access_url_id = $access_url_id "; |
|
504 | + $where .= " AND ar.access_url_id = $access_url_id "; |
|
505 | 505 | $query = "$select |
506 | 506 | FROM $tbl_session s $inject_joins |
507 | 507 | INNER JOIN $table_access_url_rel_session ar |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | INNER JOIN $tbl_lp l ON l.id = v.lp_id |
605 | 605 | INNER JOIN $tbl_user u ON u.user_id = v.user_id |
606 | 606 | INNER JOIN $tbl_course c |
607 | - WHERE v.session_id = " . $sessionId; |
|
607 | + WHERE v.session_id = ".$sessionId; |
|
608 | 608 | $result_rows = Database::query($sql); |
609 | 609 | $row = Database::fetch_array($result_rows); |
610 | 610 | $num = $row['total_rows']; |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | |
657 | 657 | $limit = null; |
658 | 658 | if (!empty($options['limit'])) { |
659 | - $limit = " LIMIT " . $options['limit']; |
|
659 | + $limit = " LIMIT ".$options['limit']; |
|
660 | 660 | } |
661 | 661 | |
662 | 662 | if (!empty($options['where'])) { |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | |
666 | 666 | $order = null; |
667 | 667 | if (!empty($options['order'])) { |
668 | - $order = " ORDER BY " . $options['order']; |
|
668 | + $order = " ORDER BY ".$options['order']; |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | $sql = "SELECT u.user_id, u.lastname, u.firstname, u.username, u.email, s.c_id |
@@ -724,13 +724,13 @@ discard block |
||
724 | 724 | foreach ($lessons as $lesson) { |
725 | 725 | $data[$lesson['id']] = (!empty($user_lessons[$lesson['id']]['progress'])) ? $user_lessons[$lesson['id']]['progress'] : 0; |
726 | 726 | $progress += $data[$lesson['id']]; |
727 | - $data[$lesson['id']] = $data[$lesson['id']] . '%'; |
|
727 | + $data[$lesson['id']] = $data[$lesson['id']].'%'; |
|
728 | 728 | $count++; |
729 | 729 | } |
730 | 730 | if ($count == 0) { |
731 | 731 | $data['total'] = 0; |
732 | 732 | } else { |
733 | - $data['total'] = round($progress / $count, 2) . '%'; |
|
733 | + $data['total'] = round($progress / $count, 2).'%'; |
|
734 | 734 | } |
735 | 735 | $table[] = $data; |
736 | 736 | } |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | |
772 | 772 | $limit = null; |
773 | 773 | if (!empty($options['limit'])) { |
774 | - $limit = " LIMIT " . $options['limit']; |
|
774 | + $limit = " LIMIT ".$options['limit']; |
|
775 | 775 | } |
776 | 776 | |
777 | 777 | if (!empty($options['where'])) { |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | |
781 | 781 | $order = null; |
782 | 782 | if (!empty($options['order'])) { |
783 | - $order = " ORDER BY " . $options['order']; |
|
783 | + $order = " ORDER BY ".$options['order']; |
|
784 | 784 | } |
785 | 785 | |
786 | 786 | $sql = "SELECT u.user_id, u.lastname, u.firstname, u.username, u.email, s.c_id |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | |
883 | 883 | $limit = null; |
884 | 884 | if (!empty($options['limit'])) { |
885 | - $limit = " LIMIT " . $options['limit']; |
|
885 | + $limit = " LIMIT ".$options['limit']; |
|
886 | 886 | } |
887 | 887 | |
888 | 888 | if (!empty($options['where'])) { |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | |
892 | 892 | $order = null; |
893 | 893 | if (!empty($options['order'])) { |
894 | - $order = " ORDER BY " . $options['order']; |
|
894 | + $order = " ORDER BY ".$options['order']; |
|
895 | 895 | } |
896 | 896 | |
897 | 897 | //TODO, fix create report without session |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | /** |
925 | 925 | * Lessons |
926 | 926 | */ |
927 | - $sql = "SELECT * FROM $tbl_course_lp WHERE c_id = %s "; //AND session_id = %s |
|
927 | + $sql = "SELECT * FROM $tbl_course_lp WHERE c_id = %s "; //AND session_id = %s |
|
928 | 928 | $sql_query = sprintf($sql, $course['real_id']); |
929 | 929 | $result = Database::query($sql_query); |
930 | 930 | $arrLesson = array(array()); |
@@ -932,7 +932,7 @@ discard block |
||
932 | 932 | if (empty($arrLesson[$row['session_id']]['lessons_total'])) { |
933 | 933 | $arrLesson[$row['session_id']]['lessons_total'] = 1; |
934 | 934 | } else { |
935 | - $arrLesson[$row['session_id']]['lessons_total'] ++; |
|
935 | + $arrLesson[$row['session_id']]['lessons_total']++; |
|
936 | 936 | } |
937 | 937 | } |
938 | 938 | |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | $course['real_id'] |
1009 | 1009 | ); |
1010 | 1010 | foreach ($user_list as $user_id) { |
1011 | - isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id] ++ : $survey_user_list[$user_id] = 1; |
|
1011 | + isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id]++ : $survey_user_list[$user_id] = 1; |
|
1012 | 1012 | } |
1013 | 1013 | } |
1014 | 1014 | |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | $assignments_done = Tracking::count_student_assignments($user['user_id'], $course['code'], $user['id_session']); |
1063 | 1063 | $assignments_left = $assignments_total - $assignments_done; |
1064 | 1064 | if (!empty($assignments_total)) { |
1065 | - $assignments_progress = round((( $assignments_done * 100 ) / $assignments_total), 2); |
|
1065 | + $assignments_progress = round((($assignments_done * 100) / $assignments_total), 2); |
|
1066 | 1066 | } else { |
1067 | 1067 | $assignments_progress = 0; |
1068 | 1068 | } |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | $wiki_read = $row['count']; |
1093 | 1093 | $wiki_unread = $wiki_total - $wiki_read; |
1094 | 1094 | if (!empty($wiki_total)) { |
1095 | - $wiki_progress = round((( $wiki_read * 100 ) / $wiki_total), 2); |
|
1095 | + $wiki_progress = round((($wiki_read * 100) / $wiki_total), 2); |
|
1096 | 1096 | } else { |
1097 | 1097 | $wiki_progress = 0; |
1098 | 1098 | } |
@@ -1101,7 +1101,7 @@ discard block |
||
1101 | 1101 | $surveys_done = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0); |
1102 | 1102 | $surveys_left = $surveys_total - $surveys_done; |
1103 | 1103 | if (!empty($surveys_total)) { |
1104 | - $surveys_progress = round((( $surveys_done * 100 ) / $surveys_total), 2); |
|
1104 | + $surveys_progress = round((($surveys_done * 100) / $surveys_total), 2); |
|
1105 | 1105 | } else { |
1106 | 1106 | $surveys_progress = 0; |
1107 | 1107 | } |
@@ -1114,7 +1114,7 @@ discard block |
||
1114 | 1114 | ); |
1115 | 1115 | $forums_left = $forums_total - $forums_done; |
1116 | 1116 | if (!empty($forums_total)) { |
1117 | - $forums_progress = round((( $forums_done * 100 ) / $forums_total), 2); |
|
1117 | + $forums_progress = round((($forums_done * 100) / $forums_total), 2); |
|
1118 | 1118 | } else { |
1119 | 1119 | $forums_progress = 0; |
1120 | 1120 | } |
@@ -1122,58 +1122,58 @@ discard block |
||
1122 | 1122 | //Overall Total |
1123 | 1123 | $overall_total = ($course_description_progress + $exercises_progress + $forums_progress + $assignments_progress + $wiki_progress + $surveys_progress) / 6; |
1124 | 1124 | |
1125 | - $link = '<a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/myStudents.php?student=' . $user[0] . '&details=true&course=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>'; |
|
1126 | - $linkForum = '<a href="' . api_get_path(WEB_CODE_PATH) . 'forum/index.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>'; |
|
1127 | - $linkWork = '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>'; |
|
1128 | - $linkWiki = '<a href="' . api_get_path(WEB_CODE_PATH) . 'wiki/index.php?cidReq=' . $course['code'] . '&session_id=' . $user['id_session'] . '&action=statistics"> %s </a>'; |
|
1129 | - $linkSurvey = '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>'; |
|
1125 | + $link = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$user[0].'&details=true&course='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>'; |
|
1126 | + $linkForum = '<a href="'.api_get_path(WEB_CODE_PATH).'forum/index.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>'; |
|
1127 | + $linkWork = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>'; |
|
1128 | + $linkWiki = '<a href="'.api_get_path(WEB_CODE_PATH).'wiki/index.php?cidReq='.$course['code'].'&session_id='.$user['id_session'].'&action=statistics"> %s </a>'; |
|
1129 | + $linkSurvey = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>'; |
|
1130 | 1130 | |
1131 | 1131 | $table[] = array( |
1132 | 1132 | 'lastname' => $user[1], |
1133 | 1133 | 'firstname' => $user[2], |
1134 | 1134 | 'username' => $user[3], |
1135 | 1135 | #'profile' => '', |
1136 | - 'total' => round($overall_total, 2) . '%', |
|
1137 | - 'courses' => sprintf($link, $course_description_progress . '%'), |
|
1138 | - 'lessons' => sprintf($link, $lessons_progress . '%'), |
|
1139 | - 'exercises' => sprintf($link, $exercises_progress . '%'), |
|
1140 | - 'forums' => sprintf($link, $forums_progress . '%'), |
|
1141 | - 'homeworks' => sprintf($link, $assignments_progress . '%'), |
|
1142 | - 'wikis' => sprintf($link, $wiki_progress . '%'), |
|
1143 | - 'surveys' => sprintf($link, $surveys_progress . '%'), |
|
1136 | + 'total' => round($overall_total, 2).'%', |
|
1137 | + 'courses' => sprintf($link, $course_description_progress.'%'), |
|
1138 | + 'lessons' => sprintf($link, $lessons_progress.'%'), |
|
1139 | + 'exercises' => sprintf($link, $exercises_progress.'%'), |
|
1140 | + 'forums' => sprintf($link, $forums_progress.'%'), |
|
1141 | + 'homeworks' => sprintf($link, $assignments_progress.'%'), |
|
1142 | + 'wikis' => sprintf($link, $wiki_progress.'%'), |
|
1143 | + 'surveys' => sprintf($link, $surveys_progress.'%'), |
|
1144 | 1144 | //course description |
1145 | - 'course_description_progress' => $course_description_progress . '%', |
|
1145 | + 'course_description_progress' => $course_description_progress.'%', |
|
1146 | 1146 | //lessons |
1147 | 1147 | 'lessons_total' => sprintf($link, $lessons_total), |
1148 | 1148 | 'lessons_done' => sprintf($link, $lessons_done), |
1149 | 1149 | 'lessons_left' => sprintf($link, $lessons_left), |
1150 | - 'lessons_progress' => sprintf($link, $lessons_progress . '%'), |
|
1150 | + 'lessons_progress' => sprintf($link, $lessons_progress.'%'), |
|
1151 | 1151 | //exercises |
1152 | 1152 | 'exercises_total' => sprintf($link, $exercises_total), |
1153 | 1153 | 'exercises_done' => sprintf($link, $exercises_done), |
1154 | 1154 | 'exercises_left' => sprintf($link, $exercises_left), |
1155 | - 'exercises_progress' => sprintf($link, $exercises_progress . '%'), |
|
1155 | + 'exercises_progress' => sprintf($link, $exercises_progress.'%'), |
|
1156 | 1156 | //forums |
1157 | 1157 | 'forums_total' => sprintf($linkForum, $forums_total), |
1158 | 1158 | 'forums_done' => sprintf($linkForum, $forums_done), |
1159 | 1159 | 'forums_left' => sprintf($linkForum, $forums_left), |
1160 | - 'forums_progress' => sprintf($linkForum, $forums_progress . '%'), |
|
1160 | + 'forums_progress' => sprintf($linkForum, $forums_progress.'%'), |
|
1161 | 1161 | //assignments |
1162 | 1162 | 'assignments_total' => sprintf($linkWork, $assignments_total), |
1163 | 1163 | 'assignments_done' => sprintf($linkWork, $assignments_done), |
1164 | 1164 | 'assignments_left' => sprintf($linkWork, $assignments_left), |
1165 | - 'assignments_progress' => sprintf($linkWork, $assignments_progress . '%'), |
|
1165 | + 'assignments_progress' => sprintf($linkWork, $assignments_progress.'%'), |
|
1166 | 1166 | //wiki |
1167 | 1167 | 'wiki_total' => sprintf($linkWiki, $wiki_total), |
1168 | 1168 | 'wiki_revisions' => sprintf($linkWiki, $wiki_revisions), |
1169 | 1169 | 'wiki_read' => sprintf($linkWiki, $wiki_read), |
1170 | 1170 | 'wiki_unread' => sprintf($linkWiki, $wiki_unread), |
1171 | - 'wiki_progress' => sprintf($linkWiki, $wiki_progress . '%'), |
|
1171 | + 'wiki_progress' => sprintf($linkWiki, $wiki_progress.'%'), |
|
1172 | 1172 | //survey |
1173 | 1173 | 'surveys_total' => sprintf($linkSurvey, $surveys_total), |
1174 | 1174 | 'surveys_done' => sprintf($linkSurvey, $surveys_done), |
1175 | 1175 | 'surveys_left' => sprintf($linkSurvey, $surveys_left), |
1176 | - 'surveys_progress' => sprintf($linkSurvey, $surveys_progress . '%'), |
|
1176 | + 'surveys_progress' => sprintf($linkSurvey, $surveys_progress.'%'), |
|
1177 | 1177 | ); |
1178 | 1178 | } |
1179 | 1179 | |
@@ -1255,7 +1255,7 @@ discard block |
||
1255 | 1255 | |
1256 | 1256 | $limit = null; |
1257 | 1257 | if (!empty($options['limit'])) { |
1258 | - $limit = " LIMIT " . $options['limit']; |
|
1258 | + $limit = " LIMIT ".$options['limit']; |
|
1259 | 1259 | } |
1260 | 1260 | |
1261 | 1261 | if (!empty($options['where'])) { |
@@ -1264,7 +1264,7 @@ discard block |
||
1264 | 1264 | |
1265 | 1265 | $order = null; |
1266 | 1266 | if (!empty($options['order'])) { |
1267 | - $order = " ORDER BY " . $options['order']; |
|
1267 | + $order = " ORDER BY ".$options['order']; |
|
1268 | 1268 | } |
1269 | 1269 | |
1270 | 1270 | //TODO add course name |
@@ -1277,7 +1277,7 @@ discard block |
||
1277 | 1277 | " : " |
1278 | 1278 | u.lastname, |
1279 | 1279 | u.firstname, |
1280 | - ") . " |
|
1280 | + ")." |
|
1281 | 1281 | a.logout_course_date, |
1282 | 1282 | a.counter, |
1283 | 1283 | c.title, |
@@ -1359,7 +1359,7 @@ discard block |
||
1359 | 1359 | if (Database::num_rows($result) > 0) { |
1360 | 1360 | $row = Database::fetch_array($result); |
1361 | 1361 | $count = $row['count'] + 1; |
1362 | - $session_name = $session_name . '_' . $count; |
|
1362 | + $session_name = $session_name.'_'.$count; |
|
1363 | 1363 | $result = self::session_name_exists($session_name); |
1364 | 1364 | if (!$result) { |
1365 | 1365 | return $session_name; |
@@ -1866,7 +1866,7 @@ discard block |
||
1866 | 1866 | // Delete users from the session |
1867 | 1867 | if ($empty_users === true) { |
1868 | 1868 | $sql = "DELETE FROM $tbl_session_rel_user |
1869 | - WHERE session_id = $id_session AND relation_type<>" . SESSION_RELATION_TYPE_RRHH . ""; |
|
1869 | + WHERE session_id = $id_session AND relation_type<>".SESSION_RELATION_TYPE_RRHH.""; |
|
1870 | 1870 | Database::query($sql); |
1871 | 1871 | } |
1872 | 1872 | |
@@ -1877,7 +1877,7 @@ discard block |
||
1877 | 1877 | $enreg_user = Database::escape_string($enreg_user); |
1878 | 1878 | $nbr_users++; |
1879 | 1879 | $sql = "INSERT IGNORE INTO $tbl_session_rel_user (relation_type, session_id, user_id, registered_at) |
1880 | - VALUES (0, $id_session, $enreg_user, '" . api_get_utc_datetime() . "')"; |
|
1880 | + VALUES (0, $id_session, $enreg_user, '".api_get_utc_datetime()."')"; |
|
1881 | 1881 | Database::query($sql); |
1882 | 1882 | } |
1883 | 1883 | |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | $statusCondition = null; |
1970 | 1970 | if (isset($status) && !is_null($status)) { |
1971 | 1971 | $status = intval($status); |
1972 | - $statusCondition = " AND status = $status"; |
|
1972 | + $statusCondition = " AND status = $status"; |
|
1973 | 1973 | } |
1974 | 1974 | |
1975 | 1975 | foreach ($userList as $userId) { |
@@ -2101,7 +2101,7 @@ discard block |
||
2101 | 2101 | if (empty($count)) { |
2102 | 2102 | // If user is not registered to a session then add it. |
2103 | 2103 | $sql = "INSERT IGNORE INTO $tbl_session_rel_user (session_id, user_id, registered_at) |
2104 | - VALUES ($session_id, $enreg_user, '" . api_get_utc_datetime() . "')"; |
|
2104 | + VALUES ($session_id, $enreg_user, '".api_get_utc_datetime()."')"; |
|
2105 | 2105 | Database::query($sql); |
2106 | 2106 | |
2107 | 2107 | $sql = "UPDATE $tbl_session SET nbr_users = nbr_users + 1 |
@@ -2144,7 +2144,7 @@ discard block |
||
2144 | 2144 | WHERE |
2145 | 2145 | session_id = $session_id AND |
2146 | 2146 | user_id = $user_id AND |
2147 | - relation_type <> " . SESSION_RELATION_TYPE_RRHH . ""; |
|
2147 | + relation_type <> ".SESSION_RELATION_TYPE_RRHH.""; |
|
2148 | 2148 | $result = Database::query($sql); |
2149 | 2149 | $return = Database::affected_rows($result); |
2150 | 2150 | |
@@ -2229,7 +2229,7 @@ discard block |
||
2229 | 2229 | FROM $tbl_session_rel_user |
2230 | 2230 | WHERE |
2231 | 2231 | session_id = $sessionId AND |
2232 | - relation_type<>" . SESSION_RELATION_TYPE_RRHH; |
|
2232 | + relation_type<>".SESSION_RELATION_TYPE_RRHH; |
|
2233 | 2233 | $result = Database::query($sql); |
2234 | 2234 | $user_list = Database::store_result($result); |
2235 | 2235 | |
@@ -2240,7 +2240,7 @@ discard block |
||
2240 | 2240 | |
2241 | 2241 | $sql = "DELETE FROM $tbl_session_rel_course |
2242 | 2242 | WHERE |
2243 | - c_id = " . $existingCourse['c_id'] . " AND |
|
2243 | + c_id = ".$existingCourse['c_id']." AND |
|
2244 | 2244 | session_id = $sessionId"; |
2245 | 2245 | Database::query($sql); |
2246 | 2246 | |
@@ -2303,7 +2303,7 @@ discard block |
||
2303 | 2303 | $links = $cat->get_links(null, false, $courseInfo['code'], 0); |
2304 | 2304 | |
2305 | 2305 | $cat->set_session_id($sessionId); |
2306 | - $oldCategoryId= $cat->get_id(); |
|
2306 | + $oldCategoryId = $cat->get_id(); |
|
2307 | 2307 | $newId = $cat->add(); |
2308 | 2308 | $newCategoryIdList[$oldCategoryId] = $newId; |
2309 | 2309 | $parentId = $cat->get_parent_id(); |
@@ -2490,7 +2490,7 @@ discard block |
||
2490 | 2490 | $return_value = false; |
2491 | 2491 | $sql = "SELECT c_id FROM $tbl_session_course |
2492 | 2492 | WHERE |
2493 | - session_id = " . intval($session_id) . " AND |
|
2493 | + session_id = ".intval($session_id)." AND |
|
2494 | 2494 | c_id = " . intval($courseId); |
2495 | 2495 | $result = Database::query($sql); |
2496 | 2496 | $num = Database::num_rows($result); |
@@ -2514,8 +2514,8 @@ discard block |
||
2514 | 2514 | } |
2515 | 2515 | |
2516 | 2516 | $sql = 'SELECT * |
2517 | - FROM ' . $tbl_session . ' |
|
2518 | - WHERE name = "' . Database::escape_string($session_name) . '"'; |
|
2517 | + FROM ' . $tbl_session.' |
|
2518 | + WHERE name = "' . Database::escape_string($session_name).'"'; |
|
2519 | 2519 | $result = Database::query($sql); |
2520 | 2520 | $num = Database::num_rows($result); |
2521 | 2521 | if ($num > 0) { |
@@ -2555,8 +2555,8 @@ discard block |
||
2555 | 2555 | $month_end = intval($smonth_end); |
2556 | 2556 | $day_end = intval($sday_end); |
2557 | 2557 | |
2558 | - $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
|
2559 | - $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
|
2558 | + $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start); |
|
2559 | + $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end); |
|
2560 | 2560 | |
2561 | 2561 | if (empty($name)) { |
2562 | 2562 | $msg = get_lang('SessionCategoryNameIsRequired'); |
@@ -2633,8 +2633,8 @@ discard block |
||
2633 | 2633 | $month_end = intval($smonth_end); |
2634 | 2634 | $day_end = intval($sday_end); |
2635 | 2635 | $id = intval($id); |
2636 | - $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start); |
|
2637 | - $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end); |
|
2636 | + $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start); |
|
2637 | + $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end); |
|
2638 | 2638 | |
2639 | 2639 | if (empty($name)) { |
2640 | 2640 | $msg = get_lang('SessionCategoryNameIsRequired'); |
@@ -2654,13 +2654,13 @@ discard block |
||
2654 | 2654 | if ($date_end <> null) { |
2655 | 2655 | $sql = "UPDATE $tbl_session_category |
2656 | 2656 | SET |
2657 | - name = '" . Database::escape_string($name) . "', |
|
2657 | + name = '".Database::escape_string($name)."', |
|
2658 | 2658 | date_start = '$date_start' , |
2659 | 2659 | date_end = '$date_end' |
2660 | 2660 | WHERE id= $id"; |
2661 | 2661 | } else { |
2662 | 2662 | $sql = "UPDATE $tbl_session_category SET |
2663 | - name = '" . Database::escape_string($name) . "', |
|
2663 | + name = '".Database::escape_string($name)."', |
|
2664 | 2664 | date_start = '$date_start', |
2665 | 2665 | date_end = NULL |
2666 | 2666 | WHERE id= $id"; |
@@ -2690,10 +2690,10 @@ discard block |
||
2690 | 2690 | |
2691 | 2691 | //Setting session_category_id to 0 |
2692 | 2692 | $sql = "UPDATE $tbl_session SET session_category_id = 0 |
2693 | - WHERE session_category_id IN (" . $id_checked . ")"; |
|
2693 | + WHERE session_category_id IN (".$id_checked.")"; |
|
2694 | 2694 | Database::query($sql); |
2695 | 2695 | |
2696 | - $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (" . $id_checked . ")"; |
|
2696 | + $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (".$id_checked.")"; |
|
2697 | 2697 | $result = Database::query($sql); |
2698 | 2698 | while ($rows = Database::fetch_array($result)) { |
2699 | 2699 | $session_id = $rows['id']; |
@@ -2705,7 +2705,7 @@ discard block |
||
2705 | 2705 | } |
2706 | 2706 | } |
2707 | 2707 | } |
2708 | - $sql = "DELETE FROM $tbl_session_category WHERE id IN (" . $id_checked . ")"; |
|
2708 | + $sql = "DELETE FROM $tbl_session_category WHERE id IN (".$id_checked.")"; |
|
2709 | 2709 | Database::query($sql); |
2710 | 2710 | |
2711 | 2711 | // Add event to system log |
@@ -2778,7 +2778,7 @@ discard block |
||
2778 | 2778 | $value = Database::escape_string($options['value']); |
2779 | 2779 | $sql_query .= ' AND '; |
2780 | 2780 | if (in_array($field, $availableFields) && in_array($operator, $availableOperator)) { |
2781 | - $sql_query .= $field . " $operator '" . $value . "'"; |
|
2781 | + $sql_query .= $field." $operator '".$value."'"; |
|
2782 | 2782 | } |
2783 | 2783 | } |
2784 | 2784 | } |
@@ -2845,8 +2845,8 @@ discard block |
||
2845 | 2845 | { |
2846 | 2846 | $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); |
2847 | 2847 | $id = api_get_current_access_url_id(); |
2848 | - $sql = 'SELECT * FROM ' . $tbl_session_category . ' |
|
2849 | - WHERE access_url_id = ' . $id . ' |
|
2848 | + $sql = 'SELECT * FROM '.$tbl_session_category.' |
|
2849 | + WHERE access_url_id = ' . $id.' |
|
2850 | 2850 | ORDER BY name ASC'; |
2851 | 2851 | $result = Database::query($sql); |
2852 | 2852 | if (Database::num_rows($result) > 0) { |
@@ -2999,7 +2999,7 @@ discard block |
||
2999 | 2999 | $sql = "DELETE FROM $tbl_session_rel_user |
3000 | 3000 | WHERE |
3001 | 3001 | session_id = $sessionId AND |
3002 | - relation_type =" . SESSION_RELATION_TYPE_RRHH; |
|
3002 | + relation_type =".SESSION_RELATION_TYPE_RRHH; |
|
3003 | 3003 | Database::query($sql); |
3004 | 3004 | |
3005 | 3005 | return true; |
@@ -3053,12 +3053,12 @@ discard block |
||
3053 | 3053 | ON (a.session_id = s.session_id) |
3054 | 3054 | WHERE |
3055 | 3055 | s.user_id = $userId AND |
3056 | - relation_type = " . SESSION_RELATION_TYPE_RRHH . " AND |
|
3056 | + relation_type = ".SESSION_RELATION_TYPE_RRHH." AND |
|
3057 | 3057 | access_url_id = " . api_get_current_access_url_id(); |
3058 | 3058 | } else { |
3059 | 3059 | $sql = "SELECT s.session_id |
3060 | 3060 | FROM $tbl_session_rel_user s |
3061 | - WHERE user_id = $userId AND relation_type=" . SESSION_RELATION_TYPE_RRHH; |
|
3061 | + WHERE user_id = $userId AND relation_type=".SESSION_RELATION_TYPE_RRHH; |
|
3062 | 3062 | } |
3063 | 3063 | $result = Database::query($sql); |
3064 | 3064 | |
@@ -3068,7 +3068,7 @@ discard block |
||
3068 | 3068 | WHERE |
3069 | 3069 | session_id = {$row['session_id']} AND |
3070 | 3070 | user_id = $userId AND |
3071 | - relation_type =" . SESSION_RELATION_TYPE_RRHH; |
|
3071 | + relation_type =".SESSION_RELATION_TYPE_RRHH; |
|
3072 | 3072 | Database::query($sql); |
3073 | 3073 | } |
3074 | 3074 | } |
@@ -3083,7 +3083,7 @@ discard block |
||
3083 | 3083 | WHERE |
3084 | 3084 | session_id = $session_id AND |
3085 | 3085 | user_id = $userId AND |
3086 | - relation_type = '" . SESSION_RELATION_TYPE_RRHH . "'"; |
|
3086 | + relation_type = '".SESSION_RELATION_TYPE_RRHH."'"; |
|
3087 | 3087 | $result = Database::query($sql); |
3088 | 3088 | if (Database::num_rows($result) == 0) { |
3089 | 3089 | $sql = "INSERT IGNORE INTO $tbl_session_rel_user (session_id, user_id, relation_type, registered_at) |
@@ -3133,8 +3133,8 @@ discard block |
||
3133 | 3133 | WHERE |
3134 | 3134 | sru.user_id = '$userId' AND |
3135 | 3135 | sru.session_id = '$sessionId' AND |
3136 | - sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' AND |
|
3137 | - access_url_id = " . api_get_current_access_url_id() . " |
|
3136 | + sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' AND |
|
3137 | + access_url_id = " . api_get_current_access_url_id()." |
|
3138 | 3138 | "; |
3139 | 3139 | } else { |
3140 | 3140 | $sql = "$select FROM $tbl_session s |
@@ -3143,7 +3143,7 @@ discard block |
||
3143 | 3143 | sru.session_id = s.id AND |
3144 | 3144 | sru.user_id = '$userId' AND |
3145 | 3145 | sru.session_id = '$sessionId' AND |
3146 | - sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' |
|
3146 | + sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' |
|
3147 | 3147 | "; |
3148 | 3148 | } |
3149 | 3149 | |
@@ -3243,7 +3243,7 @@ discard block |
||
3243 | 3243 | |
3244 | 3244 | $limitCondition = null; |
3245 | 3245 | if (!empty($start) && !empty($limit)) { |
3246 | - $limitCondition = " LIMIT " . intval($start) . ", " . intval($limit); |
|
3246 | + $limitCondition = " LIMIT ".intval($start).", ".intval($limit); |
|
3247 | 3247 | } |
3248 | 3248 | |
3249 | 3249 | if (empty($orderCondition)) { |
@@ -3320,26 +3320,26 @@ discard block |
||
3320 | 3320 | |
3321 | 3321 | $sessions = array(); |
3322 | 3322 | if (Database::num_rows($result) > 0) { |
3323 | - $sysUploadPath = api_get_path(SYS_UPLOAD_PATH). 'sessions/'; |
|
3324 | - $webUploadPath = api_get_path(WEB_UPLOAD_PATH). 'sessions/'; |
|
3323 | + $sysUploadPath = api_get_path(SYS_UPLOAD_PATH).'sessions/'; |
|
3324 | + $webUploadPath = api_get_path(WEB_UPLOAD_PATH).'sessions/'; |
|
3325 | 3325 | $imgPath = Display::return_icon('session_default_small.png', null, null, null, null, true); |
3326 | 3326 | |
3327 | 3327 | $tableExtraFields = Database::get_main_table(TABLE_EXTRA_FIELD); |
3328 | - $sql = "SELECT id FROM " . $tableExtraFields . " |
|
3328 | + $sql = "SELECT id FROM ".$tableExtraFields." |
|
3329 | 3329 | WHERE extra_field_type = 3 AND variable='image'"; |
3330 | 3330 | $resultField = Database::query($sql); |
3331 | 3331 | $imageFieldId = Database::fetch_assoc($resultField); |
3332 | 3332 | |
3333 | 3333 | while ($row = Database::fetch_array($result)) { |
3334 | 3334 | |
3335 | - $row['image'] = null; |
|
3336 | - $sessionImage = $sysUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png'; |
|
3335 | + $row['image'] = null; |
|
3336 | + $sessionImage = $sysUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png'; |
|
3337 | 3337 | |
3338 | 3338 | if (is_file($sessionImage)) { |
3339 | - $sessionImage = $webUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png'; |
|
3339 | + $sessionImage = $webUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png'; |
|
3340 | 3340 | $row['image'] = $sessionImage; |
3341 | 3341 | } else { |
3342 | - $row['image'] = $imgPath; |
|
3342 | + $row['image'] = $imgPath; |
|
3343 | 3343 | } |
3344 | 3344 | |
3345 | 3345 | if ($row['display_start_date'] == '0000-00-00 00:00:00' || $row['display_start_date'] == '0000-00-00') { |
@@ -3439,7 +3439,7 @@ discard block |
||
3439 | 3439 | return intval($count['count']); |
3440 | 3440 | } |
3441 | 3441 | |
3442 | - while ($row = Database::fetch_array($result,'ASSOC')) { |
|
3442 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
3443 | 3443 | $courses[$row['real_id']] = $row; |
3444 | 3444 | } |
3445 | 3445 | } |
@@ -3483,7 +3483,7 @@ discard block |
||
3483 | 3483 | } |
3484 | 3484 | |
3485 | 3485 | $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
3486 | - $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
3486 | + $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
3487 | 3487 | |
3488 | 3488 | if ($getCount) { |
3489 | 3489 | $select = "SELECT COUNT(DISTINCT(c.code)) as count "; |
@@ -3508,7 +3508,7 @@ discard block |
||
3508 | 3508 | "; |
3509 | 3509 | if ($getCount) { |
3510 | 3510 | $result = Database::query($sql); |
3511 | - $row = Database::fetch_array($result,'ASSOC'); |
|
3511 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
3512 | 3512 | return $row['count']; |
3513 | 3513 | } |
3514 | 3514 | |
@@ -3523,7 +3523,7 @@ discard block |
||
3523 | 3523 | $courses = array(); |
3524 | 3524 | |
3525 | 3525 | if ($num_rows > 0) { |
3526 | - while ($row = Database::fetch_array($result,'ASSOC')) { |
|
3526 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
3527 | 3527 | $courses[$row['id']] = $row; |
3528 | 3528 | } |
3529 | 3529 | } |
@@ -3601,7 +3601,7 @@ discard block |
||
3601 | 3601 | $result = Database::query($sql); |
3602 | 3602 | $num_rows = Database::num_rows($result); |
3603 | 3603 | if ($num_rows > 0) { |
3604 | - $row = Database::fetch_array($result,'ASSOC'); |
|
3604 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
3605 | 3605 | return $row['count']; |
3606 | 3606 | } |
3607 | 3607 | |
@@ -3720,9 +3720,9 @@ discard block |
||
3720 | 3720 | |
3721 | 3721 | if ($access_url_id != -1) { |
3722 | 3722 | $sql = 'SELECT DISTINCT session.* |
3723 | - FROM ' . $session_table . ' session INNER JOIN ' . $tbl_session_rel_access_url . ' session_rel_url |
|
3723 | + FROM ' . $session_table.' session INNER JOIN '.$tbl_session_rel_access_url.' session_rel_url |
|
3724 | 3724 | ON (session.id = session_rel_url.session_id) |
3725 | - WHERE '.$sqlCoach.' access_url_id = ' . $access_url_id; |
|
3725 | + WHERE '.$sqlCoach.' access_url_id = '.$access_url_id; |
|
3726 | 3726 | } |
3727 | 3727 | } |
3728 | 3728 | $sql .= ' ORDER by name'; |
@@ -3756,8 +3756,8 @@ discard block |
||
3756 | 3756 | FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user |
3757 | 3757 | WHERE |
3758 | 3758 | session_rcru.user_id = user.user_id AND |
3759 | - session_rcru.session_id = '" . intval($session_id) . "' AND |
|
3760 | - session_rcru.c_id ='" . intval($courseId) . "' AND |
|
3759 | + session_rcru.session_id = '".intval($session_id)."' AND |
|
3760 | + session_rcru.c_id ='" . intval($courseId)."' AND |
|
3761 | 3761 | user.user_id = " . intval($user_id); |
3762 | 3762 | |
3763 | 3763 | $result = Database::query($sql); |
@@ -3788,8 +3788,8 @@ discard block |
||
3788 | 3788 | $sql = "SELECT session_rcru.status |
3789 | 3789 | FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user |
3790 | 3790 | WHERE session_rcru.user_id = user.user_id AND |
3791 | - session_rcru.session_id = '" . intval($session_id) . "' AND |
|
3792 | - session_rcru.c_id ='" . intval($courseId) . "' AND |
|
3791 | + session_rcru.session_id = '".intval($session_id)."' AND |
|
3792 | + session_rcru.c_id ='" . intval($courseId)."' AND |
|
3793 | 3793 | user.user_id = " . intval($user_id); |
3794 | 3794 | $result = Database::query($sql); |
3795 | 3795 | $status = false; |
@@ -3866,7 +3866,7 @@ discard block |
||
3866 | 3866 | // Get timestamp for now in UTC - see http://php.net/manual/es/function.time.php#117251 |
3867 | 3867 | $now = time() - date('Z'); |
3868 | 3868 | // Timestamp in one month |
3869 | - $inOneMonth = $now + (30*24*3600); |
|
3869 | + $inOneMonth = $now + (30 * 24 * 3600); |
|
3870 | 3870 | $inOneMonth = api_get_local_time($inOneMonth); |
3871 | 3871 | if (api_strtotime($s['access_start_date']) < $now) { |
3872 | 3872 | $s['access_start_date'] = api_get_local_time($now); |
@@ -3888,16 +3888,16 @@ discard block |
||
3888 | 3888 | } |
3889 | 3889 | // Now try to create the session |
3890 | 3890 | $sid = self::create_session( |
3891 | - $s['name'] . ' ' . get_lang('CopyLabelSuffix'), |
|
3891 | + $s['name'].' '.get_lang('CopyLabelSuffix'), |
|
3892 | 3892 | $s['access_start_date'], |
3893 | 3893 | $s['access_end_date'], |
3894 | 3894 | $s['display_start_date'], |
3895 | 3895 | $s['display_end_date'], |
3896 | 3896 | $s['coach_access_start_date'], |
3897 | 3897 | $s['coach_access_end_date'], |
3898 | - (int)$s['id_coach'], |
|
3898 | + (int) $s['id_coach'], |
|
3899 | 3899 | $s['session_category_id'], |
3900 | - (int)$s['visibility'], |
|
3900 | + (int) $s['visibility'], |
|
3901 | 3901 | true |
3902 | 3902 | ); |
3903 | 3903 | |
@@ -4016,7 +4016,7 @@ discard block |
||
4016 | 4016 | $session_table = Database::get_main_table(TABLE_MAIN_SESSION); |
4017 | 4017 | $sql = "SELECT DISTINCT id |
4018 | 4018 | FROM $session_table |
4019 | - WHERE session.id_coach = '" . $user_id . "' AND id = '$session_id'"; |
|
4019 | + WHERE session.id_coach = '".$user_id."' AND id = '$session_id'"; |
|
4020 | 4020 | $result = Database::query($sql); |
4021 | 4021 | if ($result && Database::num_rows($result)) { |
4022 | 4022 | return true; |
@@ -4035,7 +4035,7 @@ discard block |
||
4035 | 4035 | $access_url_rel_session_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
4036 | 4036 | $sql = "SELECT count(id) FROM $session_table s"; |
4037 | 4037 | if (!empty($access_url_id) && $access_url_id == intval($access_url_id)) { |
4038 | - $sql .= ", $access_url_rel_session_table u " . |
|
4038 | + $sql .= ", $access_url_rel_session_table u ". |
|
4039 | 4039 | " WHERE s.id = u.session_id AND u.access_url_id = $access_url_id"; |
4040 | 4040 | } |
4041 | 4041 | $res = Database::query($sql); |
@@ -4274,7 +4274,7 @@ discard block |
||
4274 | 4274 | |
4275 | 4275 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
4276 | 4276 | $tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
4277 | - $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
4277 | + $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
4278 | 4278 | $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
4279 | 4279 | |
4280 | 4280 | $sessions = array(); |
@@ -4410,10 +4410,10 @@ discard block |
||
4410 | 4410 | $suffix = null; |
4411 | 4411 | while (!$unique_name) { |
4412 | 4412 | if ($i > 1) { |
4413 | - $suffix = ' - ' . $i; |
|
4413 | + $suffix = ' - '.$i; |
|
4414 | 4414 | } |
4415 | - $sql = 'SELECT 1 FROM ' . $tbl_session . ' |
|
4416 | - WHERE name="' . Database::escape_string($session_name). $suffix . '"'; |
|
4415 | + $sql = 'SELECT 1 FROM '.$tbl_session.' |
|
4416 | + WHERE name="' . Database::escape_string($session_name).$suffix.'"'; |
|
4417 | 4417 | $rs = Database::query($sql); |
4418 | 4418 | |
4419 | 4419 | if (Database::result($rs, 0, 0)) { |
@@ -4426,14 +4426,14 @@ discard block |
||
4426 | 4426 | |
4427 | 4427 | // Creating the session. |
4428 | 4428 | $sql = "INSERT IGNORE INTO $tbl_session SET |
4429 | - name = '" . Database::escape_string($session_name). "', |
|
4429 | + name = '".Database::escape_string($session_name)."', |
|
4430 | 4430 | id_coach = '$coach_id', |
4431 | 4431 | access_start_date = '$dateStart', |
4432 | 4432 | access_end_date = '$dateEnd', |
4433 | 4433 | display_start_date = '$dateStart', |
4434 | 4434 | display_end_date = '$dateEnd', |
4435 | 4435 | visibility = '$visibilityAfterExpirationPerSession', |
4436 | - session_admin_id = " . $defaultUserId . " |
|
4436 | + session_admin_id = ".$defaultUserId." |
|
4437 | 4437 | $sessionCondition $extraParameters $extraSessionParameters"; |
4438 | 4438 | Database::query($sql); |
4439 | 4439 | |
@@ -4499,7 +4499,7 @@ discard block |
||
4499 | 4499 | |
4500 | 4500 | // Delete session-user relation only for students |
4501 | 4501 | $sql = "DELETE FROM $tbl_session_user |
4502 | - WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH; |
|
4502 | + WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH; |
|
4503 | 4503 | Database::query($sql); |
4504 | 4504 | |
4505 | 4505 | $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'"; |
@@ -4590,7 +4590,7 @@ discard block |
||
4590 | 4590 | |
4591 | 4591 | // Delete session-user relation only for students |
4592 | 4592 | $sql = "DELETE FROM $tbl_session_user |
4593 | - WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH; |
|
4593 | + WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH; |
|
4594 | 4594 | Database::query($sql); |
4595 | 4595 | |
4596 | 4596 | $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'"; |
@@ -4633,7 +4633,7 @@ discard block |
||
4633 | 4633 | $sql = "INSERT IGNORE INTO $tbl_session_user SET |
4634 | 4634 | user_id = '$user_id', |
4635 | 4635 | session_id = '$session_id', |
4636 | - registered_at = '" . api_get_utc_datetime() . "'"; |
|
4636 | + registered_at = '".api_get_utc_datetime()."'"; |
|
4637 | 4637 | Database::query($sql); |
4638 | 4638 | if ($debug) { |
4639 | 4639 | $logger->addInfo("Sessions - Adding User #$user_id ($user) to session #$session_id"); |
@@ -5201,7 +5201,7 @@ discard block |
||
5201 | 5201 | foreach ($sessions as $session) { |
5202 | 5202 | $courseList = SessionManager::get_course_list_by_session_id($session['id']); |
5203 | 5203 | foreach ($courseList as $course) { |
5204 | - $coursesFromSession[$course['code'].':'.$session['id']] = $course['visual_code'] . ' - ' . $course['title'] . ' (' . $session['name'] . ')'; |
|
5204 | + $coursesFromSession[$course['code'].':'.$session['id']] = $course['visual_code'].' - '.$course['title'].' ('.$session['name'].')'; |
|
5205 | 5205 | } |
5206 | 5206 | } |
5207 | 5207 | } |
@@ -5348,7 +5348,7 @@ discard block |
||
5348 | 5348 | |
5349 | 5349 | if (!empty($lastConnectionDate)) { |
5350 | 5350 | $lastConnectionDate = Database::escape_string($lastConnectionDate); |
5351 | - $userConditions .= " AND u.last_login <= '$lastConnectionDate' "; |
|
5351 | + $userConditions .= " AND u.last_login <= '$lastConnectionDate' "; |
|
5352 | 5352 | } |
5353 | 5353 | |
5354 | 5354 | if (!empty($keyword)) { |
@@ -5418,7 +5418,7 @@ discard block |
||
5418 | 5418 | $result = Database::query($sql); |
5419 | 5419 | $result = Database::store_result($result); |
5420 | 5420 | |
5421 | - return $result ; |
|
5421 | + return $result; |
|
5422 | 5422 | } |
5423 | 5423 | |
5424 | 5424 | /** |
@@ -5478,7 +5478,7 @@ discard block |
||
5478 | 5478 | $userToString = null; |
5479 | 5479 | foreach ($userList as $userInfo) { |
5480 | 5480 | $newUserList[] = $userInfo['user_id']; |
5481 | - $userToString .= $userInfo['firstname'] . ' ' . $userInfo['lastname'] . '<br />'; |
|
5481 | + $userToString .= $userInfo['firstname'].' '.$userInfo['lastname'].'<br />'; |
|
5482 | 5482 | } |
5483 | 5483 | |
5484 | 5484 | if (!empty($sessionsDestination)) { |
@@ -5491,7 +5491,7 @@ discard block |
||
5491 | 5491 | $messages[] = Display::return_message(sprintf(get_lang('SessionXSkipped'), $sessionDestinationId), 'warning', false); |
5492 | 5492 | continue; |
5493 | 5493 | } |
5494 | - $messages[] = Display::return_message(get_lang('StudentList') . '<br />' . $userToString, 'info', false); |
|
5494 | + $messages[] = Display::return_message(get_lang('StudentList').'<br />'.$userToString, 'info', false); |
|
5495 | 5495 | SessionManager::subscribe_users_to_session( |
5496 | 5496 | $sessionDestinationId, |
5497 | 5497 | $newUserList, |
@@ -5546,7 +5546,7 @@ discard block |
||
5546 | 5546 | } |
5547 | 5547 | } |
5548 | 5548 | } |
5549 | - $sessionUrl = api_get_path(WEB_CODE_PATH) . 'admin/resume_session.php?id_session='; |
|
5549 | + $sessionUrl = api_get_path(WEB_CODE_PATH).'admin/resume_session.php?id_session='; |
|
5550 | 5550 | |
5551 | 5551 | $htmlResult = null; |
5552 | 5552 | |
@@ -5561,7 +5561,7 @@ discard block |
||
5561 | 5561 | $sessionInfo = self::fetch($sessionId); |
5562 | 5562 | $htmlResult .= '<br />'; |
5563 | 5563 | $htmlResult .= Display::url( |
5564 | - get_lang('Session') . ': ' . $sessionInfo['name'] . ' <br />', $sessionUrl . $sessionId, array('target' => '_blank') |
|
5564 | + get_lang('Session').': '.$sessionInfo['name'].' <br />', $sessionUrl.$sessionId, array('target' => '_blank') |
|
5565 | 5565 | ); |
5566 | 5566 | $teacherList = array(); |
5567 | 5567 | foreach ($coachList as $coachId) { |
@@ -5674,7 +5674,7 @@ discard block |
||
5674 | 5674 | } |
5675 | 5675 | |
5676 | 5676 | $sessionIdList = array_map('intval', $sessionIdList); |
5677 | - $sessionToString = implode("', '", $sessionIdList); |
|
5677 | + $sessionToString = implode("', '", $sessionIdList); |
|
5678 | 5678 | |
5679 | 5679 | $course = Database::get_main_table(TABLE_MAIN_COURSE); |
5680 | 5680 | $sessionCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
@@ -5686,7 +5686,7 @@ discard block |
||
5686 | 5686 | INNER JOIN $courseUser cu ON (cu.c_id = c.id) |
5687 | 5687 | WHERE src.session_id IN ('$sessionToString') AND cu.status = 1"; |
5688 | 5688 | $result = Database::query($sql); |
5689 | - while($row = Database::fetch_array($result, 'ASSOC')) { |
|
5689 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
5690 | 5690 | $teacherListId[$row['user_id']] = $row['user_id']; |
5691 | 5691 | } |
5692 | 5692 | } else { |
@@ -5761,7 +5761,7 @@ discard block |
||
5761 | 5761 | $toolList = self::getCourseToolToBeManaged(); |
5762 | 5762 | |
5763 | 5763 | foreach ($toolList as $tool) { |
5764 | - $method = 'add' . $tool; |
|
5764 | + $method = 'add'.$tool; |
|
5765 | 5765 | if (method_exists(get_class(), $method)) { |
5766 | 5766 | self::$method($sessionId, $courseId); |
5767 | 5767 | } |
@@ -5780,7 +5780,7 @@ discard block |
||
5780 | 5780 | $toolList = self::getCourseToolToBeManaged(); |
5781 | 5781 | |
5782 | 5782 | foreach ($toolList as $tool) { |
5783 | - $method = 'remove' . $tool; |
|
5783 | + $method = 'remove'.$tool; |
|
5784 | 5784 | if (method_exists(get_class(), $method)) { |
5785 | 5785 | self::$method($sessionId, $courseId); |
5786 | 5786 | } |
@@ -5898,18 +5898,18 @@ discard block |
||
5898 | 5898 | } |
5899 | 5899 | } |
5900 | 5900 | |
5901 | - $message .= '<strong>' . get_lang('User') . '</strong> ' . $userInfo['complete_name'] . ' <br />'; |
|
5901 | + $message .= '<strong>'.get_lang('User').'</strong> '.$userInfo['complete_name'].' <br />'; |
|
5902 | 5902 | |
5903 | 5903 | if (!in_array($userInfo['status'], array(DRH)) && !api_is_platform_admin_by_id($userInfo['user_id'])) { |
5904 | - $message .= get_lang('UserMustHaveTheDrhRole') . '<br />'; |
|
5904 | + $message .= get_lang('UserMustHaveTheDrhRole').'<br />'; |
|
5905 | 5905 | continue; |
5906 | 5906 | } |
5907 | 5907 | |
5908 | 5908 | if (!empty($sessionList)) { |
5909 | - $message .= '<strong>' . get_lang('Sessions') . ':</strong> <br />'; |
|
5910 | - $message .= implode(', ', $sessionList) . '<br /><br />'; |
|
5909 | + $message .= '<strong>'.get_lang('Sessions').':</strong> <br />'; |
|
5910 | + $message .= implode(', ', $sessionList).'<br /><br />'; |
|
5911 | 5911 | } else { |
5912 | - $message .= get_lang('NoSessionProvided') . ' <br /><br />'; |
|
5912 | + $message .= get_lang('NoSessionProvided').' <br /><br />'; |
|
5913 | 5913 | } |
5914 | 5914 | } |
5915 | 5915 | } |
@@ -6089,8 +6089,8 @@ discard block |
||
6089 | 6089 | |
6090 | 6090 | $firstAccess = api_strtotime($courseAccess['login_course_date'], 'UTC'); |
6091 | 6091 | |
6092 | - $endDateInSeconds = $firstAccess + $duration*24*60*60; |
|
6093 | - $leftDays = round(($endDateInSeconds- $currentTime) / 60 / 60 / 24); |
|
6092 | + $endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60; |
|
6093 | + $leftDays = round(($endDateInSeconds - $currentTime) / 60 / 60 / 24); |
|
6094 | 6094 | |
6095 | 6095 | return $leftDays; |
6096 | 6096 | } |
@@ -6382,7 +6382,7 @@ discard block |
||
6382 | 6382 | FROM $table scu |
6383 | 6383 | INNER JOIN $tableUser u |
6384 | 6384 | ON scu.user_id = u.id |
6385 | - WHERE scu.session_id = " . intval($sessionId) ." |
|
6385 | + WHERE scu.session_id = ".intval($sessionId)." |
|
6386 | 6386 | GROUP BY u.id"; |
6387 | 6387 | |
6388 | 6388 | $result = Database::query($sql); |
@@ -6420,7 +6420,7 @@ discard block |
||
6420 | 6420 | $sfTable = Database::get_main_table(TABLE_EXTRA_FIELD); |
6421 | 6421 | $sfvTable = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES); |
6422 | 6422 | // Join session field and session field values tables |
6423 | - $joinTable = $sfTable . ' sf INNER JOIN ' . $sfvTable . ' sfv ON sf.id = sfv.field_id'; |
|
6423 | + $joinTable = $sfTable.' sf INNER JOIN '.$sfvTable.' sfv ON sf.id = sfv.field_id'; |
|
6424 | 6424 | $fieldsArray = array(); |
6425 | 6425 | foreach ($extraFields as $field) { |
6426 | 6426 | $fieldsArray[] = Database::escape_string($field); |
@@ -6463,14 +6463,14 @@ discard block |
||
6463 | 6463 | for ($i = 1; $i < count($fieldsArray); $i++) { |
6464 | 6464 | $whereParams .= ', ?'; |
6465 | 6465 | } |
6466 | - $whereFieldVariables = ' variable IN ( ' . $whereParams .' )'; |
|
6467 | - $whereFieldIds = 'field_id IN ( ' . $whereParams . ' )'; |
|
6466 | + $whereFieldVariables = ' variable IN ( '.$whereParams.' )'; |
|
6467 | + $whereFieldIds = 'field_id IN ( '.$whereParams.' )'; |
|
6468 | 6468 | } |
6469 | 6469 | // Get session fields |
6470 | 6470 | $extraField = new ExtraFieldModel('session'); |
6471 | 6471 | $questionMarks = substr(str_repeat('?, ', count($fieldsArray)), 0, -2); |
6472 | 6472 | $fieldsList = $extraField->get_all(array( |
6473 | - ' variable IN ( ' . $questionMarks . ' )' => $fieldsArray, |
|
6473 | + ' variable IN ( '.$questionMarks.' )' => $fieldsArray, |
|
6474 | 6474 | )); |
6475 | 6475 | // Index session fields |
6476 | 6476 | foreach ($fieldsList as $field) { |
@@ -6479,7 +6479,7 @@ discard block |
||
6479 | 6479 | // Get session field values |
6480 | 6480 | $extra = new ExtraFieldValue('session'); |
6481 | 6481 | $questionMarksFields = substr(str_repeat('?, ', count($fields)), 0, -2); |
6482 | - $sessionFieldValueList = $extra->get_all(array ('where' => array('field_id IN ( ' . $questionMarksFields . ' )' => array_keys($fields)))); |
|
6482 | + $sessionFieldValueList = $extra->get_all(array('where' => array('field_id IN ( '.$questionMarksFields.' )' => array_keys($fields)))); |
|
6483 | 6483 | // Add session fields values to session list |
6484 | 6484 | foreach ($sessionList as $id => &$session) { |
6485 | 6485 | foreach ($sessionFieldValueList as $sessionFieldValue) { |
@@ -6532,7 +6532,7 @@ discard block |
||
6532 | 6532 | // Check the result |
6533 | 6533 | if ($result < 1) { |
6534 | 6534 | // If not found any result, update error message |
6535 | - $errorResult['errorMessage'] = 'Not found any session category name ' . $categoryName; |
|
6535 | + $errorResult['errorMessage'] = 'Not found any session category name '.$categoryName; |
|
6536 | 6536 | } elseif (count($result) > 1 && !$force) { |
6537 | 6537 | // If found more than one result and force is disabled, update error message |
6538 | 6538 | $errorResult['errorMessage'] = 'Found many session categories'; |
@@ -6591,7 +6591,7 @@ discard block |
||
6591 | 6591 | // Check if session list query had result |
6592 | 6592 | if (!empty($sessionList)) { |
6593 | 6593 | // implode all session id |
6594 | - $sessionIdsString = '(' . implode(', ', array_keys($sessionList)) . ')'; |
|
6594 | + $sessionIdsString = '('.implode(', ', array_keys($sessionList)).')'; |
|
6595 | 6595 | // Get all field variables |
6596 | 6596 | $sessionFieldList = Database::select( |
6597 | 6597 | 'id, variable', |
@@ -6678,7 +6678,7 @@ discard block |
||
6678 | 6678 | return $sessionList; |
6679 | 6679 | } else { |
6680 | 6680 | // Not found result, update error message |
6681 | - $errorResult['errorMessage'] = 'Not found any session for session category id ' . $sessionCategoryId; |
|
6681 | + $errorResult['errorMessage'] = 'Not found any session for session category id '.$sessionCategoryId; |
|
6682 | 6682 | } |
6683 | 6683 | } |
6684 | 6684 | |
@@ -6782,7 +6782,7 @@ discard block |
||
6782 | 6782 | |
6783 | 6783 | $sessionExtraField = new ExtraFieldModel('session'); |
6784 | 6784 | $fieldList = $sessionExtraField->get_all(array( |
6785 | - "variable IN ( " . implode(", ", $variablePlaceHolders) . " ) " => $variables, |
|
6785 | + "variable IN ( ".implode(", ", $variablePlaceHolders)." ) " => $variables, |
|
6786 | 6786 | )); |
6787 | 6787 | |
6788 | 6788 | $fields = array(); |
@@ -6796,7 +6796,7 @@ discard block |
||
6796 | 6796 | $extra = new ExtraFieldValue('session'); |
6797 | 6797 | $sessionFieldValueList = $extra->get_all( |
6798 | 6798 | array( |
6799 | - "field_id IN ( " . implode(", ", $variablePlaceHolders) . " )" => array_keys($fields), |
|
6799 | + "field_id IN ( ".implode(", ", $variablePlaceHolders)." )" => array_keys($fields), |
|
6800 | 6800 | ) |
6801 | 6801 | ); |
6802 | 6802 | |
@@ -6868,7 +6868,7 @@ discard block |
||
6868 | 6868 | INNER JOIN $sessionUserTable sru |
6869 | 6869 | ON s.id = sru.id_session |
6870 | 6870 | WHERE |
6871 | - (sru.id_user IN (" . implode(', ', $userIdList) . ") |
|
6871 | + (sru.id_user IN (".implode(', ', $userIdList).") |
|
6872 | 6872 | AND sru.relation_type = 0 |
6873 | 6873 | )"; |
6874 | 6874 | |
@@ -6884,7 +6884,7 @@ discard block |
||
6884 | 6884 | WHERE |
6885 | 6885 | srau.access_url_id = $accessUrlId |
6886 | 6886 | AND ( |
6887 | - sru.id_user IN (" . implode(', ', $userIdList) . ") |
|
6887 | + sru.id_user IN (".implode(', ', $userIdList).") |
|
6888 | 6888 | AND sru.relation_type = 0 |
6889 | 6889 | )"; |
6890 | 6890 | } |
@@ -7106,7 +7106,7 @@ discard block |
||
7106 | 7106 | get_lang('CoachName'), |
7107 | 7107 | $coachInfo ? [$coachInfo['id'] => $coachInfo['complete_name_with_username']] : [], |
7108 | 7108 | [ |
7109 | - 'url' => api_get_path(WEB_AJAX_PATH) . 'session.ajax.php?a=search_general_coach', |
|
7109 | + 'url' => api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=search_general_coach', |
|
7110 | 7110 | 'width' => '100%', |
7111 | 7111 | ] |
7112 | 7112 | ); |
@@ -7117,7 +7117,7 @@ discard block |
||
7117 | 7117 | $form->addHtml('<div id="ajax_list_coachs"></div>'); |
7118 | 7118 | |
7119 | 7119 | $form->addButtonAdvancedSettings('advanced_params'); |
7120 | - $form->addElement('html','<div id="advanced_params_options" style="display:none">'); |
|
7120 | + $form->addElement('html', '<div id="advanced_params_options" style="display:none">'); |
|
7121 | 7121 | |
7122 | 7122 | $form->addSelect( |
7123 | 7123 | 'session_category', |
@@ -7296,16 +7296,16 @@ discard block |
||
7296 | 7296 | if (api_is_session_admin() && |
7297 | 7297 | api_get_setting('allow_session_admins_to_see_all_sessions') == 'false' |
7298 | 7298 | ) { |
7299 | - $where.=" WHERE s.session_admin_id = $user_id "; |
|
7299 | + $where .= " WHERE s.session_admin_id = $user_id "; |
|
7300 | 7300 | } |
7301 | 7301 | |
7302 | 7302 | if (!empty($options['where'])) { |
7303 | 7303 | $options['where'] = str_replace('course_title', 'c.title', $options['where']); |
7304 | - $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']); |
|
7304 | + $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']); |
|
7305 | 7305 | |
7306 | 7306 | $options['where'] = str_replace( |
7307 | 7307 | array("AND session_active = '1' )", " AND ( session_active = '1' )"), |
7308 | - array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " ) |
|
7308 | + array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ") |
|
7309 | 7309 | , $options['where'] |
7310 | 7310 | ); |
7311 | 7311 | |
@@ -7347,10 +7347,10 @@ discard block |
||
7347 | 7347 | $where "; |
7348 | 7348 | |
7349 | 7349 | if (api_is_multiple_url_enabled()) { |
7350 | - $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
7350 | + $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
7351 | 7351 | $access_url_id = api_get_current_access_url_id(); |
7352 | 7352 | if ($access_url_id != -1) { |
7353 | - $where.= " AND ar.access_url_id = $access_url_id "; |
|
7353 | + $where .= " AND ar.access_url_id = $access_url_id "; |
|
7354 | 7354 | |
7355 | 7355 | $query_rows = "SELECT count(*) as total_rows |
7356 | 7356 | FROM $tbl_session s |
@@ -7395,12 +7395,12 @@ discard block |
||
7395 | 7395 | //get_lang('CourseTitle'), |
7396 | 7396 | get_lang('Visibility'), |
7397 | 7397 | ); |
7398 | - $column_model = array ( |
|
7399 | - array('name'=>'name', 'index'=>'s.name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7400 | - array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7401 | - array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)), |
|
7402 | - array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)), |
|
7403 | - array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
7398 | + $column_model = array( |
|
7399 | + array('name'=>'name', 'index'=>'s.name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7400 | + array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7401 | + array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)), |
|
7402 | + array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)), |
|
7403 | + array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
7404 | 7404 | ); |
7405 | 7405 | break; |
7406 | 7406 | case 'complete': |
@@ -7413,12 +7413,12 @@ discard block |
||
7413 | 7413 | get_lang('Visibility'), |
7414 | 7414 | get_lang('CourseTitle'), |
7415 | 7415 | ); |
7416 | - $column_model = array ( |
|
7417 | - array('name'=>'name', 'index'=>'s.name', 'width'=>'200', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7418 | - array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)), |
|
7419 | - array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)), |
|
7420 | - array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'70', 'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)), |
|
7421 | - array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25', 'align'=>'left', 'search' => 'true', 'stype'=>'select', |
|
7416 | + $column_model = array( |
|
7417 | + array('name'=>'name', 'index'=>'s.name', 'width'=>'200', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)), |
|
7418 | + array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)), |
|
7419 | + array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)), |
|
7420 | + array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'70', 'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)), |
|
7421 | + array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25', 'align'=>'left', 'search' => 'true', 'stype'=>'select', |
|
7422 | 7422 | // for the bottom bar |
7423 | 7423 | 'searchoptions' => array( |
7424 | 7424 | 'defaultValue' => '1', |
@@ -7426,8 +7426,8 @@ discard block |
||
7426 | 7426 | // for the top bar |
7427 | 7427 | 'editoptions' => array('value' => '" ":'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive')), |
7428 | 7428 | ), |
7429 | - array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
7430 | - array('name'=>'course_title', 'index'=>'course_title', 'width'=>'50', 'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true','sopt' => $operators)), |
|
7429 | + array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
7430 | + array('name'=>'course_title', 'index'=>'course_title', 'width'=>'50', 'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true', 'sopt' => $operators)), |
|
7431 | 7431 | ); |
7432 | 7432 | break; |
7433 | 7433 | } |
@@ -7436,14 +7436,14 @@ discard block |
||
7436 | 7436 | $session_field = new ExtraFieldModel('session'); |
7437 | 7437 | $rules = $session_field->getRules($columns, $column_model); |
7438 | 7438 | |
7439 | - $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false'); |
|
7439 | + $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false', 'search' => 'false'); |
|
7440 | 7440 | $columns[] = get_lang('Actions'); |
7441 | 7441 | |
7442 | 7442 | foreach ($column_model as $col_model) { |
7443 | 7443 | $simple_column_name[] = $col_model['name']; |
7444 | 7444 | } |
7445 | 7445 | |
7446 | - $return_array = array( |
|
7446 | + $return_array = array( |
|
7447 | 7447 | 'columns' => $columns, |
7448 | 7448 | 'column_model' => $column_model, |
7449 | 7449 | 'rules' => $rules, |
@@ -7532,7 +7532,7 @@ discard block |
||
7532 | 7532 | if (api_is_session_admin() && |
7533 | 7533 | api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false' |
7534 | 7534 | ) { |
7535 | - $where.=" AND s.session_admin_id = $user_id "; |
|
7535 | + $where .= " AND s.session_admin_id = $user_id "; |
|
7536 | 7536 | } |
7537 | 7537 | } |
7538 | 7538 | |
@@ -7614,11 +7614,11 @@ discard block |
||
7614 | 7614 | } |
7615 | 7615 | $options['where'] = str_replace('course_title', 'c.title', $options['where']); |
7616 | 7616 | |
7617 | - $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']); |
|
7617 | + $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']); |
|
7618 | 7618 | |
7619 | 7619 | $options['where'] = str_replace( |
7620 | 7620 | array("AND session_active = '1' )", " AND ( session_active = '1' )"), |
7621 | - array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " ) |
|
7621 | + array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ") |
|
7622 | 7622 | , $options['where'] |
7623 | 7623 | ); |
7624 | 7624 | |
@@ -7653,10 +7653,10 @@ discard block |
||
7653 | 7653 | $where; |
7654 | 7654 | |
7655 | 7655 | if (api_is_multiple_url_enabled()) { |
7656 | - $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
7656 | + $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
7657 | 7657 | $access_url_id = api_get_current_access_url_id(); |
7658 | 7658 | if ($access_url_id != -1) { |
7659 | - $where.= " AND ar.access_url_id = $access_url_id "; |
|
7659 | + $where .= " AND ar.access_url_id = $access_url_id "; |
|
7660 | 7660 | $query = "$select |
7661 | 7661 | FROM $tbl_session s |
7662 | 7662 | LEFT JOIN $tbl_session_field_values fv ON (fv.session_id = s.id) |
@@ -7680,7 +7680,7 @@ discard block |
||
7680 | 7680 | $formatted_sessions = array(); |
7681 | 7681 | |
7682 | 7682 | if (Database::num_rows($result)) { |
7683 | - $sessions = Database::store_result($result, 'ASSOC'); |
|
7683 | + $sessions = Database::store_result($result, 'ASSOC'); |
|
7684 | 7684 | foreach ($sessions as $session) { |
7685 | 7685 | $session_id = $session['id']; |
7686 | 7686 | $session['name'] = Display::url($session['name'], "resume_session.php?id_session=".$session['id']); |
@@ -7695,14 +7695,14 @@ discard block |
||
7695 | 7695 | |
7696 | 7696 | switch ($session['visibility']) { |
7697 | 7697 | case SESSION_VISIBLE_READ_ONLY: //1 |
7698 | - $session['visibility'] = get_lang('ReadOnly'); |
|
7698 | + $session['visibility'] = get_lang('ReadOnly'); |
|
7699 | 7699 | break; |
7700 | 7700 | case SESSION_VISIBLE: //2 |
7701 | 7701 | case SESSION_AVAILABLE: //4 |
7702 | - $session['visibility'] = get_lang('Visible'); |
|
7702 | + $session['visibility'] = get_lang('Visible'); |
|
7703 | 7703 | break; |
7704 | 7704 | case SESSION_INVISIBLE: //3 |
7705 | - $session['visibility'] = api_ucfirst(get_lang('Invisible')); |
|
7705 | + $session['visibility'] = api_ucfirst(get_lang('Invisible')); |
|
7706 | 7706 | break; |
7707 | 7707 | } |
7708 | 7708 | |
@@ -7778,7 +7778,7 @@ discard block |
||
7778 | 7778 | if (empty($session)) { |
7779 | 7779 | return false; |
7780 | 7780 | } |
7781 | - return api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . $id; |
|
7781 | + return api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$id; |
|
7782 | 7782 | } |
7783 | 7783 | |
7784 | 7784 | /** |
@@ -7796,7 +7796,7 @@ discard block |
||
7796 | 7796 | return false; |
7797 | 7797 | } |
7798 | 7798 | if (empty($courseId)) { |
7799 | - return api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . $id; |
|
7799 | + return api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$id; |
|
7800 | 7800 | } else { |
7801 | 7801 | $courseInfo = api_get_course_info_by_id($courseId); |
7802 | 7802 | if ($courseInfo) { |
@@ -8007,7 +8007,7 @@ discard block |
||
8007 | 8007 | // sort $listCat by catSessionName |
8008 | 8008 | usort($listCat, 'self::compareBySessionName'); |
8009 | 8009 | // in each catSession sort sessionList by sessionName |
8010 | - foreach($listCat as $i => $listCatSessionInfo) { |
|
8010 | + foreach ($listCat as $i => $listCatSessionInfo) { |
|
8011 | 8011 | $listSessionList = $listCatSessionInfo['sessionList']; |
8012 | 8012 | usort($listSessionList, 'self::compareCatSessionInfo'); |
8013 | 8013 | $listCat[$i]['sessionList'] = $listSessionList; |
@@ -8022,8 +8022,8 @@ discard block |
||
8022 | 8022 | ); |
8023 | 8023 | |
8024 | 8024 | $userCatId = intval($userCatId); |
8025 | - $listResults[$userCatId]['courseInUserCategoryId'] = $userCatId; |
|
8026 | - $listResults[$userCatId]['courseInUserCategoryTitle'] = $userCatTitle; |
|
8025 | + $listResults[$userCatId]['courseInUserCategoryId'] = $userCatId; |
|
8026 | + $listResults[$userCatId]['courseInUserCategoryTitle'] = $userCatTitle; |
|
8027 | 8027 | $listResults[$userCatId]['courseInUserCatList'][] = $listOneCourse; |
8028 | 8028 | } |
8029 | 8029 | |
@@ -8049,7 +8049,7 @@ discard block |
||
8049 | 8049 | { |
8050 | 8050 | if ($listA['sessionName'] == $listB['sessionName']) { |
8051 | 8051 | return 0; |
8052 | - } else if($listA['sessionName'] > $listB['sessionName']) { |
|
8052 | + } else if ($listA['sessionName'] > $listB['sessionName']) { |
|
8053 | 8053 | return 1; |
8054 | 8054 | } else { |
8055 | 8055 | return -1; |
@@ -8069,7 +8069,7 @@ discard block |
||
8069 | 8069 | return 1; |
8070 | 8070 | } else if ($listA['catSessionName'] == $listB['catSessionName']) { |
8071 | 8071 | return 0; |
8072 | - } else if($listA['catSessionName'] > $listB['catSessionName']) { |
|
8072 | + } else if ($listA['catSessionName'] > $listB['catSessionName']) { |
|
8073 | 8073 | return 1; |
8074 | 8074 | } else { |
8075 | 8075 | return -1; |
@@ -8085,7 +8085,7 @@ discard block |
||
8085 | 8085 | { |
8086 | 8086 | if ($listA['courseInUserCategoryTitle'] == $listB['courseInUserCategoryTitle']) { |
8087 | 8087 | return 0; |
8088 | - } else if($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) { |
|
8088 | + } else if ($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) { |
|
8089 | 8089 | return 1; |
8090 | 8090 | } else { |
8091 | 8091 | return -1; |
@@ -8101,7 +8101,7 @@ discard block |
||
8101 | 8101 | { |
8102 | 8102 | if ($listA['title'] == $listB['title']) { |
8103 | 8103 | return 0; |
8104 | - } else if($listA['title'] > $listB['title']) { |
|
8104 | + } else if ($listA['title'] > $listB['title']) { |
|
8105 | 8105 | return 1; |
8106 | 8106 | } else { |
8107 | 8107 | return -1; |
@@ -8146,8 +8146,8 @@ discard block |
||
8146 | 8146 | |
8147 | 8147 | $marginShift = 20; |
8148 | 8148 | if ($catSessionName != '') { |
8149 | - $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">' . |
|
8150 | - CourseManager::course_item_html($listParamsCatSession, true) . '</div>'; |
|
8149 | + $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">'. |
|
8150 | + CourseManager::course_item_html($listParamsCatSession, true).'</div>'; |
|
8151 | 8151 | $marginShift = 40; |
8152 | 8152 | } |
8153 | 8153 | |
@@ -8212,12 +8212,12 @@ discard block |
||
8212 | 8212 | $userId = api_get_user_id(); |
8213 | 8213 | $response = self::isUserSubscribedAsStudent($sessionId, $userId); |
8214 | 8214 | if ($response) { |
8215 | - $urlToRedirect = api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . $sessionId; |
|
8215 | + $urlToRedirect = api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$sessionId; |
|
8216 | 8216 | if (!empty($onlyOneCourseSessionToRedirect)) { |
8217 | - $urlToRedirect = api_get_path(WEB_PATH) . 'courses/' . $onlyOneCourseSessionToRedirect . '/index.php?id_session=' . $sessionId; |
|
8217 | + $urlToRedirect = api_get_path(WEB_PATH).'courses/'.$onlyOneCourseSessionToRedirect.'/index.php?id_session='.$sessionId; |
|
8218 | 8218 | } |
8219 | 8219 | |
8220 | - header('Location: ' . $urlToRedirect); |
|
8220 | + header('Location: '.$urlToRedirect); |
|
8221 | 8221 | exit; |
8222 | 8222 | } |
8223 | 8223 | } |