@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | $template = api_get_setting('course_creation_use_template'); |
129 | 129 | if (!empty($template)) { |
130 | 130 | // Include the necessary libraries to generate a course copy |
131 | - require_once api_get_path(SYS_CODE_PATH) . 'coursecopy/classes/CourseBuilder.class.php'; |
|
132 | - require_once api_get_path(SYS_CODE_PATH) . 'coursecopy/classes/CourseRestorer.class.php'; |
|
133 | - require_once api_get_path(SYS_CODE_PATH) . 'coursecopy/classes/CourseSelectForm.class.php'; |
|
131 | + require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/CourseBuilder.class.php'; |
|
132 | + require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/CourseRestorer.class.php'; |
|
133 | + require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/CourseSelectForm.class.php'; |
|
134 | 134 | // Call the course copy object |
135 | 135 | $originCourse = api_get_course_info_by_id($template); |
136 | 136 | $originCourse['official_code'] = $originCourse['code']; |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | { |
167 | 167 | return Database::fetch_array( |
168 | 168 | Database::query( |
169 | - "SELECT *, id as real_id FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " |
|
170 | - WHERE code='" . Database::escape_string($course_code) . "'"), 'ASSOC' |
|
169 | + "SELECT *, id as real_id FROM ".Database::get_main_table(TABLE_MAIN_COURSE)." |
|
170 | + WHERE code='" . Database::escape_string($course_code)."'"), 'ASSOC' |
|
171 | 171 | ); |
172 | 172 | } |
173 | 173 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $alsoSearchCode = false, |
196 | 196 | $conditionsLike = array() |
197 | 197 | ) { |
198 | - $sql = "SELECT course.* FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " course "; |
|
198 | + $sql = "SELECT course.* FROM ".Database::get_main_table(TABLE_MAIN_COURSE)." course "; |
|
199 | 199 | |
200 | 200 | if (!empty($urlId)) { |
201 | 201 | $table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | if (!empty($startwith)) { |
206 | - $sql .= "WHERE (title LIKE '" . Database::escape_string($startwith) . "%' "; |
|
206 | + $sql .= "WHERE (title LIKE '".Database::escape_string($startwith)."%' "; |
|
207 | 207 | if ($alsoSearchCode) { |
208 | - $sql .= "OR code LIKE '" . Database::escape_string($startwith) . "%' "; |
|
208 | + $sql .= "OR code LIKE '".Database::escape_string($startwith)."%' "; |
|
209 | 209 | } |
210 | 210 | $sql .= ') '; |
211 | 211 | if ($visibility !== -1 && $visibility == strval(intval($visibility))) { |
@@ -239,19 +239,19 @@ discard block |
||
239 | 239 | $value = Database::escape_string($value); |
240 | 240 | $simple_like = false; |
241 | 241 | if ($simple_like) { |
242 | - $temp_conditions[] = $field . " LIKE '$value%'"; |
|
242 | + $temp_conditions[] = $field." LIKE '$value%'"; |
|
243 | 243 | } else { |
244 | - $temp_conditions[] = $field . ' LIKE \'%' . $value . '%\''; |
|
244 | + $temp_conditions[] = $field.' LIKE \'%'.$value.'%\''; |
|
245 | 245 | } |
246 | 246 | } |
247 | 247 | $condition = ' AND '; |
248 | 248 | if (!empty($temp_conditions)) { |
249 | - $sql .= implode(' ' . $condition . ' ', $temp_conditions); |
|
249 | + $sql .= implode(' '.$condition.' ', $temp_conditions); |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
253 | 253 | if (!empty($orderby)) { |
254 | - $sql .= " ORDER BY " . Database::escape_string($orderby) . " "; |
|
254 | + $sql .= " ORDER BY ".Database::escape_string($orderby)." "; |
|
255 | 255 | } else { |
256 | 256 | $sql .= " ORDER BY 1 "; |
257 | 257 | } |
@@ -263,13 +263,13 @@ discard block |
||
263 | 263 | } |
264 | 264 | |
265 | 265 | if (!empty($howmany) && is_int($howmany) and $howmany > 0) { |
266 | - $sql .= ' LIMIT ' . Database::escape_string($howmany); |
|
266 | + $sql .= ' LIMIT '.Database::escape_string($howmany); |
|
267 | 267 | } else { |
268 | 268 | $sql .= ' LIMIT 1000000'; //virtually no limit |
269 | 269 | } |
270 | 270 | if (!empty($from)) { |
271 | 271 | $from = intval($from); |
272 | - $sql .= ' OFFSET ' . intval($from); |
|
272 | + $sql .= ' OFFSET '.intval($from); |
|
273 | 273 | } else { |
274 | 274 | $sql .= ' OFFSET 0'; |
275 | 275 | } |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | return Database::fetch_array( |
294 | 294 | Database::query( |
295 | 295 | "SELECT visibility, subscribe, unsubscribe |
296 | - FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " |
|
297 | - WHERE code = '" . Database::escape_string($course_code) . "'" |
|
296 | + FROM " . Database::get_main_table(TABLE_MAIN_COURSE)." |
|
297 | + WHERE code = '" . Database::escape_string($course_code)."'" |
|
298 | 298 | ) |
299 | 299 | ); |
300 | 300 | } |
@@ -315,10 +315,10 @@ discard block |
||
315 | 315 | } |
316 | 316 | $result = Database::fetch_array( |
317 | 317 | Database::query( |
318 | - "SELECT status FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " |
|
318 | + "SELECT status FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)." |
|
319 | 319 | WHERE |
320 | 320 | c_id = $courseId AND |
321 | - user_id = " . intval($user_id) |
|
321 | + user_id = ".intval($user_id) |
|
322 | 322 | ) |
323 | 323 | ); |
324 | 324 | |
@@ -336,9 +336,9 @@ discard block |
||
336 | 336 | |
337 | 337 | $result = Database::fetch_array( |
338 | 338 | Database::query(" |
339 | - SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " |
|
339 | + SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER)." |
|
340 | 340 | WHERE |
341 | - c_id = '" . intval($courseId). "' AND |
|
341 | + c_id = '" . intval($courseId)."' AND |
|
342 | 342 | user_id = " . intval($userId) |
343 | 343 | ) |
344 | 344 | ); |
@@ -385,9 +385,9 @@ discard block |
||
385 | 385 | $result = Database::fetch_array( |
386 | 386 | Database::query(" |
387 | 387 | SELECT is_tutor |
388 | - FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " |
|
388 | + FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER)." |
|
389 | 389 | WHERE |
390 | - course_code = '" . Database::escape_string($course_code) . "' AND |
|
390 | + course_code = '" . Database::escape_string($course_code)."' AND |
|
391 | 391 | user_id = " . intval($user_id) |
392 | 392 | ) |
393 | 393 | ); |
@@ -440,17 +440,17 @@ discard block |
||
440 | 440 | $course_id = $course_info['real_id']; |
441 | 441 | |
442 | 442 | // Unsubscribe user from all groups in the course. |
443 | - $sql = "DELETE FROM " . Database::get_course_table(TABLE_GROUP_USER) . " |
|
444 | - WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")"; |
|
443 | + $sql = "DELETE FROM ".Database::get_course_table(TABLE_GROUP_USER)." |
|
444 | + WHERE c_id = $course_id AND user_id IN (".$user_ids.")"; |
|
445 | 445 | Database::query($sql); |
446 | - $sql = "DELETE FROM " . Database::get_course_table(TABLE_GROUP_TUTOR) . " |
|
447 | - WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")"; |
|
446 | + $sql = "DELETE FROM ".Database::get_course_table(TABLE_GROUP_TUTOR)." |
|
447 | + WHERE c_id = $course_id AND user_id IN (".$user_ids.")"; |
|
448 | 448 | Database::query($sql); |
449 | 449 | |
450 | 450 | // Erase user student publications (works) in the course - by André Boivin |
451 | 451 | |
452 | 452 | if (!empty($user_list)) { |
453 | - require_once api_get_path(SYS_CODE_PATH) . 'work/work.lib.php'; |
|
453 | + require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php'; |
|
454 | 454 | foreach ($user_list as $userId) { |
455 | 455 | // Getting all work from user |
456 | 456 | $workList = getWorkPerUser($userId); |
@@ -469,74 +469,74 @@ discard block |
||
469 | 469 | } |
470 | 470 | |
471 | 471 | // Unsubscribe user from all blogs in the course. |
472 | - Database::query("DELETE FROM " . Database::get_course_table(TABLE_BLOGS_REL_USER) . " WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")"); |
|
473 | - Database::query("DELETE FROM " . Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER) . " WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")"); |
|
472 | + Database::query("DELETE FROM ".Database::get_course_table(TABLE_BLOGS_REL_USER)." WHERE c_id = $course_id AND user_id IN (".$user_ids.")"); |
|
473 | + Database::query("DELETE FROM ".Database::get_course_table(TABLE_BLOGS_TASKS_REL_USER)." WHERE c_id = $course_id AND user_id IN (".$user_ids.")"); |
|
474 | 474 | |
475 | 475 | // Deleting users in forum_notification and mailqueue course tables |
476 | - $sql = "DELETE FROM " . Database::get_course_table(TABLE_FORUM_NOTIFICATION) . " |
|
477 | - WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")"; |
|
476 | + $sql = "DELETE FROM ".Database::get_course_table(TABLE_FORUM_NOTIFICATION)." |
|
477 | + WHERE c_id = $course_id AND user_id IN (".$user_ids.")"; |
|
478 | 478 | Database::query($sql); |
479 | 479 | |
480 | - $sql = "DELETE FROM " . Database::get_course_table(TABLE_FORUM_MAIL_QUEUE) . " |
|
481 | - WHERE c_id = $course_id AND user_id IN (" . $user_ids . ")"; |
|
480 | + $sql = "DELETE FROM ".Database::get_course_table(TABLE_FORUM_MAIL_QUEUE)." |
|
481 | + WHERE c_id = $course_id AND user_id IN (".$user_ids.")"; |
|
482 | 482 | Database::query($sql); |
483 | 483 | |
484 | 484 | // Unsubscribe user from the course. |
485 | 485 | if (!empty($session_id)) { |
486 | 486 | |
487 | 487 | // Delete in table session_rel_course_rel_user |
488 | - $sql = "DELETE FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " |
|
488 | + $sql = "DELETE FROM ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." |
|
489 | 489 | WHERE |
490 | - session_id ='" . $session_id . "' AND |
|
491 | - c_id = '" . $course_id . "' AND |
|
490 | + session_id ='" . $session_id."' AND |
|
491 | + c_id = '" . $course_id."' AND |
|
492 | 492 | user_id IN ($user_ids)"; |
493 | 493 | Database::query($sql); |
494 | 494 | |
495 | 495 | foreach ($user_list as $uid) { |
496 | 496 | // check if a user is register in the session with other course |
497 | - $sql = "SELECT user_id FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " |
|
497 | + $sql = "SELECT user_id FROM ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." |
|
498 | 498 | WHERE session_id='$session_id' AND user_id='$uid'"; |
499 | 499 | $rs = Database::query($sql); |
500 | 500 | |
501 | 501 | if (Database::num_rows($rs) == 0) { |
502 | 502 | // Delete in table session_rel_user |
503 | - $sql = "DELETE FROM " . Database::get_main_table(TABLE_MAIN_SESSION_USER) . " |
|
503 | + $sql = "DELETE FROM ".Database::get_main_table(TABLE_MAIN_SESSION_USER)." |
|
504 | 504 | WHERE |
505 | - session_id ='" . $session_id . "' AND |
|
505 | + session_id ='" . $session_id."' AND |
|
506 | 506 | user_id = '$uid' AND |
507 | - relation_type<>" . SESSION_RELATION_TYPE_RRHH . ""; |
|
507 | + relation_type<>".SESSION_RELATION_TYPE_RRHH.""; |
|
508 | 508 | Database::query($sql); |
509 | 509 | } |
510 | 510 | } |
511 | 511 | |
512 | 512 | // Update the table session |
513 | - $sql = "SELECT COUNT(*) FROM " . Database::get_main_table(TABLE_MAIN_SESSION_USER) . " |
|
514 | - WHERE session_id = '" . $session_id . "' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH; |
|
513 | + $sql = "SELECT COUNT(*) FROM ".Database::get_main_table(TABLE_MAIN_SESSION_USER)." |
|
514 | + WHERE session_id = '" . $session_id."' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH; |
|
515 | 515 | $row = Database::fetch_array(Database::query($sql)); |
516 | 516 | $count = $row[0]; |
517 | 517 | // number of users by session |
518 | - $sql = "UPDATE " . Database::get_main_table(TABLE_MAIN_SESSION) . " SET nbr_users = '$count' |
|
519 | - WHERE id = '" . $session_id . "'"; |
|
518 | + $sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_SESSION)." SET nbr_users = '$count' |
|
519 | + WHERE id = '".$session_id."'"; |
|
520 | 520 | Database::query($sql); |
521 | 521 | |
522 | 522 | // Update the table session_rel_course |
523 | - $sql = "SELECT COUNT(*) FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " |
|
523 | + $sql = "SELECT COUNT(*) FROM ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." |
|
524 | 524 | WHERE session_id = '$session_id' AND c_id = '$course_id' AND status<>2"; |
525 | 525 | $row = Database::fetch_array(@Database::query($sql)); |
526 | 526 | $count = $row[0]; |
527 | 527 | |
528 | 528 | // number of users by session and course |
529 | - $sql = "UPDATE " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE) . " |
|
529 | + $sql = "UPDATE ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE)." |
|
530 | 530 | SET nbr_users = '$count' |
531 | 531 | WHERE session_id = '$session_id' AND c_id = '$course_id'"; |
532 | 532 | Database::query($sql); |
533 | 533 | |
534 | 534 | } else { |
535 | - $sql = "DELETE FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " |
|
535 | + $sql = "DELETE FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)." |
|
536 | 536 | WHERE |
537 | - user_id IN (" . $user_ids . ") AND |
|
538 | - relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND |
|
539 | - c_id = '" . $course_id . "'"; |
|
537 | + user_id IN (" . $user_ids.") AND |
|
538 | + relation_type<>" . COURSE_RELATION_TYPE_RRHH." AND |
|
539 | + c_id = '" . $course_id."'"; |
|
540 | 540 | Database::query($sql); |
541 | 541 | |
542 | 542 | // add event to system log |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | |
607 | 607 | // A preliminary check whether the user has bben already registered on the platform. |
608 | 608 | if (Database::num_rows(Database::query( |
609 | - "SELECT status FROM " . Database::get_main_table(TABLE_MAIN_USER) . " |
|
609 | + "SELECT status FROM ".Database::get_main_table(TABLE_MAIN_USER)." |
|
610 | 610 | WHERE user_id = '$user_id' ")) == 0 |
611 | 611 | ) { |
612 | 612 | return false; // The user has not been registered to the platform. |
@@ -616,8 +616,8 @@ discard block |
||
616 | 616 | |
617 | 617 | if (empty($session_id)) { |
618 | 618 | if (Database::num_rows(Database::query(" |
619 | - SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " |
|
620 | - WHERE user_id = '$user_id' AND relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND c_id = '$courseId'")) > 0 |
|
619 | + SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER)." |
|
620 | + WHERE user_id = '$user_id' AND relation_type<>".COURSE_RELATION_TYPE_RRHH." AND c_id = '$courseId'")) > 0 |
|
621 | 621 | ) { |
622 | 622 | // The user has been already subscribed to the course. |
623 | 623 | return false; |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | $courseId = $courseInfo['real_id']; |
740 | 740 | |
741 | 741 | // Check in advance whether the user has already been registered on the platform. |
742 | - $sql = "SELECT status FROM " . $user_table . " WHERE user_id = $user_id "; |
|
742 | + $sql = "SELECT status FROM ".$user_table." WHERE user_id = $user_id "; |
|
743 | 743 | if (Database::num_rows(Database::query($sql)) == 0) { |
744 | 744 | if ($debug) { |
745 | 745 | error_log('The user has not been registered to the platform'); |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | $sql = "SELECT * FROM $course_user_table |
752 | 752 | WHERE |
753 | 753 | user_id = $user_id AND |
754 | - relation_type <> " . COURSE_RELATION_TYPE_RRHH . " AND |
|
754 | + relation_type <> ".COURSE_RELATION_TYPE_RRHH." AND |
|
755 | 755 | c_id = $courseId"; |
756 | 756 | if (Database::num_rows(Database::query($sql)) > 0) { |
757 | 757 | if ($debug) { |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | if (!api_is_course_admin()) { |
764 | 764 | // Check in advance whether subscription is allowed or not for this course. |
765 | 765 | $sql = "SELECT code, visibility FROM $course_table |
766 | - WHERE id = $courseId AND subscribe = '" . SUBSCRIBE_NOT_ALLOWED . "'"; |
|
766 | + WHERE id = $courseId AND subscribe = '".SUBSCRIBE_NOT_ALLOWED."'"; |
|
767 | 767 | if (Database::num_rows(Database::query($sql)) > 0) { |
768 | 768 | if ($debug) { |
769 | 769 | error_log('Subscription is not allowed for this course'); |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | { |
823 | 823 | $wanted_course_code = Database::escape_string($wanted_course_code); |
824 | 824 | $sql = "SELECT COUNT(*) as number |
825 | - FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " |
|
825 | + FROM " . Database::get_main_table(TABLE_MAIN_COURSE)." |
|
826 | 826 | WHERE code = '$wanted_course_code' OR visual_code = '$wanted_course_code'"; |
827 | 827 | $result = Database::fetch_array(Database::query($sql)); |
828 | 828 | |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | $sql = "SELECT * FROM $table |
1009 | 1009 | WHERE |
1010 | 1010 | user_id = $userId AND |
1011 | - relation_type = " . COURSE_RELATION_TYPE_RRHH . " AND |
|
1011 | + relation_type = ".COURSE_RELATION_TYPE_RRHH." AND |
|
1012 | 1012 | c_id = $courseId"; |
1013 | 1013 | |
1014 | 1014 | $result = Database::fetch_array(Database::query($sql)); |
@@ -1047,13 +1047,13 @@ discard block |
||
1047 | 1047 | return false; |
1048 | 1048 | } |
1049 | 1049 | $courseId = $courseInfo['real_id']; |
1050 | - $condition_course = ' AND c_id = ' . $courseId; |
|
1050 | + $condition_course = ' AND c_id = '.$courseId; |
|
1051 | 1051 | } |
1052 | 1052 | |
1053 | - $sql = "SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " |
|
1053 | + $sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)." |
|
1054 | 1054 | WHERE |
1055 | 1055 | user_id = $user_id AND |
1056 | - relation_type<>" . COURSE_RELATION_TYPE_RRHH . " |
|
1056 | + relation_type<>".COURSE_RELATION_TYPE_RRHH." |
|
1057 | 1057 | $condition_course "; |
1058 | 1058 | |
1059 | 1059 | $result = Database::fetch_array(Database::query($sql)); |
@@ -1069,20 +1069,20 @@ discard block |
||
1069 | 1069 | } |
1070 | 1070 | |
1071 | 1071 | $tableSessionCourseUser = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
1072 | - $sql = 'SELECT 1 FROM ' . $tableSessionCourseUser . |
|
1073 | - ' WHERE user_id = ' . $user_id . ' ' . $condition_course; |
|
1072 | + $sql = 'SELECT 1 FROM '.$tableSessionCourseUser. |
|
1073 | + ' WHERE user_id = '.$user_id.' '.$condition_course; |
|
1074 | 1074 | if (Database::num_rows(Database::query($sql)) > 0) { |
1075 | 1075 | return true; |
1076 | 1076 | } |
1077 | 1077 | |
1078 | - $sql = 'SELECT 1 FROM ' . $tableSessionCourseUser . |
|
1079 | - ' WHERE user_id = ' . $user_id . ' AND status=2 ' . $condition_course; |
|
1078 | + $sql = 'SELECT 1 FROM '.$tableSessionCourseUser. |
|
1079 | + ' WHERE user_id = '.$user_id.' AND status=2 '.$condition_course; |
|
1080 | 1080 | if (Database::num_rows(Database::query($sql)) > 0) { |
1081 | 1081 | return true; |
1082 | 1082 | } |
1083 | 1083 | |
1084 | - $sql = 'SELECT 1 FROM ' . Database::get_main_table(TABLE_MAIN_SESSION) . |
|
1085 | - ' WHERE id = ' . $session_id . ' AND id_coach=' . $user_id; |
|
1084 | + $sql = 'SELECT 1 FROM '.Database::get_main_table(TABLE_MAIN_SESSION). |
|
1085 | + ' WHERE id = '.$session_id.' AND id_coach='.$user_id; |
|
1086 | 1086 | |
1087 | 1087 | if (Database::num_rows(Database::query($sql)) > 0) { |
1088 | 1088 | return true; |
@@ -1109,8 +1109,8 @@ discard block |
||
1109 | 1109 | $courseId = $courseInfo['real_id']; |
1110 | 1110 | |
1111 | 1111 | $result = Database::query( |
1112 | - 'SELECT status FROM ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) . |
|
1113 | - ' WHERE c_id = ' . $courseId . ' AND user_id = ' . $user_id . '' |
|
1112 | + 'SELECT status FROM '.Database::get_main_table(TABLE_MAIN_COURSE_USER). |
|
1113 | + ' WHERE c_id = '.$courseId.' AND user_id = '.$user_id.'' |
|
1114 | 1114 | ); |
1115 | 1115 | |
1116 | 1116 | if (Database::num_rows($result) > 0) { |
@@ -1140,12 +1140,12 @@ discard block |
||
1140 | 1140 | $result = Database::fetch_array( |
1141 | 1141 | Database::query( |
1142 | 1142 | "SELECT * |
1143 | - FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " course |
|
1144 | - LEFT JOIN " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " course_user |
|
1143 | + FROM " . Database::get_main_table(TABLE_MAIN_COURSE)." course |
|
1144 | + LEFT JOIN " . Database::get_main_table(TABLE_MAIN_COURSE_USER)." course_user |
|
1145 | 1145 | ON course.id = course_user.c_id |
1146 | 1146 | WHERE |
1147 | 1147 | course_user.user_id = '$user_id' AND |
1148 | - course_user.relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND |
|
1148 | + course_user.relation_type<>".COURSE_RELATION_TYPE_RRHH." AND |
|
1149 | 1149 | ( course.id = '$courseId')" |
1150 | 1150 | ) |
1151 | 1151 | ); |
@@ -1159,8 +1159,8 @@ discard block |
||
1159 | 1159 | |
1160 | 1160 | // A user? |
1161 | 1161 | if (Database::num_rows(Database::query("SELECT user_id |
1162 | - FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " |
|
1163 | - WHERE session_id='" . $session_id . "' |
|
1162 | + FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." |
|
1163 | + WHERE session_id='" . $session_id."' |
|
1164 | 1164 | AND user_id ='$user_id'")) |
1165 | 1165 | ) { |
1166 | 1166 | return true; |
@@ -1168,8 +1168,8 @@ discard block |
||
1168 | 1168 | |
1169 | 1169 | // A course coach? |
1170 | 1170 | if (Database::num_rows(Database::query("SELECT user_id |
1171 | - FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " |
|
1172 | - WHERE session_id='" . $session_id . "' |
|
1171 | + FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." |
|
1172 | + WHERE session_id='" . $session_id."' |
|
1173 | 1173 | AND user_id = '$user_id' AND status = 2 |
1174 | 1174 | AND c_id ='$courseId'")) |
1175 | 1175 | ) { |
@@ -1178,8 +1178,8 @@ discard block |
||
1178 | 1178 | |
1179 | 1179 | // A session coach? |
1180 | 1180 | if (Database::num_rows(Database::query("SELECT id_coach |
1181 | - FROM " . Database::get_main_table(TABLE_MAIN_SESSION) . " AS session |
|
1182 | - WHERE session.id='" . $session_id . "' |
|
1181 | + FROM " . Database::get_main_table(TABLE_MAIN_SESSION)." AS session |
|
1182 | + WHERE session.id='" . $session_id."' |
|
1183 | 1183 | AND id_coach='$user_id'")) |
1184 | 1184 | ) { |
1185 | 1185 | return true; |
@@ -1247,7 +1247,7 @@ discard block |
||
1247 | 1247 | // we have to check if it is a valid field that can be sorted on |
1248 | 1248 | if (!strstr($order_by, 'ORDER BY')) { |
1249 | 1249 | if (!empty($order_by)) { |
1250 | - $order_by = 'ORDER BY ' . $order_by; |
|
1250 | + $order_by = 'ORDER BY '.$order_by; |
|
1251 | 1251 | } else { |
1252 | 1252 | $order_by = ''; |
1253 | 1253 | } |
@@ -1279,11 +1279,11 @@ discard block |
||
1279 | 1279 | if (!empty($courseCodeList)) { |
1280 | 1280 | $courseCodeListForSession = array_map(array('Database', 'escape_string'), $courseCodeList); |
1281 | 1281 | $courseCodeListForSession = implode('","', $courseCodeListForSession); |
1282 | - $courseCondition = ' course.code IN ("' . $courseCodeListForSession . '") '; |
|
1282 | + $courseCondition = ' course.code IN ("'.$courseCodeListForSession.'") '; |
|
1283 | 1283 | } |
1284 | 1284 | |
1285 | - $sql .= ' FROM ' . Database::get_main_table(TABLE_MAIN_USER) . ' as user '; |
|
1286 | - $sql .= " LEFT JOIN ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " as session_course_user |
|
1285 | + $sql .= ' FROM '.Database::get_main_table(TABLE_MAIN_USER).' as user '; |
|
1286 | + $sql .= " LEFT JOIN ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." as session_course_user |
|
1287 | 1287 | ON |
1288 | 1288 | user.user_id = session_course_user.user_id AND |
1289 | 1289 | $sessionCondition |
@@ -1325,14 +1325,14 @@ discard block |
||
1325 | 1325 | } |
1326 | 1326 | } |
1327 | 1327 | |
1328 | - $sql .= ' FROM ' . Database::get_main_table(TABLE_MAIN_USER) . ' as user '; |
|
1329 | - $sql .= ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) . ' as course_rel_user |
|
1328 | + $sql .= ' FROM '.Database::get_main_table(TABLE_MAIN_USER).' as user '; |
|
1329 | + $sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_COURSE_USER).' as course_rel_user |
|
1330 | 1330 | ON user.user_id = course_rel_user.user_id AND |
1331 | - course_rel_user.relation_type <> ' . COURSE_RELATION_TYPE_RRHH . ' '; |
|
1331 | + course_rel_user.relation_type <> ' . COURSE_RELATION_TYPE_RRHH.' '; |
|
1332 | 1332 | $sql .= " INNER JOIN $course_table course ON course_rel_user.c_id = course.id "; |
1333 | 1333 | |
1334 | 1334 | if (!empty($course_code)) { |
1335 | - $sql .= ' AND course_rel_user.c_id="' . $courseId . '"'; |
|
1335 | + $sql .= ' AND course_rel_user.c_id="'.$courseId.'"'; |
|
1336 | 1336 | } |
1337 | 1337 | $where[] = ' course_rel_user.c_id IS NOT NULL '; |
1338 | 1338 | |
@@ -1344,7 +1344,7 @@ discard block |
||
1344 | 1344 | |
1345 | 1345 | $multiple_access_url = api_get_multiple_access_url(); |
1346 | 1346 | if ($multiple_access_url) { |
1347 | - $sql .= ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER) . ' au |
|
1347 | + $sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER).' au |
|
1348 | 1348 | ON (au.user_id = user.user_id) '; |
1349 | 1349 | } |
1350 | 1350 | |
@@ -1364,7 +1364,7 @@ discard block |
||
1364 | 1364 | } |
1365 | 1365 | } |
1366 | 1366 | |
1367 | - $sql .= ' WHERE ' . $filter_by_status_condition . ' ' . implode(' OR ', $where); |
|
1367 | + $sql .= ' WHERE '.$filter_by_status_condition.' '.implode(' OR ', $where); |
|
1368 | 1368 | |
1369 | 1369 | if ($multiple_access_url) { |
1370 | 1370 | $current_access_url_id = api_get_current_access_url_id(); |
@@ -1386,15 +1386,15 @@ discard block |
||
1386 | 1386 | if (!empty($userIdList)) { |
1387 | 1387 | $userIdList = array_map('intval', $userIdList); |
1388 | 1388 | $userIdList = implode('","', $userIdList); |
1389 | - $sql .= ' AND user.user_id IN ("' . $userIdList . '")'; |
|
1389 | + $sql .= ' AND user.user_id IN ("'.$userIdList.'")'; |
|
1390 | 1390 | } |
1391 | 1391 | |
1392 | 1392 | if (isset($filterByActive)) { |
1393 | 1393 | $filterByActive = intval($filterByActive); |
1394 | - $sql .= ' AND user.active = ' . $filterByActive; |
|
1394 | + $sql .= ' AND user.active = '.$filterByActive; |
|
1395 | 1395 | } |
1396 | 1396 | |
1397 | - $sql .= ' ' . $order_by . ' ' . $limit; |
|
1397 | + $sql .= ' '.$order_by.' '.$limit; |
|
1398 | 1398 | |
1399 | 1399 | $rs = Database::query($sql); |
1400 | 1400 | $users = array(); |
@@ -1551,7 +1551,7 @@ discard block |
||
1551 | 1551 | ) |
1552 | 1552 | ); |
1553 | 1553 | $report_info['progress_100'] = $progress == 100 ? Display::label(get_lang('Yes'), 'success') : Display::label(get_lang('No')); |
1554 | - $report_info['progress'] = $progress . "%"; |
|
1554 | + $report_info['progress'] = $progress."%"; |
|
1555 | 1555 | |
1556 | 1556 | foreach ($extra_fields as $extra) { |
1557 | 1557 | $user_data = UserManager::get_extra_user_data_by_field($user['user_id'], $extra['1']); |
@@ -1620,32 +1620,32 @@ discard block |
||
1620 | 1620 | $courseInfo = api_get_course_info($course_code); |
1621 | 1621 | $courseId = $courseInfo['real_id']; |
1622 | 1622 | |
1623 | - $sql = 'SELECT DISTINCT count(*) as count FROM ' . Database::get_main_table(TABLE_MAIN_USER) . ' as user '; |
|
1623 | + $sql = 'SELECT DISTINCT count(*) as count FROM '.Database::get_main_table(TABLE_MAIN_USER).' as user '; |
|
1624 | 1624 | $where = array(); |
1625 | 1625 | if (!empty($session_id)) { |
1626 | - $sql .= ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . ' as session_course_user |
|
1626 | + $sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER).' as session_course_user |
|
1627 | 1627 | ON |
1628 | 1628 | user.user_id = session_course_user.user_id AND |
1629 | - session_course_user.c_id = "' . $courseId . '" AND |
|
1629 | + session_course_user.c_id = "' . $courseId.'" AND |
|
1630 | 1630 | session_course_user.session_id = ' . $session_id; |
1631 | 1631 | |
1632 | 1632 | $where[] = ' session_course_user.c_id IS NOT NULL '; |
1633 | 1633 | } else { |
1634 | - $sql .= ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) . ' as course_rel_user |
|
1634 | + $sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_COURSE_USER).' as course_rel_user |
|
1635 | 1635 | ON |
1636 | 1636 | user.user_id = course_rel_user.user_id AND |
1637 | - course_rel_user.relation_type<>' . COURSE_RELATION_TYPE_RRHH . ' AND |
|
1638 | - course_rel_user.c_id = ' . $courseId ; |
|
1637 | + course_rel_user.relation_type<>' . COURSE_RELATION_TYPE_RRHH.' AND |
|
1638 | + course_rel_user.c_id = ' . $courseId; |
|
1639 | 1639 | $where[] = ' course_rel_user.c_id IS NOT NULL '; |
1640 | 1640 | } |
1641 | 1641 | |
1642 | 1642 | $multiple_access_url = api_get_multiple_access_url(); |
1643 | 1643 | if ($multiple_access_url) { |
1644 | - $sql .= ' LEFT JOIN ' . Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER) . ' au |
|
1644 | + $sql .= ' LEFT JOIN '.Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER).' au |
|
1645 | 1645 | ON (au.user_id = user.user_id) '; |
1646 | 1646 | } |
1647 | 1647 | |
1648 | - $sql .= ' WHERE ' . implode(' OR ', $where); |
|
1648 | + $sql .= ' WHERE '.implode(' OR ', $where); |
|
1649 | 1649 | |
1650 | 1650 | if ($multiple_access_url) { |
1651 | 1651 | $current_access_url_id = api_get_current_access_url_id(); |
@@ -1682,8 +1682,8 @@ discard block |
||
1682 | 1682 | $users = array(); |
1683 | 1683 | |
1684 | 1684 | // We get the coach for the given course in a given session. |
1685 | - $sql = 'SELECT user_id FROM ' . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . |
|
1686 | - ' WHERE session_id ="' . $session_id . '" AND c_id="' . $courseId . '" AND status = 2'; |
|
1685 | + $sql = 'SELECT user_id FROM '.Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER). |
|
1686 | + ' WHERE session_id ="'.$session_id.'" AND c_id="'.$courseId.'" AND status = 2'; |
|
1687 | 1687 | $rs = Database::query($sql); |
1688 | 1688 | while ($user = Database::fetch_array($rs)) { |
1689 | 1689 | $user_info = api_get_user_info($user['user_id']); |
@@ -1773,11 +1773,11 @@ discard block |
||
1773 | 1773 | $joinSession = ""; |
1774 | 1774 | //Session creation date |
1775 | 1775 | if (!empty($date_from) && !empty($date_to)) { |
1776 | - $joinSession = "INNER JOIN " . Database::get_main_table(TABLE_MAIN_SESSION) . " s"; |
|
1776 | + $joinSession = "INNER JOIN ".Database::get_main_table(TABLE_MAIN_SESSION)." s"; |
|
1777 | 1777 | } |
1778 | 1778 | |
1779 | 1779 | $sql_query = "SELECT * |
1780 | - FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " scu |
|
1780 | + FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." scu |
|
1781 | 1781 | $joinSession |
1782 | 1782 | INNER JOIN $userTable u ON scu.user_id = u.user_id |
1783 | 1783 | WHERE scu.c_id = '$courseId' AND scu.status <> 2"; |
@@ -1789,11 +1789,11 @@ discard block |
||
1789 | 1789 | } |
1790 | 1790 | |
1791 | 1791 | if ($session_id != 0) { |
1792 | - $sql_query .= ' AND scu.session_id = ' . $session_id; |
|
1792 | + $sql_query .= ' AND scu.session_id = '.$session_id; |
|
1793 | 1793 | } |
1794 | 1794 | |
1795 | 1795 | if (!$includeInvitedUsers) { |
1796 | - $sql_query .= " AND u.status != " . INVITEE; |
|
1796 | + $sql_query .= " AND u.status != ".INVITEE; |
|
1797 | 1797 | } |
1798 | 1798 | |
1799 | 1799 | $rs = Database::query($sql_query); |
@@ -1827,8 +1827,8 @@ discard block |
||
1827 | 1827 | u.email, |
1828 | 1828 | u.username, |
1829 | 1829 | u.status |
1830 | - FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " cu |
|
1831 | - INNER JOIN " . Database::get_main_table(TABLE_MAIN_USER) . " u |
|
1830 | + FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER)." cu |
|
1831 | + INNER JOIN " . Database::get_main_table(TABLE_MAIN_USER)." u |
|
1832 | 1832 | ON (cu.user_id = u.id) |
1833 | 1833 | WHERE |
1834 | 1834 | cu.c_id = $courseId AND |
@@ -1866,7 +1866,7 @@ discard block |
||
1866 | 1866 | $teacher['lastname'] |
1867 | 1867 | ); |
1868 | 1868 | if ($add_link_to_profile) { |
1869 | - $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $teacher['user_id']; |
|
1869 | + $url = api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_popup&user_id='.$teacher['user_id']; |
|
1870 | 1870 | $teacher_name = Display::url( |
1871 | 1871 | $teacher_name, |
1872 | 1872 | $url, |
@@ -1880,13 +1880,13 @@ discard block |
||
1880 | 1880 | } |
1881 | 1881 | |
1882 | 1882 | if (!empty($list)) { |
1883 | - if ($orderList === true){ |
|
1883 | + if ($orderList === true) { |
|
1884 | 1884 | $html .= '<ul class="user-teacher">'; |
1885 | - foreach ($list as $teacher){ |
|
1886 | - $html .= Display::tag('li', Display::return_icon('teacher.png', $teacher, null, ICON_SIZE_TINY) . ' ' . $teacher); |
|
1885 | + foreach ($list as $teacher) { |
|
1886 | + $html .= Display::tag('li', Display::return_icon('teacher.png', $teacher, null, ICON_SIZE_TINY).' '.$teacher); |
|
1887 | 1887 | } |
1888 | 1888 | $html .= '</ul>'; |
1889 | - }else{ |
|
1889 | + } else { |
|
1890 | 1890 | $html .= array_to_string($list, $separator); |
1891 | 1891 | } |
1892 | 1892 | } |
@@ -1965,7 +1965,7 @@ discard block |
||
1965 | 1965 | foreach ($coachs_course as $coach_course) { |
1966 | 1966 | $coach_name = api_get_person_name($coach_course['firstname'], $coach_course['lastname']); |
1967 | 1967 | if ($add_link_to_profile) { |
1968 | - $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $coach_course['user_id']; |
|
1968 | + $url = api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_popup&user_id='.$coach_course['user_id']; |
|
1969 | 1969 | $coach_name = Display::url( |
1970 | 1970 | $coach_name, |
1971 | 1971 | $url, |
@@ -1981,10 +1981,10 @@ discard block |
||
1981 | 1981 | $coaches_to_string = null; |
1982 | 1982 | |
1983 | 1983 | if (!empty($course_coachs)) { |
1984 | - if ($orderList === true){ |
|
1984 | + if ($orderList === true) { |
|
1985 | 1985 | $html .= '<ul class="user-coachs">'; |
1986 | - foreach ($course_coachs as $coachs){ |
|
1987 | - $html .= Display::tag('li', Display::return_icon('teacher.png', $coachs, null, ICON_SIZE_TINY) . ' ' . $coachs); |
|
1986 | + foreach ($course_coachs as $coachs) { |
|
1987 | + $html .= Display::tag('li', Display::return_icon('teacher.png', $coachs, null, ICON_SIZE_TINY).' '.$coachs); |
|
1988 | 1988 | } |
1989 | 1989 | $html .= '</ul>'; |
1990 | 1990 | } else { |
@@ -2039,20 +2039,20 @@ discard block |
||
2039 | 2039 | } |
2040 | 2040 | |
2041 | 2041 | $group_list = array(); |
2042 | - $session_id != 0 ? $session_condition = ' WHERE g.session_id IN(1,' . intval($session_id) . ')' : $session_condition = ' WHERE g.session_id = 0'; |
|
2042 | + $session_id != 0 ? $session_condition = ' WHERE g.session_id IN(1,'.intval($session_id).')' : $session_condition = ' WHERE g.session_id = 0'; |
|
2043 | 2043 | |
2044 | 2044 | if ($in_get_empty_group == 0) { |
2045 | 2045 | // get only groups that are not empty |
2046 | 2046 | $sql = "SELECT DISTINCT g.id, g.name |
2047 | - FROM " . Database::get_course_table(TABLE_GROUP) . " AS g |
|
2048 | - INNER JOIN " . Database::get_course_table(TABLE_GROUP_USER) . " gu |
|
2047 | + FROM " . Database::get_course_table(TABLE_GROUP)." AS g |
|
2048 | + INNER JOIN " . Database::get_course_table(TABLE_GROUP_USER)." gu |
|
2049 | 2049 | ON (g.id = gu.group_id AND g.c_id = $course_id AND gu.c_id = $course_id) |
2050 | 2050 | $session_condition |
2051 | 2051 | ORDER BY g.name"; |
2052 | 2052 | } else { |
2053 | 2053 | // get all groups even if they are empty |
2054 | 2054 | $sql = "SELECT g.id, g.name |
2055 | - FROM " . Database::get_course_table(TABLE_GROUP) . " AS g |
|
2055 | + FROM " . Database::get_course_table(TABLE_GROUP)." AS g |
|
2056 | 2056 | $session_condition |
2057 | 2057 | AND c_id = $course_id"; |
2058 | 2058 | } |
@@ -2108,7 +2108,7 @@ discard block |
||
2108 | 2108 | $table_stats_uploads = Database::get_main_table(TABLE_STATISTIC_TRACK_E_UPLOADS); |
2109 | 2109 | |
2110 | 2110 | $codeFiltered = Database::escape_string($code); |
2111 | - $sql = "SELECT * FROM $table_course WHERE code='" . $codeFiltered . "'"; |
|
2111 | + $sql = "SELECT * FROM $table_course WHERE code='".$codeFiltered."'"; |
|
2112 | 2112 | $res = Database::query($sql); |
2113 | 2113 | |
2114 | 2114 | if (Database::num_rows($res) == 0) { |
@@ -2116,7 +2116,7 @@ discard block |
||
2116 | 2116 | } |
2117 | 2117 | |
2118 | 2118 | $sql = "SELECT * FROM $table_course |
2119 | - WHERE code = '" . $codeFiltered . "'"; |
|
2119 | + WHERE code = '".$codeFiltered."'"; |
|
2120 | 2120 | $res = Database::query($sql); |
2121 | 2121 | $course = Database::fetch_array($res); |
2122 | 2122 | $courseId = $course['id']; |
@@ -2161,34 +2161,34 @@ discard block |
||
2161 | 2161 | } |
2162 | 2162 | } |
2163 | 2163 | |
2164 | - $course_dir = api_get_path(SYS_COURSE_PATH) . $course['directory']; |
|
2165 | - $archive_dir = api_get_path(SYS_ARCHIVE_PATH) . $course['directory'] . '_' . time(); |
|
2164 | + $course_dir = api_get_path(SYS_COURSE_PATH).$course['directory']; |
|
2165 | + $archive_dir = api_get_path(SYS_ARCHIVE_PATH).$course['directory'].'_'.time(); |
|
2166 | 2166 | if (is_dir($course_dir)) { |
2167 | 2167 | rename($course_dir, $archive_dir); |
2168 | 2168 | } |
2169 | 2169 | |
2170 | 2170 | // Unsubscribe all users from the course |
2171 | - $sql = "DELETE FROM $table_course_user WHERE c_id='" . $courseId . "'"; |
|
2171 | + $sql = "DELETE FROM $table_course_user WHERE c_id='".$courseId."'"; |
|
2172 | 2172 | Database::query($sql); |
2173 | 2173 | // Delete the course from the sessions tables |
2174 | - $sql = "DELETE FROM $table_session_course WHERE c_id='" . $courseId . "'"; |
|
2174 | + $sql = "DELETE FROM $table_session_course WHERE c_id='".$courseId."'"; |
|
2175 | 2175 | Database::query($sql); |
2176 | - $sql = "DELETE FROM $table_session_course_user WHERE c_id='" . $courseId . "'"; |
|
2176 | + $sql = "DELETE FROM $table_session_course_user WHERE c_id='".$courseId."'"; |
|
2177 | 2177 | Database::query($sql); |
2178 | 2178 | |
2179 | 2179 | // Delete from Course - URL |
2180 | - $sql = "DELETE FROM $table_course_rel_url WHERE c_id = '" . $courseId. "'"; |
|
2180 | + $sql = "DELETE FROM $table_course_rel_url WHERE c_id = '".$courseId."'"; |
|
2181 | 2181 | Database::query($sql); |
2182 | 2182 | |
2183 | - $sql = 'SELECT survey_id FROM ' . $table_course_survey . ' WHERE course_code="' . $codeFiltered . '"'; |
|
2183 | + $sql = 'SELECT survey_id FROM '.$table_course_survey.' WHERE course_code="'.$codeFiltered.'"'; |
|
2184 | 2184 | $result_surveys = Database::query($sql); |
2185 | 2185 | while ($surveys = Database::fetch_array($result_surveys)) { |
2186 | 2186 | $survey_id = $surveys[0]; |
2187 | - $sql = 'DELETE FROM ' . $table_course_survey_question . ' WHERE survey_id="' . $survey_id . '"'; |
|
2187 | + $sql = 'DELETE FROM '.$table_course_survey_question.' WHERE survey_id="'.$survey_id.'"'; |
|
2188 | 2188 | Database::query($sql); |
2189 | - $sql = 'DELETE FROM ' . $table_course_survey_question_option . ' WHERE survey_id="' . $survey_id . '"'; |
|
2189 | + $sql = 'DELETE FROM '.$table_course_survey_question_option.' WHERE survey_id="'.$survey_id.'"'; |
|
2190 | 2190 | Database::query($sql); |
2191 | - $sql = 'DELETE FROM ' . $table_course_survey . ' WHERE survey_id="' . $survey_id . '"'; |
|
2191 | + $sql = 'DELETE FROM '.$table_course_survey.' WHERE survey_id="'.$survey_id.'"'; |
|
2192 | 2192 | Database::query($sql); |
2193 | 2193 | } |
2194 | 2194 | |
@@ -2221,7 +2221,7 @@ discard block |
||
2221 | 2221 | Database::query($sql); |
2222 | 2222 | |
2223 | 2223 | // Delete the course from the database |
2224 | - $sql = "DELETE FROM $table_course WHERE code = '" . $codeFiltered . "'"; |
|
2224 | + $sql = "DELETE FROM $table_course WHERE code = '".$codeFiltered."'"; |
|
2225 | 2225 | Database::query($sql); |
2226 | 2226 | |
2227 | 2227 | // delete extra course fields |
@@ -2267,15 +2267,15 @@ discard block |
||
2267 | 2267 | while ($row = Database::fetch_array($res_table, 'ASSOC')) { |
2268 | 2268 | $row_to_save = array(); |
2269 | 2269 | foreach ($row as $key => $value) { |
2270 | - $row_to_save[$key] = $key . "='" . Database::escape_string($row[$key]) . "'"; |
|
2270 | + $row_to_save[$key] = $key."='".Database::escape_string($row[$key])."'"; |
|
2271 | 2271 | } |
2272 | - $sql_dump .= "\nINSERT INTO $table SET " . implode(', ', $row_to_save) . ';'; |
|
2272 | + $sql_dump .= "\nINSERT INTO $table SET ".implode(', ', $row_to_save).';'; |
|
2273 | 2273 | } |
2274 | 2274 | } |
2275 | 2275 | } |
2276 | 2276 | |
2277 | - if (is_dir(api_get_path(SYS_COURSE_PATH) . $course['directory'])) { |
|
2278 | - $file_name = api_get_path(SYS_COURSE_PATH) . $course['directory'] . '/mysql_dump.sql'; |
|
2277 | + if (is_dir(api_get_path(SYS_COURSE_PATH).$course['directory'])) { |
|
2278 | + $file_name = api_get_path(SYS_COURSE_PATH).$course['directory'].'/mysql_dump.sql'; |
|
2279 | 2279 | $handle = fopen($file_name, 'a+'); |
2280 | 2280 | if ($handle !== false) { |
2281 | 2281 | fwrite($handle, $sql_dump); |
@@ -2304,13 +2304,13 @@ discard block |
||
2304 | 2304 | $TABLECOURSE = Database::get_main_table(TABLE_MAIN_COURSE); |
2305 | 2305 | $TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER); |
2306 | 2306 | |
2307 | - $course_title = Database::result(Database::query('SELECT title FROM ' . $TABLECOURSE . ' WHERE code="' . $course_code . '"'), |
|
2307 | + $course_title = Database::result(Database::query('SELECT title FROM '.$TABLECOURSE.' WHERE code="'.$course_code.'"'), |
|
2308 | 2308 | 0, 0); |
2309 | 2309 | |
2310 | 2310 | $sql = 'SELECT course.code as code, course.title as title, cu.sort as sort |
2311 | - FROM ' . $TABLECOURSUSER . ' as cu, ' . $TABLECOURSE . ' as course |
|
2312 | - WHERE course.id = cu.c_id AND user_id = "' . $user_id . '" AND |
|
2313 | - cu.relation_type<>' . COURSE_RELATION_TYPE_RRHH . ' AND |
|
2311 | + FROM ' . $TABLECOURSUSER.' as cu, '.$TABLECOURSE.' as course |
|
2312 | + WHERE course.id = cu.c_id AND user_id = "' . $user_id.'" AND |
|
2313 | + cu.relation_type<>' . COURSE_RELATION_TYPE_RRHH.' AND |
|
2314 | 2314 | user_course_cat = 0 |
2315 | 2315 | ORDER BY cu.sort'; |
2316 | 2316 | $result = Database::query($sql); |
@@ -2329,21 +2329,21 @@ discard block |
||
2329 | 2329 | $course_found = true; |
2330 | 2330 | $course_sort = $courses['sort']; |
2331 | 2331 | if ($counter == 0) { |
2332 | - $sql = 'UPDATE ' . $TABLECOURSUSER . ' |
|
2332 | + $sql = 'UPDATE '.$TABLECOURSUSER.' |
|
2333 | 2333 | SET sort = sort+1 |
2334 | 2334 | WHERE |
2335 | - user_id= "' . $user_id . '" AND |
|
2336 | - relation_type<>' . COURSE_RELATION_TYPE_RRHH . ' |
|
2335 | + user_id= "' . $user_id.'" AND |
|
2336 | + relation_type<>' . COURSE_RELATION_TYPE_RRHH.' |
|
2337 | 2337 | AND user_course_cat="0" |
2338 | - AND sort > "' . $course_sort . '"'; |
|
2338 | + AND sort > "' . $course_sort.'"'; |
|
2339 | 2339 | $course_sort++; |
2340 | 2340 | } else { |
2341 | - $sql = 'UPDATE ' . $TABLECOURSUSER . ' SET sort = sort+1 |
|
2341 | + $sql = 'UPDATE '.$TABLECOURSUSER.' SET sort = sort+1 |
|
2342 | 2342 | WHERE |
2343 | - user_id= "' . $user_id . '" AND |
|
2344 | - relation_type<>' . COURSE_RELATION_TYPE_RRHH . ' AND |
|
2343 | + user_id= "' . $user_id.'" AND |
|
2344 | + relation_type<>' . COURSE_RELATION_TYPE_RRHH.' AND |
|
2345 | 2345 | user_course_cat="0" AND |
2346 | - sort >= "' . $course_sort . '"'; |
|
2346 | + sort >= "' . $course_sort.'"'; |
|
2347 | 2347 | } |
2348 | 2348 | Database::query($sql); |
2349 | 2349 | break; |
@@ -2356,9 +2356,9 @@ discard block |
||
2356 | 2356 | |
2357 | 2357 | // We must register the course in the beginning of the list |
2358 | 2358 | if (!$course_found) { |
2359 | - $course_sort = Database::result(Database::query('SELECT min(sort) as min_sort FROM ' . $TABLECOURSUSER . ' WHERE user_id="' . $user_id . '" AND user_course_cat="0"'), |
|
2359 | + $course_sort = Database::result(Database::query('SELECT min(sort) as min_sort FROM '.$TABLECOURSUSER.' WHERE user_id="'.$user_id.'" AND user_course_cat="0"'), |
|
2360 | 2360 | 0, 0); |
2361 | - Database::query('UPDATE ' . $TABLECOURSUSER . ' SET sort = sort+1 WHERE user_id= "' . $user_id . '" AND user_course_cat="0"'); |
|
2361 | + Database::query('UPDATE '.$TABLECOURSUSER.' SET sort = sort+1 WHERE user_id= "'.$user_id.'" AND user_course_cat="0"'); |
|
2362 | 2362 | } |
2363 | 2363 | } |
2364 | 2364 | return $course_sort; |
@@ -2373,11 +2373,11 @@ discard block |
||
2373 | 2373 | public static function course_exists($course_code, $accept_virtual = false) |
2374 | 2374 | { |
2375 | 2375 | if ($accept_virtual === true) { |
2376 | - $sql = 'SELECT 1 FROM ' . Database::get_main_table(TABLE_MAIN_COURSE) . ' |
|
2377 | - WHERE code="' . Database::escape_string($course_code) . '" OR visual_code="' . Database::escape_string($course_code) . '"'; |
|
2376 | + $sql = 'SELECT 1 FROM '.Database::get_main_table(TABLE_MAIN_COURSE).' |
|
2377 | + WHERE code="' . Database::escape_string($course_code).'" OR visual_code="'.Database::escape_string($course_code).'"'; |
|
2378 | 2378 | } else { |
2379 | - $sql = 'SELECT 1 FROM ' . Database::get_main_table(TABLE_MAIN_COURSE) . ' |
|
2380 | - WHERE code="' . Database::escape_string($course_code) . '"'; |
|
2379 | + $sql = 'SELECT 1 FROM '.Database::get_main_table(TABLE_MAIN_COURSE).' |
|
2380 | + WHERE code="' . Database::escape_string($course_code).'"'; |
|
2381 | 2381 | } |
2382 | 2382 | |
2383 | 2383 | return Database::num_rows(Database::query($sql)); |
@@ -2403,7 +2403,7 @@ discard block |
||
2403 | 2403 | $student = api_get_user_info($user_id); |
2404 | 2404 | |
2405 | 2405 | $name_course = $information['title']; |
2406 | - $sql = "SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " WHERE c_id ='" . $courseId . "'"; |
|
2406 | + $sql = "SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)." WHERE c_id ='".$courseId."'"; |
|
2407 | 2407 | |
2408 | 2408 | // TODO: Ivan: This is a mistake, please, have a look at it. Intention here is diffcult to be guessed. |
2409 | 2409 | //if ($send_to_tutor_also = true) |
@@ -2418,18 +2418,18 @@ discard block |
||
2418 | 2418 | while ($row = Database::fetch_array($result)) { |
2419 | 2419 | $tutor = api_get_user_info($row['user_id']); |
2420 | 2420 | $emailto = $tutor['email']; |
2421 | - $emailsubject = get_lang('NewUserInTheCourse') . ': ' . $name_course; |
|
2422 | - $emailbody = get_lang('Dear') . ': ' . api_get_person_name($tutor['firstname'], $tutor['lastname']) . "\n"; |
|
2423 | - $emailbody .= get_lang('MessageNewUserInTheCourse') . ': ' . $name_course . "\n"; |
|
2424 | - $emailbody .= get_lang('UserName') . ': ' . $student['username'] . "\n"; |
|
2421 | + $emailsubject = get_lang('NewUserInTheCourse').': '.$name_course; |
|
2422 | + $emailbody = get_lang('Dear').': '.api_get_person_name($tutor['firstname'], $tutor['lastname'])."\n"; |
|
2423 | + $emailbody .= get_lang('MessageNewUserInTheCourse').': '.$name_course."\n"; |
|
2424 | + $emailbody .= get_lang('UserName').': '.$student['username']."\n"; |
|
2425 | 2425 | if (api_is_western_name_order()) { |
2426 | - $emailbody .= get_lang('FirstName') . ': ' . $student['firstname'] . "\n"; |
|
2427 | - $emailbody .= get_lang('LastName') . ': ' . $student['lastname'] . "\n"; |
|
2426 | + $emailbody .= get_lang('FirstName').': '.$student['firstname']."\n"; |
|
2427 | + $emailbody .= get_lang('LastName').': '.$student['lastname']."\n"; |
|
2428 | 2428 | } else { |
2429 | - $emailbody .= get_lang('LastName') . ': ' . $student['lastname'] . "\n"; |
|
2430 | - $emailbody .= get_lang('FirstName') . ': ' . $student['firstname'] . "\n"; |
|
2429 | + $emailbody .= get_lang('LastName').': '.$student['lastname']."\n"; |
|
2430 | + $emailbody .= get_lang('FirstName').': '.$student['firstname']."\n"; |
|
2431 | 2431 | } |
2432 | - $emailbody .= get_lang('Email') . ': <a href="mailto:' . $student['email'] . '">' . $student['email'] ."</a>\n\n"; |
|
2432 | + $emailbody .= get_lang('Email').': <a href="mailto:'.$student['email'].'">'.$student['email']."</a>\n\n"; |
|
2433 | 2433 | $recipient_name = api_get_person_name($tutor['firstname'], $tutor['lastname'], null, |
2434 | 2434 | PERSON_NAME_EMAIL_ADDRESS); |
2435 | 2435 | $sender_name = api_get_person_name(api_get_setting('administratorName'), |
@@ -2531,9 +2531,9 @@ discard block |
||
2531 | 2531 | |
2532 | 2532 | $with_special_courses = $without_special_courses = ''; |
2533 | 2533 | if (!empty($special_course_list)) { |
2534 | - $sc_string = '"' . implode('","', $special_course_list) . '"'; |
|
2535 | - $with_special_courses = ' course.code IN (' . $sc_string . ')'; |
|
2536 | - $without_special_courses = ' AND course.code NOT IN (' . $sc_string . ')'; |
|
2534 | + $sc_string = '"'.implode('","', $special_course_list).'"'; |
|
2535 | + $with_special_courses = ' course.code IN ('.$sc_string.')'; |
|
2536 | + $without_special_courses = ' AND course.code NOT IN ('.$sc_string.')'; |
|
2537 | 2537 | } |
2538 | 2538 | |
2539 | 2539 | if (!empty($with_special_courses)) { |
@@ -2577,8 +2577,8 @@ discard block |
||
2577 | 2577 | |
2578 | 2578 | if ($include_sessions === true) { |
2579 | 2579 | $sql = "SELECT DISTINCT(c.code), c.id as real_id |
2580 | - FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . " s, |
|
2581 | - " . Database::get_main_table(TABLE_MAIN_COURSE) . " c |
|
2580 | + FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER)." s, |
|
2581 | + " . Database::get_main_table(TABLE_MAIN_COURSE)." c |
|
2582 | 2582 | WHERE user_id = $user_id AND s.c_id = c.id"; |
2583 | 2583 | $r = Database::query($sql); |
2584 | 2584 | while ($row = Database::fetch_array($r, 'ASSOC')) { |
@@ -2599,7 +2599,7 @@ discard block |
||
2599 | 2599 | public static function get_course_id_from_path($path) |
2600 | 2600 | { |
2601 | 2601 | $path = Database::escape_string(str_replace('.', '', str_replace('/', '', $path))); |
2602 | - $res = Database::query("SELECT code FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " |
|
2602 | + $res = Database::query("SELECT code FROM ".Database::get_main_table(TABLE_MAIN_COURSE)." |
|
2603 | 2603 | WHERE directory LIKE BINARY '$path'"); |
2604 | 2604 | if ($res === false) { |
2605 | 2605 | return false; |
@@ -2621,8 +2621,8 @@ discard block |
||
2621 | 2621 | public static function get_courses_info_from_visual_code($code) |
2622 | 2622 | { |
2623 | 2623 | $result = array(); |
2624 | - $sql_result = Database::query("SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " |
|
2625 | - WHERE visual_code = '" . Database::escape_string($code) . "'"); |
|
2624 | + $sql_result = Database::query("SELECT * FROM ".Database::get_main_table(TABLE_MAIN_COURSE)." |
|
2625 | + WHERE visual_code = '" . Database::escape_string($code)."'"); |
|
2626 | 2626 | while ($virtual_course = Database::fetch_array($sql_result)) { |
2627 | 2627 | $result[] = $virtual_course; |
2628 | 2628 | } |
@@ -2639,10 +2639,10 @@ discard block |
||
2639 | 2639 | public static function get_emails_of_tutors_to_course($courseId) |
2640 | 2640 | { |
2641 | 2641 | $list = array(); |
2642 | - $res = Database::query("SELECT user_id FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " |
|
2643 | - WHERE c_id ='" . intval($courseId) . "' AND status=1"); |
|
2642 | + $res = Database::query("SELECT user_id FROM ".Database::get_main_table(TABLE_MAIN_COURSE_USER)." |
|
2643 | + WHERE c_id ='" . intval($courseId)."' AND status=1"); |
|
2644 | 2644 | while ($list_users = Database::fetch_array($res)) { |
2645 | - $result = Database::query("SELECT * FROM " . Database::get_main_table(TABLE_MAIN_USER) . " |
|
2645 | + $result = Database::query("SELECT * FROM ".Database::get_main_table(TABLE_MAIN_USER)." |
|
2646 | 2646 | WHERE user_id=" . $list_users['user_id']); |
2647 | 2647 | while ($row_user = Database::fetch_array($result)) { |
2648 | 2648 | $name_teacher = api_get_person_name($row_user['firstname'], $row_user['lastname']); |
@@ -2686,7 +2686,7 @@ discard block |
||
2686 | 2686 | } |
2687 | 2687 | |
2688 | 2688 | $sql = "SELECT firstname, lastname, email FROM $tbl_user |
2689 | - WHERE user_id IN (" . implode(",", $user_ids) . ")"; |
|
2689 | + WHERE user_id IN (".implode(",", $user_ids).")"; |
|
2690 | 2690 | $rs_user = Database::query($sql); |
2691 | 2691 | |
2692 | 2692 | while ($row_emails = Database::fetch_array($rs_user)) { |
@@ -2734,9 +2734,9 @@ discard block |
||
2734 | 2734 | */ |
2735 | 2735 | public static function update_attribute($id, $name, $value) |
2736 | 2736 | { |
2737 | - $id = (int)$id; |
|
2737 | + $id = (int) $id; |
|
2738 | 2738 | $table = Database::get_main_table(TABLE_MAIN_COURSE); |
2739 | - $sql = "UPDATE $table SET $name = '" . Database::escape_string($value) . "' |
|
2739 | + $sql = "UPDATE $table SET $name = '".Database::escape_string($value)."' |
|
2740 | 2740 | WHERE id = '$id';"; |
2741 | 2741 | return Database::query($sql); |
2742 | 2742 | } |
@@ -2751,7 +2751,7 @@ discard block |
||
2751 | 2751 | */ |
2752 | 2752 | public static function update_attributes($id, $attributes) |
2753 | 2753 | { |
2754 | - $id = (int)$id; |
|
2754 | + $id = (int) $id; |
|
2755 | 2755 | $table = Database::get_main_table(TABLE_MAIN_COURSE); |
2756 | 2756 | $sql = "UPDATE $table SET "; |
2757 | 2757 | $i = 0; |
@@ -2760,7 +2760,7 @@ discard block |
||
2760 | 2760 | if ($i > 0) { |
2761 | 2761 | $sql .= ", "; |
2762 | 2762 | } |
2763 | - $sql .= " $name = '" . Database::escape_string($value) . "'"; |
|
2763 | + $sql .= " $name = '".Database::escape_string($value)."'"; |
|
2764 | 2764 | $i++; |
2765 | 2765 | } |
2766 | 2766 | } |
@@ -2797,9 +2797,9 @@ discard block |
||
2797 | 2797 | { |
2798 | 2798 | return Database::result( |
2799 | 2799 | Database::query('SELECT sc.id session_category |
2800 | - FROM ' . Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY) . ' sc |
|
2801 | - INNER JOIN ' . Database::get_main_table(TABLE_MAIN_SESSION) . ' s |
|
2802 | - ON sc.id=s.session_category_id WHERE s.id="' . Database::escape_string($session_id) . '"'), |
|
2800 | + FROM ' . Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY).' sc |
|
2801 | + INNER JOIN ' . Database::get_main_table(TABLE_MAIN_SESSION).' s |
|
2802 | + ON sc.id=s.session_category_id WHERE s.id="' . Database::escape_string($session_id).'"'), |
|
2803 | 2803 | 0, |
2804 | 2804 | 'session_category' |
2805 | 2805 | ); |
@@ -2842,13 +2842,13 @@ discard block |
||
2842 | 2842 | $data .= '<div class="sectiontitle">'; |
2843 | 2843 | if (api_is_allowed_to_edit() && $action_show) { |
2844 | 2844 | //delete |
2845 | - $data .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete&description_id=' . $description->id . '" onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), |
|
2846 | - ENT_QUOTES, $charset)) . '\')) return false;">'; |
|
2845 | + $data .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete&description_id='.$description->id.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), |
|
2846 | + ENT_QUOTES, $charset)).'\')) return false;">'; |
|
2847 | 2847 | $data .= Display::return_icon('delete.gif', get_lang('Delete'), |
2848 | 2848 | array('style' => 'vertical-align:middle;float:right;')); |
2849 | 2849 | $data .= '</a> '; |
2850 | 2850 | //edit |
2851 | - $data .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&description_id=' . $description->id . '">'; |
|
2851 | + $data .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&description_id='.$description->id.'">'; |
|
2852 | 2852 | $data .= Display::return_icon('edit.png', get_lang('Edit'), |
2853 | 2853 | array('style' => 'vertical-align:middle;float:right; padding-right:4px;'), ICON_SIZE_SMALL); |
2854 | 2854 | $data .= '</a> '; |
@@ -2860,7 +2860,7 @@ discard block |
||
2860 | 2860 | $data .= '</div>'; |
2861 | 2861 | } |
2862 | 2862 | } else { |
2863 | - $data .= '<em>' . get_lang('ThisCourseDescriptionIsEmpty') . '</em>'; |
|
2863 | + $data .= '<em>'.get_lang('ThisCourseDescriptionIsEmpty').'</em>'; |
|
2864 | 2864 | } |
2865 | 2865 | |
2866 | 2866 | return $data; |
@@ -2927,11 +2927,11 @@ discard block |
||
2927 | 2927 | ON (a.c_id = s.c_id) |
2928 | 2928 | WHERE |
2929 | 2929 | user_id = $hr_manager_id AND |
2930 | - relation_type=" . COURSE_RELATION_TYPE_RRHH . " AND |
|
2931 | - access_url_id = " . api_get_current_access_url_id() . ""; |
|
2930 | + relation_type=".COURSE_RELATION_TYPE_RRHH." AND |
|
2931 | + access_url_id = " . api_get_current_access_url_id().""; |
|
2932 | 2932 | } else { |
2933 | 2933 | $sql = "SELECT c_id FROM $tbl_course_rel_user |
2934 | - WHERE user_id = $hr_manager_id AND relation_type=" . COURSE_RELATION_TYPE_RRHH . " "; |
|
2934 | + WHERE user_id = $hr_manager_id AND relation_type=".COURSE_RELATION_TYPE_RRHH." "; |
|
2935 | 2935 | } |
2936 | 2936 | $result = Database::query($sql); |
2937 | 2937 | if (Database::num_rows($result) > 0) { |
@@ -2940,7 +2940,7 @@ discard block |
||
2940 | 2940 | WHERE |
2941 | 2941 | c_id = '{$row['c_id']}' AND |
2942 | 2942 | user_id = $hr_manager_id AND |
2943 | - relation_type=" . COURSE_RELATION_TYPE_RRHH . " "; |
|
2943 | + relation_type=".COURSE_RELATION_TYPE_RRHH." "; |
|
2944 | 2944 | Database::query($sql); |
2945 | 2945 | } |
2946 | 2946 | } |
@@ -2951,7 +2951,7 @@ discard block |
||
2951 | 2951 | $courseInfo = api_get_course_info($course_code); |
2952 | 2952 | $courseId = $courseInfo['real_id']; |
2953 | 2953 | $sql = "INSERT IGNORE INTO $tbl_course_rel_user(c_id, user_id, status, relation_type) |
2954 | - VALUES($courseId, $hr_manager_id, '" . DRH . "', '" . COURSE_RELATION_TYPE_RRHH . "')"; |
|
2954 | + VALUES($courseId, $hr_manager_id, '".DRH."', '".COURSE_RELATION_TYPE_RRHH."')"; |
|
2955 | 2955 | $result = Database::query($sql); |
2956 | 2956 | if (Database::affected_rows($result)) { |
2957 | 2957 | $affected_rows++; |
@@ -3034,16 +3034,16 @@ discard block |
||
3034 | 3034 | case COURSEMANAGER: |
3035 | 3035 | $whereConditions .= " AND cru.user_id = '$user_id'"; |
3036 | 3036 | if (!$showAllAssignedCourses) { |
3037 | - $whereConditions .= " AND status = " . COURSEMANAGER; |
|
3037 | + $whereConditions .= " AND status = ".COURSEMANAGER; |
|
3038 | 3038 | } else { |
3039 | - $whereConditions .= " AND relation_type = " . COURSE_RELATION_TYPE_COURSE_MANAGER; |
|
3039 | + $whereConditions .= " AND relation_type = ".COURSE_RELATION_TYPE_COURSE_MANAGER; |
|
3040 | 3040 | } |
3041 | 3041 | break; |
3042 | 3042 | case DRH: |
3043 | 3043 | $whereConditions .= " AND |
3044 | 3044 | cru.user_id = '$user_id' AND |
3045 | - status = " . DRH . " AND |
|
3046 | - relation_type = '" . COURSE_RELATION_TYPE_RRHH . "' |
|
3045 | + status = ".DRH." AND |
|
3046 | + relation_type = '" . COURSE_RELATION_TYPE_RRHH."' |
|
3047 | 3047 | "; |
3048 | 3048 | break; |
3049 | 3049 | } |
@@ -3064,7 +3064,7 @@ discard block |
||
3064 | 3064 | ); |
3065 | 3065 | if (!empty($courseList)) { |
3066 | 3066 | $courseListToString = implode("','", array_keys($courseList)); |
3067 | - $whereConditions .= " AND c.id IN ('" . $courseListToString . "')"; |
|
3067 | + $whereConditions .= " AND c.id IN ('".$courseListToString."')"; |
|
3068 | 3068 | } |
3069 | 3069 | $tableSessionRelCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
3070 | 3070 | $orderBy = ' ORDER BY position'; |
@@ -3080,7 +3080,7 @@ discard block |
||
3080 | 3080 | INNER JOIN $tbl_course_rel_access_url a ON (a.c_id = c.id) |
3081 | 3081 | $extraInnerJoin |
3082 | 3082 | WHERE |
3083 | - access_url_id = " . api_get_current_access_url_id() . " |
|
3083 | + access_url_id = ".api_get_current_access_url_id()." |
|
3084 | 3084 | $whereConditions |
3085 | 3085 | $orderBy |
3086 | 3086 | "; |
@@ -3140,10 +3140,10 @@ discard block |
||
3140 | 3140 | { |
3141 | 3141 | $course_info = api_get_course_info($course_code); |
3142 | 3142 | // course path |
3143 | - $store_path = api_get_path(SYS_COURSE_PATH) . $course_info['path']; |
|
3143 | + $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path']; |
|
3144 | 3144 | // image name for courses |
3145 | - $course_image = $store_path . '/course-pic.png'; |
|
3146 | - $course_medium_image = $store_path . '/course-pic85x85.png'; |
|
3145 | + $course_image = $store_path.'/course-pic.png'; |
|
3146 | + $course_medium_image = $store_path.'/course-pic85x85.png'; |
|
3147 | 3147 | |
3148 | 3148 | if (file_exists($course_image)) { |
3149 | 3149 | unlink($course_image); |
@@ -3177,11 +3177,11 @@ discard block |
||
3177 | 3177 | { |
3178 | 3178 | $course_info = api_get_course_info($courseCode); |
3179 | 3179 | // course path |
3180 | - $storePath = api_get_path(SYS_COURSE_PATH) . $course_info['path']; |
|
3180 | + $storePath = api_get_path(SYS_COURSE_PATH).$course_info['path']; |
|
3181 | 3181 | // image name for courses |
3182 | - $courseImage = $storePath . '/course-pic.png'; |
|
3183 | - $courseMediumImage = $storePath . '/course-pic85x85.png'; |
|
3184 | - $courseSmallImage = $storePath . '/course-pic32.png'; |
|
3182 | + $courseImage = $storePath.'/course-pic.png'; |
|
3183 | + $courseMediumImage = $storePath.'/course-pic85x85.png'; |
|
3184 | + $courseSmallImage = $storePath.'/course-pic32.png'; |
|
3185 | 3185 | |
3186 | 3186 | if (file_exists($courseImage)) { |
3187 | 3187 | unlink($courseImage); |
@@ -3209,26 +3209,26 @@ discard block |
||
3209 | 3209 | |
3210 | 3210 | $notifications = isset($params['notifications']) ? $params['notifications'] : null; |
3211 | 3211 | |
3212 | - $html .= '<h3>' . $params['title'] . $notifications . '</h3> '; |
|
3212 | + $html .= '<h3>'.$params['title'].$notifications.'</h3> '; |
|
3213 | 3213 | |
3214 | 3214 | if (isset($params['description'])) { |
3215 | - $html .= '<p>' . $params['description'] . '</p>'; |
|
3215 | + $html .= '<p>'.$params['description'].'</p>'; |
|
3216 | 3216 | } |
3217 | 3217 | if (!empty($params['subtitle'])) { |
3218 | - $html .= '<small>' . $params['subtitle'] . '</small>'; |
|
3218 | + $html .= '<small>'.$params['subtitle'].'</small>'; |
|
3219 | 3219 | } |
3220 | 3220 | if (!empty($params['teachers'])) { |
3221 | - $html .= '<h5 class="teacher">' . Display::return_icon('teacher.png', get_lang('Teacher'), array(), |
|
3222 | - ICON_SIZE_TINY) . $params['teachers'] . '</h5>'; |
|
3221 | + $html .= '<h5 class="teacher">'.Display::return_icon('teacher.png', get_lang('Teacher'), array(), |
|
3222 | + ICON_SIZE_TINY).$params['teachers'].'</h5>'; |
|
3223 | 3223 | } |
3224 | 3224 | if (!empty($params['coaches'])) { |
3225 | - $html .= '<h5 class="teacher">' . Display::return_icon('teacher.png', get_lang('Coach'), array(), |
|
3226 | - ICON_SIZE_TINY) . $params['coaches'] . '</h5>'; |
|
3225 | + $html .= '<h5 class="teacher">'.Display::return_icon('teacher.png', get_lang('Coach'), array(), |
|
3226 | + ICON_SIZE_TINY).$params['coaches'].'</h5>'; |
|
3227 | 3227 | } |
3228 | 3228 | |
3229 | 3229 | $html .= '</div>'; |
3230 | 3230 | $params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : null; |
3231 | - $html .= '<div class="pull-right course-box-actions">' . $params['right_actions'] . '</div>'; |
|
3231 | + $html .= '<div class="pull-right course-box-actions">'.$params['right_actions'].'</div>'; |
|
3232 | 3232 | $html .= '</div>'; |
3233 | 3233 | $html .= '</div>'; |
3234 | 3234 | return $html; |
@@ -3244,11 +3244,11 @@ discard block |
||
3244 | 3244 | $html = ''; |
3245 | 3245 | $html .= '<div class="row">'; |
3246 | 3246 | $html .= '<div class="col-md-2">'; |
3247 | - if (!empty($params['link'])){ |
|
3247 | + if (!empty($params['link'])) { |
|
3248 | 3248 | $html .= '<a class="thumbnail" href="'.$params['link'].'">'; |
3249 | 3249 | $html .= $params['icon']; |
3250 | 3250 | $html .= '</a>'; |
3251 | - }else{ |
|
3251 | + } else { |
|
3252 | 3252 | $html .= $params['icon']; |
3253 | 3253 | } |
3254 | 3254 | $html .= '</div>'; |
@@ -3275,13 +3275,13 @@ discard block |
||
3275 | 3275 | if ($is_sub_content) { |
3276 | 3276 | $class = "course_item"; |
3277 | 3277 | } |
3278 | - $html .= '<div class="' . $class . '">'; |
|
3278 | + $html .= '<div class="'.$class.'">'; |
|
3279 | 3279 | $html .= '<div class="panel-body">'; |
3280 | 3280 | $html .= '<div class="course-items">'; |
3281 | 3281 | $html .= ' <div class="row">'; |
3282 | 3282 | $html .= '<div class="col-md-2">'; |
3283 | 3283 | if (!empty($params['link'])) { |
3284 | - $html .= '<a class="thumbnail" href="' . $params['link'] . '">'; |
|
3284 | + $html .= '<a class="thumbnail" href="'.$params['link'].'">'; |
|
3285 | 3285 | $html .= $params['icon']; |
3286 | 3286 | $html .= '</a>'; |
3287 | 3287 | } else { |
@@ -3294,25 +3294,25 @@ discard block |
||
3294 | 3294 | $param_class = isset($params['class']) ? $params['class'] : ''; |
3295 | 3295 | $params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : ''; |
3296 | 3296 | |
3297 | - $html .= '<div class="col-md-10 ' . $param_class . '">'; |
|
3298 | - $html .= '<div class="pull-right">' . $params['right_actions'] . '</div>'; |
|
3299 | - $html .= '<h4 class="course-items-title">' . $params['title'] . $notifications . '</h4> '; |
|
3297 | + $html .= '<div class="col-md-10 '.$param_class.'">'; |
|
3298 | + $html .= '<div class="pull-right">'.$params['right_actions'].'</div>'; |
|
3299 | + $html .= '<h4 class="course-items-title">'.$params['title'].$notifications.'</h4> '; |
|
3300 | 3300 | |
3301 | 3301 | if (isset($params['show_description'], $params['description']) && $params['show_description'] == 1) { |
3302 | - $html .= '<p class="description-session">' . $params['description'] . '</p>'; |
|
3302 | + $html .= '<p class="description-session">'.$params['description'].'</p>'; |
|
3303 | 3303 | } |
3304 | 3304 | if (!empty($params['subtitle'])) { |
3305 | - $html .= '<div class="subtitle-session">' . $params['subtitle'] . '</div>'; |
|
3305 | + $html .= '<div class="subtitle-session">'.$params['subtitle'].'</div>'; |
|
3306 | 3306 | } |
3307 | 3307 | if (!empty($params['teachers'])) { |
3308 | - $html .= '<h5 class="course-items-session">' . |
|
3309 | - Display::return_icon('teacher.png', get_lang('Teacher'), array(), ICON_SIZE_TINY) . |
|
3310 | - $params['teachers'] . '</h5>'; |
|
3308 | + $html .= '<h5 class="course-items-session">'. |
|
3309 | + Display::return_icon('teacher.png', get_lang('Teacher'), array(), ICON_SIZE_TINY). |
|
3310 | + $params['teachers'].'</h5>'; |
|
3311 | 3311 | } |
3312 | 3312 | if (!empty($params['coaches'])) { |
3313 | - $html .= '<h5 class="course-items-session">' . |
|
3314 | - Display::return_icon('teacher.png', get_lang('Coach'), array(), ICON_SIZE_TINY) . |
|
3315 | - $params['coaches'] . '</h5>'; |
|
3313 | + $html .= '<h5 class="course-items-session">'. |
|
3314 | + Display::return_icon('teacher.png', get_lang('Coach'), array(), ICON_SIZE_TINY). |
|
3315 | + $params['coaches'].'</h5>'; |
|
3316 | 3316 | } |
3317 | 3317 | |
3318 | 3318 | $html .= '</div>'; |
@@ -3333,7 +3333,7 @@ discard block |
||
3333 | 3333 | */ |
3334 | 3334 | public static function course_item_parent($main_content, $sub_content, $sub_sub_content = null) |
3335 | 3335 | { |
3336 | - return '<div class="panel panel-default">' . $main_content . $sub_content . $sub_sub_content . '</div>'; |
|
3336 | + return '<div class="panel panel-default">'.$main_content.$sub_content.$sub_sub_content.'</div>'; |
|
3337 | 3337 | } |
3338 | 3338 | |
3339 | 3339 | /** |
@@ -3355,7 +3355,7 @@ discard block |
||
3355 | 3355 | |
3356 | 3356 | $with_special_courses = $without_special_courses = ''; |
3357 | 3357 | if (!empty($special_course_list)) { |
3358 | - $with_special_courses = ' course.code IN ("' . implode('","', $special_course_list) . '")'; |
|
3358 | + $with_special_courses = ' course.code IN ("'.implode('","', $special_course_list).'")'; |
|
3359 | 3359 | } |
3360 | 3360 | $html = null; |
3361 | 3361 | $courseCount = 0; |
@@ -3406,14 +3406,14 @@ discard block |
||
3406 | 3406 | $params['right_actions'] = ''; |
3407 | 3407 | if (api_is_platform_admin()) { |
3408 | 3408 | if ($load_dirs) { |
3409 | - $params['right_actions'] .= '<a id="document_preview_' . $course['id'] . '_0" class="document_preview" href="javascript:void(0);">' . |
|
3409 | + $params['right_actions'] .= '<a id="document_preview_'.$course['id'].'_0" class="document_preview" href="javascript:void(0);">'. |
|
3410 | 3410 | Display::return_icon( |
3411 | 3411 | 'folder.png', |
3412 | 3412 | get_lang('Documents'), |
3413 | 3413 | array('align' => 'absmiddle'), |
3414 | 3414 | ICON_SIZE_SMALL |
3415 | 3415 | ).'</a>'; |
3416 | - $params['right_actions'] .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'] . '">' . |
|
3416 | + $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'. |
|
3417 | 3417 | Display::return_icon( |
3418 | 3418 | 'edit.png', |
3419 | 3419 | get_lang('Edit'), |
@@ -3421,13 +3421,13 @@ discard block |
||
3421 | 3421 | ICON_SIZE_SMALL |
3422 | 3422 | ).'</a>'; |
3423 | 3423 | $params['right_actions'] .= Display::div('', array( |
3424 | - 'id' => 'document_result_' . $course['id'] . '_0', |
|
3424 | + 'id' => 'document_result_'.$course['id'].'_0', |
|
3425 | 3425 | 'class' => 'document_preview_container' |
3426 | 3426 | )); |
3427 | 3427 | } else { |
3428 | - $params['right_actions'] .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'] . '">' . |
|
3428 | + $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'. |
|
3429 | 3429 | Display::return_icon('edit.png', |
3430 | - get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>'; |
|
3430 | + get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
3431 | 3431 | } |
3432 | 3432 | if ($course['status'] == COURSEMANAGER) { |
3433 | 3433 | //echo Display::return_icon('teachers.gif', get_lang('Status').': '.get_lang('Teacher'), array('style'=>'width: 11px; height: 11px;')); |
@@ -3435,7 +3435,7 @@ discard block |
||
3435 | 3435 | } else { |
3436 | 3436 | if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) { |
3437 | 3437 | if ($load_dirs) { |
3438 | - $params['right_actions'] .= '<a id="document_preview_' . $course['id'] . '_0" class="document_preview" href="javascript:void(0);">' . |
|
3438 | + $params['right_actions'] .= '<a id="document_preview_'.$course['id'].'_0" class="document_preview" href="javascript:void(0);">'. |
|
3439 | 3439 | Display::return_icon( |
3440 | 3440 | 'folder.png', |
3441 | 3441 | get_lang('Documents'), |
@@ -3443,7 +3443,7 @@ discard block |
||
3443 | 3443 | ICON_SIZE_SMALL |
3444 | 3444 | ).'</a>'; |
3445 | 3445 | $params['right_actions'] .= Display::div('', array( |
3446 | - 'id' => 'document_result_' . $course['id'] . '_0', |
|
3446 | + 'id' => 'document_result_'.$course['id'].'_0', |
|
3447 | 3447 | 'class' => 'document_preview_container' |
3448 | 3448 | )); |
3449 | 3449 | } |
@@ -3451,14 +3451,14 @@ discard block |
||
3451 | 3451 | } |
3452 | 3452 | |
3453 | 3453 | if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED || $course['status'] == COURSEMANAGER) { |
3454 | - $course_title = '<a href="' . $course_info['course_public_url'] . '?id_session=0&autoreg=1">' . $course_info['title'] . '</a>'; |
|
3454 | + $course_title = '<a href="'.$course_info['course_public_url'].'?id_session=0&autoreg=1">'.$course_info['title'].'</a>'; |
|
3455 | 3455 | } else { |
3456 | - $course_title = $course_info['title'] . " " . Display::tag('span', get_lang('CourseClosed'), |
|
3456 | + $course_title = $course_info['title']." ".Display::tag('span', get_lang('CourseClosed'), |
|
3457 | 3457 | array('class' => 'item_closed')); |
3458 | 3458 | } |
3459 | 3459 | |
3460 | 3460 | if (api_get_setting('display_coursecode_in_courselist') == 'true') { |
3461 | - $course_title .= ' (' . $course_info['visual_code'] . ') '; |
|
3461 | + $course_title .= ' ('.$course_info['visual_code'].') '; |
|
3462 | 3462 | } |
3463 | 3463 | if (api_get_setting('display_teacher_in_courselist') == 'true') { |
3464 | 3464 | $params['teachers'] = CourseManager::get_teacher_list_from_course_code_to_string( |
@@ -3508,7 +3508,7 @@ discard block |
||
3508 | 3508 | // Step 1: We get all the categories of the user |
3509 | 3509 | $table = Database::get_main_table(TABLE_USER_COURSE_CATEGORY); |
3510 | 3510 | $sql = "SELECT id, title FROM $table |
3511 | - WHERE user_id = '" . $user_id . "' |
|
3511 | + WHERE user_id = '".$user_id."' |
|
3512 | 3512 | ORDER BY sort ASC"; |
3513 | 3513 | $result = Database::query($sql); |
3514 | 3514 | $html = null; |
@@ -3569,7 +3569,7 @@ discard block |
||
3569 | 3569 | |
3570 | 3570 | $without_special_courses = ''; |
3571 | 3571 | if (!empty($special_course_list)) { |
3572 | - $without_special_courses = ' AND course.code NOT IN ("' . implode('","', $special_course_list) . '")'; |
|
3572 | + $without_special_courses = ' AND course.code NOT IN ("'.implode('","', $special_course_list).'")'; |
|
3573 | 3573 | } |
3574 | 3574 | |
3575 | 3575 | //AND course_rel_user.relation_type<>".COURSE_RELATION_TYPE_RRHH." |
@@ -3588,14 +3588,14 @@ discard block |
||
3588 | 3588 | WHERE |
3589 | 3589 | course.id = course_rel_user.c_id AND |
3590 | 3590 | url.c_id = course.id AND |
3591 | - course_rel_user.user_id = '" . $user_id . "' AND |
|
3592 | - course_rel_user.user_course_cat = '" . $user_category_id . "' |
|
3591 | + course_rel_user.user_id = '".$user_id."' AND |
|
3592 | + course_rel_user.user_course_cat = '" . $user_category_id."' |
|
3593 | 3593 | $without_special_courses "; |
3594 | 3594 | |
3595 | 3595 | // If multiple URL access mode is enabled, only fetch courses |
3596 | 3596 | // corresponding to the current URL. |
3597 | 3597 | if (api_get_multiple_access_url() && $current_url_id != -1) { |
3598 | - $sql .= " AND url.c_id = course.id AND access_url_id='" . $current_url_id . "'"; |
|
3598 | + $sql .= " AND url.c_id = course.id AND access_url_id='".$current_url_id."'"; |
|
3599 | 3599 | } |
3600 | 3600 | // Use user's classification for courses (if any). |
3601 | 3601 | $sql .= " ORDER BY course_rel_user.user_course_cat, course_rel_user.sort ASC"; |
@@ -3651,17 +3651,17 @@ discard block |
||
3651 | 3651 | |
3652 | 3652 | if (api_is_platform_admin()) { |
3653 | 3653 | if ($load_dirs) { |
3654 | - $params['right_actions'] .= '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview" href="javascript:void(0);">' . Display::return_icon('folder.png', |
|
3655 | - get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>'; |
|
3656 | - $params['right_actions'] .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'] . '">' . Display::return_icon('edit.png', |
|
3657 | - get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>'; |
|
3654 | + $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', |
|
3655 | + get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
3656 | + $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', |
|
3657 | + get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
3658 | 3658 | $params['right_actions'] .= Display::div('', array( |
3659 | - 'id' => 'document_result_' . $course_info['real_id'] . '_0', |
|
3659 | + 'id' => 'document_result_'.$course_info['real_id'].'_0', |
|
3660 | 3660 | 'class' => 'document_preview_container' |
3661 | 3661 | )); |
3662 | 3662 | } else { |
3663 | - $params['right_actions'] .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'] . '">' . Display::return_icon('edit.png', |
|
3664 | - get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>'; |
|
3663 | + $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', |
|
3664 | + get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
3665 | 3665 | } |
3666 | 3666 | |
3667 | 3667 | if ($course_info['status'] == COURSEMANAGER) { |
@@ -3670,16 +3670,16 @@ discard block |
||
3670 | 3670 | } else { |
3671 | 3671 | if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) { |
3672 | 3672 | if ($load_dirs) { |
3673 | - $params['right_actions'] .= '<a id="document_preview_' . $course_info['real_id'] . '_0" class="document_preview" href="javascript:void(0);">' . Display::return_icon('folder.png', |
|
3674 | - get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>'; |
|
3673 | + $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', |
|
3674 | + get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
3675 | 3675 | $params['right_actions'] .= Display::div('', array( |
3676 | - 'id' => 'document_result_' . $course_info['real_id'] . '_0', |
|
3676 | + 'id' => 'document_result_'.$course_info['real_id'].'_0', |
|
3677 | 3677 | 'class' => 'document_preview_container' |
3678 | 3678 | )); |
3679 | 3679 | } else { |
3680 | 3680 | if ($course_info['status'] == COURSEMANAGER) { |
3681 | - $params['right_actions'] .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'course_info/infocours.php?cidReq=' . $course['code'] . '">' . Display::return_icon('edit.png', |
|
3682 | - get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL) . '</a>'; |
|
3681 | + $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', |
|
3682 | + get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
3683 | 3683 | } |
3684 | 3684 | } |
3685 | 3685 | } |
@@ -3687,16 +3687,16 @@ discard block |
||
3687 | 3687 | |
3688 | 3688 | $course_title_url = ''; |
3689 | 3689 | if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED || $course['status'] == COURSEMANAGER) { |
3690 | - $course_title_url = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?id_session=0'; |
|
3690 | + $course_title_url = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php?id_session=0'; |
|
3691 | 3691 | $course_title = Display::url($course_info['title'], $course_title_url); |
3692 | 3692 | } else { |
3693 | - $course_title = $course_info['title'] . " " . Display::tag('span', get_lang('CourseClosed'), |
|
3693 | + $course_title = $course_info['title']." ".Display::tag('span', get_lang('CourseClosed'), |
|
3694 | 3694 | array('class' => 'item_closed')); |
3695 | 3695 | } |
3696 | 3696 | |
3697 | 3697 | // Start displaying the course block itself |
3698 | 3698 | if (api_get_setting('display_coursecode_in_courselist') == 'true') { |
3699 | - $course_title .= ' (' . $course_info['visual_code'] . ') '; |
|
3699 | + $course_title .= ' ('.$course_info['visual_code'].') '; |
|
3700 | 3700 | } |
3701 | 3701 | |
3702 | 3702 | $teachers = ''; |
@@ -3911,14 +3911,14 @@ discard block |
||
3911 | 3911 | } |
3912 | 3912 | |
3913 | 3913 | if ($user_in_course_status == COURSEMANAGER || $sessionCourseAvailable) { |
3914 | - $session_url = $course_info['course_public_url'] . '?id_session=' . $course_info['id_session']; |
|
3915 | - $session_title = '<h4><a href="' . $session_url. '">'. $course_info['name'] . '</a>'.$notifications.'</h4>'; |
|
3914 | + $session_url = $course_info['course_public_url'].'?id_session='.$course_info['id_session']; |
|
3915 | + $session_title = '<h4><a href="'.$session_url.'">'.$course_info['name'].'</a>'.$notifications.'</h4>'; |
|
3916 | 3916 | } else { |
3917 | 3917 | $session_title = $course_info['name']; |
3918 | 3918 | } |
3919 | 3919 | |
3920 | 3920 | } else { |
3921 | - $session_title = $course_info['name'] . ' ' . Display::tag('span', get_lang('CourseClosed'), |
|
3921 | + $session_title = $course_info['name'].' '.Display::tag('span', get_lang('CourseClosed'), |
|
3922 | 3922 | array('class' => 'item_closed')); |
3923 | 3923 | } |
3924 | 3924 | } else { |
@@ -3943,21 +3943,21 @@ discard block |
||
3943 | 3943 | $course_visibility != COURSE_VISIBILITY_HIDDEN |
3944 | 3944 | ) { |
3945 | 3945 | if ($load_dirs) { |
3946 | - $params['right_actions'] .= '<a id="document_preview_' . $course_info['real_id'] . '_' . $course_info['id_session'] . '" class="document_preview" href="javascript:void(0);">' . |
|
3946 | + $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_'.$course_info['id_session'].'" class="document_preview" href="javascript:void(0);">'. |
|
3947 | 3947 | Display::return_icon('folder.png', |
3948 | 3948 | get_lang('Documents'), |
3949 | 3949 | array('align' => 'absmiddle'), |
3950 | 3950 | ICON_SIZE_SMALL |
3951 | - ) . '</a>'; |
|
3951 | + ).'</a>'; |
|
3952 | 3952 | $params['right_actions'] .= Display::div('', array( |
3953 | - 'id' => 'document_result_' . $course_info['real_id'] . '_' . $course_info['id_session'], |
|
3953 | + 'id' => 'document_result_'.$course_info['real_id'].'_'.$course_info['id_session'], |
|
3954 | 3954 | 'class' => 'document_preview_container' |
3955 | 3955 | )); |
3956 | 3956 | } |
3957 | 3957 | } |
3958 | 3958 | |
3959 | 3959 | if (api_get_setting('display_coursecode_in_courselist') == 'true') { |
3960 | - $session_title .= ' (' . $course_info['visual_code'] . ') '; |
|
3960 | + $session_title .= ' ('.$course_info['visual_code'].') '; |
|
3961 | 3961 | } |
3962 | 3962 | |
3963 | 3963 | if (api_get_setting('display_teacher_in_courselist') == 'true') { |
@@ -3986,7 +3986,7 @@ discard block |
||
3986 | 3986 | } |
3987 | 3987 | } |
3988 | 3988 | |
3989 | - $session_title .= isset($course['special_course']) ? ' ' . |
|
3989 | + $session_title .= isset($course['special_course']) ? ' '. |
|
3990 | 3990 | Display::return_icon('klipper.png', get_lang('CourseAutoRegister')) : ''; |
3991 | 3991 | |
3992 | 3992 | $params['title'] = $session_title; |
@@ -4002,12 +4002,12 @@ discard block |
||
4002 | 4002 | |
4003 | 4003 | // Request for the name of the general coach |
4004 | 4004 | $sql = 'SELECT lastname, firstname,sc.name |
4005 | - FROM ' . $tbl_session . ' ts |
|
4006 | - LEFT JOIN ' . $main_user_table . ' tu |
|
4005 | + FROM ' . $tbl_session.' ts |
|
4006 | + LEFT JOIN ' . $main_user_table.' tu |
|
4007 | 4007 | ON ts.id_coach = tu.user_id |
4008 | - INNER JOIN ' . $tbl_session_category . ' sc |
|
4008 | + INNER JOIN ' . $tbl_session_category.' sc |
|
4009 | 4009 | ON ts.session_category_id = sc.id |
4010 | - WHERE ts.id=' . (int)$course_info['id_session'] . ' |
|
4010 | + WHERE ts.id=' . (int) $course_info['id_session'].' |
|
4011 | 4011 | LIMIT 1'; |
4012 | 4012 | |
4013 | 4013 | $rs = Database::query($sql); |
@@ -4022,14 +4022,14 @@ discard block |
||
4022 | 4022 | //$session['dates'] = get_lang('WithoutTimeLimits'); |
4023 | 4023 | $session['dates'] = ''; |
4024 | 4024 | if (api_get_setting('show_session_coach') === 'true') { |
4025 | - $session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name($sessioncoach['firstname'], |
|
4025 | + $session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($sessioncoach['firstname'], |
|
4026 | 4026 | $sessioncoach['lastname']); |
4027 | 4027 | } |
4028 | 4028 | $active = true; |
4029 | 4029 | } else { |
4030 | - $session ['dates'] = ' - ' . get_lang('From') . ' ' . $course_info['access_start_date'] . ' ' . get_lang('To') . ' ' . $course_info['access_end_date']; |
|
4030 | + $session ['dates'] = ' - '.get_lang('From').' '.$course_info['access_start_date'].' '.get_lang('To').' '.$course_info['access_end_date']; |
|
4031 | 4031 | if (api_get_setting('show_session_coach') === 'true') { |
4032 | - $session['coach'] = get_lang('GeneralCoach') . ': ' . api_get_person_name($sessioncoach['firstname'], |
|
4032 | + $session['coach'] = get_lang('GeneralCoach').': '.api_get_person_name($sessioncoach['firstname'], |
|
4033 | 4033 | $sessioncoach['lastname']); |
4034 | 4034 | } |
4035 | 4035 | $active = ($date_start <= $now && $date_end >= $now); |
@@ -4083,9 +4083,9 @@ discard block |
||
4083 | 4083 | $destination_session_id, |
4084 | 4084 | $params = array() |
4085 | 4085 | ) { |
4086 | - require_once api_get_path(SYS_CODE_PATH) . 'coursecopy/classes/CourseBuilder.class.php'; |
|
4087 | - require_once api_get_path(SYS_CODE_PATH) . 'coursecopy/classes/CourseRestorer.class.php'; |
|
4088 | - require_once api_get_path(SYS_CODE_PATH) . 'coursecopy/classes/CourseSelectForm.class.php'; |
|
4086 | + require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/CourseBuilder.class.php'; |
|
4087 | + require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/CourseRestorer.class.php'; |
|
4088 | + require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/CourseSelectForm.class.php'; |
|
4089 | 4089 | |
4090 | 4090 | $course_info = api_get_course_info($source_course_code); |
4091 | 4091 | |
@@ -4159,7 +4159,7 @@ discard block |
||
4159 | 4159 | if (Database::num_rows($result) > 0) { |
4160 | 4160 | $row = Database::fetch_array($result); |
4161 | 4161 | $count = $row['count'] + 1; |
4162 | - $wanted_code = $wanted_code . '_' . $count; |
|
4162 | + $wanted_code = $wanted_code.'_'.$count; |
|
4163 | 4163 | $result = api_get_course_info($wanted_code); |
4164 | 4164 | if (empty($result)) { |
4165 | 4165 | return $wanted_code; |
@@ -4193,7 +4193,7 @@ discard block |
||
4193 | 4193 | $enabled = api_get_plugin_setting('courselegal', 'tool_enable'); |
4194 | 4194 | |
4195 | 4195 | if ($enabled == 'true') { |
4196 | - require_once api_get_path(SYS_PLUGIN_PATH) . 'courselegal/config.php'; |
|
4196 | + require_once api_get_path(SYS_PLUGIN_PATH).'courselegal/config.php'; |
|
4197 | 4197 | $plugin = CourseLegalPlugin::create(); |
4198 | 4198 | return $plugin->isUserAcceptedLegal($user_id, $course_code, $session_id); |
4199 | 4199 | } |
@@ -4238,7 +4238,7 @@ discard block |
||
4238 | 4238 | $enabled = api_get_plugin_setting('courselegal', 'tool_enable'); |
4239 | 4239 | |
4240 | 4240 | if ($enabled == 'true') { |
4241 | - require_once api_get_path(SYS_PLUGIN_PATH) . 'courselegal/config.php'; |
|
4241 | + require_once api_get_path(SYS_PLUGIN_PATH).'courselegal/config.php'; |
|
4242 | 4242 | $plugin = CourseLegalPlugin::create(); |
4243 | 4243 | return $plugin->saveUserLegal($user_id, $course_code, $session_id); |
4244 | 4244 | } |
@@ -4580,10 +4580,10 @@ discard block |
||
4580 | 4580 | INNER JOIN $table_course_url u |
4581 | 4581 | ON u.c_id = c.id |
4582 | 4582 | WHERE |
4583 | - u.access_url_id = " . api_get_current_access_url_id() . " AND |
|
4583 | + u.access_url_id = ".api_get_current_access_url_id()." AND |
|
4584 | 4584 | login_course_date <= '$now' AND |
4585 | 4585 | login_course_date > DATE_SUB('$now', INTERVAL $days DAY) AND |
4586 | - visibility <> '" . COURSE_VISIBILITY_CLOSED . "' AND visibility <> '" . COURSE_VISIBILITY_HIDDEN . "' |
|
4586 | + visibility <> '".COURSE_VISIBILITY_CLOSED."' AND visibility <> '".COURSE_VISIBILITY_HIDDEN."' |
|
4587 | 4587 | GROUP BY a.c_id |
4588 | 4588 | ORDER BY course_count DESC |
4589 | 4589 | LIMIT $limit |
@@ -4609,7 +4609,7 @@ discard block |
||
4609 | 4609 | { |
4610 | 4610 | $hotCourses = []; |
4611 | 4611 | |
4612 | - $ajax_url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=add_course_vote'; |
|
4612 | + $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote'; |
|
4613 | 4613 | |
4614 | 4614 | $stok = Security::get_existing_token(); |
4615 | 4615 | |
@@ -4631,7 +4631,7 @@ discard block |
||
4631 | 4631 | if ($access_link && in_array('register', $access_link)) { |
4632 | 4632 | $my_course['extra_info']['register_button'] = Display::url( |
4633 | 4633 | Display::returnFontAwesomeIcon('sign-in'), |
4634 | - api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?action=subscribe&sec_token=' . $stok, |
|
4634 | + api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php?action=subscribe&sec_token='.$stok, |
|
4635 | 4635 | array('class' => 'btn btn-success btn-sm', 'title' => get_lang('Subscribe'))); |
4636 | 4636 | } |
4637 | 4637 | |
@@ -4640,14 +4640,14 @@ discard block |
||
4640 | 4640 | ) { |
4641 | 4641 | $my_course['extra_info']['go_to_course_button'] = Display::url( |
4642 | 4642 | Display::returnFontAwesomeIcon('share'), |
4643 | - api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php', |
|
4643 | + api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php', |
|
4644 | 4644 | array('class' => 'btn btn-default btn-sm', 'title' => get_lang('GoToCourse'))); |
4645 | 4645 | } |
4646 | 4646 | |
4647 | 4647 | if ($access_link && in_array('unsubscribe', $access_link)) { |
4648 | 4648 | $my_course['extra_info']['unsubscribe_button'] = Display::url( |
4649 | 4649 | Display::returnFontAwesomeIcon('sign-out'), |
4650 | - api_get_path(WEB_CODE_PATH) . 'auth/courses.php?action=unsubscribe&unsubscribe=' . $courseCode . '&sec_token=' . $stok . '&category_code=' . $categoryCode, |
|
4650 | + api_get_path(WEB_CODE_PATH).'auth/courses.php?action=unsubscribe&unsubscribe='.$courseCode.'&sec_token='.$stok.'&category_code='.$categoryCode, |
|
4651 | 4651 | array('class' => 'btn btn-danger btn-sm', 'title' => get_lang('Unreg'))); |
4652 | 4652 | } |
4653 | 4653 | |
@@ -4658,7 +4658,7 @@ discard block |
||
4658 | 4658 | ) { */ |
4659 | 4659 | $my_course['extra_info']['description_button'] = Display::url( |
4660 | 4660 | Display::returnFontAwesomeIcon('info-circle'), |
4661 | - api_get_path(WEB_AJAX_PATH) . 'course_home.ajax.php?a=show_course_information&code=' . $course_info['code'], |
|
4661 | + api_get_path(WEB_AJAX_PATH).'course_home.ajax.php?a=show_course_information&code='.$course_info['code'], |
|
4662 | 4662 | [ |
4663 | 4663 | 'class' => 'btn btn-default btn-sm ajax', |
4664 | 4664 | 'data-title' => get_lang('Description'), |
@@ -4669,8 +4669,8 @@ discard block |
||
4669 | 4669 | /* get_lang('Description') */ |
4670 | 4670 | $my_course['extra_info']['teachers'] = CourseManager::get_teacher_list_from_course_code_to_string($course_info['code']); |
4671 | 4671 | $point_info = self::get_course_ranking($course_info['real_id'], 0); |
4672 | - $my_course['extra_info']['rating_html'] = Display::return_rating_system('star_' . $course_info['real_id'], |
|
4673 | - $ajax_url . '&course_id=' . $course_info['real_id'], $point_info); |
|
4672 | + $my_course['extra_info']['rating_html'] = Display::return_rating_system('star_'.$course_info['real_id'], |
|
4673 | + $ajax_url.'&course_id='.$course_info['real_id'], $point_info); |
|
4674 | 4674 | |
4675 | 4675 | $hotCourses[] = $my_course; |
4676 | 4676 | } |
@@ -4746,9 +4746,9 @@ discard block |
||
4746 | 4746 | WHERE |
4747 | 4747 | c.id = u.c_id AND |
4748 | 4748 | u.access_url_id = $urlId AND |
4749 | - visibility <> " . COURSE_VISIBILITY_HIDDEN; |
|
4749 | + visibility <> ".COURSE_VISIBILITY_HIDDEN; |
|
4750 | 4750 | } else { |
4751 | - $sql .= " WHERE visibility <> " . COURSE_VISIBILITY_HIDDEN; |
|
4751 | + $sql .= " WHERE visibility <> ".COURSE_VISIBILITY_HIDDEN; |
|
4752 | 4752 | } |
4753 | 4753 | $res = Database::query($sql); |
4754 | 4754 | $row = Database::fetch_row($res); |
@@ -4769,7 +4769,7 @@ discard block |
||
4769 | 4769 | |
4770 | 4770 | $withoutSpecialCourses = ''; |
4771 | 4771 | if (!empty($specialCourseList)) { |
4772 | - $withoutSpecialCourses = ' AND c.code NOT IN ("' . implode('","', $specialCourseList) . '")'; |
|
4772 | + $withoutSpecialCourses = ' AND c.code NOT IN ("'.implode('","', $specialCourseList).'")'; |
|
4773 | 4773 | } |
4774 | 4774 | |
4775 | 4775 | $visibilityCondition = null; |
@@ -4904,12 +4904,12 @@ discard block |
||
4904 | 4904 | if (count($teachers) > 0) { |
4905 | 4905 | foreach ($teachers as $key) { |
4906 | 4906 | $key = Database::escape_string($key); |
4907 | - $cond .= " AND user_id <> '" . $key . "'"; |
|
4907 | + $cond .= " AND user_id <> '".$key."'"; |
|
4908 | 4908 | } |
4909 | 4909 | } |
4910 | 4910 | |
4911 | - $sql = 'DELETE FROM ' . $course_user_table . ' |
|
4912 | - WHERE c_id ="' . $courseId . '" AND status="1" AND relation_type = 0 ' . $cond; |
|
4911 | + $sql = 'DELETE FROM '.$course_user_table.' |
|
4912 | + WHERE c_id ="' . $courseId.'" AND status="1" AND relation_type = 0 '.$cond; |
|
4913 | 4913 | Database::query($sql); |
4914 | 4914 | } |
4915 | 4915 | |
@@ -4917,12 +4917,12 @@ discard block |
||
4917 | 4917 | foreach ($teachers as $userId) { |
4918 | 4918 | $userId = intval($userId); |
4919 | 4919 | // We check if the teacher is already subscribed in this course |
4920 | - $sql = 'SELECT 1 FROM ' . $course_user_table . ' |
|
4921 | - WHERE user_id = "' . $userId . '" AND c_id = "' . $courseId . '" '; |
|
4920 | + $sql = 'SELECT 1 FROM '.$course_user_table.' |
|
4921 | + WHERE user_id = "' . $userId.'" AND c_id = "'.$courseId.'" '; |
|
4922 | 4922 | $result = Database::query($sql); |
4923 | 4923 | if (Database::num_rows($result)) { |
4924 | - $sql = 'UPDATE ' . $course_user_table . ' SET status = "1" |
|
4925 | - WHERE c_id = "' . $courseId . '" AND user_id = "' . $userId . '" '; |
|
4924 | + $sql = 'UPDATE '.$course_user_table.' SET status = "1" |
|
4925 | + WHERE c_id = "' . $courseId.'" AND user_id = "'.$userId.'" '; |
|
4926 | 4926 | } else { |
4927 | 4927 | $userCourseCategory = '0'; |
4928 | 4928 | if (isset($teacherBackup[$userId]) && |
@@ -4932,9 +4932,9 @@ discard block |
||
4932 | 4932 | $userCourseCategory = $courseUserData['user_course_cat']; |
4933 | 4933 | } |
4934 | 4934 | |
4935 | - $sql = "INSERT INTO " . $course_user_table . " SET |
|
4936 | - c_id = " . $courseId . ", |
|
4937 | - user_id = " . $userId . ", |
|
4935 | + $sql = "INSERT INTO ".$course_user_table." SET |
|
4936 | + c_id = " . $courseId.", |
|
4937 | + user_id = " . $userId.", |
|
4938 | 4938 | status = '1', |
4939 | 4939 | is_tutor = '0', |
4940 | 4940 | sort = '0', |
@@ -5270,8 +5270,8 @@ discard block |
||
5270 | 5270 | { |
5271 | 5271 | $tbl_main_categories = Database:: get_main_table(TABLE_MAIN_COURSE); |
5272 | 5272 | $sql = 'SELECT title |
5273 | - FROM ' . $tbl_main_categories . ' |
|
5274 | - WHERE code = "' . Database::escape_string($code) . '"'; |
|
5273 | + FROM ' . $tbl_main_categories.' |
|
5274 | + WHERE code = "' . Database::escape_string($code).'"'; |
|
5275 | 5275 | $result = Database::query($sql); |
5276 | 5276 | if ($col = Database::fetch_array($result)) { |
5277 | 5277 | return $col['title']; |
@@ -5452,7 +5452,7 @@ discard block |
||
5452 | 5452 | foreach ($group_list as $this_group) { |
5453 | 5453 | if (is_array($to_already_selected)) { |
5454 | 5454 | if (!in_array( |
5455 | - "GROUP:" . $this_group['id'], |
|
5455 | + "GROUP:".$this_group['id'], |
|
5456 | 5456 | $to_already_selected |
5457 | 5457 | ) |
5458 | 5458 | ) { // $to_already_selected is the array containing the groups (and users) that are already selected |
@@ -5460,8 +5460,8 @@ discard block |
||
5460 | 5460 | $user_disabled = ($this_group['userNb'] > 0) ? "" : "disabled=disabled"; |
5461 | 5461 | $result[] = array( |
5462 | 5462 | 'disabled' => $user_disabled, |
5463 | - 'value' => "GROUP:" . $this_group['id'], |
|
5464 | - 'content' => "G: " . $this_group['name'] . " - " . $this_group['userNb'] . " " . $user_label |
|
5463 | + 'value' => "GROUP:".$this_group['id'], |
|
5464 | + 'content' => "G: ".$this_group['name']." - ".$this_group['userNb']." ".$user_label |
|
5465 | 5465 | ); |
5466 | 5466 | } |
5467 | 5467 | } |
@@ -5473,13 +5473,13 @@ discard block |
||
5473 | 5473 | foreach ($user_list as $user) { |
5474 | 5474 | if (is_array($to_already_selected)) { |
5475 | 5475 | if (!in_array( |
5476 | - "USER:" . $user['user_id'], |
|
5476 | + "USER:".$user['user_id'], |
|
5477 | 5477 | $to_already_selected |
5478 | 5478 | ) |
5479 | 5479 | ) { // $to_already_selected is the array containing the users (and groups) that are already selected |
5480 | 5480 | |
5481 | 5481 | $result[] = array( |
5482 | - 'value' => "USER:" . $user['user_id'], |
|
5482 | + 'value' => "USER:".$user['user_id'], |
|
5483 | 5483 | 'content' => api_get_person_name($user['firstname'], $user['lastname']) |
5484 | 5484 | ); |
5485 | 5485 | } |
@@ -5508,7 +5508,7 @@ discard block |
||
5508 | 5508 | { |
5509 | 5509 | $category_id = intval($category_id); |
5510 | 5510 | $info = Database::fetch_array( |
5511 | - Database::query('SELECT course_code FROM ' . Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY) . ' |
|
5511 | + Database::query('SELECT course_code FROM '.Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY).' |
|
5512 | 5512 | WHERE id=' . $category_id), 'ASSOC' |
5513 | 5513 | ); |
5514 | 5514 | return $info ? $info['course_code'] : false; |
@@ -5524,15 +5524,14 @@ discard block |
||
5524 | 5524 | public static function getCoursesWithoutSession($startDate = null, $endDate = null, $includeClosed = false) |
5525 | 5525 | { |
5526 | 5526 | $dateConditional = ($startDate && $endDate) ? |
5527 | - " WHERE session_id IN (SELECT id FROM " . Database::get_main_table(TABLE_MAIN_SESSION) . |
|
5528 | - " WHERE access_start_date = '$startDate' AND access_end_date = '$endDate')" : |
|
5529 | - null; |
|
5527 | + " WHERE session_id IN (SELECT id FROM ".Database::get_main_table(TABLE_MAIN_SESSION). |
|
5528 | + " WHERE access_start_date = '$startDate' AND access_end_date = '$endDate')" : null; |
|
5530 | 5529 | $visibility = ($includeClosed ? '' : 'visibility NOT IN (0, 4) AND '); |
5531 | 5530 | |
5532 | 5531 | $query = "SELECT id, code, title |
5533 | - FROM " . Database::get_main_table(TABLE_MAIN_COURSE). " |
|
5532 | + FROM " . Database::get_main_table(TABLE_MAIN_COURSE)." |
|
5534 | 5533 | WHERE $visibility code NOT IN ( |
5535 | - SELECT DISTINCT course_code FROM " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE) . $dateConditional . ") |
|
5534 | + SELECT DISTINCT course_code FROM ".Database::get_main_table(TABLE_MAIN_SESSION_COURSE).$dateConditional.") |
|
5536 | 5535 | ORDER BY id"; |
5537 | 5536 | |
5538 | 5537 | $result = Database::query($query); |
@@ -5565,7 +5564,7 @@ discard block |
||
5565 | 5564 | FROM $courseTable c |
5566 | 5565 | INNER JOIN $courseUserTable cru ON c.id = cru.c_id |
5567 | 5566 | WHERE ( |
5568 | - cru.user_id IN (" . implode(', ', $userIdList) . ") |
|
5567 | + cru.user_id IN (".implode(', ', $userIdList).") |
|
5569 | 5568 | AND cru.relation_type = 0 |
5570 | 5569 | )"; |
5571 | 5570 | |
@@ -5580,7 +5579,7 @@ discard block |
||
5580 | 5579 | INNER JOIN $courseAccessUrlTable crau ON c.id = crau.c_id |
5581 | 5580 | WHERE crau.access_url_id = $accessUrlId |
5582 | 5581 | AND ( |
5583 | - cru.id_user IN (" . implode(', ', $userIdList) . ") AND |
|
5582 | + cru.id_user IN (".implode(', ', $userIdList).") AND |
|
5584 | 5583 | cru.relation_type = 0 |
5585 | 5584 | )"; |
5586 | 5585 | } |
@@ -5689,7 +5688,7 @@ discard block |
||
5689 | 5688 | |
5690 | 5689 | $without_special_courses = ''; |
5691 | 5690 | if (!empty($special_course_list)) { |
5692 | - $without_special_courses = ' AND course.code NOT IN ("'.implode('","',$special_course_list).'")'; |
|
5691 | + $without_special_courses = ' AND course.code NOT IN ("'.implode('","', $special_course_list).'")'; |
|
5693 | 5692 | } |
5694 | 5693 | |
5695 | 5694 | //AND course_rel_user.relation_type<>".COURSE_RELATION_TYPE_RRHH." |
@@ -5745,11 +5744,11 @@ discard block |
||
5745 | 5744 | |
5746 | 5745 | if (api_is_platform_admin()) { |
5747 | 5746 | if ($loadDirs) { |
5748 | - $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>'; |
|
5749 | - $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>'; |
|
5747 | + $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
5748 | + $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
5750 | 5749 | $params['right_actions'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class'=>'document_preview_container')); |
5751 | 5750 | } else { |
5752 | - $params['right_actions'].= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>'; |
|
5751 | + $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
5753 | 5752 | } |
5754 | 5753 | |
5755 | 5754 | if ($course_info['status'] == COURSEMANAGER) { |
@@ -5758,11 +5757,11 @@ discard block |
||
5758 | 5757 | } else { |
5759 | 5758 | if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) { |
5760 | 5759 | if ($loadDirs) { |
5761 | - $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>'; |
|
5760 | + $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
5762 | 5761 | $params['right_actions'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class'=>'document_preview_container')); |
5763 | 5762 | } else { |
5764 | 5763 | if ($course_info['status'] == COURSEMANAGER) { |
5765 | - $params['right_actions'].= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>'; |
|
5764 | + $params['right_actions'] .= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'), ICON_SIZE_SMALL).'</a>'; |
|
5766 | 5765 | } |
5767 | 5766 | } |
5768 | 5767 | } |
@@ -5773,7 +5772,7 @@ discard block |
||
5773 | 5772 | $course_title_url = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/?id_session=0'; |
5774 | 5773 | $course_title = Display::url($course_info['title'], $course_title_url); |
5775 | 5774 | } else { |
5776 | - $course_title = $course_info['title']." ".Display::tag('span',get_lang('CourseClosed'), array('class'=>'item_closed')); |
|
5775 | + $course_title = $course_info['title']." ".Display::tag('span', get_lang('CourseClosed'), array('class'=>'item_closed')); |
|
5777 | 5776 | } |
5778 | 5777 | |
5779 | 5778 | // Start displaying the course block itself |