Completed
Push — 1.11.x ( 63a9c1...5396c4 )
by José
77:08 queued 37:00
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 4 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.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1604,8 +1604,10 @@  discard block
 block discarded – undo
1604 1604
         if (empty($session_visibility)) {
1605 1605
             $session_visibility = $session->getVisibility();
1606 1606
             //default status loaded if empty
1607
-            if (empty($session_visibility))
1608
-                $session_visibility = SESSION_VISIBLE_READ_ONLY; // by default readonly 1
1607
+            if (empty($session_visibility)) {
1608
+                            $session_visibility = SESSION_VISIBLE_READ_ONLY;
1609
+            }
1610
+            // by default readonly 1
1609 1611
         } else {
1610 1612
             if (!in_array($session_visibility, array(SESSION_VISIBLE_READ_ONLY, SESSION_VISIBLE, SESSION_INVISIBLE))) {
1611 1613
                 $session_visibility = SESSION_VISIBLE_READ_ONLY;
@@ -2819,10 +2821,11 @@  discard block
 block discarded – undo
2819 2821
                                 c_id = $courseId AND
2820 2822
                                 user_id = $user_id ";
2821 2823
                     $result = Database::query($sql);
2822
-                    if (Database::affected_rows($result) > 0)
2823
-                        return true;
2824
-                    else
2825
-                        return false;
2824
+                    if (Database::affected_rows($result) > 0) {
2825
+                                            return true;
2826
+                    } else {
2827
+                                            return false;
2828
+                    }
2826 2829
                 } else {
2827 2830
                     // The user is not subscribed to the session, so make sure
2828 2831
                     // he isn't subscribed to a course in this session either
Please login to merge, or discard this patch.
Doc Comments   +20 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1619,7 +1619,7 @@  discard block
 block discarded – undo
1619 1619
      * @param array $user_list
1620 1620
      * @param int $session_visibility
1621 1621
      * @param bool $empty_users
1622
-     * @return bool
1622
+     * @return false|null
1623 1623
      */
1624 1624
     public static function suscribe_users_to_session(
1625 1625
         $id_session,
@@ -1891,7 +1891,7 @@  discard block
 block discarded – undo
1891 1891
      * @param array $courseInfo
1892 1892
      * @param int $status
1893 1893
      * @param bool $updateTotal
1894
-     * @return bool
1894
+     * @return false|null
1895 1895
      */
1896 1896
     public static function removeUsersFromCourseSession(
1897 1897
         $userList,
@@ -1957,7 +1957,7 @@  discard block
 block discarded – undo
1957 1957
      * @param string $course_code
1958 1958
      * @param int $session_visibility
1959 1959
      * @param bool $removeUsersNotInList
1960
-     * @return bool
1960
+     * @return false|null
1961 1961
      */
1962 1962
     public static function subscribe_users_to_session_course(
1963 1963
         $user_list,
@@ -2140,7 +2140,7 @@  discard block
 block discarded – undo
2140 2140
      * @param	bool	$removeExistingCoursesWithUsers Whether to unsubscribe
2141 2141
      * existing courses and users (true, default) or not (false)
2142 2142
      * @param $copyEvaluation from base course to session course
2143
-     * @return	void	Nothing, or false on error
2143
+     * @return	false|null	Nothing, or false on error
2144 2144
      * */
2145 2145
     public static function add_courses_to_session(
2146 2146
         $sessionId,
@@ -2336,6 +2336,8 @@  discard block
 block discarded – undo
2336 2336
      *
2337 2337
      * @param int Session id
2338 2338
      * @param int Course id
2339
+     * @param integer $session_id
2340
+     * @param integer $course_id
2339 2341
      * @return bool True in case of success, false otherwise
2340 2342
      */
2341 2343
     public static function unsubscribe_course_from_session($session_id, $course_id)
@@ -2391,7 +2393,7 @@  discard block
 block discarded – undo
2391 2393
      * @param	string	$variable Field's internal variable name
2392 2394
      * @param	int		$fieldType Field's type
2393 2395
      * @param	string	$displayText Field's language var name
2394
-     * @return int     new extra field id
2396
+     * @return boolean     new extra field id
2395 2397
      */
2396 2398
     public static function create_session_extra_field($variable, $fieldType, $displayText)
2397 2399
     {
@@ -2615,7 +2617,7 @@  discard block
 block discarded – undo
2615 2617
      * @param	array	id_checked
2616 2618
      * @param	bool	include delete session
2617 2619
      * @param	bool	optional, true if the function is called by a webservice, false otherwise.
2618
-     * @return	void	Nothing, or false on error
2620
+     * @return	boolean	Nothing, or false on error
2619 2621
      * The parameters is a array to delete sessions
2620 2622
      * */
2621 2623
     public static function delete_session_category($id_checked, $delete_session = false, $from_ws = false)
@@ -3381,8 +3383,8 @@  discard block
 block discarded – undo
3381 3383
     /**
3382 3384
      * Gets the list of courses by session filtered by access_url
3383 3385
      *
3384
-     * @param $userId
3385
-     * @param $sessionId
3386
+     * @param integer $userId
3387
+     * @param null|integer $sessionId
3386 3388
      * @param null $from
3387 3389
      * @param null $limit
3388 3390
      * @param null $column
@@ -3507,6 +3509,7 @@  discard block
 block discarded – undo
3507 3509
     /**
3508 3510
      * Gets the count of courses by session filtered by access_url
3509 3511
      * @param int session id
3512
+     * @param integer $session_id
3510 3513
      * @return array list of courses
3511 3514
      */
3512 3515
     public static function getCourseCountBySessionId($session_id, $keyword = null)
@@ -3758,6 +3761,7 @@  discard block
 block discarded – undo
3758 3761
      * Updates a session status
3759 3762
      * @param	int 	session id
3760 3763
      * @param	int 	status
3764
+     * @param integer $status
3761 3765
      */
3762 3766
     public static function set_session_status($session_id, $status)
3763 3767
     {
@@ -3966,7 +3970,7 @@  discard block
 block discarded – undo
3966 3970
      * Protect a session to be edited.
3967 3971
      * @param int $id
3968 3972
      * @param bool $checkSession
3969
-     * @return mixed | bool true if pass the check, api_not_allowed otherwise
3973
+     * @return boolean|null | bool true if pass the check, api_not_allowed otherwise
3970 3974
      */
3971 3975
     public static function protectSession($id, $checkSession = true)
3972 3976
     {
@@ -4074,7 +4078,7 @@  discard block
 block discarded – undo
4074 4078
 
4075 4079
     /**
4076 4080
      * @param $id
4077
-     * @return bool
4081
+     * @return null|boolean
4078 4082
      */
4079 4083
     public static function protect_teacher_session_edit($id)
4080 4084
     {
@@ -4138,7 +4142,7 @@  discard block
 block discarded – undo
4138 4142
      *  true: if the session exists it will be updated.
4139 4143
      *  false: if session exists a new session will be created adding a counter session1, session2, etc
4140 4144
      * @param int $defaultUserId
4141
-     * @param mixed $logger
4145
+     * @param Logger $logger
4142 4146
      * @param array $extraFields convert a file row to an extra field. Example in CSV file there's a SessionID then it will
4143 4147
      * converted to extra_external_session_id if you set this: array('SessionId' => 'extra_external_session_id')
4144 4148
      * @param string $extraFieldId
@@ -5441,7 +5445,6 @@  discard block
 block discarded – undo
5441 5445
      * @param string $lastConnectionDate
5442 5446
      * @param array $sessionIdList
5443 5447
      * @param array $studentIdList
5444
-     * @param int $userStatus STUDENT|COURSEMANAGER constants
5445 5448
      *
5446 5449
      * @return array|int
5447 5450
      */
@@ -5593,7 +5596,7 @@  discard block
 block discarded – undo
5593 5596
     /**
5594 5597
      * Get the list of course tools that have to be dealt with in case of
5595 5598
      * registering any course to a session
5596
-     * @return array The list of tools to be dealt with (literal names)
5599
+     * @return string[] The list of tools to be dealt with (literal names)
5597 5600
      */
5598 5601
     public static function getCourseToolToBeManaged()
5599 5602
     {
@@ -5607,7 +5610,7 @@  discard block
 block discarded – undo
5607 5610
      * Calls the methods bound to each tool when a course is registered into a session
5608 5611
      * @param int $sessionId
5609 5612
      * @param int $courseId
5610
-     * @return void
5613
+     * @return boolean|null
5611 5614
      */
5612 5615
     public static function installCourse($sessionId, $courseId)
5613 5616
     {
@@ -6247,6 +6250,7 @@  discard block
 block discarded – undo
6247 6250
      * @param int $categoryId The internal ID of the session category
6248 6251
      * @param string $target Value to search for in the session field values
6249 6252
      * @param array $extraFields A list of fields to be scanned and returned
6253
+     * @param DateTime $publicationDate
6250 6254
      * @return mixed
6251 6255
      */
6252 6256
     public static function getShortSessionListAndExtraByCategory($categoryId, $target, $extraFields = null, $publicationDate = null)
@@ -7577,7 +7581,7 @@  discard block
 block discarded – undo
7577 7581
     /**
7578 7582
      * Get link to the admin page for this session
7579 7583
      * @param   int $id Session ID
7580
-     * @return mixed    URL to the admin page to manage the session, or false on error
7584
+     * @return false|string    URL to the admin page to manage the session, or false on error
7581 7585
      */
7582 7586
     public static function getAdminPath($id)
7583 7587
     {
@@ -7594,7 +7598,7 @@  discard block
 block discarded – undo
7594 7598
      * If a course is provided, build the link to the course
7595 7599
      * @param   int $id Session ID
7596 7600
      * @param   int $courseId Course ID (optional) in case the link has to send straight to the course
7597
-     * @return mixed    URL to the page to use the session, or false on error
7601
+     * @return false|string    URL to the page to use the session, or false on error
7598 7602
      */
7599 7603
     public static function getPath($id, $courseId = 0)
7600 7604
     {
Please login to merge, or discard this patch.
Spacing   +191 added lines, -191 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;
@@ -1810,7 +1810,7 @@  discard block
 block discarded – undo
1810 1810
         // Delete users from the session
1811 1811
         if ($empty_users === true) {
1812 1812
             $sql = "DELETE FROM $tbl_session_rel_user
1813
-                    WHERE session_id = $id_session AND relation_type<>" . SESSION_RELATION_TYPE_RRHH . "";
1813
+                    WHERE session_id = $id_session AND relation_type<>".SESSION_RELATION_TYPE_RRHH."";
1814 1814
             Database::query($sql);
1815 1815
         }
1816 1816
 
@@ -1821,7 +1821,7 @@  discard block
 block discarded – undo
1821 1821
             $enreg_user = Database::escape_string($enreg_user);
1822 1822
             $nbr_users++;
1823 1823
             $sql = "INSERT IGNORE INTO $tbl_session_rel_user (relation_type, session_id, user_id, registered_at)
1824
-                    VALUES (0, $id_session, $enreg_user, '" . api_get_utc_datetime() . "')";
1824
+                    VALUES (0, $id_session, $enreg_user, '".api_get_utc_datetime()."')";
1825 1825
             Database::query($sql);
1826 1826
         }
1827 1827
 
@@ -1911,9 +1911,9 @@  discard block
 block discarded – undo
1911 1911
         is_array($courseInfo) ? $courseId = $courseInfo['real_id'] : $courseId = $courseInfo;
1912 1912
 
1913 1913
         $statusCondition = null;
1914
-        if (isset($status) && !is_null($status))  {
1914
+        if (isset($status) && !is_null($status)) {
1915 1915
             $status = intval($status);
1916
-            $statusCondition  = " AND status = $status";
1916
+            $statusCondition = " AND status = $status";
1917 1917
         }
1918 1918
 
1919 1919
         foreach ($userList as $userId) {
@@ -2045,7 +2045,7 @@  discard block
 block discarded – undo
2045 2045
             if (empty($count)) {
2046 2046
                 // If user is not registered to a session then add it.
2047 2047
                 $sql = "INSERT IGNORE INTO $tbl_session_rel_user (session_id, user_id, registered_at)
2048
-                        VALUES ($session_id, $enreg_user, '" . api_get_utc_datetime() . "')";
2048
+                        VALUES ($session_id, $enreg_user, '".api_get_utc_datetime()."')";
2049 2049
                 Database::query($sql);
2050 2050
 
2051 2051
                 $sql = "UPDATE $tbl_session SET nbr_users = nbr_users + 1
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
 		               WHERE
2089 2089
                             session_id = $session_id AND
2090 2090
 		                    user_id = $user_id AND
2091
-		                    relation_type <> " . SESSION_RELATION_TYPE_RRHH . "";
2091
+		                    relation_type <> ".SESSION_RELATION_TYPE_RRHH."";
2092 2092
         $result = Database::query($delete_sql);
2093 2093
         $return = Database::affected_rows($result);
2094 2094
 
@@ -2172,7 +2172,7 @@  discard block
 block discarded – undo
2172 2172
                 FROM $tbl_session_rel_user
2173 2173
                 WHERE
2174 2174
                     session_id = $sessionId AND
2175
-                    relation_type<>" . SESSION_RELATION_TYPE_RRHH;
2175
+                    relation_type<>".SESSION_RELATION_TYPE_RRHH;
2176 2176
         $result = Database::query($sql);
2177 2177
         $user_list = Database::store_result($result);
2178 2178
 
@@ -2184,7 +2184,7 @@  discard block
 block discarded – undo
2184 2184
 
2185 2185
                     $sql = "DELETE FROM $tbl_session_rel_course
2186 2186
                             WHERE
2187
-                                c_id = " . $existingCourse['c_id'] . " AND
2187
+                                c_id = ".$existingCourse['c_id']." AND
2188 2188
                                 session_id = $sessionId";
2189 2189
                     Database::query($sql);
2190 2190
 
@@ -2247,7 +2247,7 @@  discard block
 block discarded – undo
2247 2247
                             $links = $cat->get_links(null, false, $courseInfo['code'], 0);
2248 2248
 
2249 2249
                             $cat->set_session_id($sessionId);
2250
-                            $oldCategoryId= $cat->get_id();
2250
+                            $oldCategoryId = $cat->get_id();
2251 2251
                             $newId = $cat->add();
2252 2252
                             $newCategoryIdList[$oldCategoryId] = $newId;
2253 2253
 
@@ -2435,8 +2435,8 @@  discard block
 block discarded – undo
2435 2435
         $return_value = false;
2436 2436
         $sql = "SELECT c_id FROM $tbl_session_course
2437 2437
                 WHERE
2438
-                  session_id = " . intval($session_id) . " AND
2439
-                  c_id = " . intval($courseId) . "";
2438
+                  session_id = ".intval($session_id)." AND
2439
+                  c_id = " . intval($courseId)."";
2440 2440
         $result = Database::query($sql);
2441 2441
         $num = Database::num_rows($result);
2442 2442
         if ($num > 0) {
@@ -2459,8 +2459,8 @@  discard block
 block discarded – undo
2459 2459
         }
2460 2460
 
2461 2461
         $sql = 'SELECT *
2462
-		        FROM ' . $tbl_session . '
2463
-		        WHERE name = "' . Database::escape_string($session_name) . '"';
2462
+		        FROM ' . $tbl_session.'
2463
+		        WHERE name = "' . Database::escape_string($session_name).'"';
2464 2464
         $result = Database::query($sql);
2465 2465
         $num = Database::num_rows($result);
2466 2466
         if ($num > 0) {
@@ -2500,8 +2500,8 @@  discard block
 block discarded – undo
2500 2500
         $month_end = intval($smonth_end);
2501 2501
         $day_end = intval($sday_end);
2502 2502
 
2503
-        $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start);
2504
-        $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end);
2503
+        $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start);
2504
+        $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end);
2505 2505
 
2506 2506
         if (empty($name)) {
2507 2507
             $msg = get_lang('SessionCategoryNameIsRequired');
@@ -2573,8 +2573,8 @@  discard block
 block discarded – undo
2573 2573
         $month_end = intval($smonth_end);
2574 2574
         $day_end = intval($sday_end);
2575 2575
         $id = intval($id);
2576
-        $date_start = "$year_start-" . (($month_start < 10) ? "0$month_start" : $month_start) . "-" . (($day_start < 10) ? "0$day_start" : $day_start);
2577
-        $date_end = "$year_end-" . (($month_end < 10) ? "0$month_end" : $month_end) . "-" . (($day_end < 10) ? "0$day_end" : $day_end);
2576
+        $date_start = "$year_start-".(($month_start < 10) ? "0$month_start" : $month_start)."-".(($day_start < 10) ? "0$day_start" : $day_start);
2577
+        $date_end = "$year_end-".(($month_end < 10) ? "0$month_end" : $month_end)."-".(($day_end < 10) ? "0$day_end" : $day_end);
2578 2578
 
2579 2579
         if (empty($name)) {
2580 2580
             $msg = get_lang('SessionCategoryNameIsRequired');
@@ -2594,13 +2594,13 @@  discard block
 block discarded – undo
2594 2594
         if ($date_end <> null) {
2595 2595
             $sql = "UPDATE $tbl_session_category
2596 2596
                     SET
2597
-                        name = '" . Database::escape_string($name) . "',
2597
+                        name = '".Database::escape_string($name)."',
2598 2598
                         date_start = '$date_start' ,
2599 2599
                         date_end = '$date_end'
2600 2600
                     WHERE id= $id";
2601 2601
         } else {
2602 2602
             $sql = "UPDATE $tbl_session_category SET
2603
-                        name = '" . Database::escape_string($name) . "',
2603
+                        name = '".Database::escape_string($name)."',
2604 2604
                         date_start = '$date_start',
2605 2605
                         date_end = NULL
2606 2606
                     WHERE id= $id";
@@ -2630,10 +2630,10 @@  discard block
 block discarded – undo
2630 2630
 
2631 2631
         //Setting session_category_id to 0
2632 2632
         $sql = "UPDATE $tbl_session SET session_category_id = 0
2633
-                WHERE session_category_id IN (" . $id_checked . ")";
2633
+                WHERE session_category_id IN (".$id_checked.")";
2634 2634
         Database::query($sql);
2635 2635
 
2636
-        $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (" . $id_checked . ")";
2636
+        $sql = "SELECT id FROM $tbl_session WHERE session_category_id IN (".$id_checked.")";
2637 2637
         $result = Database::query($sql);
2638 2638
         while ($rows = Database::fetch_array($result)) {
2639 2639
             $session_id = $rows['id'];
@@ -2645,7 +2645,7 @@  discard block
 block discarded – undo
2645 2645
                 }
2646 2646
             }
2647 2647
         }
2648
-        $sql = "DELETE FROM $tbl_session_category WHERE id IN (" . $id_checked . ")";
2648
+        $sql = "DELETE FROM $tbl_session_category WHERE id IN (".$id_checked.")";
2649 2649
         Database::query($sql);
2650 2650
 
2651 2651
         // Add event to system log
@@ -2718,7 +2718,7 @@  discard block
 block discarded – undo
2718 2718
                 $value = Database::escape_string($options['value']);
2719 2719
                 $sql_query .= ' AND ';
2720 2720
                 if (in_array($field, $availableFields) && in_array($operator, $availableOperator)) {
2721
-                    $sql_query .= $field . " $operator '" . $value . "'";
2721
+                    $sql_query .= $field." $operator '".$value."'";
2722 2722
                 }
2723 2723
             }
2724 2724
         }
@@ -2785,8 +2785,8 @@  discard block
 block discarded – undo
2785 2785
     {
2786 2786
         $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
2787 2787
         $id = api_get_current_access_url_id();
2788
-        $sql = 'SELECT * FROM ' . $tbl_session_category . '
2789
-                WHERE access_url_id = ' . $id . '
2788
+        $sql = 'SELECT * FROM '.$tbl_session_category.'
2789
+                WHERE access_url_id = ' . $id.'
2790 2790
                 ORDER BY name ASC';
2791 2791
         $result = Database::query($sql);
2792 2792
         if (Database::num_rows($result) > 0) {
@@ -2939,7 +2939,7 @@  discard block
 block discarded – undo
2939 2939
         $sql = "DELETE FROM $tbl_session_rel_user
2940 2940
                 WHERE
2941 2941
                     session_id = $sessionId AND                            
2942
-                    relation_type =" . SESSION_RELATION_TYPE_RRHH;
2942
+                    relation_type =".SESSION_RELATION_TYPE_RRHH;
2943 2943
         Database::query($sql);
2944 2944
 
2945 2945
         return true;
@@ -2993,12 +2993,12 @@  discard block
 block discarded – undo
2993 2993
                         ON (a.session_id = s.session_id)
2994 2994
                         WHERE
2995 2995
                             s.user_id = $userId AND
2996
-                            relation_type = " . SESSION_RELATION_TYPE_RRHH . " AND
2996
+                            relation_type = ".SESSION_RELATION_TYPE_RRHH." AND
2997 2997
                             access_url_id = " . api_get_current_access_url_id();
2998 2998
             } else {
2999 2999
                 $sql = "SELECT s.session_id 
3000 3000
                         FROM $tbl_session_rel_user s
3001
-                        WHERE user_id = $userId AND relation_type=" . SESSION_RELATION_TYPE_RRHH;
3001
+                        WHERE user_id = $userId AND relation_type=".SESSION_RELATION_TYPE_RRHH;
3002 3002
             }
3003 3003
             $result = Database::query($sql);
3004 3004
 
@@ -3008,7 +3008,7 @@  discard block
 block discarded – undo
3008 3008
                             WHERE
3009 3009
                                 session_id = {$row['session_id']} AND
3010 3010
                                 user_id = $userId AND
3011
-                                relation_type =" . SESSION_RELATION_TYPE_RRHH;
3011
+                                relation_type =".SESSION_RELATION_TYPE_RRHH;
3012 3012
                     Database::query($sql);
3013 3013
                 }
3014 3014
             }
@@ -3022,8 +3022,8 @@  discard block
 block discarded – undo
3022 3022
                         VALUES (
3023 3023
                             $session_id,
3024 3024
                             $userId,
3025
-                            '" . SESSION_RELATION_TYPE_RRHH . "',
3026
-                            '" . api_get_utc_datetime() . "'
3025
+                            '".SESSION_RELATION_TYPE_RRHH."',
3026
+                            '" . api_get_utc_datetime()."'
3027 3027
                         )";
3028 3028
                 Database::query($sql);
3029 3029
                 $affected_rows++;
@@ -3064,8 +3064,8 @@  discard block
 block discarded – undo
3064 3064
                     WHERE
3065 3065
                         sru.user_id = '$userId' AND
3066 3066
                         sru.session_id = '$sessionId' AND
3067
-                        sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "' AND
3068
-                        access_url_id = " . api_get_current_access_url_id() . "
3067
+                        sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."' AND
3068
+                        access_url_id = " . api_get_current_access_url_id()."
3069 3069
                         ";
3070 3070
         } else {
3071 3071
             $sql = "$select FROM $tbl_session s
@@ -3074,7 +3074,7 @@  discard block
 block discarded – undo
3074 3074
                         sru.session_id = s.id AND
3075 3075
                         sru.user_id = '$userId' AND
3076 3076
                         sru.session_id = '$sessionId' AND
3077
-                        sru.relation_type = '" . SESSION_RELATION_TYPE_RRHH . "'
3077
+                        sru.relation_type = '".SESSION_RELATION_TYPE_RRHH."'
3078 3078
                     ";
3079 3079
         }
3080 3080
 
@@ -3173,7 +3173,7 @@  discard block
 block discarded – undo
3173 3173
 
3174 3174
         $limitCondition = null;
3175 3175
         if (!empty($start) && !empty($limit)) {
3176
-            $limitCondition = " LIMIT " . intval($start) . ", " . intval($limit);
3176
+            $limitCondition = " LIMIT ".intval($start).", ".intval($limit);
3177 3177
         }
3178 3178
 
3179 3179
         if (empty($orderCondition)) {
@@ -3251,26 +3251,26 @@  discard block
 block discarded – undo
3251 3251
 
3252 3252
         $sessions = array();
3253 3253
         if (Database::num_rows($result) > 0) {
3254
-            $sysUploadPath = api_get_path(SYS_UPLOAD_PATH). 'sessions/';
3255
-            $webUploadPath = api_get_path(WEB_UPLOAD_PATH). 'sessions/';
3254
+            $sysUploadPath = api_get_path(SYS_UPLOAD_PATH).'sessions/';
3255
+            $webUploadPath = api_get_path(WEB_UPLOAD_PATH).'sessions/';
3256 3256
             $imgPath = Display::return_icon('session_default_small.png', null, null, null, null, true);
3257 3257
 
3258 3258
             $tableExtraFields = Database::get_main_table(TABLE_EXTRA_FIELD);
3259
-            $sql = "SELECT id FROM " . $tableExtraFields . "
3259
+            $sql = "SELECT id FROM ".$tableExtraFields."
3260 3260
                     WHERE extra_field_type = 3 AND variable='image'";
3261 3261
             $resultField = Database::query($sql);
3262 3262
             $imageFieldId = Database::fetch_assoc($resultField);
3263 3263
 
3264 3264
             while ($row = Database::fetch_array($result)) {
3265 3265
 
3266
-                $row['image'] =  null;
3267
-                $sessionImage = $sysUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png';
3266
+                $row['image'] = null;
3267
+                $sessionImage = $sysUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png';
3268 3268
 
3269 3269
                 if (is_file($sessionImage)) {
3270
-                    $sessionImage = $webUploadPath . $imageFieldId['id'] . '_' . $row['id'] . '.png';
3270
+                    $sessionImage = $webUploadPath.$imageFieldId['id'].'_'.$row['id'].'.png';
3271 3271
                     $row['image'] = $sessionImage;
3272 3272
                 } else {
3273
-                    $row['image'] =  $imgPath;
3273
+                    $row['image'] = $imgPath;
3274 3274
                 }
3275 3275
 
3276 3276
                 if ($row['display_start_date'] == '0000-00-00 00:00:00' || $row['display_start_date'] == '0000-00-00') {
@@ -3370,7 +3370,7 @@  discard block
 block discarded – undo
3370 3370
                 return intval($count[0]);
3371 3371
             }
3372 3372
 
3373
-            while ($row = Database::fetch_array($result,'ASSOC'))	{
3373
+            while ($row = Database::fetch_array($result, 'ASSOC')) {
3374 3374
                 $courses[$row['real_id']] = $row;
3375 3375
             }
3376 3376
         }
@@ -3414,7 +3414,7 @@  discard block
 block discarded – undo
3414 3414
         }
3415 3415
 
3416 3416
         $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
3417
-        $tbl_session_rel_course	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
3417
+        $tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
3418 3418
 
3419 3419
         if ($getCount) {
3420 3420
             $select = "SELECT COUNT(DISTINCT(c.code)) as count ";
@@ -3439,7 +3439,7 @@  discard block
 block discarded – undo
3439 3439
 		        ";
3440 3440
         if ($getCount) {
3441 3441
             $result = Database::query($sql);
3442
-            $row = Database::fetch_array($result,'ASSOC');
3442
+            $row = Database::fetch_array($result, 'ASSOC');
3443 3443
             return $row['count'];
3444 3444
         }
3445 3445
 
@@ -3454,7 +3454,7 @@  discard block
 block discarded – undo
3454 3454
         $courses = array();
3455 3455
 
3456 3456
         if ($num_rows > 0) {
3457
-            while ($row = Database::fetch_array($result,'ASSOC'))	{
3457
+            while ($row = Database::fetch_array($result, 'ASSOC')) {
3458 3458
                 $courses[$row['id']] = $row;
3459 3459
             }
3460 3460
         }
@@ -3532,7 +3532,7 @@  discard block
 block discarded – undo
3532 3532
         $result = Database::query($sql);
3533 3533
         $num_rows = Database::num_rows($result);
3534 3534
         if ($num_rows > 0) {
3535
-            $row = Database::fetch_array($result,'ASSOC');
3535
+            $row = Database::fetch_array($result, 'ASSOC');
3536 3536
             return $row['count'];
3537 3537
         }
3538 3538
 
@@ -3644,9 +3644,9 @@  discard block
 block discarded – undo
3644 3644
 
3645 3645
             if ($access_url_id != -1) {
3646 3646
                 $sql = 'SELECT DISTINCT session.*
3647
-                    FROM ' . $session_table . ' session INNER JOIN ' . $tbl_session_rel_access_url . ' session_rel_url
3647
+                    FROM ' . $session_table.' session INNER JOIN '.$tbl_session_rel_access_url.' session_rel_url
3648 3648
                     ON (session.id = session_rel_url.session_id)
3649
-                    WHERE '.$sqlCoach.' access_url_id = ' . $access_url_id;
3649
+                    WHERE '.$sqlCoach.' access_url_id = '.$access_url_id;
3650 3650
             }
3651 3651
         }
3652 3652
         $sql .= ' ORDER by name';
@@ -3680,8 +3680,8 @@  discard block
 block discarded – undo
3680 3680
                 FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user
3681 3681
                 WHERE
3682 3682
                     session_rcru.user_id = user.user_id AND
3683
-                    session_rcru.session_id = '" . intval($session_id) . "' AND
3684
-                    session_rcru.c_id ='" . intval($courseId) . "' AND
3683
+                    session_rcru.session_id = '".intval($session_id)."' AND
3684
+                    session_rcru.c_id ='" . intval($courseId)."' AND
3685 3685
                     user.user_id = " . intval($user_id);
3686 3686
 
3687 3687
         $result = Database::query($sql);
@@ -3712,8 +3712,8 @@  discard block
 block discarded – undo
3712 3712
         $sql = "SELECT session_rcru.status
3713 3713
                 FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user
3714 3714
                 WHERE session_rcru.user_id = user.user_id AND
3715
-                    session_rcru.session_id = '" . intval($session_id) . "' AND
3716
-                    session_rcru.c_id ='" . intval($courseId) . "' AND
3715
+                    session_rcru.session_id = '".intval($session_id)."' AND
3716
+                    session_rcru.c_id ='" . intval($courseId)."' AND
3717 3717
                     user.user_id = " . intval($user_id);
3718 3718
         $result = Database::query($sql);
3719 3719
         $status = false;
@@ -3790,7 +3790,7 @@  discard block
 block discarded – undo
3790 3790
         // Get timestamp for now in UTC - see http://php.net/manual/es/function.time.php#117251
3791 3791
         $now = time() - date('Z');
3792 3792
         // Timestamp in one month
3793
-        $inOneMonth = $now + (30*24*3600);
3793
+        $inOneMonth = $now + (30 * 24 * 3600);
3794 3794
         $inOneMonth = api_get_local_time($inOneMonth);
3795 3795
         if (api_strtotime($s['access_start_date']) < $now) {
3796 3796
             $s['access_start_date'] = api_get_local_time($now);
@@ -3812,16 +3812,16 @@  discard block
 block discarded – undo
3812 3812
         }
3813 3813
         // Now try to create the session
3814 3814
         $sid = self::create_session(
3815
-            $s['name'] . ' ' . get_lang('CopyLabelSuffix'),
3815
+            $s['name'].' '.get_lang('CopyLabelSuffix'),
3816 3816
             $s['access_start_date'],
3817 3817
             $s['access_end_date'],
3818 3818
             $s['display_start_date'],
3819 3819
             $s['display_end_date'],
3820 3820
             $s['coach_access_start_date'],
3821 3821
             $s['coach_access_end_date'],
3822
-            (int)$s['id_coach'],
3822
+            (int) $s['id_coach'],
3823 3823
             $s['session_category_id'],
3824
-            (int)$s['visibility'],
3824
+            (int) $s['visibility'],
3825 3825
             true
3826 3826
         );
3827 3827
 
@@ -3935,7 +3935,7 @@  discard block
 block discarded – undo
3935 3935
         $session_table = Database::get_main_table(TABLE_MAIN_SESSION);
3936 3936
         $sql = "SELECT DISTINCT id
3937 3937
 	         	FROM $session_table
3938
-	         	WHERE session.id_coach =  '" . $user_id . "' AND id = '$session_id'";
3938
+	         	WHERE session.id_coach =  '".$user_id."' AND id = '$session_id'";
3939 3939
         $result = Database::query($sql);
3940 3940
         if ($result && Database::num_rows($result)) {
3941 3941
             return true;
@@ -3954,7 +3954,7 @@  discard block
 block discarded – undo
3954 3954
         $access_url_rel_session_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
3955 3955
         $sql = "SELECT count(id) FROM $session_table s";
3956 3956
         if (!empty($access_url_id) && $access_url_id == intval($access_url_id)) {
3957
-            $sql .= ", $access_url_rel_session_table u " .
3957
+            $sql .= ", $access_url_rel_session_table u ".
3958 3958
                 " WHERE s.id = u.session_id AND u.access_url_id = $access_url_id";
3959 3959
         }
3960 3960
         $res = Database::query($sql);
@@ -4192,7 +4192,7 @@  discard block
 block discarded – undo
4192 4192
 
4193 4193
         $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
4194 4194
         $tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
4195
-        $tbl_session_course  = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
4195
+        $tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
4196 4196
         $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
4197 4197
 
4198 4198
         $sessions = array();
@@ -4328,10 +4328,10 @@  discard block
 block discarded – undo
4328 4328
                     $suffix = null;
4329 4329
                     while (!$unique_name) {
4330 4330
                         if ($i > 1) {
4331
-                            $suffix = ' - ' . $i;
4331
+                            $suffix = ' - '.$i;
4332 4332
                         }
4333
-                        $sql = 'SELECT 1 FROM ' . $tbl_session . '
4334
-                                WHERE name="' . Database::escape_string($session_name). $suffix . '"';
4333
+                        $sql = 'SELECT 1 FROM '.$tbl_session.'
4334
+                                WHERE name="' . Database::escape_string($session_name).$suffix.'"';
4335 4335
                         $rs = Database::query($sql);
4336 4336
 
4337 4337
                         if (Database::result($rs, 0, 0)) {
@@ -4344,14 +4344,14 @@  discard block
 block discarded – undo
4344 4344
 
4345 4345
                     // Creating the session.
4346 4346
                     $sql = "INSERT IGNORE INTO $tbl_session SET
4347
-                            name = '" . Database::escape_string($session_name). "',
4347
+                            name = '".Database::escape_string($session_name)."',
4348 4348
                             id_coach = '$coach_id',
4349 4349
                             access_start_date = '$dateStart',
4350 4350
                             access_end_date = '$dateEnd',
4351 4351
                             display_start_date = '$dateStart',
4352 4352
                             display_end_date = '$dateEnd',
4353 4353
                             visibility = '$visibilityAfterExpirationPerSession',                            
4354
-                            session_admin_id = " . $defaultUserId . " 
4354
+                            session_admin_id = ".$defaultUserId." 
4355 4355
                             $sessionCondition $extraParameters $extraSessionParameters";
4356 4356
                     Database::query($sql);
4357 4357
 
@@ -4417,7 +4417,7 @@  discard block
 block discarded – undo
4417 4417
 
4418 4418
                             // Delete session-user relation only for students
4419 4419
                             $sql = "DELETE FROM $tbl_session_user
4420
-                                    WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH;
4420
+                                    WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH;
4421 4421
                             Database::query($sql);
4422 4422
 
4423 4423
                             $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'";
@@ -4508,7 +4508,7 @@  discard block
 block discarded – undo
4508 4508
 
4509 4509
                             // Delete session-user relation only for students
4510 4510
                             $sql = "DELETE FROM $tbl_session_user
4511
-                                    WHERE session_id = '$session_id' AND relation_type <> " . SESSION_RELATION_TYPE_RRHH;
4511
+                                    WHERE session_id = '$session_id' AND relation_type <> ".SESSION_RELATION_TYPE_RRHH;
4512 4512
                             Database::query($sql);
4513 4513
 
4514 4514
                             $sql = "DELETE FROM $tbl_session_course WHERE session_id = '$session_id'";
@@ -4551,7 +4551,7 @@  discard block
 block discarded – undo
4551 4551
                             $sql = "INSERT IGNORE INTO $tbl_session_user SET
4552 4552
                                     user_id = '$user_id',
4553 4553
                                     session_id = '$session_id',
4554
-                                    registered_at = '" . api_get_utc_datetime() . "'";
4554
+                                    registered_at = '".api_get_utc_datetime()."'";
4555 4555
                             Database::query($sql);
4556 4556
                             if ($debug) {
4557 4557
                                 $logger->addInfo("Sessions - Adding User #$user_id ($user) to session #$session_id");
@@ -5202,7 +5202,7 @@  discard block
 block discarded – undo
5202 5202
 
5203 5203
         if (!empty($lastConnectionDate)) {
5204 5204
             $lastConnectionDate = Database::escape_string($lastConnectionDate);
5205
-            $userConditions .=  " AND u.last_login <= '$lastConnectionDate' ";
5205
+            $userConditions .= " AND u.last_login <= '$lastConnectionDate' ";
5206 5206
         }
5207 5207
 
5208 5208
         if (!empty($keyword)) {
@@ -5272,7 +5272,7 @@  discard block
 block discarded – undo
5272 5272
         $result = Database::query($sql);
5273 5273
         $result = Database::store_result($result);
5274 5274
 
5275
-        return $result ;
5275
+        return $result;
5276 5276
     }
5277 5277
 
5278 5278
     /**
@@ -5332,7 +5332,7 @@  discard block
 block discarded – undo
5332 5332
                     $userToString = null;
5333 5333
                     foreach ($userList as $userInfo) {
5334 5334
                         $newUserList[] = $userInfo['user_id'];
5335
-                        $userToString .= $userInfo['firstname'] . ' ' . $userInfo['lastname'] . '<br />';
5335
+                        $userToString .= $userInfo['firstname'].' '.$userInfo['lastname'].'<br />';
5336 5336
                     }
5337 5337
 
5338 5338
                     if (!empty($sessionsDestination)) {
@@ -5345,7 +5345,7 @@  discard block
 block discarded – undo
5345 5345
                                 $messages[] = Display::return_message(sprintf(get_lang('SessionXSkipped'), $sessionDestinationId), 'warning', false);
5346 5346
                                 continue;
5347 5347
                             }
5348
-                            $messages[] = Display::return_message(get_lang('StudentList') . '<br />' . $userToString, 'info', false);
5348
+                            $messages[] = Display::return_message(get_lang('StudentList').'<br />'.$userToString, 'info', false);
5349 5349
                             SessionManager::suscribe_users_to_session(
5350 5350
                                 $sessionDestinationId,
5351 5351
                                 $newUserList,
@@ -5400,7 +5400,7 @@  discard block
 block discarded – undo
5400 5400
                 }
5401 5401
             }
5402 5402
         }
5403
-        $sessionUrl = api_get_path(WEB_CODE_PATH) . 'admin/resume_session.php?id_session=';
5403
+        $sessionUrl = api_get_path(WEB_CODE_PATH).'admin/resume_session.php?id_session=';
5404 5404
 
5405 5405
         $htmlResult = null;
5406 5406
 
@@ -5415,7 +5415,7 @@  discard block
 block discarded – undo
5415 5415
                     $sessionInfo = self::fetch($sessionId);
5416 5416
                     $htmlResult .= '<br />';
5417 5417
                     $htmlResult .= Display::url(
5418
-                        get_lang('Session') . ': ' . $sessionInfo['name'] . ' <br />', $sessionUrl . $sessionId, array('target' => '_blank')
5418
+                        get_lang('Session').': '.$sessionInfo['name'].' <br />', $sessionUrl.$sessionId, array('target' => '_blank')
5419 5419
                     );
5420 5420
                     $teacherList = array();
5421 5421
                     foreach ($coachList as $coachId) {
@@ -5528,7 +5528,7 @@  discard block
 block discarded – undo
5528 5528
                 }
5529 5529
 
5530 5530
                 $sessionIdList = array_map('intval', $sessionIdList);
5531
-                $sessionToString = implode("', '",  $sessionIdList);
5531
+                $sessionToString = implode("', '", $sessionIdList);
5532 5532
 
5533 5533
                 $course = Database::get_main_table(TABLE_MAIN_COURSE);
5534 5534
                 $sessionCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
@@ -5540,7 +5540,7 @@  discard block
 block discarded – undo
5540 5540
                         INNER JOIN $courseUser cu ON (cu.c_id = c.id)
5541 5541
 		                WHERE src.session_id IN ('$sessionToString') AND cu.status = 1";
5542 5542
                 $result = Database::query($sql);
5543
-                while($row = Database::fetch_array($result, 'ASSOC')) {
5543
+                while ($row = Database::fetch_array($result, 'ASSOC')) {
5544 5544
                     $teacherListId[$row['user_id']] = $row['user_id'];
5545 5545
                 }
5546 5546
             } else {
@@ -5615,7 +5615,7 @@  discard block
 block discarded – undo
5615 5615
         $toolList = self::getCourseToolToBeManaged();
5616 5616
 
5617 5617
         foreach ($toolList as $tool) {
5618
-            $method = 'add' . $tool;
5618
+            $method = 'add'.$tool;
5619 5619
             if (method_exists(get_class(), $method)) {
5620 5620
                 self::$method($sessionId, $courseId);
5621 5621
             }
@@ -5634,7 +5634,7 @@  discard block
 block discarded – undo
5634 5634
         $toolList = self::getCourseToolToBeManaged();
5635 5635
 
5636 5636
         foreach ($toolList as $tool) {
5637
-            $method = 'remove' . $tool;
5637
+            $method = 'remove'.$tool;
5638 5638
             if (method_exists(get_class(), $method)) {
5639 5639
                 self::$method($sessionId, $courseId);
5640 5640
             }
@@ -5752,18 +5752,18 @@  discard block
 block discarded – undo
5752 5752
                         }
5753 5753
                     }
5754 5754
 
5755
-                    $message .= '<strong>' . get_lang('User') . '</strong> ' . $userInfo['complete_name'] . ' <br />';
5755
+                    $message .= '<strong>'.get_lang('User').'</strong> '.$userInfo['complete_name'].' <br />';
5756 5756
 
5757 5757
                     if (!in_array($userInfo['status'], array(DRH)) && !api_is_platform_admin_by_id($userInfo['user_id'])) {
5758
-                        $message .= get_lang('UserMustHaveTheDrhRole') . '<br />';
5758
+                        $message .= get_lang('UserMustHaveTheDrhRole').'<br />';
5759 5759
                         continue;
5760 5760
                     }
5761 5761
 
5762 5762
                     if (!empty($sessionList)) {
5763
-                        $message .= '<strong>' . get_lang('Sessions') . ':</strong> <br />';
5764
-                        $message .= implode(', ', $sessionList) . '<br /><br />';
5763
+                        $message .= '<strong>'.get_lang('Sessions').':</strong> <br />';
5764
+                        $message .= implode(', ', $sessionList).'<br /><br />';
5765 5765
                     } else {
5766
-                        $message .= get_lang('NoSessionProvided') . ' <br /><br />';
5766
+                        $message .= get_lang('NoSessionProvided').' <br /><br />';
5767 5767
                     }
5768 5768
                 }
5769 5769
             }
@@ -5943,8 +5943,8 @@  discard block
 block discarded – undo
5943 5943
 
5944 5944
         $firstAccess = api_strtotime($courseAccess['login_course_date'], 'UTC');
5945 5945
 
5946
-        $endDateInSeconds = $firstAccess + $duration*24*60*60;
5947
-        $leftDays = round(($endDateInSeconds- $currentTime) / 60 / 60 / 24);
5946
+        $endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60;
5947
+        $leftDays = round(($endDateInSeconds - $currentTime) / 60 / 60 / 24);
5948 5948
 
5949 5949
         return $leftDays;
5950 5950
     }
@@ -6226,7 +6226,7 @@  discard block
 block discarded – undo
6226 6226
         $sql = "SELECT COUNT(1) as count, u.id, scu.status status_in_session, u.status user_status
6227 6227
                 FROM $tableSessionRelCourseRelUser scu
6228 6228
                 INNER JOIN $tableUser u ON scu.user_id = u.id
6229
-                WHERE scu.session_id = " . intval($sessionId) ."
6229
+                WHERE scu.session_id = ".intval($sessionId)."
6230 6230
                 GROUP BY u.id";
6231 6231
 
6232 6232
         $result = Database::query($sql);
@@ -6261,7 +6261,7 @@  discard block
 block discarded – undo
6261 6261
             $sfTable = Database::get_main_table(TABLE_EXTRA_FIELD);
6262 6262
             $sfvTable = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
6263 6263
             // Join session field and session field values tables
6264
-            $joinTable = $sfTable . ' sf INNER JOIN ' . $sfvTable . ' sfv ON sf.id = sfv.field_id';
6264
+            $joinTable = $sfTable.' sf INNER JOIN '.$sfvTable.' sfv ON sf.id = sfv.field_id';
6265 6265
             $fieldsArray = array();
6266 6266
             foreach ($extraFields as $field) {
6267 6267
                 $fieldsArray[] = Database::escape_string($field);
@@ -6304,14 +6304,14 @@  discard block
 block discarded – undo
6304 6304
                 for ($i = 1; $i < count($fieldsArray); $i++) {
6305 6305
                     $whereParams .= ', ?';
6306 6306
                 }
6307
-                $whereFieldVariables = ' variable IN ( ' . $whereParams .' )';
6308
-                $whereFieldIds = 'field_id IN ( ' . $whereParams .  ' )';
6307
+                $whereFieldVariables = ' variable IN ( '.$whereParams.' )';
6308
+                $whereFieldIds = 'field_id IN ( '.$whereParams.' )';
6309 6309
             }
6310 6310
             // Get session fields
6311 6311
             $extraField = new ExtraFieldModel('session');
6312 6312
             $questionMarks = substr(str_repeat('?, ', count($fieldsArray)), 0, -2);
6313 6313
             $fieldsList = $extraField->get_all(array(
6314
-                ' variable IN ( ' . $questionMarks . ' )' => $fieldsArray,
6314
+                ' variable IN ( '.$questionMarks.' )' => $fieldsArray,
6315 6315
             ));
6316 6316
             // Index session fields
6317 6317
             foreach ($fieldsList as $field) {
@@ -6320,7 +6320,7 @@  discard block
 block discarded – undo
6320 6320
             // Get session field values
6321 6321
             $extra = new ExtraFieldValue('session');
6322 6322
             $questionMarksFields = substr(str_repeat('?, ', count($fields)), 0, -2);
6323
-            $sessionFieldValueList = $extra->get_all(array ('where' => array('field_id IN ( ' . $questionMarksFields . ' )' => array_keys($fields))));
6323
+            $sessionFieldValueList = $extra->get_all(array('where' => array('field_id IN ( '.$questionMarksFields.' )' => array_keys($fields))));
6324 6324
             // Add session fields values to session list
6325 6325
             foreach ($sessionList as $id => &$session) {
6326 6326
                 foreach ($sessionFieldValueList as $sessionFieldValue) {
@@ -6373,7 +6373,7 @@  discard block
 block discarded – undo
6373 6373
             // Check the result
6374 6374
             if ($result < 1) {
6375 6375
                 // If not found any result, update error message
6376
-                $errorResult['errorMessage'] = 'Not found any session category name ' . $categoryName;
6376
+                $errorResult['errorMessage'] = 'Not found any session category name '.$categoryName;
6377 6377
             } elseif (count($result) > 1 && !$force) {
6378 6378
                 // If found more than one result and force is disabled, update error message
6379 6379
                 $errorResult['errorMessage'] = 'Found many session categories';
@@ -6432,7 +6432,7 @@  discard block
 block discarded – undo
6432 6432
             // Check if session list query had result
6433 6433
             if (!empty($sessionList)) {
6434 6434
                 // implode all session id
6435
-                $sessionIdsString = '(' . implode(', ', array_keys($sessionList)) . ')';
6435
+                $sessionIdsString = '('.implode(', ', array_keys($sessionList)).')';
6436 6436
                 // Get all field variables
6437 6437
                 $sessionFieldList = Database::select(
6438 6438
                     'id, variable',
@@ -6519,7 +6519,7 @@  discard block
 block discarded – undo
6519 6519
                 return $sessionList;
6520 6520
             } else {
6521 6521
                 // Not found result, update error message
6522
-                $errorResult['errorMessage'] = 'Not found any session for session category id ' . $sessionCategoryId;
6522
+                $errorResult['errorMessage'] = 'Not found any session for session category id '.$sessionCategoryId;
6523 6523
             }
6524 6524
         }
6525 6525
 
@@ -6623,7 +6623,7 @@  discard block
 block discarded – undo
6623 6623
 
6624 6624
         $sessionExtraField = new ExtraFieldModel('session');
6625 6625
         $fieldList = $sessionExtraField->get_all(array(
6626
-            "variable IN ( " . implode(", ", $variablePlaceHolders) . " ) " => $variables,
6626
+            "variable IN ( ".implode(", ", $variablePlaceHolders)." ) " => $variables,
6627 6627
         ));
6628 6628
 
6629 6629
         $fields = array();
@@ -6637,7 +6637,7 @@  discard block
 block discarded – undo
6637 6637
         $extra = new ExtraFieldValue('session');
6638 6638
         $sessionFieldValueList = $extra->get_all(
6639 6639
             array(
6640
-                "field_id IN ( " . implode(", ", $variablePlaceHolders) . " )" => array_keys($fields),
6640
+                "field_id IN ( ".implode(", ", $variablePlaceHolders)." )" => array_keys($fields),
6641 6641
             )
6642 6642
         );
6643 6643
 
@@ -6708,7 +6708,7 @@  discard block
 block discarded – undo
6708 6708
                 FROM $sessionTable s
6709 6709
                 INNER JOIN $sessionUserTable sru ON s.id = sru.id_session
6710 6710
                 WHERE
6711
-                    (sru.id_user IN (" . implode(', ', $userIdList) . ")
6711
+                    (sru.id_user IN (".implode(', ', $userIdList).")
6712 6712
                     AND sru.relation_type = 0
6713 6713
                 )";
6714 6714
 
@@ -6724,7 +6724,7 @@  discard block
 block discarded – undo
6724 6724
                         WHERE
6725 6725
                             srau.access_url_id = $accessUrlId
6726 6726
                             AND (
6727
-                                sru.id_user IN (" . implode(', ', $userIdList) . ")
6727
+                                sru.id_user IN (".implode(', ', $userIdList).")
6728 6728
                                 AND sru.relation_type = 0
6729 6729
                             )";
6730 6730
             }
@@ -6745,7 +6745,7 @@  discard block
 block discarded – undo
6745 6745
      */
6746 6746
     public static function getSessionVisibility($sessionInfo)
6747 6747
     {
6748
-        switch($sessionInfo['visibility']) {
6748
+        switch ($sessionInfo['visibility']) {
6749 6749
             case 1:
6750 6750
                 return get_lang('ReadOnly');
6751 6751
             case 2:
@@ -6922,7 +6922,7 @@  discard block
 block discarded – undo
6922 6922
                     get_lang('CoachName'),
6923 6923
                     null,
6924 6924
                     [
6925
-                        'url' => api_get_path(WEB_AJAX_PATH) . 'session.ajax.php?a=search_general_coach',
6925
+                        'url' => api_get_path(WEB_AJAX_PATH).'session.ajax.php?a=search_general_coach',
6926 6926
                         'width' => '100%',
6927 6927
                     ]
6928 6928
                 );
@@ -6933,7 +6933,7 @@  discard block
 block discarded – undo
6933 6933
         $form->addHtml('<div id="ajax_list_coachs"></div>');
6934 6934
 
6935 6935
         $form->addButtonAdvancedSettings('advanced_params');
6936
-        $form->addElement('html','<div id="advanced_params_options" style="display:none">');
6936
+        $form->addElement('html', '<div id="advanced_params_options" style="display:none">');
6937 6937
 
6938 6938
         $form->addSelect('session_category', get_lang('SessionCategory'), $categoriesOptions, array(
6939 6939
             'id' => 'session_category'
@@ -7100,16 +7100,16 @@  discard block
 block discarded – undo
7100 7100
         if (api_is_session_admin() &&
7101 7101
             api_get_setting('allow_session_admins_to_see_all_sessions') == 'false'
7102 7102
         ) {
7103
-            $where.=" WHERE s.session_admin_id = $user_id ";
7103
+            $where .= " WHERE s.session_admin_id = $user_id ";
7104 7104
         }
7105 7105
 
7106 7106
         if (!empty($options['where'])) {
7107 7107
             $options['where'] = str_replace('course_title', 'c.title', $options['where']);
7108
-            $options['where'] = str_replace("( session_active = '0' )", '1=1',  $options['where']);
7108
+            $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']);
7109 7109
 
7110 7110
             $options['where'] = str_replace(
7111 7111
                 array("AND session_active = '1'  )", " AND (  session_active = '1'  )"),
7112
-                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " )
7112
+                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ")
7113 7113
                 , $options['where']
7114 7114
             );
7115 7115
 
@@ -7151,10 +7151,10 @@  discard block
 block discarded – undo
7151 7151
                        $where ";
7152 7152
 
7153 7153
         if (api_is_multiple_url_enabled()) {
7154
-            $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7154
+            $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7155 7155
             $access_url_id = api_get_current_access_url_id();
7156 7156
             if ($access_url_id != -1) {
7157
-                $where.= " AND ar.access_url_id = $access_url_id ";
7157
+                $where .= " AND ar.access_url_id = $access_url_id ";
7158 7158
 
7159 7159
                 $query_rows = "SELECT count(*) as total_rows
7160 7160
                                FROM $tbl_session s
@@ -7199,12 +7199,12 @@  discard block
 block discarded – undo
7199 7199
                     //get_lang('CourseTitle'),
7200 7200
                     get_lang('Visibility'),
7201 7201
                 );
7202
-                $column_model = array (
7203
-                    array('name'=>'name', 'index'=>'s.name', 'width'=>'160',  'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7204
-                    array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40',  'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7205
-                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7206
-                    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)),
7207
-                    array('name'=>'visibility', 'index'=>'visibility',      'width'=>'40',   'align'=>'left', 'search' => 'false'),
7202
+                $column_model = array(
7203
+                    array('name'=>'name', 'index'=>'s.name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7204
+                    array('name'=>'category_name', 'index'=>'category_name', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7205
+                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7206
+                    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)),
7207
+                    array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
7208 7208
                 );
7209 7209
                 break;
7210 7210
             case 'complete':
@@ -7217,12 +7217,12 @@  discard block
 block discarded – undo
7217 7217
                     get_lang('Visibility'),
7218 7218
                     get_lang('CourseTitle'),
7219 7219
                 );
7220
-                $column_model = array (
7221
-                    array('name'=>'name', 'index'=>'s.name', 'width'=>'200',  'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7222
-                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70',   'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7223
-                    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)),
7224
-                    array('name'=>'coach_name', 'index'=>'coach_name',     'width'=>'70',   'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)),
7225
-                    array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25',   'align'=>'left', 'search' => 'true', 'stype'=>'select',
7220
+                $column_model = array(
7221
+                    array('name'=>'name', 'index'=>'s.name', 'width'=>'200', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('sopt' => $operators)),
7222
+                    array('name'=>'display_start_date', 'index'=>'display_start_date', 'width'=>'70', 'align'=>'left', 'search' => 'true', 'searchoptions' => array('dataInit' => 'date_pick_today', 'sopt' => $date_operators)),
7223
+                    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)),
7224
+                    array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'70', 'align'=>'left', 'search' => 'false', 'searchoptions' => array('sopt' => $operators)),
7225
+                    array('name'=>'session_active', 'index'=>'session_active', 'width'=>'25', 'align'=>'left', 'search' => 'true', 'stype'=>'select',
7226 7226
                         // for the bottom bar
7227 7227
                         'searchoptions' => array(
7228 7228
                             'defaultValue'  => '1',
@@ -7230,8 +7230,8 @@  discard block
 block discarded – undo
7230 7230
                         // for the top bar
7231 7231
                         'editoptions' => array('value' => '" ":'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive')),
7232 7232
                     ),
7233
-                    array('name'=>'visibility',     'index'=>'visibility',      'width'=>'40',   'align'=>'left', 'search' => 'false'),
7234
-                    array('name'=>'course_title',    'index'=>'course_title',   'width'=>'50',   'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true','sopt' => $operators)),
7233
+                    array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'),
7234
+                    array('name'=>'course_title', 'index'=>'course_title', 'width'=>'50', 'hidden' => 'true', 'search' => 'true', 'searchoptions' => array('searchhidden' =>'true', 'sopt' => $operators)),
7235 7235
                 );
7236 7236
                 break;
7237 7237
         }
@@ -7240,14 +7240,14 @@  discard block
 block discarded – undo
7240 7240
         $session_field = new ExtraFieldModel('session');
7241 7241
         $rules = $session_field->getRules($columns, $column_model);
7242 7242
 
7243
-        $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80',  'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false');
7243
+        $column_model[] = array('name'=>'actions', 'index'=>'actions', 'width'=>'80', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false', 'search' => 'false');
7244 7244
         $columns[] = get_lang('Actions');
7245 7245
 
7246 7246
         foreach ($column_model as $col_model) {
7247 7247
             $simple_column_name[] = $col_model['name'];
7248 7248
         }
7249 7249
 
7250
-        $return_array =  array(
7250
+        $return_array = array(
7251 7251
             'columns' => $columns,
7252 7252
             'column_model' => $column_model,
7253 7253
             'rules' => $rules,
@@ -7336,7 +7336,7 @@  discard block
 block discarded – undo
7336 7336
             if (api_is_session_admin() &&
7337 7337
                 api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false'
7338 7338
             ) {
7339
-                $where.=" AND s.session_admin_id = $user_id ";
7339
+                $where .= " AND s.session_admin_id = $user_id ";
7340 7340
             }
7341 7341
         }
7342 7342
 
@@ -7419,11 +7419,11 @@  discard block
 block discarded – undo
7419 7419
             }
7420 7420
             $options['where'] = str_replace('course_title', 'c.title', $options['where']);
7421 7421
 
7422
-            $options['where'] = str_replace("( session_active = '0' )", '1=1',  $options['where']);
7422
+            $options['where'] = str_replace("( session_active = '0' )", '1=1', $options['where']);
7423 7423
 
7424 7424
             $options['where'] = str_replace(
7425 7425
                 array("AND session_active = '1'  )", " AND (  session_active = '1'  )"),
7426
-                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 " )
7426
+                array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ")
7427 7427
                 , $options['where']
7428 7428
             );
7429 7429
 
@@ -7458,10 +7458,10 @@  discard block
 block discarded – undo
7458 7458
             $where;
7459 7459
 
7460 7460
         if (api_is_multiple_url_enabled()) {
7461
-            $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7461
+            $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
7462 7462
             $access_url_id = api_get_current_access_url_id();
7463 7463
             if ($access_url_id != -1) {
7464
-                $where.= " AND ar.access_url_id = $access_url_id ";
7464
+                $where .= " AND ar.access_url_id = $access_url_id ";
7465 7465
                 $query = "$select
7466 7466
                     FROM $tbl_session s
7467 7467
                     LEFT JOIN $tbl_session_field_values fv ON (fv.session_id = s.id)
@@ -7488,7 +7488,7 @@  discard block
 block discarded – undo
7488 7488
         $formatted_sessions = array();
7489 7489
 
7490 7490
         if (Database::num_rows($result)) {
7491
-            $sessions   = Database::store_result($result, 'ASSOC');
7491
+            $sessions = Database::store_result($result, 'ASSOC');
7492 7492
             foreach ($sessions as $session) {
7493 7493
                 $session_id = $session['id'];
7494 7494
                 $session['name'] = Display::url($session['name'], "resume_session.php?id_session=".$session['id']);
@@ -7503,14 +7503,14 @@  discard block
 block discarded – undo
7503 7503
 
7504 7504
                 switch ($session['visibility']) {
7505 7505
                     case SESSION_VISIBLE_READ_ONLY: //1
7506
-                        $session['visibility'] =  get_lang('ReadOnly');
7506
+                        $session['visibility'] = get_lang('ReadOnly');
7507 7507
                         break;
7508 7508
                     case SESSION_VISIBLE:           //2
7509 7509
                     case SESSION_AVAILABLE:         //4
7510
-                        $session['visibility'] =  get_lang('Visible');
7510
+                        $session['visibility'] = get_lang('Visible');
7511 7511
                         break;
7512 7512
                     case SESSION_INVISIBLE:         //3
7513
-                        $session['visibility'] =  api_ucfirst(get_lang('Invisible'));
7513
+                        $session['visibility'] = api_ucfirst(get_lang('Invisible'));
7514 7514
                         break;
7515 7515
                 }
7516 7516
 
@@ -7586,7 +7586,7 @@  discard block
 block discarded – undo
7586 7586
         if (empty($session)) {
7587 7587
             return false;
7588 7588
         }
7589
-        return api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . $id;
7589
+        return api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$id;
7590 7590
     }
7591 7591
 
7592 7592
     /**
@@ -7604,7 +7604,7 @@  discard block
 block discarded – undo
7604 7604
             return false;
7605 7605
         }
7606 7606
         if (empty($courseId)) {
7607
-            return api_get_path(WEB_CODE_PATH) . 'session/index.php?session_id=' . $id;
7607
+            return api_get_path(WEB_CODE_PATH).'session/index.php?session_id='.$id;
7608 7608
         } else {
7609 7609
             $courseInfo = api_get_course_info_by_id($courseId);
7610 7610
             if ($courseInfo) {
@@ -7810,7 +7810,7 @@  discard block
 block discarded – undo
7810 7810
             // sort $listCat by catSessionName
7811 7811
             usort($listCat, 'self::compareBySessionName');
7812 7812
             // in each catSession sort sessionList by sessionName
7813
-            foreach($listCat as $i => $listCatSessionInfo) {
7813
+            foreach ($listCat as $i => $listCatSessionInfo) {
7814 7814
                 $listSessionList = $listCatSessionInfo['sessionList'];
7815 7815
                 usort($listSessionList, 'self::compareCatSessionInfo');
7816 7816
                 $listCat[$i]['sessionList'] = $listSessionList;
@@ -7825,8 +7825,8 @@  discard block
 block discarded – undo
7825 7825
             );
7826 7826
 
7827 7827
             $userCatId = intval($userCatId);
7828
-            $listResults[$userCatId]['courseInUserCategoryId'] =  $userCatId;
7829
-            $listResults[$userCatId]['courseInUserCategoryTitle'] =  $userCatTitle;
7828
+            $listResults[$userCatId]['courseInUserCategoryId'] = $userCatId;
7829
+            $listResults[$userCatId]['courseInUserCategoryTitle'] = $userCatTitle;
7830 7830
             $listResults[$userCatId]['courseInUserCatList'][] = $listOneCourse;
7831 7831
         }
7832 7832
 
@@ -7852,7 +7852,7 @@  discard block
 block discarded – undo
7852 7852
     {
7853 7853
         if ($listA['sessionName'] == $listB['sessionName']) {
7854 7854
             return 0;
7855
-        } else if($listA['sessionName'] > $listB['sessionName']) {
7855
+        } else if ($listA['sessionName'] > $listB['sessionName']) {
7856 7856
             return 1;
7857 7857
         } else {
7858 7858
             return -1;
@@ -7872,7 +7872,7 @@  discard block
 block discarded – undo
7872 7872
             return 1;
7873 7873
         } else if ($listA['catSessionName'] == $listB['catSessionName']) {
7874 7874
             return 0;
7875
-        } else if($listA['catSessionName'] > $listB['catSessionName']) {
7875
+        } else if ($listA['catSessionName'] > $listB['catSessionName']) {
7876 7876
             return 1;
7877 7877
         } else {
7878 7878
             return -1;
@@ -7888,7 +7888,7 @@  discard block
 block discarded – undo
7888 7888
     {
7889 7889
         if ($listA['courseInUserCategoryTitle'] == $listB['courseInUserCategoryTitle']) {
7890 7890
             return 0;
7891
-        } else if($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) {
7891
+        } else if ($listA['courseInUserCategoryTitle'] > $listB['courseInUserCategoryTitle']) {
7892 7892
             return 1;
7893 7893
         } else {
7894 7894
             return -1;
@@ -7904,7 +7904,7 @@  discard block
 block discarded – undo
7904 7904
     {
7905 7905
         if ($listA['title'] == $listB['title']) {
7906 7906
             return 0;
7907
-        } else if($listA['title'] > $listB['title']) {
7907
+        } else if ($listA['title'] > $listB['title']) {
7908 7908
             return 1;
7909 7909
         } else {
7910 7910
             return -1;
@@ -7950,8 +7950,8 @@  discard block
 block discarded – undo
7950 7950
 
7951 7951
                 $marginShift = 20;
7952 7952
                 if ($catSessionName != '') {
7953
-                    $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">' .
7954
-                        CourseManager::course_item_html($listParamsCatSession, true) . '</div>';
7953
+                    $htmlCatSessions .= '<div style="margin-left:'.$marginShift.'px;">'.
7954
+                        CourseManager::course_item_html($listParamsCatSession, true).'</div>';
7955 7955
                     $marginShift = 40;
7956 7956
                 }
7957 7957
 
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.