Completed
Push — 1.11.x ( 3ebade...c47d58 )
by José
213:48 queued 162:56
created
main/inc/lib/internationalization_database/transliteration/xb4.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 // $Id: xb4.php,v 1.1.8.1 2008/06/12 20:34:32 smk Exp $
3 3
 
4 4
 return array(
5
-  'en' => array('dwaen', 'dwaenj', 'dwaenh', 'dwaed', 'dwael', 'dwaelg', 'dwaelm', 'dwaelb', 'dwaels', 'dwaelt', 'dwaelp', 'dwaelh', 'dwaem', 'dwaeb', 'dwaebs', 'dwaes',
5
+    'en' => array('dwaen', 'dwaenj', 'dwaenh', 'dwaed', 'dwael', 'dwaelg', 'dwaelm', 'dwaelb', 'dwaels', 'dwaelt', 'dwaelp', 'dwaelh', 'dwaem', 'dwaeb', 'dwaebs', 'dwaes',
6 6
     'dwaess', 'dwaeng', 'dwaej', 'dwaec', 'dwaek', 'dwaet', 'dwaep', 'dwaeh', 'doe', 'doeg', 'doegg', 'doegs', 'doen', 'doenj', 'doenh', 'doed',
7 7
     'doel', 'doelg', 'doelm', 'doelb', 'doels', 'doelt', 'doelp', 'doelh', 'doem', 'doeb', 'doebs', 'does', 'doess', 'doeng', 'doej', 'doec',
8 8
     'doek', 'doet', 'doep', 'doeh', 'dyo', 'dyog', 'dyogg', 'dyogs', 'dyon', 'dyonj', 'dyonh', 'dyod', 'dyol', 'dyolg', 'dyolm', 'dyolb',
Please login to merge, or discard this patch.
main/inc/lib/internationalization_database/transliteration/x02.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 // $Id: x02.php,v 1.1.8.1 2008/06/12 20:34:31 smk Exp $
3 3
 
4 4
 return array(
5
-  'en' => array('A', 'a', 'A', 'a', 'E', 'e', 'E', 'e', 'I', 'i', 'I', 'i', 'O', 'o', 'O', 'o',
5
+    'en' => array('A', 'a', 'A', 'a', 'E', 'e', 'E', 'e', 'I', 'i', 'I', 'i', 'O', 'o', 'O', 'o',
6 6
     'R', 'r', 'R', 'r', 'U', 'u', 'U', 'u', 'S', 's', 'T', 't', 'Y', 'y', 'H', 'h',
7 7
     'N', 'd', 'OU', 'ou', 'Z', 'z', 'A', 'a', 'E', 'e', 'O', 'o', 'O', 'o', 'O', 'o',
8 8
     'O', 'o', 'Y', 'y', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's',
Please login to merge, or discard this patch.
main/inc/lib/internationalization_database/transliteration/x16.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 // $Id: x16.php,v 1.1.8.1 2008/06/12 20:34:31 smk Exp $
3 3
 
4 4
 return array(
5
-  'en' => array('kka', 'kk', 'nu', 'no', 'ne', 'nee', 'ni', 'na', 'mu', 'mo', 'me', 'mee', 'mi', 'ma', 'yu', 'yo',
5
+    'en' => array('kka', 'kk', 'nu', 'no', 'ne', 'nee', 'ni', 'na', 'mu', 'mo', 'me', 'mee', 'mi', 'ma', 'yu', 'yo',
6 6
     'ye', 'yee', 'yi', 'ya', 'ju', 'ju', 'jo', 'je', 'jee', 'ji', 'ji', 'ja', 'jju', 'jjo', 'jje', 'jjee',
7 7
     'jji', 'jja', 'lu', 'lo', 'le', 'lee', 'li', 'la', 'dlu', 'dlo', 'dle', 'dlee', 'dli', 'dla', 'lhu', 'lho',
8 8
     'lhe', 'lhee', 'lhi', 'lha', 'tlhu', 'tlho', 'tlhe', 'tlhee', 'tlhi', 'tlha', 'tlu', 'tlo', 'tle', 'tlee', 'tli', 'tla',
Please login to merge, or discard this patch.
main/inc/lib/internationalization_database/transliteration/x6c.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 // $Id: x6c.php,v 1.1.8.1 2008/06/12 20:34:31 smk Exp $
3 3
 
4 4
 return array(
5
-  'en' => array('Lu ', 'Mu ', 'Li ', 'Tong ', 'Rong ', 'Chang ', 'Pu ', 'Luo ', 'Zhan ', 'Sao ', 'Zhan ', 'Meng ', 'Luo ', 'Qu ', 'Die ', 'Shi ',
5
+    'en' => array('Lu ', 'Mu ', 'Li ', 'Tong ', 'Rong ', 'Chang ', 'Pu ', 'Luo ', 'Zhan ', 'Sao ', 'Zhan ', 'Meng ', 'Luo ', 'Qu ', 'Die ', 'Shi ',
6 6
     'Di ', 'Min ', 'Jue ', 'Mang ', 'Qi ', 'Pie ', 'Nai ', 'Qi ', 'Dao ', 'Xian ', 'Chuan ', 'Fen ', 'Ri ', 'Nei ', NULL, 'Fu ',
7 7
     'Shen ', 'Dong ', 'Qing ', 'Qi ', 'Yin ', 'Xi ', 'Hai ', 'Yang ', 'An ', 'Ya ', 'Ke ', 'Qing ', 'Ya ', 'Dong ', 'Dan ', 'Lu ',
8 8
     'Qing ', 'Yang ', 'Yun ', 'Yun ', 'Shui ', 'San ', 'Zheng ', 'Bing ', 'Yong ', 'Dang ', 'Shitamizu ', 'Le ', 'Ni ', 'Tun ', 'Fan ', 'Gui ',
Please login to merge, or discard this patch.
main/inc/lib/internationalization_database/transliteration/xb8.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 // $Id: xb8.php,v 1.1.8.1 2008/06/12 20:34:32 smk Exp $
3 3
 
4 4
 return array(
5
-  'en' => array('reoss', 'reong', 'reoj', 'reoc', 'reok', 'reot', 'reop', 'reoh', 're', 'reg', 'regg', 'regs', 'ren', 'renj', 'renh', 'red',
5
+    'en' => array('reoss', 'reong', 'reoj', 'reoc', 'reok', 'reot', 'reop', 'reoh', 're', 'reg', 'regg', 'regs', 'ren', 'renj', 'renh', 'red',
6 6
     'rel', 'relg', 'relm', 'relb', 'rels', 'relt', 'relp', 'relh', 'rem', 'reb', 'rebs', 'res', 'ress', 'reng', 'rej', 'rec',
7 7
     'rek', 'ret', 'rep', 'reh', 'ryeo', 'ryeog', 'ryeogg', 'ryeogs', 'ryeon', 'ryeonj', 'ryeonh', 'ryeod', 'ryeol', 'ryeolg', 'ryeolm', 'ryeolb',
8 8
     'ryeols', 'ryeolt', 'ryeolp', 'ryeolh', 'ryeom', 'ryeob', 'ryeobs', 'ryeos', 'ryeoss', 'ryeong', 'ryeoj', 'ryeoc', 'ryeok', 'ryeot', 'ryeop', 'ryeoh',
Please login to merge, or discard this patch.
main/inc/lib/internationalization_database/transliteration/xbd.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 // $Id: xbd.php,v 1.1.8.1 2008/06/12 20:34:32 smk Exp $
3 3
 
4 4
 return array(
5
-  'en' => array('bols', 'bolt', 'bolp', 'bolh', 'bom', 'bob', 'bobs', 'bos', 'boss', 'bong', 'boj', 'boc', 'bok', 'bot', 'bop', 'boh',
5
+    'en' => array('bols', 'bolt', 'bolp', 'bolh', 'bom', 'bob', 'bobs', 'bos', 'boss', 'bong', 'boj', 'boc', 'bok', 'bot', 'bop', 'boh',
6 6
     'bwa', 'bwag', 'bwagg', 'bwags', 'bwan', 'bwanj', 'bwanh', 'bwad', 'bwal', 'bwalg', 'bwalm', 'bwalb', 'bwals', 'bwalt', 'bwalp', 'bwalh',
7 7
     'bwam', 'bwab', 'bwabs', 'bwas', 'bwass', 'bwang', 'bwaj', 'bwac', 'bwak', 'bwat', 'bwap', 'bwah', 'bwae', 'bwaeg', 'bwaegg', 'bwaegs',
8 8
     'bwaen', 'bwaenj', 'bwaenh', 'bwaed', 'bwael', 'bwaelg', 'bwaelm', 'bwaelb', 'bwaels', 'bwaelt', 'bwaelp', 'bwaelh', 'bwaem', 'bwaeb', 'bwaebs', 'bwaes',
Please login to merge, or discard this patch.
main/inc/lib/login_redirection.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,30 +18,30 @@  discard block
 block discarded – undo
18 18
         if (api_is_student() && !api_get_setting('student_page_after_login') == '') {
19 19
             $redirect_url = html_entity_decode(api_get_setting('student_page_after_login'));
20 20
             if ($redirect_url[0] == "/") {
21
-                $redirect_url = substr(api_get_path(WEB_PATH), 0, -1) . $redirect_url;
21
+                $redirect_url = substr(api_get_path(WEB_PATH), 0, -1).$redirect_url;
22 22
             }
23 23
         }
24 24
         if (api_is_teacher() && !api_get_setting('teacher_page_after_login') == '') {
25 25
             $redirect_url = html_entity_decode(api_get_setting('teacher_page_after_login'));
26 26
             if ($redirect_url[0] == "/") {
27
-                $redirect_url = substr(api_get_path(WEB_PATH), 0, -1) . $redirect_url;
27
+                $redirect_url = substr(api_get_path(WEB_PATH), 0, -1).$redirect_url;
28 28
             }
29 29
         }
30 30
         if (api_is_drh() && !api_get_setting('drh_page_after_login') == '') {
31 31
             $redirect_url = html_entity_decode(api_get_setting('drh_page_after_login'));
32 32
             if ($redirect_url[0] == "/") {
33
-                $redirect_url = substr(api_get_path(WEB_PATH), 0, -1) . $redirect_url;
33
+                $redirect_url = substr(api_get_path(WEB_PATH), 0, -1).$redirect_url;
34 34
             }
35 35
         }
36 36
         if (api_is_session_admin() && !api_get_setting('sessionadmin_page_after_login') == '') {
37 37
             $redirect_url = html_entity_decode(api_get_setting('sessionadmin_page_after_login'));
38 38
             if ($redirect_url[0] == "/") {
39
-                $redirect_url = substr(api_get_path(WEB_PATH), 0, -1) . $redirect_url;
39
+                $redirect_url = substr(api_get_path(WEB_PATH), 0, -1).$redirect_url;
40 40
             }
41 41
         }
42 42
 
43 43
         if (!empty($redirect_url)) {
44
-            header('Location: ' . $redirect_url . $param);
44
+            header('Location: '.$redirect_url.$param);
45 45
             exit();
46 46
         }
47 47
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         if (CustomPages::enabled()) {
50 50
             CustomPages::display(CustomPages::INDEX_LOGGED);
51 51
         }
52
-        header('location: ' . api_get_path(WEB_PATH) . api_get_setting('page_after_login') . $param);
52
+        header('location: '.api_get_path(WEB_PATH).api_get_setting('page_after_login').$param);
53 53
         exit();
54 54
     }
55 55
 }
Please login to merge, or discard this patch.
main/inc/lib/sessionmanager.lib.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6022,7 +6022,7 @@
 block discarded – undo
6022 6022
         ]);
6023 6023
     }
6024 6024
 
6025
-	/**
6025
+    /**
6026 6026
      * Get the count of user courses in session
6027 6027
      * @param int $sessionId The session id
6028 6028
      * @return array
Please login to merge, or discard this patch.
Spacing   +190 added lines, -190 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                     return $msg;
178 178
                 }
179 179
             } else {
180
-                $rs = Database::query("SELECT 1 FROM $tbl_session WHERE name='" . $name . "'");
180
+                $rs = Database::query("SELECT 1 FROM $tbl_session WHERE name='".$name."'");
181 181
                 if (Database::num_rows($rs)) {
182 182
                     $msg = get_lang('SessionNameAlreadyExists');
183 183
                     return $msg;
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
     public static function session_name_exists($name)
291 291
     {
292 292
         $name = Database::escape_string($name);
293
-        $sql = "SELECT COUNT(*) as count FROM " . Database::get_main_table(TABLE_MAIN_SESSION) . "
293
+        $sql = "SELECT COUNT(*) as count FROM ".Database::get_main_table(TABLE_MAIN_SESSION)."
294 294
                 WHERE name = '$name'";
295 295
         $result = Database::fetch_array(Database::query($sql));
296 296
 
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
             $where .= " AND (
322 322
                             s.session_admin_id = $user_id  OR
323 323
                             sru.user_id = '$user_id' AND
324
-                            sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "'
324
+                            sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."'
325 325
                             )
326 326
                       ";
327 327
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             $where_condition = str_replace('category_name', 'sc.name', $where_condition);
340 340
             $where_condition = str_replace(
341 341
                 array("AND session_active = '1'  )", " AND (  session_active = '1'  )"),
342
-                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " )
342
+                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ")
343 343
                 , $where_condition
344 344
             );
345 345
             $where_condition = str_replace(
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
             $access_url_id = api_get_current_access_url_id();
386 386
             if ($access_url_id != -1) {
387
-                $where.= " AND ar.access_url_id = $access_url_id ";
387
+                $where .= " AND ar.access_url_id = $access_url_id ";
388 388
 
389 389
                 $sql = "SELECT count(id) as total_rows FROM (
390 390
                 SELECT DISTINCT
@@ -434,14 +434,14 @@  discard block
 block discarded – undo
434 434
             if (api_is_session_admin() &&
435 435
                 api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false'
436 436
             ) {
437
-                $where .=" AND s.session_admin_id = $user_id ";
437
+                $where .= " AND s.session_admin_id = $user_id ";
438 438
             }
439 439
         }
440 440
 
441 441
         if (!api_is_platform_admin() && api_is_teacher() &&
442 442
             api_get_setting('allow_teachers_to_create_sessions') == 'true'
443 443
         ) {
444
-            $where .=" AND s.id_coach = $user_id ";
444
+            $where .= " AND s.id_coach = $user_id ";
445 445
         }
446 446
 
447 447
         $extra_field = new ExtraFieldModel('session');
@@ -491,10 +491,10 @@  discard block
 block discarded – undo
491 491
         $query = "$select FROM $tbl_session s $inject_joins $where $inject_where";
492 492
 
493 493
         if (api_is_multiple_url_enabled()) {
494
-            $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
494
+            $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
495 495
             $access_url_id = api_get_current_access_url_id();
496 496
             if ($access_url_id != -1) {
497
-                $where.= " AND ar.access_url_id = $access_url_id ";
497
+                $where .= " AND ar.access_url_id = $access_url_id ";
498 498
                 $query = "$select
499 499
                         FROM $tbl_session s $inject_joins
500 500
                         INNER JOIN $table_access_url_rel_session ar
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
                 INNER JOIN $tbl_lp l ON l.id = v.lp_id
599 599
                 INNER JOIN $tbl_user u ON u.user_id = v.user_id
600 600
                 INNER JOIN $tbl_course c
601
-                WHERE v.session_id = " . $sessionId;
601
+                WHERE v.session_id = ".$sessionId;
602 602
         $result_rows = Database::query($sql);
603 603
         $row = Database::fetch_array($result_rows);
604 604
         $num = $row['total_rows'];
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 
651 651
         $limit = null;
652 652
         if (!empty($options['limit'])) {
653
-            $limit = " LIMIT " . $options['limit'];
653
+            $limit = " LIMIT ".$options['limit'];
654 654
         }
655 655
 
656 656
         if (!empty($options['where'])) {
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 
660 660
         $order = null;
661 661
         if (!empty($options['order'])) {
662
-            $order = " ORDER BY " . $options['order'];
662
+            $order = " ORDER BY ".$options['order'];
663 663
         }
664 664
 
665 665
         $sql = "SELECT u.user_id, u.lastname, u.firstname, u.username, u.email, s.c_id
@@ -718,13 +718,13 @@  discard block
 block discarded – undo
718 718
             foreach ($lessons as $lesson) {
719 719
                 $data[$lesson['id']] = (!empty($user_lessons[$lesson['id']]['progress'])) ? $user_lessons[$lesson['id']]['progress'] : 0;
720 720
                 $progress += $data[$lesson['id']];
721
-                $data[$lesson['id']] = $data[$lesson['id']] . '%';
721
+                $data[$lesson['id']] = $data[$lesson['id']].'%';
722 722
                 $count++;
723 723
             }
724 724
             if ($count == 0) {
725 725
                 $data['total'] = 0;
726 726
             } else {
727
-                $data['total'] = round($progress / $count, 2) . '%';
727
+                $data['total'] = round($progress / $count, 2).'%';
728 728
             }
729 729
             $table[] = $data;
730 730
         }
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 
766 766
         $limit = null;
767 767
         if (!empty($options['limit'])) {
768
-            $limit = " LIMIT " . $options['limit'];
768
+            $limit = " LIMIT ".$options['limit'];
769 769
         }
770 770
 
771 771
         if (!empty($options['where'])) {
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
 
775 775
         $order = null;
776 776
         if (!empty($options['order'])) {
777
-            $order = " ORDER BY " . $options['order'];
777
+            $order = " ORDER BY ".$options['order'];
778 778
         }
779 779
 
780 780
         $sql = "SELECT u.user_id, u.lastname, u.firstname, u.username, u.email, s.c_id
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 
877 877
         $limit = null;
878 878
         if (!empty($options['limit'])) {
879
-            $limit = " LIMIT " . $options['limit'];
879
+            $limit = " LIMIT ".$options['limit'];
880 880
         }
881 881
 
882 882
         if (!empty($options['where'])) {
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 
886 886
         $order = null;
887 887
         if (!empty($options['order'])) {
888
-            $order = " ORDER BY " . $options['order'];
888
+            $order = " ORDER BY ".$options['order'];
889 889
         }
890 890
 
891 891
         //TODO, fix create report without session
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
         /**
919 919
          *  Lessons
920 920
          */
921
-        $sql = "SELECT * FROM $tbl_course_lp WHERE c_id = %s ";  //AND session_id = %s
921
+        $sql = "SELECT * FROM $tbl_course_lp WHERE c_id = %s "; //AND session_id = %s
922 922
         $sql_query = sprintf($sql, $course['real_id']);
923 923
         $result = Database::query($sql_query);
924 924
         $arrLesson = array(array());
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
             if (empty($arrLesson[$row['session_id']]['lessons_total'])) {
927 927
                 $arrLesson[$row['session_id']]['lessons_total'] = 1;
928 928
             } else {
929
-                $arrLesson[$row['session_id']]['lessons_total'] ++;
929
+                $arrLesson[$row['session_id']]['lessons_total']++;
930 930
             }
931 931
         }
932 932
 
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
                 $course['real_id']
1001 1001
             );
1002 1002
             foreach ($user_list as $user_id) {
1003
-                isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id] ++ : $survey_user_list[$user_id] = 1;
1003
+                isset($survey_user_list[$user_id]) ? $survey_user_list[$user_id]++ : $survey_user_list[$user_id] = 1;
1004 1004
             }
1005 1005
         }
1006 1006
 
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
             $assignments_done = Tracking::count_student_assignments($user['user_id'], $course['code'], $user['id_session']);
1055 1055
             $assignments_left = $assignments_total - $assignments_done;
1056 1056
             if (!empty($assignments_total)) {
1057
-                $assignments_progress = round((( $assignments_done * 100 ) / $assignments_total), 2);
1057
+                $assignments_progress = round((($assignments_done * 100) / $assignments_total), 2);
1058 1058
             } else {
1059 1059
                 $assignments_progress = 0;
1060 1060
             }
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
             $wiki_read = $row['count'];
1085 1085
             $wiki_unread = $wiki_total - $wiki_read;
1086 1086
             if (!empty($wiki_total)) {
1087
-                $wiki_progress = round((( $wiki_read * 100 ) / $wiki_total), 2);
1087
+                $wiki_progress = round((($wiki_read * 100) / $wiki_total), 2);
1088 1088
             } else {
1089 1089
                 $wiki_progress = 0;
1090 1090
             }
@@ -1093,7 +1093,7 @@  discard block
 block discarded – undo
1093 1093
             $surveys_done = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0);
1094 1094
             $surveys_left = $surveys_total - $surveys_done;
1095 1095
             if (!empty($surveys_total)) {
1096
-                $surveys_progress = round((( $surveys_done * 100 ) / $surveys_total), 2);
1096
+                $surveys_progress = round((($surveys_done * 100) / $surveys_total), 2);
1097 1097
             } else {
1098 1098
                 $surveys_progress = 0;
1099 1099
             }
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
             );
1107 1107
             $forums_left = $forums_total - $forums_done;
1108 1108
             if (!empty($forums_total)) {
1109
-                $forums_progress = round((( $forums_done * 100 ) / $forums_total), 2);
1109
+                $forums_progress = round((($forums_done * 100) / $forums_total), 2);
1110 1110
             } else {
1111 1111
                 $forums_progress = 0;
1112 1112
             }
@@ -1114,58 +1114,58 @@  discard block
 block discarded – undo
1114 1114
             //Overall Total
1115 1115
             $overall_total = ($course_description_progress + $exercises_progress + $forums_progress + $assignments_progress + $wiki_progress + $surveys_progress) / 6;
1116 1116
 
1117
-            $link = '<a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/myStudents.php?student=' . $user[0] . '&details=true&course=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>';
1118
-            $linkForum = '<a href="' . api_get_path(WEB_CODE_PATH) . 'forum/index.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>';
1119
-            $linkWork = '<a href="' . api_get_path(WEB_CODE_PATH) . 'work/work.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>';
1120
-            $linkWiki = '<a href="' . api_get_path(WEB_CODE_PATH) . 'wiki/index.php?cidReq=' . $course['code'] . '&session_id=' . $user['id_session'] . '&action=statistics"> %s </a>';
1121
-            $linkSurvey = '<a href="' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?cidReq=' . $course['code'] . '&id_session=' . $user['id_session'] . '"> %s </a>';
1117
+            $link = '<a href="'.api_get_path(WEB_CODE_PATH).'mySpace/myStudents.php?student='.$user[0].'&details=true&course='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>';
1118
+            $linkForum = '<a href="'.api_get_path(WEB_CODE_PATH).'forum/index.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>';
1119
+            $linkWork = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>';
1120
+            $linkWiki = '<a href="'.api_get_path(WEB_CODE_PATH).'wiki/index.php?cidReq='.$course['code'].'&session_id='.$user['id_session'].'&action=statistics"> %s </a>';
1121
+            $linkSurvey = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?cidReq='.$course['code'].'&id_session='.$user['id_session'].'"> %s </a>';
1122 1122
 
1123 1123
             $table[] = array(
1124 1124
                 'lastname' => $user[1],
1125 1125
                 'firstname' => $user[2],
1126 1126
                 'username' => $user[3],
1127 1127
                 #'profile'   => '',
1128
-                'total' => round($overall_total, 2) . '%',
1129
-                'courses' => sprintf($link, $course_description_progress . '%'),
1130
-                'lessons' => sprintf($link, $lessons_progress . '%'),
1131
-                'exercises' => sprintf($link, $exercises_progress . '%'),
1132
-                'forums' => sprintf($link, $forums_progress . '%'),
1133
-                'homeworks' => sprintf($link, $assignments_progress . '%'),
1134
-                'wikis' => sprintf($link, $wiki_progress . '%'),
1135
-                'surveys' => sprintf($link, $surveys_progress . '%'),
1128
+                'total' => round($overall_total, 2).'%',
1129
+                'courses' => sprintf($link, $course_description_progress.'%'),
1130
+                'lessons' => sprintf($link, $lessons_progress.'%'),
1131
+                'exercises' => sprintf($link, $exercises_progress.'%'),
1132
+                'forums' => sprintf($link, $forums_progress.'%'),
1133
+                'homeworks' => sprintf($link, $assignments_progress.'%'),
1134
+                'wikis' => sprintf($link, $wiki_progress.'%'),
1135
+                'surveys' => sprintf($link, $surveys_progress.'%'),
1136 1136
                 //course description
1137
-                'course_description_progress' => $course_description_progress . '%',
1137
+                'course_description_progress' => $course_description_progress.'%',
1138 1138
                 //lessons
1139 1139
                 'lessons_total' => sprintf($link, $lessons_total),
1140 1140
                 'lessons_done' => sprintf($link, $lessons_done),
1141 1141
                 'lessons_left' => sprintf($link, $lessons_left),
1142
-                'lessons_progress' => sprintf($link, $lessons_progress . '%'),
1142
+                'lessons_progress' => sprintf($link, $lessons_progress.'%'),
1143 1143
                 //exercises
1144 1144
                 'exercises_total' => sprintf($link, $exercises_total),
1145 1145
                 'exercises_done' => sprintf($link, $exercises_done),
1146 1146
                 'exercises_left' => sprintf($link, $exercises_left),
1147
-                'exercises_progress' => sprintf($link, $exercises_progress . '%'),
1147
+                'exercises_progress' => sprintf($link, $exercises_progress.'%'),
1148 1148
                 //forums
1149 1149
                 'forums_total' => sprintf($linkForum, $forums_total),
1150 1150
                 'forums_done' => sprintf($linkForum, $forums_done),
1151 1151
                 'forums_left' => sprintf($linkForum, $forums_left),
1152
-                'forums_progress' => sprintf($linkForum, $forums_progress . '%'),
1152
+                'forums_progress' => sprintf($linkForum, $forums_progress.'%'),
1153 1153
                 //assignments
1154 1154
                 'assignments_total' => sprintf($linkWork, $assignments_total),
1155 1155
                 'assignments_done' => sprintf($linkWork, $assignments_done),
1156 1156
                 'assignments_left' => sprintf($linkWork, $assignments_left),
1157
-                'assignments_progress' => sprintf($linkWork, $assignments_progress . '%'),
1157
+                'assignments_progress' => sprintf($linkWork, $assignments_progress.'%'),
1158 1158
                 //wiki
1159 1159
                 'wiki_total' => sprintf($linkWiki, $wiki_total),
1160 1160
                 'wiki_revisions' => sprintf($linkWiki, $wiki_revisions),
1161 1161
                 'wiki_read' => sprintf($linkWiki, $wiki_read),
1162 1162
                 'wiki_unread' => sprintf($linkWiki, $wiki_unread),
1163
-                'wiki_progress' => sprintf($linkWiki, $wiki_progress . '%'),
1163
+                'wiki_progress' => sprintf($linkWiki, $wiki_progress.'%'),
1164 1164
                 //survey
1165 1165
                 'surveys_total' => sprintf($linkSurvey, $surveys_total),
1166 1166
                 'surveys_done' => sprintf($linkSurvey, $surveys_done),
1167 1167
                 'surveys_left' => sprintf($linkSurvey, $surveys_left),
1168
-                'surveys_progress' => sprintf($linkSurvey, $surveys_progress . '%'),
1168
+                'surveys_progress' => sprintf($linkSurvey, $surveys_progress.'%'),
1169 1169
             );
1170 1170
         }
1171 1171
 
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
 
1246 1246
         $limit = null;
1247 1247
         if (!empty($options['limit'])) {
1248
-            $limit = " LIMIT " . $options['limit'];
1248
+            $limit = " LIMIT ".$options['limit'];
1249 1249
         }
1250 1250
 
1251 1251
         if (!empty($options['where'])) {
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
 
1255 1255
         $order = null;
1256 1256
         if (!empty($options['order'])) {
1257
-            $order = " ORDER BY " . $options['order'];
1257
+            $order = " ORDER BY ".$options['order'];
1258 1258
         }
1259 1259
 
1260 1260
         //TODO add course name
@@ -1267,7 +1267,7 @@  discard block
 block discarded – undo
1267 1267
                     " : "
1268 1268
                     u.lastname,
1269 1269
                     u.firstname,
1270
-                ") . "
1270
+                ")."
1271 1271
                 a.logout_course_date,
1272 1272
                 a.counter,
1273 1273
                 c.title,
@@ -1349,7 +1349,7 @@  discard block
 block discarded – undo
1349 1349
             if (Database::num_rows($result) > 0) {
1350 1350
                 $row = Database::fetch_array($result);
1351 1351
                 $count = $row['count'] + 1;
1352
-                $session_name = $session_name . '_' . $count;
1352
+                $session_name = $session_name.'_'.$count;
1353 1353
                 $result = self::session_name_exists($session_name);
1354 1354
                 if (!$result) {
1355 1355
                     return $session_name;
@@ -1844,7 +1844,7 @@  discard block
 block discarded – undo
1844 1844
         // Delete users from the session
1845 1845
         if ($empty_users === true) {
1846 1846
             $sql = "DELETE FROM $tbl_session_rel_user
1847
-                    WHERE session_id = $id_session AND relation_type<>" . SESSION_RELATION_TYPE_RRHH . "";
1847
+                    WHERE session_id = $id_session AND relation_type<>".SESSION_RELATION_TYPE_RRHH."";
1848 1848
             Database::query($sql);
1849 1849
         }
1850 1850
 
@@ -1855,7 +1855,7 @@  discard block
 block discarded – undo
1855 1855
             $enreg_user = Database::escape_string($enreg_user);
1856 1856
             $nbr_users++;
1857 1857
             $sql = "INSERT IGNORE INTO $tbl_session_rel_user (relation_type, session_id, user_id, registered_at)
1858
-                    VALUES (0, $id_session, $enreg_user, '" . api_get_utc_datetime() . "')";
1858
+                    VALUES (0, $id_session, $enreg_user, '".api_get_utc_datetime()."')";
1859 1859
             Database::query($sql);
1860 1860
         }
1861 1861
 
@@ -1945,9 +1945,9 @@  discard block
 block discarded – undo
1945 1945
         is_array($courseInfo) ? $courseId = $courseInfo['real_id'] : $courseId = $courseInfo;
1946 1946
 
1947 1947
         $statusCondition = null;
1948
-        if (isset($status) && !is_null($status))  {
1948
+        if (isset($status) && !is_null($status)) {
1949 1949
             $status = intval($status);
1950
-            $statusCondition  = " AND status = $status";
1950
+            $statusCondition = " AND status = $status";
1951 1951
         }
1952 1952
 
1953 1953
         foreach ($userList as $userId) {
@@ -2079,7 +2079,7 @@  discard block
 block discarded – undo
2079 2079
             if (empty($count)) {
2080 2080
                 // If user is not registered to a session then add it.
2081 2081
                 $sql = "INSERT IGNORE INTO $tbl_session_rel_user (session_id, user_id, registered_at)
2082
-                        VALUES ($session_id, $enreg_user, '" . api_get_utc_datetime() . "')";
2082
+                        VALUES ($session_id, $enreg_user, '".api_get_utc_datetime()."')";
2083 2083
                 Database::query($sql);
2084 2084
 
2085 2085
                 $sql = "UPDATE $tbl_session SET nbr_users = nbr_users + 1
@@ -2122,7 +2122,7 @@  discard block
 block discarded – undo
2122 2122
                 WHERE
2123 2123
                     session_id = $session_id AND
2124 2124
                     user_id = $user_id AND
2125
-                    relation_type <> " . SESSION_RELATION_TYPE_RRHH . "";
2125
+                    relation_type <> ".SESSION_RELATION_TYPE_RRHH."";
2126 2126
         $result = Database::query($sql);
2127 2127
         $return = Database::affected_rows($result);
2128 2128
 
@@ -2207,7 +2207,7 @@  discard block
 block discarded – undo
2207 2207
                 FROM $tbl_session_rel_user
2208 2208
                 WHERE
2209 2209
                     session_id = $sessionId AND
2210
-                    relation_type<>" . SESSION_RELATION_TYPE_RRHH;
2210
+                    relation_type<>".SESSION_RELATION_TYPE_RRHH;
2211 2211
         $result = Database::query($sql);
2212 2212
         $user_list = Database::store_result($result);
2213 2213
 
@@ -2218,7 +2218,7 @@  discard block
 block discarded – undo
2218 2218
 
2219 2219
                     $sql = "DELETE FROM $tbl_session_rel_course
2220 2220
                             WHERE
2221
-                                c_id = " . $existingCourse['c_id'] . " AND
2221
+                                c_id = ".$existingCourse['c_id']." AND
2222 2222
                                 session_id = $sessionId";
2223 2223
                     Database::query($sql);
2224 2224
 
@@ -2281,7 +2281,7 @@  discard block
 block discarded – undo
2281 2281
                             $links = $cat->get_links(null, false, $courseInfo['code'], 0);
2282 2282
 
2283 2283
                             $cat->set_session_id($sessionId);
2284
-                            $oldCategoryId= $cat->get_id();
2284
+                            $oldCategoryId = $cat->get_id();
2285 2285
                             $newId = $cat->add();
2286 2286
                             $newCategoryIdList[$oldCategoryId] = $newId;
2287 2287
                             $parentId = $cat->get_parent_id();
@@ -2468,7 +2468,7 @@  discard block
 block discarded – undo
2468 2468
         $return_value = false;
2469 2469
         $sql = "SELECT c_id FROM $tbl_session_course
2470 2470
                 WHERE
2471
-                  session_id = " . intval($session_id) . " AND
2471
+                  session_id = ".intval($session_id)." AND
2472 2472
                   c_id = " . intval($courseId);
2473 2473
         $result = Database::query($sql);
2474 2474
         $num = Database::num_rows($result);
@@ -2492,8 +2492,8 @@  discard block
 block discarded – undo
2492 2492
         }
2493 2493
 
2494 2494
         $sql = 'SELECT *
2495
-		        FROM ' . $tbl_session . '
2496
-		        WHERE name = "' . Database::escape_string($session_name) . '"';
2495
+		        FROM ' . $tbl_session.'
2496
+		        WHERE name = "' . Database::escape_string($session_name).'"';
2497 2497
         $result = Database::query($sql);
2498 2498
         $num = Database::num_rows($result);
2499 2499
         if ($num > 0) {
@@ -2533,8 +2533,8 @@  discard block
 block discarded – undo
2533 2533
         $month_end = intval($smonth_end);
2534 2534
         $day_end = intval($sday_end);
2535 2535
 
2536
-        $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start);
2537
-        $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end);
2536
+        $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start);
2537
+        $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end);
2538 2538
 
2539 2539
         if (empty($name)) {
2540 2540
             $msg = get_lang('SessionCategoryNameIsRequired');
@@ -2606,8 +2606,8 @@  discard block
 block discarded – undo
2606 2606
         $month_end = intval($smonth_end);
2607 2607
         $day_end = intval($sday_end);
2608 2608
         $id = intval($id);
2609
-        $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start);
2610
-        $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end);
2609
+        $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start);
2610
+        $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end);
2611 2611
 
2612 2612
         if (empty($name)) {
2613 2613
             $msg = get_lang('SessionCategoryNameIsRequired');
@@ -2627,13 +2627,13 @@  discard block
 block discarded – undo
2627 2627
         if ($date_end <> null) {
2628 2628
             $sql = "UPDATE $tbl_session_category
2629 2629
                     SET
2630
-                        name = '" . Database::escape_string($name) . "',
2630
+                        name = '".Database::escape_string($name)."',
2631 2631
                         date_start = '$date_start' ,
2632 2632
                         date_end = '$date_end'
2633 2633
                     WHERE id= $id";
2634 2634
         } else {
2635 2635
             $sql = "UPDATE $tbl_session_category SET
2636
-                        name = '" . Database::escape_string($name) . "',
2636
+                        name = '".Database::escape_string($name)."',
2637 2637
                         date_start = '$date_start',
2638 2638
                         date_end = NULL
2639 2639
                     WHERE id= $id";
@@ -2663,10 +2663,10 @@  discard block
 block discarded – undo
2663 2663
 
2664 2664
         //Setting session_category_id to 0
2665 2665
         $sql = "UPDATE $tbl_session SET session_category_id = 0
2666
-                WHERE session_category_id IN (" . $id_checked . ")";
2666
+                WHERE session_category_id IN (".$id_checked.")";
2667 2667
         Database::query($sql);
2668 2668
 
2669
-        $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (" . $id_checked . ")";
2669
+        $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (".$id_checked.")";
2670 2670
         $result = Database::query($sql);
2671 2671
         while ($rows = Database::fetch_array($result)) {
2672 2672
             $session_id = $rows['id'];
@@ -2678,7 +2678,7 @@  discard block
 block discarded – undo
2678 2678
                 }
2679 2679
             }
2680 2680
         }
2681
-        $sql = "DELETE FROM $tbl_session_category WHERE id IN (" . $id_checked . ")";
2681
+        $sql = "DELETE FROM $tbl_session_category WHERE id IN (".$id_checked.")";
2682 2682
         Database::query($sql);
2683 2683
 
2684 2684
         // Add event to system log
@@ -2751,7 +2751,7 @@  discard block
 block discarded – undo
2751 2751
                 $value = Database::escape_string($options['value']);
2752 2752
                 $sql_query .= ' AND ';
2753 2753
                 if (in_array($field, $availableFields) && in_array($operator, $availableOperator)) {
2754
-                    $sql_query .= $field . " $operator '" . $value . "'";
2754
+                    $sql_query .= $field." $operator '".$value."'";
2755 2755
                 }
2756 2756
             }
2757 2757
         }
@@ -2818,8 +2818,8 @@  discard block
 block discarded – undo
2818 2818
     {
2819 2819
         $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
2820 2820
         $id = api_get_current_access_url_id();
2821
-        $sql = 'SELECT * FROM ' . $tbl_session_category . '
2822
-                WHERE access_url_id = ' . $id . '
2821
+        $sql = 'SELECT * FROM '.$tbl_session_category.'
2822
+                WHERE access_url_id = ' . $id.'
2823 2823
                 ORDER BY name ASC';
2824 2824
         $result = Database::query($sql);
2825 2825
         if (Database::num_rows($result) > 0) {
@@ -2972,7 +2972,7 @@  discard block
 block discarded – undo
2972 2972
         $sql = "DELETE FROM $tbl_session_rel_user
2973 2973
                 WHERE
2974 2974
                     session_id = $sessionId AND                            
2975
-                    relation_type =" . SESSION_RELATION_TYPE_RRHH;
2975
+                    relation_type =".SESSION_RELATION_TYPE_RRHH;
2976 2976
         Database::query($sql);
2977 2977
 
2978 2978
         return true;
@@ -3026,12 +3026,12 @@  discard block
 block discarded – undo
3026 3026
                         ON (a.session_id = s.session_id)
3027 3027
                         WHERE
3028 3028
                             s.user_id = $userId AND
3029
-                            relation_type = " . SESSION_RELATION_TYPE_RRHH . " AND
3029
+                            relation_type = ".SESSION_RELATION_TYPE_RRHH." AND
3030 3030
                             access_url_id = " . api_get_current_access_url_id();
3031 3031
             } else {
3032 3032
                 $sql = "SELECT s.session_id 
3033 3033
                         FROM $tbl_session_rel_user s
3034
-                        WHERE user_id = $userId AND relation_type=" . SESSION_RELATION_TYPE_RRHH;
3034
+                        WHERE user_id = $userId AND relation_type=".SESSION_RELATION_TYPE_RRHH;
3035 3035
             }
3036 3036
             $result = Database::query($sql);
3037 3037
 
@@ -3041,7 +3041,7 @@  discard block
 block discarded – undo
3041 3041
                             WHERE
3042 3042
                                 session_id = {$row['session_id']} AND
3043 3043
                                 user_id = $userId AND
3044
-                                relation_type =" . SESSION_RELATION_TYPE_RRHH;
3044
+                                relation_type =".SESSION_RELATION_TYPE_RRHH;
3045 3045
                     Database::query($sql);
3046 3046
                 }
3047 3047
             }
@@ -3055,8 +3055,8 @@  discard block
 block discarded – undo
3055 3055
                         VALUES (
3056 3056
                             $session_id,
3057 3057
                             $userId,
3058
-                            '" . SESSION_RELATION_TYPE_RRHH . "',
3059
-                            '" . api_get_utc_datetime() . "'
3058
+                            '".SESSION_RELATION_TYPE_RRHH."',
3059
+                            '" . api_get_utc_datetime()."'
3060 3060
                         )";
3061 3061
                 Database::query($sql);
3062 3062
                 $affected_rows++;
@@ -3097,8 +3097,8 @@  discard block
 block discarded – undo
3097 3097
                     WHERE
3098 3098
                         sru.user_id = '$userId' AND
3099 3099
                         sru.session_id = '$sessionId' AND
3100
-                        sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' AND
3101
-                        access_url_id = " . api_get_current_access_url_id() . "
3100
+                        sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' AND
3101
+                        access_url_id = " . api_get_current_access_url_id()."
3102 3102
                         ";
3103 3103
         } else {
3104 3104
             $sql = "$select FROM $tbl_session s
@@ -3107,7 +3107,7 @@  discard block
 block discarded – undo
3107 3107
                         sru.session_id = s.id AND
3108 3108
                         sru.user_id = '$userId' AND
3109 3109
                         sru.session_id = '$sessionId' AND
3110
-                        sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "'
3110
+                        sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."'
3111 3111
                     ";
3112 3112
         }
3113 3113
 
@@ -3206,7 +3206,7 @@  discard block
 block discarded – undo
3206 3206
 
3207 3207
         $limitCondition = null;
3208 3208
         if (!empty($start) && !empty($limit)) {
3209
-            $limitCondition = " LIMIT " . intval($start) . ", " . intval($limit);
3209
+            $limitCondition = " LIMIT ".intval($start).", ".intval($limit);
3210 3210
         }
3211 3211
 
3212 3212
         if (empty($orderCondition)) {
@@ -3284,26 +3284,26 @@  discard block
 block discarded – undo
3284 3284
 
3285 3285
         $sessions = array();
3286 3286
         if (Database::num_rows($result) > 0) {
3287
-            $sysUploadPath = api_get_path(SYS_UPLOAD_PATH). 'sessions/';
3288
-            $webUploadPath = api_get_path(WEB_UPLOAD_PATH). 'sessions/';
3287
+            $sysUploadPath = api_get_path(SYS_UPLOAD_PATH).'sessions/';
3288
+            $webUploadPath = api_get_path(WEB_UPLOAD_PATH).'sessions/';
3289 3289
             $imgPath = Display::return_icon('session_default_small.png', null, null, null, null, true);
3290 3290
 
3291 3291
             $tableExtraFields = Database::get_main_table(TABLE_EXTRA_FIELD);
3292
-            $sql = "SELECT id FROM " . $tableExtraFields . "
3292
+            $sql = "SELECT id FROM ".$tableExtraFields."
3293 3293
                     WHERE extra_field_type = 3 AND variable='image'";
3294 3294
             $resultField = Database::query($sql);
3295 3295
             $imageFieldId = Database::fetch_assoc($resultField);
3296 3296
 
3297 3297
             while ($row = Database::fetch_array($result)) {
3298 3298
 
3299
-                $row['image'] =  null;
3300
-                $sessionImage = $sysUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png';
3299
+                $row['image'] = null;
3300
+                $sessionImage = $sysUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png';
3301 3301
 
3302 3302
                 if (is_file($sessionImage)) {
3303
-                    $sessionImage = $webUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png';
3303
+                    $sessionImage = $webUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png';
3304 3304
                     $row['image'] = $sessionImage;
3305 3305
                 } else {
3306
-                    $row['image'] =  $imgPath;
3306
+                    $row['image'] = $imgPath;
3307 3307
                 }
3308 3308
 
3309 3309
                 if ($row['display_start_date'] == '0000-00-00 00:00:00' || $row['display_start_date'] == '0000-00-00') {
@@ -3403,7 +3403,7 @@  discard block
 block discarded – undo
3403 3403
                 return intval($count['count']);
3404 3404
             }
3405 3405
 
3406
-            while ($row = Database::fetch_array($result,'ASSOC'))	{
3406
+            while ($row = Database::fetch_array($result, 'ASSOC')) {
3407 3407
                 $courses[$row['real_id']] = $row;
3408 3408
             }
3409 3409
         }
@@ -3447,7 +3447,7 @@  discard block
 block discarded – undo
3447 3447
         }
3448 3448
 
3449 3449
         $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
3450
-        $tbl_session_rel_course	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
3450
+        $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
3451 3451
 
3452 3452
         if ($getCount) {
3453 3453
             $select = "SELECT COUNT(DISTINCT(c.code)) as count ";
@@ -3472,7 +3472,7 @@  discard block
 block discarded – undo
3472 3472
 		        ";
3473 3473
         if ($getCount) {
3474 3474
             $result = Database::query($sql);
3475
-            $row = Database::fetch_array($result,'ASSOC');
3475
+            $row = Database::fetch_array($result, 'ASSOC');
3476 3476
             return $row['count'];
3477 3477
         }
3478 3478
 
@@ -3487,7 +3487,7 @@  discard block
 block discarded – undo
3487 3487
         $courses = array();
3488 3488
 
3489 3489
         if ($num_rows > 0) {
3490
-            while ($row = Database::fetch_array($result,'ASSOC'))	{
3490
+            while ($row = Database::fetch_array($result, 'ASSOC')) {
3491 3491
                 $courses[$row['id']] = $row;
3492 3492
             }
3493 3493
         }
@@ -3565,7 +3565,7 @@  discard block
 block discarded – undo
3565 3565
         $result = Database::query($sql);
3566 3566
         $num_rows = Database::num_rows($result);
3567 3567
         if ($num_rows > 0) {
3568
-            $row = Database::fetch_array($result,'ASSOC');
3568
+            $row = Database::fetch_array($result, 'ASSOC');
3569 3569
             return $row['count'];
3570 3570
         }
3571 3571
 
@@ -3684,9 +3684,9 @@  discard block
 block discarded – undo
3684 3684
 
3685 3685
             if ($access_url_id != -1) {
3686 3686
                 $sql = 'SELECT DISTINCT session.*
3687
-                    FROM ' . $session_table . ' session INNER JOIN ' . $tbl_session_rel_access_url . ' session_rel_url
3687
+                    FROM ' . $session_table.' session INNER JOIN '.$tbl_session_rel_access_url.' session_rel_url
3688 3688
                     ON (session.id = session_rel_url.session_id)
3689
-                    WHERE '.$sqlCoach.' access_url_id = ' . $access_url_id;
3689
+                    WHERE '.$sqlCoach.' access_url_id = '.$access_url_id;
3690 3690
             }
3691 3691
         }
3692 3692
         $sql .= ' ORDER by name';
@@ -3720,8 +3720,8 @@  discard block
 block discarded – undo
3720 3720
                 FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user
3721 3721
                 WHERE
3722 3722
                     session_rcru.user_id = user.user_id AND
3723
-                    session_rcru.session_id = '" . intval($session_id) . "' AND
3724
-                    session_rcru.c_id ='" . intval($courseId) . "' AND
3723
+                    session_rcru.session_id = '".intval($session_id)."' AND
3724
+                    session_rcru.c_id ='" . intval($courseId)."' AND
3725 3725
                     user.user_id = " . intval($user_id);
3726 3726
 
3727 3727
         $result = Database::query($sql);
@@ -3752,8 +3752,8 @@  discard block
 block discarded – undo
3752 3752
         $sql = "SELECT session_rcru.status
3753 3753
                 FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user
3754 3754
                 WHERE session_rcru.user_id = user.user_id AND
3755
-                    session_rcru.session_id = '" . intval($session_id) . "' AND
3756
-                    session_rcru.c_id ='" . intval($courseId) . "' AND
3755
+                    session_rcru.session_id = '".intval($session_id)."' AND
3756
+                    session_rcru.c_id ='" . intval($courseId)."' AND
3757 3757
                     user.user_id = " . intval($user_id);
3758 3758
         $result = Database::query($sql);
3759 3759
         $status = false;
@@ -3830,7 +3830,7 @@  discard block
 block discarded – undo
3830 3830
         // Get timestamp for now in UTC - see http://php.net/manual/es/function.time.php#117251
3831 3831
         $now = time() - date('Z');
3832 3832
         // Timestamp in one month
3833
-        $inOneMonth = $now + (30*24*3600);
3833
+        $inOneMonth = $now + (30 * 24 * 3600);
3834 3834
         $inOneMonth = api_get_local_time($inOneMonth);
3835 3835
         if (api_strtotime($s['access_start_date']) < $now) {
3836 3836
             $s['access_start_date'] = api_get_local_time($now);
@@ -3852,16 +3852,16 @@  discard block
 block discarded – undo
3852 3852
         }
3853 3853
         // Now try to create the session
3854 3854
         $sid = self::create_session(
3855
-            $s['name'] . ' ' . get_lang('CopyLabelSuffix'),
3855
+            $s['name'].' '.get_lang('CopyLabelSuffix'),
3856 3856
             $s['access_start_date'],
3857 3857
             $s['access_end_date'],
3858 3858
             $s['display_start_date'],
3859 3859
             $s['display_end_date'],
3860 3860
             $s['coach_access_start_date'],
3861 3861
             $s['coach_access_end_date'],
3862
-            (int)$s['id_coach'],
3862
+            (int) $s['id_coach'],
3863 3863
             $s['session_category_id'],
3864
-            (int)$s['visibility'],
3864
+            (int) $s['visibility'],
3865 3865
             true
3866 3866
         );
3867 3867
 
@@ -3975,7 +3975,7 @@  discard block
 block discarded – undo
3975 3975
         $session_table = Database::get_main_table(TABLE_MAIN_SESSION);
3976 3976
         $sql = "SELECT DISTINCT id
3977 3977
 	         	FROM $session_table
3978
-	         	WHERE session.id_coach =  '" . $user_id . "' AND id = '$session_id'";
3978
+	         	WHERE session.id_coach =  '".$user_id."' AND id = '$session_id'";
3979 3979
         $result = Database::query($sql);
3980 3980
         if ($result && Database::num_rows($result)) {
3981 3981
             return true;
@@ -3994,7 +3994,7 @@  discard block
 block discarded – undo
3994 3994
         $access_url_rel_session_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
3995 3995
         $sql = "SELECT count(id) FROM $session_table s";
3996 3996
         if (!empty($access_url_id) && $access_url_id == intval($access_url_id)) {
3997
-            $sql .= ", $access_url_rel_session_table u " .
3997
+            $sql .= ", $access_url_rel_session_table u ".
3998 3998
                 " WHERE s.id = u.session_id AND u.access_url_id = $access_url_id";
3999 3999
         }
4000 4000
         $res = Database::query($sql);
@@ -4233,7 +4233,7 @@  discard block
 block discarded – undo
4233 4233
 
4234 4234
         $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
4235 4235
         $tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
4236
-        $tbl_session_course  = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
4236
+        $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
4237 4237
         $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
4238 4238
 
4239 4239
         $sessions = array();
@@ -4369,10 +4369,10 @@  discard block
 block discarded – undo
4369 4369
                     $suffix = null;
4370 4370
                     while (!$unique_name) {
4371 4371
                         if ($i > 1) {
4372
-                            $suffix = ' - ' . $i;
4372
+                            $suffix = ' - '.$i;
4373 4373
                         }
4374
-                        $sql = 'SELECT 1 FROM ' . $tbl_session . '
4375
-                                WHERE name="' . Database::escape_string($session_name). $suffix . '"';
4374
+                        $sql = 'SELECT 1 FROM '.$tbl_session.'
4375
+                                WHERE name="' . Database::escape_string($session_name).$suffix.'"';
4376 4376
                         $rs = Database::query($sql);
4377 4377
 
4378 4378
                         if (Database::result($rs, 0, 0)) {
@@ -4385,14 +4385,14 @@  discard block
 block discarded – undo
4385 4385
 
4386 4386
                     // Creating the session.
4387 4387
                     $sql = "INSERT IGNORE INTO $tbl_session SET
4388
-                            name = '" . Database::escape_string($session_name). "',
4388
+                            name = '".Database::escape_string($session_name)."',
4389 4389
                             id_coach = '$coach_id',
4390 4390
                             access_start_date = '$dateStart',
4391 4391
                             access_end_date = '$dateEnd',
4392 4392
                             display_start_date = '$dateStart',
4393 4393
                             display_end_date = '$dateEnd',
4394 4394
                             visibility = '$visibilityAfterExpirationPerSession',                            
4395
-                            session_admin_id = " . $defaultUserId . " 
4395
+                            session_admin_id = ".$defaultUserId." 
4396 4396
                             $sessionCondition $extraParameters $extraSessionParameters";
4397 4397
                     Database::query($sql);
4398 4398
 
@@ -4458,7 +4458,7 @@  discard block
 block discarded – undo
4458 4458
 
4459 4459
                             // Delete session-user relation only for students
4460 4460
                             $sql = "DELETE FROM $tbl_session_user
4461
-                                    WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH;
4461
+                                    WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH;
4462 4462
                             Database::query($sql);
4463 4463
 
4464 4464
                             $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'";
@@ -4549,7 +4549,7 @@  discard block
 block discarded – undo
4549 4549
 
4550 4550
                             // Delete session-user relation only for students
4551 4551
                             $sql = "DELETE FROM $tbl_session_user
4552
-                                    WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH;
4552
+                                    WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH;
4553 4553
                             Database::query($sql);
4554 4554
 
4555 4555
                             $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'";
@@ -4592,7 +4592,7 @@  discard block
 block discarded – undo
4592 4592
                             $sql = "INSERT IGNORE INTO $tbl_session_user SET
4593 4593
                                     user_id = '$user_id',
4594 4594
                                     session_id = '$session_id',
4595
-                                    registered_at = '" . api_get_utc_datetime() . "'";
4595
+                                    registered_at = '".api_get_utc_datetime()."'";
4596 4596
                             Database::query($sql);
4597 4597
                             if ($debug) {
4598 4598
                                 $logger->addInfo("Sessions - Adding User #$user_id ($user) to session #$session_id");
@@ -5243,7 +5243,7 @@  discard block
 block discarded – undo
5243 5243
 
5244 5244
         if (!empty($lastConnectionDate)) {
5245 5245
             $lastConnectionDate = Database::escape_string($lastConnectionDate);
5246
-            $userConditions .=  " AND u.last_login <= '$lastConnectionDate' ";
5246
+            $userConditions .= " AND u.last_login <= '$lastConnectionDate' ";
5247 5247
         }
5248 5248
 
5249 5249
         if (!empty($keyword)) {
@@ -5313,7 +5313,7 @@  discard block
 block discarded – undo
5313 5313
         $result = Database::query($sql);
5314 5314
         $result = Database::store_result($result);
5315 5315
 
5316
-        return $result ;
5316
+        return $result;
5317 5317
     }
5318 5318
 
5319 5319
     /**
@@ -5373,7 +5373,7 @@  discard block
 block discarded – undo
5373 5373
                     $userToString = null;
5374 5374
                     foreach ($userList as $userInfo) {
5375 5375
                         $newUserList[] = $userInfo['user_id'];
5376
-                        $userToString .= $userInfo['firstname'] . ' ' . $userInfo['lastname'] . '<br />';
5376
+                        $userToString .= $userInfo['firstname'].' '.$userInfo['lastname'].'<br />';
5377 5377
                     }
5378 5378
 
5379 5379
                     if (!empty($sessionsDestination)) {
@@ -5386,7 +5386,7 @@  discard block
 block discarded – undo
5386 5386
                                 $messages[] = Display::return_message(sprintf(get_lang('SessionXSkipped'), $sessionDestinationId), 'warning', false);
5387 5387
                                 continue;
5388 5388
                             }
5389
-                            $messages[] = Display::return_message(get_lang('StudentList') . '<br />' . $userToString, 'info', false);
5389
+                            $messages[] = Display::return_message(get_lang('StudentList').'<br />'.$userToString, 'info', false);
5390 5390
                             SessionManager::subscribe_users_to_session(
5391 5391
                                 $sessionDestinationId,
5392 5392
                                 $newUserList,
@@ -5441,7 +5441,7 @@  discard block
 block discarded – undo
5441 5441
                 }
5442 5442
             }
5443 5443
         }
5444
-        $sessionUrl = api_get_path(WEB_CODE_PATH) . 'admin/resume_session.php?id_session=';
5444
+        $sessionUrl = api_get_path(WEB_CODE_PATH).'admin/resume_session.php?id_session=';
5445 5445
 
5446 5446
         $htmlResult = null;
5447 5447
 
@@ -5456,7 +5456,7 @@  discard block
 block discarded – undo
5456 5456
                     $sessionInfo = self::fetch($sessionId);
5457 5457
                     $htmlResult .= '<br />';
5458 5458
                     $htmlResult .= Display::url(
5459
-                        get_lang('Session') . ': ' . $sessionInfo['name'] . ' <br />', $sessionUrl . $sessionId, array('target' => '_blank')
5459
+                        get_lang('Session').': '.$sessionInfo['name'].' <br />', $sessionUrl.$sessionId, array('target' => '_blank')
5460 5460
                     );
5461 5461
                     $teacherList = array();
5462 5462
                     foreach ($coachList as $coachId) {
@@ -5569,7 +5569,7 @@  discard block
 block discarded – undo
5569 5569
                 }
5570 5570
 
5571 5571
                 $sessionIdList = array_map('intval', $sessionIdList);
5572
-                $sessionToString = implode("', '",  $sessionIdList);
5572
+                $sessionToString = implode("', '", $sessionIdList);
5573 5573
 
5574 5574
                 $course = Database::get_main_table(TABLE_MAIN_COURSE);
5575 5575
                 $sessionCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
@@ -5581,7 +5581,7 @@  discard block
 block discarded – undo
5581 5581
                         INNER JOIN $courseUser cu ON (cu.c_id = c.id)
5582 5582
 		                WHERE src.session_id IN ('$sessionToString') AND cu.status = 1";
5583 5583
                 $result = Database::query($sql);
5584
-                while($row = Database::fetch_array($result, 'ASSOC')) {
5584
+                while ($row = Database::fetch_array($result, 'ASSOC')) {
5585 5585
                     $teacherListId[$row['user_id']] = $row['user_id'];
5586 5586
                 }
5587 5587
             } else {
@@ -5656,7 +5656,7 @@  discard block
 block discarded – undo
5656 5656
         $toolList = self::getCourseToolToBeManaged();
5657 5657
 
5658 5658
         foreach ($toolList as $tool) {
5659
-            $method = 'add' . $tool;
5659
+            $method = 'add'.$tool;
5660 5660
             if (method_exists(get_class(), $method)) {
5661 5661
                 self::$method($sessionId, $courseId);
5662 5662
             }
@@ -5675,7 +5675,7 @@  discard block
 block discarded – undo
5675 5675
         $toolList = self::getCourseToolToBeManaged();
5676 5676
 
5677 5677
         foreach ($toolList as $tool) {
5678
-            $method = 'remove' . $tool;
5678
+            $method = 'remove'.$tool;
5679 5679
             if (method_exists(get_class(), $method)) {
5680 5680
                 self::$method($sessionId, $courseId);
5681 5681
             }
@@ -5793,18 +5793,18 @@  discard block
 block discarded – undo
5793 5793
                         }
5794 5794
                     }
5795 5795
 
5796
-                    $message .= '<strong>' . get_lang('User') . '</strong> ' . $userInfo['complete_name'] . ' <br />';
5796
+                    $message .= '<strong>'.get_lang('User').'</strong> '.$userInfo['complete_name'].' <br />';
5797 5797
 
5798 5798
                     if (!in_array($userInfo['status'], array(DRH)) && !api_is_platform_admin_by_id($userInfo['user_id'])) {
5799
-                        $message .= get_lang('UserMustHaveTheDrhRole') . '<br />';
5799
+                        $message .= get_lang('UserMustHaveTheDrhRole').'<br />';
5800 5800
                         continue;
5801 5801
                     }
5802 5802
 
5803 5803
                     if (!empty($sessionList)) {
5804
-                        $message .= '<strong>' . get_lang('Sessions') . ':</strong> <br />';
5805
-                        $message .= implode(', ', $sessionList) . '<br /><br />';
5804
+                        $message .= '<strong>'.get_lang('Sessions').':</strong> <br />';
5805
+                        $message .= implode(', ', $sessionList).'<br /><br />';
5806 5806
                     } else {
5807
-                        $message .= get_lang('NoSessionProvided') . ' <br /><br />';
5807
+                        $message .= get_lang('NoSessionProvided').' <br /><br />';
5808 5808
                     }
5809 5809
                 }
5810 5810
             }
@@ -5984,8 +5984,8 @@  discard block
 block discarded – undo
5984 5984
 
5985 5985
         $firstAccess = api_strtotime($courseAccess['login_course_date'], 'UTC');
5986 5986
 
5987
-        $endDateInSeconds = $firstAccess + $duration*24*60*60;
5988
-        $leftDays = round(($endDateInSeconds- $currentTime) / 60 / 60 / 24);
5987
+        $endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60;
5988
+        $leftDays = round(($endDateInSeconds - $currentTime) / 60 / 60 / 24);
5989 5989
 
5990 5990
         return $leftDays;
5991 5991
     }
@@ -6267,7 +6267,7 @@  discard block
 block discarded – undo
6267 6267
         $sql = "SELECT COUNT(1) as count, u.id, scu.status status_in_session, u.status user_status
6268 6268
                 FROM $tableSessionRelCourseRelUser scu
6269 6269
                 INNER JOIN $tableUser u ON scu.user_id = u.id
6270
-                WHERE scu.session_id = " . intval($sessionId) ."
6270
+                WHERE scu.session_id = ".intval($sessionId)."
6271 6271
                 GROUP BY u.id";
6272 6272
 
6273 6273
         $result = Database::query($sql);
@@ -6302,7 +6302,7 @@  discard block
 block discarded – undo
6302 6302
             $sfTable = Database::get_main_table(TABLE_EXTRA_FIELD);
6303 6303
             $sfvTable = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
6304 6304
             // Join session field and session field values tables
6305
-            $joinTable = $sfTable . ' sf INNER JOIN ' . $sfvTable . ' sfv ON sf.id = sfv.field_id';
6305
+            $joinTable = $sfTable.' sf INNER JOIN '.$sfvTable.' sfv ON sf.id = sfv.field_id';
6306 6306
             $fieldsArray = array();
6307 6307
             foreach ($extraFields as $field) {
6308 6308
                 $fieldsArray[] = Database::escape_string($field);
@@ -6345,14 +6345,14 @@  discard block
 block discarded – undo
6345 6345
                 for ($i = 1; $i < count($fieldsArray); $i++) {
6346 6346
                     $whereParams .= ', ?';
6347 6347
                 }
6348
-                $whereFieldVariables = ' variable IN ( ' . $whereParams .' )';
6349
-                $whereFieldIds = 'field_id IN ( ' . $whereParams .  ' )';
6348
+                $whereFieldVariables = ' variable IN ( '.$whereParams.' )';
6349
+                $whereFieldIds = 'field_id IN ( '.$whereParams.' )';
6350 6350
             }
6351 6351
             // Get session fields
6352 6352
             $extraField = new ExtraFieldModel('session');
6353 6353
             $questionMarks = substr(str_repeat('?, ', count($fieldsArray)), 0, -2);
6354 6354
             $fieldsList = $extraField->get_all(array(
6355
-                ' variable IN ( ' . $questionMarks . ' )' => $fieldsArray,
6355
+                ' variable IN ( '.$questionMarks.' )' => $fieldsArray,
6356 6356
             ));
6357 6357
             // Index session fields
6358 6358
             foreach ($fieldsList as $field) {
@@ -6361,7 +6361,7 @@  discard block
 block discarded – undo
6361 6361
             // Get session field values
6362 6362
             $extra = new ExtraFieldValue('session');
6363 6363
             $questionMarksFields = substr(str_repeat('?, ', count($fields)), 0, -2);
6364
-            $sessionFieldValueList = $extra->get_all(array ('where' => array('field_id IN ( ' . $questionMarksFields . ' )' => array_keys($fields))));
6364
+            $sessionFieldValueList = $extra->get_all(array('where' => array('field_id IN ( '.$questionMarksFields.' )' => array_keys($fields))));
6365 6365
             // Add session fields values to session list
6366 6366
             foreach ($sessionList as $id => &$session) {
6367 6367
                 foreach ($sessionFieldValueList as $sessionFieldValue) {
@@ -6414,7 +6414,7 @@  discard block
 block discarded – undo
6414 6414
             // Check the result
6415 6415
             if ($result < 1) {
6416 6416
                 // If not found any result, update error message
6417
-                $errorResult['errorMessage'] = 'Not found any session category name ' . $categoryName;
6417
+                $errorResult['errorMessage'] = 'Not found any session category name '.$categoryName;
6418 6418
             } elseif (count($result) > 1 && !$force) {
6419 6419
                 // If found more than one result and force is disabled, update error message
6420 6420
                 $errorResult['errorMessage'] = 'Found many session categories';
@@ -6473,7 +6473,7 @@  discard block
 block discarded – undo
6473 6473
             // Check if session list query had result
6474 6474
             if (!empty($sessionList)) {
6475 6475
                 // implode all session id
6476
-                $sessionIdsString = '(' . implode(', ', array_keys($sessionList)) . ')';
6476
+                $sessionIdsString = '('.implode(', ', array_keys($sessionList)).')';
6477 6477
                 // Get all field variables
6478 6478
                 $sessionFieldList = Database::select(
6479 6479
                     'id, variable',
@@ -6560,7 +6560,7 @@  discard block
 block discarded – undo
6560 6560
                 return $sessionList;
6561 6561
             } else {
6562 6562
                 // Not found result, update error message
6563
-                $errorResult['errorMessage'] = 'Not found any session for session category id ' . $sessionCategoryId;
6563
+                $errorResult['errorMessage'] = 'Not found any session for session category id '.$sessionCategoryId;
6564 6564
             }
6565 6565
         }
6566 6566
 
@@ -6664,7 +6664,7 @@  discard block
 block discarded – undo
6664 6664
 
6665 6665
         $sessionExtraField = new ExtraFieldModel('session');
6666 6666
         $fieldList = $sessionExtraField->get_all(array(
6667
-            "variable IN ( " . implode(", ", $variablePlaceHolders) . " ) " => $variables,
6667
+            "variable IN ( ".implode(", ", $variablePlaceHolders)." ) " => $variables,
6668 6668
         ));
6669 6669
 
6670 6670
         $fields = array();
@@ -6678,7 +6678,7 @@  discard block
 block discarded – undo
6678 6678
         $extra = new ExtraFieldValue('session');
6679 6679
         $sessionFieldValueList = $extra->get_all(
6680 6680
             array(
6681
-                "field_id IN ( " . implode(", ", $variablePlaceHolders) . " )" => array_keys($fields),
6681
+                "field_id IN ( ".implode(", ", $variablePlaceHolders)." )" => array_keys($fields),
6682 6682
             )
6683 6683
         );
6684 6684
 
@@ -6749,7 +6749,7 @@  discard block
 block discarded – undo
6749 6749
                 FROM $sessionTable s
6750 6750
                 INNER JOIN $sessionUserTable sru ON s.id = sru.id_session
6751 6751
                 WHERE
6752
-                    (sru.id_user IN (" . implode(', ', $userIdList) . ")
6752
+                    (sru.id_user IN (".implode(', ', $userIdList).")
6753 6753
                     AND sru.relation_type = 0
6754 6754
                 )";
6755 6755
 
@@ -6765,7 +6765,7 @@  discard block
 block discarded – undo
6765 6765
                         WHERE
6766 6766
                             srau.access_url_id = $accessUrlId
6767 6767
                             AND (
6768
-                                sru.id_user IN (" . implode(', ', $userIdList) . ")
6768
+                                sru.id_user IN (".implode(', ', $userIdList).")
6769 6769
                                 AND sru.relation_type = 0
6770 6770
                             )";
6771 6771
             }
@@ -6786,7 +6786,7 @@  discard block
 block discarded – undo
6786 6786
      */
6787 6787
     public static function getSessionVisibility($sessionInfo)
6788 6788
     {
6789
-        switch($sessionInfo['visibility']) {
6789
+        switch ($sessionInfo['visibility']) {
6790 6790
             case 1:
6791 6791
                 return get_lang('ReadOnly');
6792 6792
             case 2:
@@ -6963,7 +6963,7 @@  discard block
 block discarded – undo
6963 6963
                     get_lang('CoachName'),
6964 6964
                     null,
6965 6965
                     [
6966
-                        'url' => api_get_path(WEB_AJAX_PATH) . 'session.ajax.php?a=search_general_coach',
6966
+                        'url' => api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=search_general_coach',
6967 6967
                         'width' => '100%',
6968 6968
                     ]
6969 6969
                 );
@@ -6974,7 +6974,7 @@  discard block
 block discarded – undo
6974 6974
         $form->addHtml('<div id="ajax_list_coachs"></div>');
6975 6975
 
6976 6976
         $form->addButtonAdvancedSettings('advanced_params');
6977
-        $form->addElement('html','<div id="advanced_params_options" style="display:none">');
6977
+        $form->addElement('html', '<div id="advanced_params_options" style="display:none">');
6978 6978
 
6979 6979
         $form->addSelect('session_category', get_lang('SessionCategory'), $categoriesOptions, array(
6980 6980
             'id' => 'session_category'
@@ -7141,16 +7141,16 @@  discard block
 block discarded – undo
7141 7141
         if (api_is_session_admin() &&
7142 7142
             api_get_setting('allow_session_admins_to_see_all_sessions') == 'false'
7143 7143
         ) {
7144
-            $where.=" WHERE s.session_admin_id = $user_id ";
7144
+            $where .= " WHERE s.session_admin_id = $user_id ";
7145 7145
         }
7146 7146
 
7147 7147
         if (!empty($options['where'])) {
7148 7148
             $options['where'] = str_replace('course_title', 'c.title', $options['where']);
7149
-            $options['where'] = str_replace("( session_active = '0' )", '1=1',  $options['where']);
7149
+            $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']);
7150 7150
 
7151 7151
             $options['where'] = str_replace(
7152 7152
                 array("AND session_active = '1'  )", " AND (  session_active = '1'  )"),
7153
-                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " )
7153
+                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ")
7154 7154
                 , $options['where']
7155 7155
             );
7156 7156
 
@@ -7192,10 +7192,10 @@  discard block
 block discarded – undo
7192 7192
                        $where ";
7193 7193
 
7194 7194
         if (api_is_multiple_url_enabled()) {
7195
-            $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7195
+            $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7196 7196
             $access_url_id = api_get_current_access_url_id();
7197 7197
             if ($access_url_id != -1) {
7198
-                $where.= " AND ar.access_url_id = $access_url_id ";
7198
+                $where .= " AND ar.access_url_id = $access_url_id ";
7199 7199
 
7200 7200
                 $query_rows = "SELECT count(*) as total_rows
7201 7201
                                FROM $tbl_session s
@@ -7240,12 +7240,12 @@  discard block
 block discarded – undo
7240 7240
                     //get_lang('CourseTitle'),
7241 7241
                     get_lang('Visibility'),
7242 7242
                 );
7243
-                $column_model = array (
7244
-                    array('name'=>'name', 'index'=>'s.name', 'width'=>'160',  'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7245
-                    array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40',  'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7246
-                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7247
-                    array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'50',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)),
7248
-                    array('name'=>'visibility', 'index'=>'visibility',      'width'=>'40',   'align'=>'left', 'search' => 'false'),
7243
+                $column_model = array(
7244
+                    array('name'=>'name', 'index'=>'s.name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7245
+                    array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7246
+                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7247
+                    array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)),
7248
+                    array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
7249 7249
                 );
7250 7250
                 break;
7251 7251
             case 'complete':
@@ -7258,12 +7258,12 @@  discard block
 block discarded – undo
7258 7258
                     get_lang('Visibility'),
7259 7259
                     get_lang('CourseTitle'),
7260 7260
                 );
7261
-                $column_model = array (
7262
-                    array('name'=>'name', 'index'=>'s.name', 'width'=>'200',  'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7263
-                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7264
-                    array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'70',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)),
7265
-                    array('name'=>'coach_name', 'index'=>'coach_name',     'width'=>'70',   'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)),
7266
-                    array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25',   'align'=>'left', 'search' => 'true', 'stype'=>'select',
7261
+                $column_model = array(
7262
+                    array('name'=>'name', 'index'=>'s.name', 'width'=>'200', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7263
+                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7264
+                    array('name'=>'display_end_date', 'index'=>'display_end_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_one_month', 'sopt' => $date_operators)),
7265
+                    array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'70', 'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)),
7266
+                    array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25', 'align'=>'left', 'search' => 'true', 'stype'=>'select',
7267 7267
                         // for the bottom bar
7268 7268
                         'searchoptions' => array(
7269 7269
                             'defaultValue'  => '1',
@@ -7271,8 +7271,8 @@  discard block
 block discarded – undo
7271 7271
                         // for the top bar
7272 7272
                         'editoptions' => array('value' => '" ":'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive')),
7273 7273
                     ),
7274
-                    array('name'=>'visibility',     'index'=>'visibility',      'width'=>'40',   'align'=>'left', 'search' => 'false'),
7275
-                    array('name'=>'course_title',    'index'=>'course_title',   'width'=>'50',   'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true','sopt' => $operators)),
7274
+                    array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
7275
+                    array('name'=>'course_title', 'index'=>'course_title', 'width'=>'50', 'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true', 'sopt' => $operators)),
7276 7276
                 );
7277 7277
                 break;
7278 7278
         }
@@ -7281,14 +7281,14 @@  discard block
 block discarded – undo
7281 7281
         $session_field = new ExtraFieldModel('session');
7282 7282
         $rules = $session_field->getRules($columns, $column_model);
7283 7283
 
7284
-        $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80',  'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false');
7284
+        $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false', 'search' => 'false');
7285 7285
         $columns[] = get_lang('Actions');
7286 7286
 
7287 7287
         foreach ($column_model as $col_model) {
7288 7288
             $simple_column_name[] = $col_model['name'];
7289 7289
         }
7290 7290
 
7291
-        $return_array =  array(
7291
+        $return_array = array(
7292 7292
             'columns' => $columns,
7293 7293
             'column_model' => $column_model,
7294 7294
             'rules' => $rules,
@@ -7377,7 +7377,7 @@  discard block
 block discarded – undo
7377 7377
             if (api_is_session_admin() &&
7378 7378
                 api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false'
7379 7379
             ) {
7380
-                $where.=" AND s.session_admin_id = $user_id ";
7380
+                $where .= " AND s.session_admin_id = $user_id ";
7381 7381
             }
7382 7382
         }
7383 7383
 
@@ -7460,11 +7460,11 @@  discard block
 block discarded – undo
7460 7460
             }
7461 7461
             $options['where'] = str_replace('course_title', 'c.title', $options['where']);
7462 7462
 
7463
-            $options['where'] = str_replace("( session_active = '0' )", '1=1',  $options['where']);
7463
+            $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']);
7464 7464
 
7465 7465
             $options['where'] = str_replace(
7466 7466
                 array("AND session_active = '1'  )", " AND (  session_active = '1'  )"),
7467
-                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " )
7467
+                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ")
7468 7468
                 , $options['where']
7469 7469
             );
7470 7470
 
@@ -7499,10 +7499,10 @@  discard block
 block discarded – undo
7499 7499
             $where;
7500 7500
 
7501 7501
         if (api_is_multiple_url_enabled()) {
7502
-            $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7502
+            $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7503 7503
             $access_url_id = api_get_current_access_url_id();
7504 7504
             if ($access_url_id != -1) {
7505
-                $where.= " AND ar.access_url_id = $access_url_id ";
7505
+                $where .= " AND ar.access_url_id = $access_url_id ";
7506 7506
                 $query = "$select
7507 7507
                     FROM $tbl_session s
7508 7508
                     LEFT JOIN $tbl_session_field_values fv ON (fv.session_id = s.id)
@@ -7529,7 +7529,7 @@  discard block
 block discarded – undo
7529 7529
         $formatted_sessions = array();
7530 7530
 
7531 7531
         if (Database::num_rows($result)) {
7532
-            $sessions   = Database::store_result($result, 'ASSOC');
7532
+            $sessions = Database::store_result($result, 'ASSOC');
7533 7533
             foreach ($sessions as $session) {
7534 7534
                 $session_id = $session['id'];
7535 7535
                 $session['name'] = Display::url($session['name'], "resume_session.php?id_session=".$session['id']);
@@ -7544,14 +7544,14 @@  discard block
 block discarded – undo
7544 7544
 
7545 7545
                 switch ($session['visibility']) {
7546 7546
                     case SESSION_VISIBLE_READ_ONLY: //1
7547
-                        $session['visibility'] =  get_lang('ReadOnly');
7547
+                        $session['visibility'] = get_lang('ReadOnly');
7548 7548
                         break;
7549 7549
                     case SESSION_VISIBLE:           //2
7550 7550
                     case SESSION_AVAILABLE:         //4
7551
-                        $session['visibility'] =  get_lang('Visible');
7551
+                        $session['visibility'] = get_lang('Visible');
7552 7552
                         break;
7553 7553
                     case SESSION_INVISIBLE:         //3
7554
-                        $session['visibility'] =  api_ucfirst(get_lang('Invisible'));
7554
+                        $session['visibility'] = api_ucfirst(get_lang('Invisible'));
7555 7555
                         break;
7556 7556
                 }
7557 7557
 
@@ -7627,7 +7627,7 @@  discard block
 block discarded – undo
7627 7627
         if (empty($session)) {
7628 7628
             return false;
7629 7629
         }
7630
-        return api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . $id;
7630
+        return api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$id;
7631 7631
     }
7632 7632
 
7633 7633
     /**
@@ -7645,7 +7645,7 @@  discard block
 block discarded – undo
7645 7645
             return false;
7646 7646
         }
7647 7647
         if (empty($courseId)) {
7648
-            return api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . $id;
7648
+            return api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$id;
7649 7649
         } else {
7650 7650
             $courseInfo = api_get_course_info_by_id($courseId);
7651 7651
             if ($courseInfo) {
@@ -7851,7 +7851,7 @@  discard block
 block discarded – undo
7851 7851
             // sort $listCat by catSessionName
7852 7852
             usort($listCat, 'self::compareBySessionName');
7853 7853
             // in each catSession sort sessionList by sessionName
7854
-            foreach($listCat as $i => $listCatSessionInfo) {
7854
+            foreach ($listCat as $i => $listCatSessionInfo) {
7855 7855
                 $listSessionList = $listCatSessionInfo['sessionList'];
7856 7856
                 usort($listSessionList, 'self::compareCatSessionInfo');
7857 7857
                 $listCat[$i]['sessionList'] = $listSessionList;
@@ -7866,8 +7866,8 @@  discard block
 block discarded – undo
7866 7866
             );
7867 7867
 
7868 7868
             $userCatId = intval($userCatId);
7869
-            $listResults[$userCatId]['courseInUserCategoryId'] =  $userCatId;
7870
-            $listResults[$userCatId]['courseInUserCategoryTitle'] =  $userCatTitle;
7869
+            $listResults[$userCatId]['courseInUserCategoryId'] = $userCatId;
7870
+            $listResults[$userCatId]['courseInUserCategoryTitle'] = $userCatTitle;
7871 7871
             $listResults[$userCatId]['courseInUserCatList'][] = $listOneCourse;
7872 7872
         }
7873 7873
 
@@ -7893,7 +7893,7 @@  discard block
 block discarded – undo
7893 7893
     {
7894 7894
         if ($listA['sessionName'] == $listB['sessionName']) {
7895 7895
             return 0;
7896
-        } else if($listA['sessionName'] > $listB['sessionName']) {
7896
+        } else if ($listA['sessionName'] > $listB['sessionName']) {
7897 7897
             return 1;
7898 7898
         } else {
7899 7899
             return -1;
@@ -7913,7 +7913,7 @@  discard block
 block discarded – undo
7913 7913
             return 1;
7914 7914
         } else if ($listA['catSessionName'] == $listB['catSessionName']) {
7915 7915
             return 0;
7916
-        } else if($listA['catSessionName'] > $listB['catSessionName']) {
7916
+        } else if ($listA['catSessionName'] > $listB['catSessionName']) {
7917 7917
             return 1;
7918 7918
         } else {
7919 7919
             return -1;
@@ -7929,7 +7929,7 @@  discard block
 block discarded – undo
7929 7929
     {
7930 7930
         if ($listA['courseInUserCategoryTitle'] == $listB['courseInUserCategoryTitle']) {
7931 7931
             return 0;
7932
-        } else if($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) {
7932
+        } else if ($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) {
7933 7933
             return 1;
7934 7934
         } else {
7935 7935
             return -1;
@@ -7945,7 +7945,7 @@  discard block
 block discarded – undo
7945 7945
     {
7946 7946
         if ($listA['title'] == $listB['title']) {
7947 7947
             return 0;
7948
-        } else if($listA['title'] > $listB['title']) {
7948
+        } else if ($listA['title'] > $listB['title']) {
7949 7949
             return 1;
7950 7950
         } else {
7951 7951
             return -1;
@@ -7991,8 +7991,8 @@  discard block
 block discarded – undo
7991 7991
 
7992 7992
                 $marginShift = 20;
7993 7993
                 if ($catSessionName != '') {
7994
-                    $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">' .
7995
-                        CourseManager::course_item_html($listParamsCatSession, true) . '</div>';
7994
+                    $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">'.
7995
+                        CourseManager::course_item_html($listParamsCatSession, true).'</div>';
7996 7996
                     $marginShift = 40;
7997 7997
                 }
7998 7998
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2896,10 +2896,11 @@
 block discarded – undo
2896 2896
                                 c_id = $courseId AND
2897 2897
                                 user_id = $user_id ";
2898 2898
                     $result = Database::query($sql);
2899
-                    if (Database::affected_rows($result) > 0)
2900
-                        return true;
2901
-                    else
2902
-                        return false;
2899
+                    if (Database::affected_rows($result) > 0) {
2900
+                                            return true;
2901
+                    } else {
2902
+                                            return false;
2903
+                    }
2903 2904
                 } else {
2904 2905
                     // The user is not subscribed to the session, so make sure
2905 2906
                     // he isn't subscribed to a course in this session either
Please login to merge, or discard this patch.
main/inc/lib/conditional_login.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
                     if (isset($condition['conditional_function']) && $condition['conditional_function']($user) == false) {
24 24
                         $_SESSION['conditional_login']['uid'] = $user['user_id'];
25 25
                         $_SESSION['conditional_login']['can_login'] = false;
26
-                        header("Location:". $condition['url']);
26
+                        header("Location:".$condition['url']);
27 27
                         exit();
28 28
                     }
29 29
                 }
Please login to merge, or discard this patch.