Test Setup Failed
Push — master ( f6b79f...2f2ea9 )
by Angel Fernando Quiroz
154:29 queued 97:29
created
main/inc/lib/tracking.lib.php 1 patch
Doc Comments   +13 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1287,6 +1287,8 @@  discard block
 block discarded – undo
1287 1287
      * @param   string type of time filter: 'last_week' or 'custom'
1288 1288
      * @param   string  start date date('Y-m-d H:i:s')
1289 1289
      * @param   string  end date date('Y-m-d H:i:s')
1290
+     * @param string $start_date
1291
+     * @param string $end_date
1290 1292
      * @return timestamp $nb_seconds
1291 1293
      */
1292 1294
     public static function get_time_spent_on_the_platform(
@@ -1390,7 +1392,7 @@  discard block
 block discarded – undo
1390 1392
      * Get first connection date for a student
1391 1393
      * @param    int $student_id
1392 1394
      *
1393
-     * @return    string|bool Date format long without day or false if there are no connections
1395
+     * @return    string|false Date format long without day or false if there are no connections
1394 1396
      */
1395 1397
     public static function get_first_connection_date($student_id)
1396 1398
     {
@@ -1420,7 +1422,7 @@  discard block
 block discarded – undo
1420 1422
      * @param int $student_id
1421 1423
      * @param bool $warning_message Show a warning message (optional)
1422 1424
      * @param bool $return_timestamp True for returning results in timestamp (optional)
1423
-     * @return string|int|bool Date format long without day, false if there are no connections or
1425
+     * @return string Date format long without day, false if there are no connections or
1424 1426
      * timestamp if parameter $return_timestamp is true
1425 1427
      */
1426 1428
     public static function get_last_connection_date($student_id, $warning_message = false, $return_timestamp = false)
@@ -2667,6 +2669,9 @@  discard block
 block discarded – undo
2667 2669
      * @param     array         Limit average to listed lp ids
2668 2670
      * @param     int            Session id (optional), if param $session_id is
2669 2671
      * null(default) it'll return results including sessions, 0 = session is not filtered
2672
+     * @param integer $student_id
2673
+     * @param string $course_code
2674
+     * @param integer $session_id
2670 2675
      * @return     int         Total time
2671 2676
      */
2672 2677
     public static function get_time_spent_in_lp($student_id, $course_code, $lp_ids = array(), $session_id = null)
@@ -2733,6 +2738,8 @@  discard block
 block discarded – undo
2733 2738
      * @param     int|array    Student id(s)
2734 2739
      * @param     string         Course code
2735 2740
      * @param     int         Learning path id
2741
+     * @param integer $student_id
2742
+     * @param string $course_code
2736 2743
      * @return     int         Total time
2737 2744
      */
2738 2745
     public static function get_last_connection_time_in_lp($student_id, $course_code, $lp_id, $session_id = 0)
@@ -5400,7 +5407,7 @@  discard block
 block discarded – undo
5400 5407
 
5401 5408
     /**
5402 5409
     * @param FormValidator $form
5403
-    * @return mixed
5410
+    * @return FormValidator
5404 5411
     */
5405 5412
     public static function setUserSearchForm($form)
5406 5413
     {
@@ -5439,7 +5446,6 @@  discard block
 block discarded – undo
5439 5446
      * @param   int $sessionId  The session ID (session.id)
5440 5447
      * @param   int $courseId   The course ID (course.id)
5441 5448
      * @param   int $exerciseId The quiz ID (c_quiz.id)
5442
-     * @param   int $answer     The answer status (0 = incorrect, 1 = correct, 2 = both)
5443 5449
      * @param   array   $options    An array of options you can pass to the query (limit, where and order)
5444 5450
      * @return array An array with the data of exercise(s) progress
5445 5451
      */
@@ -6876,7 +6882,7 @@  discard block
 block discarded – undo
6876 6882
      * @param int $user_id
6877 6883
      * @param int $course_id
6878 6884
      * @param int $session_id
6879
-     * @return array
6885
+     * @return string[]
6880 6886
      */
6881 6887
     public function display_login_tracking_info($view, $user_id, $course_id, $session_id = 0)
6882 6888
     {
@@ -6922,9 +6928,9 @@  discard block
 block discarded – undo
6922 6928
     /**
6923 6929
      * Displays the exercise results for a specific user in a specific course.
6924 6930
      * @param   string $view
6925
-     * @param   int $user_id    User ID
6931
+     * @param   int $userId    User ID
6926 6932
      * @param   string  $courseCode Course code
6927
-     * @return array
6933
+     * @return string[]
6928 6934
      * @todo remove globals
6929 6935
      */
6930 6936
     public function display_exercise_tracking_info($view, $userId, $courseCode)
Please login to merge, or discard this patch.
main/inc/lib/usergroup.lib.php 2 patches
Doc Comments   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
      * @param int    $groupId
1014 1014
      * @param string $picture
1015 1015
      *
1016
-     * @return bool|string
1016
+     * @return false|string
1017 1017
      */
1018 1018
     public function manageFileUpload($groupId, $picture)
1019 1019
     {
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
     }
1156 1156
 
1157 1157
     /**
1158
-     * @return mixed
1158
+     * @return integer
1159 1159
      */
1160 1160
     public function getGroupType()
1161 1161
     {
@@ -1359,6 +1359,8 @@  discard block
 block discarded – undo
1359 1359
      * @param string height
1360 1360
      * @param string picture size it can be small_,  medium_  or  big_
1361 1361
      * @param string style css
1362
+     * @param integer $height
1363
+     * @param integer $size_picture
1362 1364
      * @return array with the file and the style of an image i.e $array['file'] $array['style']
1363 1365
      */
1364 1366
     public function get_picture_group($id, $picture_file, $height, $size_picture = GROUP_IMAGE_SIZE_MEDIUM , $style = '')
@@ -1420,7 +1422,7 @@  discard block
 block discarded – undo
1420 1422
      * @param	string	Type of path to return (can be 'none', 'system', 'rel', 'web')
1421 1423
      * @param	bool	Whether we want to have the directory name returned 'as if' there was a file or not (in the case we want to know which directory to create - otherwise no file means no split subdir)
1422 1424
      * @param	bool	If we want that the function returns the /main/img/unknown.jpg image set it at true
1423
-     * @return	array 	Array of 2 elements: 'dir' and 'file' which contain the dir and file as the name implies if image does not exist it will return the unknow image if anonymous parameter is true if not it returns an empty er's
1425
+     * @return	integer 	Array of 2 elements: 'dir' and 'file' which contain the dir and file as the name implies if image does not exist it will return the unknow image if anonymous parameter is true if not it returns an empty er's
1424 1426
      */
1425 1427
     public function get_group_picture_path_by_id($id, $type = 'none', $preview = false, $anonymous = false)
1426 1428
     {
@@ -1473,7 +1475,7 @@  discard block
 block discarded – undo
1473 1475
     }
1474 1476
 
1475 1477
     /**
1476
-     * @return array
1478
+     * @return string[]
1477 1479
      */
1478 1480
     public function getAllowedPictureExtensions()
1479 1481
     {
@@ -1663,7 +1665,7 @@  discard block
 block discarded – undo
1663 1665
      * @author Julio Montoya
1664 1666
      * @param  int  $user_id
1665 1667
      * @param  int $group_id
1666
-     * @return boolean true if success
1668
+     * @return Statement|null true if success
1667 1669
      * */
1668 1670
     public function delete_user_rel_group($user_id, $group_id)
1669 1671
     {
@@ -1875,6 +1877,8 @@  discard block
 block discarded – undo
1875 1877
      * @param int from value
1876 1878
      * @param int limit
1877 1879
      * @param array image configuration, i.e array('height'=>'20px', 'size'=> '20px')
1880
+     * @param integer $from
1881
+     * @param integer $limit
1878 1882
      * @return array list of users in a group
1879 1883
      */
1880 1884
     public function get_users_by_group(
@@ -1973,6 +1977,8 @@  discard block
 block discarded – undo
1973 1977
      * Shows the left column of the group page
1974 1978
      * @param int group id
1975 1979
      * @param int user id
1980
+     * @param integer $group_id
1981
+     * @param integer $user_id
1976 1982
      *
1977 1983
      */
1978 1984
     public function show_group_column_information($group_id, $user_id, $show = '')
@@ -2326,7 +2332,7 @@  discard block
 block discarded – undo
2326 2332
      * @param int $group_id
2327 2333
      * @param int $parent_group_id if 0, we delete the parent_group association
2328 2334
      * @param int $relation_type
2329
-     * @return resource
2335
+     * @return Statement|null
2330 2336
      **/
2331 2337
     public static function set_parent_group($group_id, $parent_group_id, $relation_type = 1)
2332 2338
     {
Please login to merge, or discard this patch.
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             ";
82 82
             $result = Database::query($sql);
83 83
             if (Database::num_rows($result)) {
84
-                $row  = Database::fetch_array($result);
84
+                $row = Database::fetch_array($result);
85 85
 
86 86
                 return $row['count'];
87 87
             }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             ";
102 102
             $result = Database::query($sql);
103 103
             if (Database::num_rows($result)) {
104
-                $row  = Database::fetch_array($result);
104
+                $row = Database::fetch_array($result);
105 105
                 return $row['count'];
106 106
             }
107 107
         }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             ";
127 127
             $result = Database::query($sql);
128 128
             if (Database::num_rows($result)) {
129
-                $row  = Database::fetch_array($result);
129
+                $row = Database::fetch_array($result);
130 130
                 return $row['count'];
131 131
             }
132 132
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
             ";
148 148
             $result = Database::query($sql);
149 149
             if (Database::num_rows($result)) {
150
-                $row  = Database::fetch_array($result);
150
+                $row = Database::fetch_array($result);
151 151
                 return $row['count'];
152 152
             }
153 153
 
@@ -528,13 +528,13 @@  discard block
 block discarded – undo
528 528
                 INNER JOIN {$this->table} g
529 529
                 ON (u.usergroup_id = g.id)
530 530
                 ";
531
-            $where =  array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId)));
531
+            $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId)));
532 532
         } else {
533 533
             $from = $this->usergroup_rel_user_table." u
534 534
                 INNER JOIN {$this->table} g
535 535
                 ON (u.usergroup_id = g.id)
536 536
                 ";
537
-            $where =  array('where' => array('user_id = ?' => $userId));
537
+            $where = array('where' => array('user_id = ?' => $userId));
538 538
         }
539 539
 
540 540
         if ($filterByType !== null) {
@@ -567,10 +567,10 @@  discard block
 block discarded – undo
567 567
             $urlId = api_get_current_access_url_id();
568 568
             $from = $this->usergroup_rel_user_table." u
569 569
                     INNER JOIN {$this->access_url_rel_usergroup} a ON (a.usergroup_id AND u.usergroup_id)";
570
-            $where =  array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId)));
570
+            $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId)));
571 571
         } else {
572 572
             $from = $this->usergroup_rel_user_table." u ";
573
-            $where =  array('where' => array('user_id = ?' => $userId));
573
+            $where = array('where' => array('user_id = ?' => $userId));
574 574
         }
575 575
 
576 576
         $results = Database::select(
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
             }
857 857
             $result = $new_result;
858 858
         }
859
-        $columns = array('name', 'users', 'courses','sessions', 'group_type');
859
+        $columns = array('name', 'users', 'courses', 'sessions', 'group_type');
860 860
 
861 861
         if (!in_array($sidx, $columns)) {
862 862
             $sidx = 'name';
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
                 }
1261 1261
             }
1262 1262
         }
1263
-        $response->addAssign('ajax_list_courses','innerHTML', api_utf8_encode($return));
1263
+        $response->addAssign('ajax_list_courses', 'innerHTML', api_utf8_encode($return));
1264 1264
 
1265 1265
         return $response;
1266 1266
     }
@@ -1367,7 +1367,7 @@  discard block
 block discarded – undo
1367 1367
      * @param string style css
1368 1368
      * @return array with the file and the style of an image i.e $array['file'] $array['style']
1369 1369
      */
1370
-    public function get_picture_group($id, $picture_file, $height, $size_picture = GROUP_IMAGE_SIZE_MEDIUM , $style = '')
1370
+    public function get_picture_group($id, $picture_file, $height, $size_picture = GROUP_IMAGE_SIZE_MEDIUM, $style = '')
1371 1371
     {
1372 1372
         $picture = array();
1373 1373
         $picture['style'] = $style;
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
      */
1481 1481
     public function getAllowedPictureExtensions()
1482 1482
     {
1483
-        return $allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif');
1483
+        return $allowed_picture_types = array('jpg', 'jpeg', 'png', 'gif');
1484 1484
     }
1485 1485
 
1486 1486
     /**
@@ -1514,7 +1514,7 @@  discard block
 block discarded – undo
1514 1514
         if (empty($user_id)) {
1515 1515
             $user_id = api_get_user_id();
1516 1516
         }
1517
-        $user_role	= $this->get_user_group_role($user_id, $group_id);
1517
+        $user_role = $this->get_user_group_role($user_id, $group_id);
1518 1518
         if (in_array($user_role, array(GROUP_USER_PERMISSION_ADMIN))) {
1519 1519
             return true;
1520 1520
         } else {
@@ -1532,7 +1532,7 @@  discard block
 block discarded – undo
1532 1532
         if (empty($user_id)) {
1533 1533
             $user_id = api_get_user_id();
1534 1534
         }
1535
-        $user_role	= $this->get_user_group_role($user_id, $group_id);
1535
+        $user_role = $this->get_user_group_role($user_id, $group_id);
1536 1536
         if (in_array($user_role, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_MODERATOR))) {
1537 1537
             return true;
1538 1538
         } else {
@@ -1559,7 +1559,7 @@  discard block
 block discarded – undo
1559 1559
             GROUP_USER_PERMISSION_READER,
1560 1560
             GROUP_USER_PERMISSION_HRM,
1561 1561
         );
1562
-        $user_role	= self::get_user_group_role($user_id, $group_id);
1562
+        $user_role = self::get_user_group_role($user_id, $group_id);
1563 1563
         if (in_array($user_role, $roles)) {
1564 1564
             return true;
1565 1565
         } else {
@@ -1576,7 +1576,7 @@  discard block
 block discarded – undo
1576 1576
      * */
1577 1577
     public function get_user_group_role($user_id, $group_id)
1578 1578
     {
1579
-        $table_group_rel_user= $this->usergroup_rel_user_table;
1579
+        $table_group_rel_user = $this->usergroup_rel_user_table;
1580 1580
         $return_value = 0;
1581 1581
         if (!empty($user_id) && !empty($group_id)) {
1582 1582
             $sql = "SELECT relation_type FROM $table_group_rel_user
@@ -1584,8 +1584,8 @@  discard block
 block discarded – undo
1584 1584
                         usergroup_id = ".intval($group_id)." AND
1585 1585
                         user_id = ".intval($user_id)." ";
1586 1586
             $result = Database::query($sql);
1587
-            if (Database::num_rows($result)>0) {
1588
-                $row = Database::fetch_array($result,'ASSOC');
1587
+            if (Database::num_rows($result) > 0) {
1588
+                $row = Database::fetch_array($result, 'ASSOC');
1589 1589
                 $return_value = $row['relation_type'];
1590 1590
             }
1591 1591
         }
@@ -1640,7 +1640,7 @@  discard block
 block discarded – undo
1640 1640
         if (is_array($user_list) && is_array($group_list)) {
1641 1641
             foreach ($group_list as $group_id) {
1642 1642
                 foreach ($user_list as $user_id) {
1643
-                    $role = self::get_user_group_role($user_id,$group_id);
1643
+                    $role = self::get_user_group_role($user_id, $group_id);
1644 1644
                     if ($role == 0) {
1645 1645
                         $sql = "INSERT INTO $table_url_rel_group
1646 1646
 		               			SET
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
     public function delete_user_rel_group($user_id, $group_id)
1672 1672
     {
1673 1673
         $table = $this->usergroup_rel_user_table;
1674
-        $sql= "DELETE FROM $table
1674
+        $sql = "DELETE FROM $table
1675 1675
                WHERE
1676 1676
                 user_id = ".intval($user_id)." AND
1677 1677
                 usergroup_id = ".intval($group_id)."  ";
@@ -1727,7 +1727,7 @@  discard block
 block discarded – undo
1727 1727
 
1728 1728
         $sql = "UPDATE $table_group_rel_user
1729 1729
    				SET relation_type = ".intval($relation_type)."
1730
-                WHERE user_id = $user_id AND usergroup_id = $group_id" ;
1730
+                WHERE user_id = $user_id AND usergroup_id = $group_id";
1731 1731
         Database::query($sql);
1732 1732
     }
1733 1733
 
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
         if (Database::num_rows($result) > 0) {
1770 1770
             while ($row = Database::fetch_array($result, 'ASSOC')) {
1771 1771
                 if ($with_image) {
1772
-                    $picture = self::get_picture_group($row['id'], $row['picture'],80);
1772
+                    $picture = self::get_picture_group($row['id'], $row['picture'], 80);
1773 1773
                     $img = '<img src="'.$picture['file'].'" />';
1774 1774
                     $row['picture'] = $img;
1775 1775
                 }
@@ -1805,11 +1805,11 @@  discard block
 block discarded – undo
1805 1805
 				ORDER BY count DESC
1806 1806
 				LIMIT $num";
1807 1807
 
1808
-        $result=Database::query($sql);
1808
+        $result = Database::query($sql);
1809 1809
         $array = array();
1810 1810
         while ($row = Database::fetch_array($result, 'ASSOC')) {
1811 1811
             if ($with_image) {
1812
-                $picture = self::get_picture_group($row['id'], $row['picture'],80);
1812
+                $picture = self::get_picture_group($row['id'], $row['picture'], 80);
1813 1813
                 $img = '<img src="'.$picture['file'].'" />';
1814 1814
                 $row['picture'] = $img;
1815 1815
             }
@@ -1854,11 +1854,11 @@  discard block
 block discarded – undo
1854 1854
                 ORDER BY created_at DESC
1855 1855
                 LIMIT $num ";
1856 1856
 
1857
-        $result=Database::query($sql);
1857
+        $result = Database::query($sql);
1858 1858
         $array = array();
1859 1859
         while ($row = Database::fetch_array($result, 'ASSOC')) {
1860 1860
             if ($with_image) {
1861
-                $picture = self::get_picture_group($row['id'], $row['picture'],80);
1861
+                $picture = self::get_picture_group($row['id'], $row['picture'], 80);
1862 1862
                 $img = '<img src="'.$picture['file'].'" />';
1863 1863
                 $row['picture'] = $img;
1864 1864
             }
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
         $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
1893 1893
         $group_id = intval($group_id);
1894 1894
 
1895
-        if (empty($group_id)){
1895
+        if (empty($group_id)) {
1896 1896
             return array();
1897 1897
         }
1898 1898
 
@@ -1907,9 +1907,9 @@  discard block
 block discarded – undo
1907 1907
             $where_relation_condition = '';
1908 1908
         } else {
1909 1909
             $new_relation_type = array();
1910
-            foreach($relation_type as $rel) {
1910
+            foreach ($relation_type as $rel) {
1911 1911
                 $rel = intval($rel);
1912
-                $new_relation_type[] ="'$rel'";
1912
+                $new_relation_type[] = "'$rel'";
1913 1913
             }
1914 1914
             $relation_type = implode(',', $new_relation_type);
1915 1915
             if (!empty($relation_type))
@@ -1953,7 +1953,7 @@  discard block
 block discarded – undo
1953 1953
         $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
1954 1954
         $group_id = intval($group_id);
1955 1955
 
1956
-        if (empty($group_id)){
1956
+        if (empty($group_id)) {
1957 1957
             return array();
1958 1958
         }
1959 1959
 
@@ -1964,7 +1964,7 @@  discard block
 block discarded – undo
1964 1964
 			    WHERE gu.usergroup_id= $group_id
1965 1965
 			    ORDER BY relation_type, firstname";
1966 1966
 
1967
-        $result=Database::query($sql);
1967
+        $result = Database::query($sql);
1968 1968
         $array = array();
1969 1969
         while ($row = Database::fetch_array($result, 'ASSOC')) {
1970 1970
             $array[$row['id']] = $row;
@@ -1993,27 +1993,27 @@  discard block
 block discarded – undo
1993 1993
             case GROUP_USER_PERMISSION_READER:
1994 1994
                 // I'm just a reader
1995 1995
                 $relation_group_title = get_lang('IAmAReader');
1996
-                $links .=  '<li><a href="group_invitation.php?id='.$group_id.'">'.
1997
-                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show=='invite_friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>';
1998
-                $links .=  '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
1996
+                $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'.
1997
+                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show == 'invite_friends' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>';
1998
+                $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
1999 1999
                             Display::return_icon('group_leave.png', get_lang('LeaveGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('LeaveGroup').'</span></a></li>';
2000 2000
                 break;
2001 2001
             case GROUP_USER_PERMISSION_ADMIN:
2002 2002
                 $relation_group_title = get_lang('IAmAnAdmin');
2003
-                $links .=  '<li><a href="group_edit.php?id='.$group_id.'">'.
2004
-                            Display::return_icon('group_edit.png', get_lang('EditGroup'), array('hspace'=>'6')).'<span class="'.($show=='group_edit'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('EditGroup').'</span></a></li>';
2005
-                $links .=  '<li><a href="group_waiting_list.php?id='.$group_id.'">'.
2006
-                            Display::return_icon('waiting_list.png', get_lang('WaitingList'), array('hspace'=>'6')).'<span class="'.($show=='waiting_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('WaitingList').'</span></a></li>';
2007
-                $links .=  '<li><a href="group_invitation.php?id='.$group_id.'">'.
2008
-                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show=='invite_friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>';
2009
-                $links .=  '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2003
+                $links .= '<li><a href="group_edit.php?id='.$group_id.'">'.
2004
+                            Display::return_icon('group_edit.png', get_lang('EditGroup'), array('hspace'=>'6')).'<span class="'.($show == 'group_edit' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('EditGroup').'</span></a></li>';
2005
+                $links .= '<li><a href="group_waiting_list.php?id='.$group_id.'">'.
2006
+                            Display::return_icon('waiting_list.png', get_lang('WaitingList'), array('hspace'=>'6')).'<span class="'.($show == 'waiting_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('WaitingList').'</span></a></li>';
2007
+                $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'.
2008
+                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show == 'invite_friends' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>';
2009
+                $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2010 2010
                             Display::return_icon('group_leave.png', get_lang('LeaveGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('LeaveGroup').'</span></a></li>';
2011 2011
                 break;
2012 2012
             case GROUP_USER_PERMISSION_PENDING_INVITATION:
2013 2013
 //				$links .=  '<li><a href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.Display::return_icon('addd.gif', get_lang('YouHaveBeenInvitedJoinNow'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('YouHaveBeenInvitedJoinNow').'</span></a></li>';
2014 2014
                 break;
2015 2015
             case GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER:
2016
-                $relation_group_title =  get_lang('WaitingForAdminResponse');
2016
+                $relation_group_title = get_lang('WaitingForAdminResponse');
2017 2017
                 break;
2018 2018
             case GROUP_USER_PERMISSION_MODERATOR:
2019 2019
                 $relation_group_title = get_lang('IAmAModerator');
@@ -2021,25 +2021,25 @@  discard block
 block discarded – undo
2021 2021
                 //$links .=  '<li><a href="groups.php?id='.$group_id.'">'.				Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace'=>'6')).'<span class="'.($show=='messages_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>';
2022 2022
                 //$links .=  '<li><a href="group_members.php?id='.$group_id.'">'.		Display::return_icon('member_list.png', get_lang('MemberList'), array('hspace'=>'6')).'<span class="'.($show=='member_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MemberList').'</span></a></li>';
2023 2023
                 if ($group_info['visibility'] == GROUP_PERMISSION_CLOSED) {
2024
-                    $links .=  '<li><a href="group_waiting_list.php?id='.$group_id.'">'.
2025
-                                Display::return_icon('waiting_list.png', get_lang('WaitingList'), array('hspace'=>'6')).'<span class="'.($show=='waiting_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('WaitingList').'</span></a></li>';
2024
+                    $links .= '<li><a href="group_waiting_list.php?id='.$group_id.'">'.
2025
+                                Display::return_icon('waiting_list.png', get_lang('WaitingList'), array('hspace'=>'6')).'<span class="'.($show == 'waiting_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('WaitingList').'</span></a></li>';
2026 2026
                 }
2027
-                $links .=  '<li><a href="group_invitation.php?id='.$group_id.'">'.
2028
-                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show=='invite_friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>';
2029
-                $links .=  '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2027
+                $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'.
2028
+                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show == 'invite_friends' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>';
2029
+                $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2030 2030
                             Display::return_icon('group_leave.png', get_lang('LeaveGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('LeaveGroup').'</span></a></li>';
2031 2031
                 break;
2032 2032
             case GROUP_USER_PERMISSION_HRM:
2033 2033
                 $relation_group_title = get_lang('IAmAHRM');
2034 2034
                 $links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group" class="ajax" title="'.get_lang('ComposeMessage').'" data-size="lg" data-title="'.get_lang('ComposeMessage').'">'.
2035 2035
                             Display::return_icon('new-message.png', get_lang('NewTopic'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('NewTopic').'</span></a></li>';
2036
-                $links .=  '<li><a href="group_view.php?id='.$group_id.'">'.
2037
-                            Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace'=>'6')).'<span class="'.($show=='messages_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>';
2038
-                $links .=  '<li><a href="group_invitation.php?id='.$group_id.'">'.
2039
-                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show=='invite_friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>';
2040
-                $links .=  '<li><a href="group_members.php?id='.$group_id.'">'.
2041
-                            Display::return_icon('member_list.png', get_lang('MemberList'), array('hspace'=>'6')).'<span class="'.($show=='member_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MemberList').'</span></a></li>';
2042
-                $links .=  '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2036
+                $links .= '<li><a href="group_view.php?id='.$group_id.'">'.
2037
+                            Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace'=>'6')).'<span class="'.($show == 'messages_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>';
2038
+                $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'.
2039
+                            Display::return_icon('invitation_friend.png', get_lang('InviteFriends'), array('hspace'=>'6')).'<span class="'.($show == 'invite_friends' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('InviteFriends').'</span></a></li>';
2040
+                $links .= '<li><a href="group_members.php?id='.$group_id.'">'.
2041
+                            Display::return_icon('member_list.png', get_lang('MemberList'), array('hspace'=>'6')).'<span class="'.($show == 'member_list' ? 'social-menu-text-active' : 'social-menu-text4').'" >'.get_lang('MemberList').'</span></a></li>';
2042
+                $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'.
2043 2043
                             Display::return_icon('delete_data.gif', get_lang('LeaveGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('LeaveGroup').'</span></a></li>';
2044 2044
                 break;
2045 2045
             default:
@@ -2082,14 +2082,14 @@  discard block
 block discarded – undo
2082 2082
      */
2083 2083
     public function get_groups_by_user_count($user_id = '', $relation_type = GROUP_USER_PERMISSION_READER, $with_image = false)
2084 2084
     {
2085
-        $table_group_rel_user	= $this->usergroup_rel_user_table;
2086
-        $tbl_group				= $this->table;
2087
-        $user_id 				= intval($user_id);
2085
+        $table_group_rel_user = $this->usergroup_rel_user_table;
2086
+        $tbl_group = $this->table;
2087
+        $user_id = intval($user_id);
2088 2088
 
2089 2089
         if ($relation_type == 0) {
2090 2090
             $where_relation_condition = '';
2091 2091
         } else {
2092
-            $relation_type 			= intval($relation_type);
2092
+            $relation_type = intval($relation_type);
2093 2093
             $where_relation_condition = "AND gu.relation_type = $relation_type ";
2094 2094
         }
2095 2095
 
@@ -2162,7 +2162,7 @@  discard block
 block discarded – undo
2162 2162
         }
2163 2163
 
2164 2164
         $direction = 'ASC';
2165
-        if (!in_array($direction, array('ASC','DESC'))) {
2165
+        if (!in_array($direction, array('ASC', 'DESC'))) {
2166 2166
             $direction = 'ASC';
2167 2167
         }
2168 2168
 
@@ -2173,8 +2173,8 @@  discard block
 block discarded – undo
2173 2173
         $sql .= " LIMIT $from,$number_of_items";
2174 2174
 
2175 2175
         $res = Database::query($sql);
2176
-        if (Database::num_rows($res)> 0) {
2177
-            while ($row = Database::fetch_array($res,'ASSOC')) {
2176
+        if (Database::num_rows($res) > 0) {
2177
+            while ($row = Database::fetch_array($res, 'ASSOC')) {
2178 2178
                 if (!in_array($row['id'], $return)) {
2179 2179
                     $return[$row['id']] = $row;
2180 2180
                 }
@@ -2199,7 +2199,7 @@  discard block
 block discarded – undo
2199 2199
             if ($i == $max_level) {
2200 2200
                 $select_part .= "rg$rg_number.group_id as id_$rg_number ";
2201 2201
             } else {
2202
-                $select_part .="rg$rg_number.group_id as id_$rg_number, ";
2202
+                $select_part .= "rg$rg_number.group_id as id_$rg_number, ";
2203 2203
             }
2204 2204
             if ($i == 1) {
2205 2205
                 $cond_part .= "FROM $t_rel_group rg0 LEFT JOIN $t_rel_group rg$i on rg$rg_number.group_id = rg$i.subgroup_id ";
@@ -2387,7 +2387,7 @@  discard block
 block discarded – undo
2387 2387
         $nameList = '<ul class="list-unstyled">';
2388 2388
 
2389 2389
         foreach ($groupsNameListParsed as $name) {
2390
-            $nameList .= '<li>' . Display::span($name, ['class' => 'label label-info']) . '</li>';
2390
+            $nameList .= '<li>'.Display::span($name, ['class' => 'label label-info']).'</li>';
2391 2391
         }
2392 2392
 
2393 2393
         $nameList .= '</ul>';
Please login to merge, or discard this patch.