Completed
Pull Request — 1.11.x (#1688)
by José
28:44
created
src/Chamilo/CoreBundle/Entity/Course.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1191,7 +1191,7 @@  discard block
 block discarded – undo
1191 1191
      */
1192 1192
     public function hasPicture()
1193 1193
     {
1194
-        return file_exists(api_get_path(SYS_COURSE_PATH) . $this->directory . '/course-pic85x85.png');
1194
+        return file_exists(api_get_path(SYS_COURSE_PATH).$this->directory.'/course-pic85x85.png');
1195 1195
     }
1196 1196
 
1197 1197
     /**
@@ -1206,9 +1206,9 @@  discard block
 block discarded – undo
1206 1206
         }
1207 1207
 
1208 1208
         if ($fullSize) {
1209
-            return api_get_path(WEB_COURSE_PATH) . $this->directory . '/course-pic.png';
1209
+            return api_get_path(WEB_COURSE_PATH).$this->directory.'/course-pic.png';
1210 1210
         }
1211 1211
 
1212
-        return api_get_path(WEB_COURSE_PATH) . $this->directory . '/course-pic85x85.png';
1212
+        return api_get_path(WEB_COURSE_PATH).$this->directory.'/course-pic85x85.png';
1213 1213
     }
1214 1214
 }
Please login to merge, or discard this patch.
main/inc/lib/groupmanager.lib.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
             $sql = "UPDATE $table_group SET id = iid WHERE iid = $lastId";
213 213
             Database::query($sql);
214 214
 
215
-            $desired_dir_name= '/'.api_replace_dangerous_char($name).'_groupdocs';
216
-            $my_path = api_get_path(SYS_COURSE_PATH) . $currentCourseRepository . '/document';
215
+            $desired_dir_name = '/'.api_replace_dangerous_char($name).'_groupdocs';
216
+            $my_path = api_get_path(SYS_COURSE_PATH).$currentCourseRepository.'/document';
217 217
 
218 218
             $newFolderData = create_unexisting_directory(
219 219
                 $_course,
@@ -276,11 +276,11 @@  discard block
 block discarded – undo
276 276
                 $values['default_view_type_group']['default_view_type'] = api_get_setting('default_forum_view');
277 277
                 $values['group_forum'] = $lastId;
278 278
                 if ($forumState == '1') {
279
-                    $values['public_private_group_forum_group']['public_private_group_forum']='public';
279
+                    $values['public_private_group_forum_group']['public_private_group_forum'] = 'public';
280 280
                 } elseif ($forumState == '2') {
281
-                    $values['public_private_group_forum_group']['public_private_group_forum']='private';
281
+                    $values['public_private_group_forum_group']['public_private_group_forum'] = 'private';
282 282
                 } elseif ($forumState == '0') {
283
-                    $values['public_private_group_forum_group']['public_private_group_forum']='unavailable';
283
+                    $values['public_private_group_forum_group']['public_private_group_forum'] = 'unavailable';
284 284
                 }
285 285
                 store_forum($values);
286 286
             }
@@ -312,9 +312,9 @@  discard block
 block discarded – undo
312 312
             1
313 313
         );
314 314
         $users = self::get_users($group_id);
315
-        $group_ids = array ();
315
+        $group_ids = array();
316 316
 
317
-        for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr ++) {
317
+        for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr++) {
318 318
             $group_ids[] = self::create_group(
319 319
                 get_lang('Subgroup').' '.$group_nr,
320 320
                 $category_id,
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
         } elseif ($forum_state === 0) {
616 616
             $sql2 .= " forum_group_public_private='unavailable' ";
617 617
         }
618
-        $sql2 .=" WHERE c_id = $course_id AND forum_of_group=".$group_id;
618
+        $sql2 .= " WHERE c_id = $course_id AND forum_of_group=".$group_id;
619 619
         Database::query($sql2);
620 620
         return $result;
621 621
     }
@@ -645,13 +645,13 @@  discard block
 block discarded – undo
645 645
     public static function get_categories($course_code = null)
646 646
     {
647 647
         $course_info = api_get_course_info($course_code);
648
-        $course_id     = $course_info['real_id'];
648
+        $course_id = $course_info['real_id'];
649 649
         $table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY);
650 650
         $sql = "SELECT * FROM $table_group_cat
651 651
                 WHERE c_id = $course_id
652 652
                 ORDER BY display_order";
653 653
         $res = Database::query($sql);
654
-        $cats = array ();
654
+        $cats = array();
655 655
         while ($cat = Database::fetch_array($res)) {
656 656
             $cats[] = $cat;
657 657
         }
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
      */
936 936
     public static function get_current_max_groups_per_user($category_id = null, $course_code = null)
937 937
     {
938
-        $course_info = api_get_course_info ($course_code);
938
+        $course_info = api_get_course_info($course_code);
939 939
         $group_table = Database :: get_course_table(TABLE_GROUP);
940 940
         $group_user_table = Database :: get_course_table(TABLE_GROUP_USER);
941 941
         $sql = 'SELECT COUNT(gu.group_id) AS current_max
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
          * Retrieve course users (reverse) ordered by the number
1217 1217
          * of group they are already enrolled
1218 1218
          */
1219
-        for ($i = 0; $i < count($complete_user_list); $i ++) {
1219
+        for ($i = 0; $i < count($complete_user_list); $i++) {
1220 1220
             //find # of groups the user is enrolled in
1221 1221
             $number_of_groups = self :: user_in_number_of_groups(
1222 1222
                 $complete_user_list[$i]["user_id"],
@@ -1235,7 +1235,7 @@  discard block
 block discarded – undo
1235 1235
 
1236 1236
         //now sort by # of group left
1237 1237
         $complete_user_list = TableSort :: sort_table($complete_user_list, 'number_groups_left', SORT_DESC);
1238
-        $userToken = array ();
1238
+        $userToken = array();
1239 1239
         foreach ($complete_user_list as $this_user) {
1240 1240
             if ($this_user['number_groups_left'] > 0) {
1241 1241
                 $userToken[$this_user['user_id']] = $this_user['number_groups_left'];
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
                 if ($category['groups_per_user'] == self::GROUP_PER_MEMBER_NO_LIMIT) {
1436 1436
                     $category['groups_per_user'] = self::INFINITE;
1437 1437
                 }
1438
-                $result = self:: user_in_number_of_groups($user_id, $category['id'] ) < $category['groups_per_user'];
1438
+                $result = self:: user_in_number_of_groups($user_id, $category['id']) < $category['groups_per_user'];
1439 1439
                 if ($result == false) {
1440 1440
                     return false;
1441 1441
                 }
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
                 $order_clause
1537 1537
                 ";
1538 1538
         $db_result = Database::query($sql);
1539
-        $users = array ();
1539
+        $users = array();
1540 1540
         while ($user = Database::fetch_object($db_result)) {
1541 1541
             if (!$id_only) {
1542 1542
                 $member['user_id'] = $user->user_id;
@@ -1601,8 +1601,8 @@  discard block
 block discarded – undo
1601 1601
         foreach ($user_ids as $user_id) {
1602 1602
             $user_id = intval($user_id);
1603 1603
             if (self::can_user_subscribe($user_id, $groupId, false)) {
1604
-                $sql = "INSERT INTO " . $table_group_tutor . " (c_id, user_id, group_id)
1605
-                        VALUES ('$course_id', '" . $user_id . "', '" . $groupId . "')";
1604
+                $sql = "INSERT INTO ".$table_group_tutor." (c_id, user_id, group_id)
1605
+                        VALUES ('$course_id', '".$user_id."', '".$groupId."')";
1606 1606
                 $result = Database::query($sql);
1607 1607
             }
1608 1608
         }
@@ -1618,7 +1618,7 @@  discard block
 block discarded – undo
1618 1618
      */
1619 1619
     public static function unsubscribe_users($user_ids, $group_id)
1620 1620
     {
1621
-        $user_ids = is_array($user_ids) ? $user_ids : array ($user_ids);
1621
+        $user_ids = is_array($user_ids) ? $user_ids : array($user_ids);
1622 1622
         $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
1623 1623
         $group_id = intval($group_id);
1624 1624
         $course_id = api_get_course_int_id();
@@ -2066,7 +2066,7 @@  discard block
 block discarded – undo
2066 2066
          * Retrieve course users (reverse) ordered by the number
2067 2067
          * of group they are already enrolled
2068 2068
          */
2069
-        for ($i = 0; $i < count($complete_user_list); $i ++) {
2069
+        for ($i = 0; $i < count($complete_user_list); $i++) {
2070 2070
             // find # of groups the user is enrolled in
2071 2071
             $number_of_groups = self:: user_in_number_of_groups(
2072 2072
                 $complete_user_list[$i]["user_id"],
@@ -2203,14 +2203,14 @@  discard block
 block discarded – undo
2203 2203
                 !(api_is_course_coach() && intval($this_group['session_id']) != $session_id)
2204 2204
             ) {
2205 2205
                 $edit_actions = '<a href="'.$url.'settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'"  title="'.get_lang('Edit').'">'.
2206
-                    Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
2206
+                    Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2207 2207
 
2208 2208
                 if ($this_group['status'] == 1) {
2209
-                    $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true,false) . '&category=' . $category_id . '&action=set_invisible&id=' . $this_group['id'] . '" title="' . get_lang('Hide') . '">' .
2210
-                        Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
2209
+                    $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_invisible&id='.$this_group['id'].'" title="'.get_lang('Hide').'">'.
2210
+                        Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2211 2211
                 } else {
2212
-                    $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true, false) . '&category=' . $category_id . '&action=set_visible&id=' . $this_group['id'] . '" title="' . get_lang('Show') . '">' .
2213
-                        Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
2212
+                    $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_visible&id='.$this_group['id'].'" title="'.get_lang('Show').'">'.
2213
+                        Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2214 2214
                 }
2215 2215
 
2216 2216
                 $edit_actions .= '<a href="'.$url.'member_settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'"  title="'.get_lang('GroupMembers').'">'.
@@ -2220,10 +2220,10 @@  discard block
 block discarded – undo
2220 2220
                     Display::return_icon('export_excel.png', get_lang('Export'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2221 2221
 
2222 2222
                 $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=fill_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('FillGroup').'">'.
2223
-                    Display::return_icon('fill.png',get_lang('FillGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
2223
+                    Display::return_icon('fill.png', get_lang('FillGroup'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2224 2224
 
2225 2225
                 $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=delete_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'">'.
2226
-                    Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
2226
+                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2227 2227
 
2228 2228
                 $row[] = $edit_actions;
2229 2229
             }
@@ -2595,7 +2595,7 @@  discard block
 block discarded – undo
2595 2595
         $activeTutor = null;
2596 2596
         $activeMember = null;
2597 2597
 
2598
-        switch($default) {
2598
+        switch ($default) {
2599 2599
             case 'settings':
2600 2600
                 $activeSettings = 'active';
2601 2601
                 break;
Please login to merge, or discard this patch.
main/exercise/question_admin.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  */
12 12
 
13 13
 if (isset($_GET['editQuestion'])) {
14
-    $objQuestion = Question::read ($_GET['editQuestion']);
14
+    $objQuestion = Question::read($_GET['editQuestion']);
15 15
     $action = api_get_self()."?".api_get_cidreq()."&myid=1&modifyQuestion=".$modifyQuestion."&editQuestion=".$objQuestion->id;
16 16
 } else {
17 17
     $objQuestion = Question :: getInstance($_REQUEST['answerType']);
Please login to merge, or discard this patch.
main/auth/external_login/login.ws.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 $wsUrl = '';
15 15
 
16 16
 // include common authentication functions
17
-require_once dirname(__FILE__) . '/functions.inc.php';
17
+require_once dirname(__FILE__).'/functions.inc.php';
18 18
 // call the login checker (defined below)
19 19
 $isValid = loginWSAuthenticate($login, $password, $wsUrl);
20 20
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     $key = '-+*%$({[]})$%*+-';
63 63
     // Complete password con PKCS7-specific padding
64 64
     $blockSize = 16;
65
-    $padding = $blockSize - (strlen($password)%$blockSize);
65
+    $padding = $blockSize - (strlen($password) % $blockSize);
66 66
     $password .= str_repeat(chr($padding), $padding);
67 67
     $cipher = new Crypt_AES(CRYPT_AES_MODE_CFB);
68 68
     $cipher->setKeyLength(128);
Please login to merge, or discard this patch.
main/inc/lib/events.lib.php 1 patch
Spacing   +9 added lines, -11 removed lines patch added patch discarded remove patch
@@ -77,9 +77,7 @@  discard block
 block discarded – undo
77 77
         Database::query($sql);
78 78
 
79 79
         // Auto subscribe
80
-        $user_status = $userInfo['status']  == SESSIONADMIN ? 'sessionadmin' :
81
-            $userInfo['status'] == COURSEMANAGER ? 'teacher' :
82
-                $userInfo['status'] == DRH ? 'DRH' : 'student';
80
+        $user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : $userInfo['status'] == COURSEMANAGER ? 'teacher' : $userInfo['status'] == DRH ? 'DRH' : 'student';
83 81
         $autoSubscribe = api_get_setting($user_status.'_autosubscribe');
84 82
         if ($autoSubscribe) {
85 83
             $autoSubscribe = explode('|', $autoSubscribe);
@@ -336,7 +334,7 @@  discard block
 block discarded – undo
336 334
         global $debug;
337 335
 
338 336
         if ($debug) error_log('Called to update_event_exercice');
339
-        if ($debug) error_log('duration:' . $duration);
337
+        if ($debug) error_log('duration:'.$duration);
340 338
 
341 339
         if ($exeid != '') {
342 340
             /*
@@ -384,7 +382,7 @@  discard block
 block discarded – undo
384 382
         		   status = '".$status."',
385 383
         		   questions_to_check = '".$remind_list."',
386 384
         		   data_tracking = '".implode(',', $question_list)."',
387
-                   user_ip = '" . Database::escape_string(api_get_real_ip()) . "'
385
+                   user_ip = '" . Database::escape_string(api_get_real_ip())."'
388 386
         		 WHERE exe_id = '".Database::escape_string($exeid)."'";
389 387
             $res = Database::query($sql);
390 388
 
@@ -1055,15 +1053,15 @@  discard block
 block discarded – undo
1055 1053
 
1056 1054
         if (!empty($exe_list) && is_array($exe_list) && count($exe_list) > 0) {
1057 1055
             $sql = "DELETE FROM $track_e_exercises
1058
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1056
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1059 1057
             Database::query($sql);
1060 1058
 
1061 1059
             $sql = "DELETE FROM $track_attempts
1062
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1060
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1063 1061
             Database::query($sql);
1064 1062
 
1065 1063
             $sql = "DELETE FROM $recording_table
1066
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1064
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1067 1065
             Database::query($sql);
1068 1066
         }
1069 1067
 
@@ -1105,7 +1103,7 @@  discard block
 block discarded – undo
1105 1103
             Event::addEvent(
1106 1104
                 LOG_EXERCISE_RESULT_DELETE,
1107 1105
                 LOG_EXERCISE_AND_USER_ID,
1108
-                $exercise_id . '-' . $user_id,
1106
+                $exercise_id.'-'.$user_id,
1109 1107
                 null,
1110 1108
                 null,
1111 1109
                 $course_id,
@@ -1705,7 +1703,7 @@  discard block
 block discarded – undo
1705 1703
         Event::addEvent(
1706 1704
             LOG_QUESTION_RESULT_DELETE,
1707 1705
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1708
-            $exe_id . '-' . $question_id,
1706
+            $exe_id.'-'.$question_id,
1709 1707
             null,
1710 1708
             null,
1711 1709
             $courseId,
@@ -1741,7 +1739,7 @@  discard block
 block discarded – undo
1741 1739
         Event::addEvent(
1742 1740
             LOG_QUESTION_RESULT_DELETE,
1743 1741
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1744
-            $exe_id . '-' . $question_id,
1742
+            $exe_id.'-'.$question_id,
1745 1743
             null,
1746 1744
             null,
1747 1745
             $courseId,
Please login to merge, or discard this patch.
main/admin/dashboard_add_users_to_user.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 // setting breadcrumbs
26 26
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
27
-$interbreadcrumb[] = array('url' => 'user_list.php','name' => get_lang('UserList'));
27
+$interbreadcrumb[] = array('url' => 'user_list.php', 'name' => get_lang('UserList'));
28 28
 
29 29
 // Database Table Definitions
30 30
 $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
@@ -44,17 +44,17 @@  discard block
 block discarded – undo
44 44
 $isAdmin = UserManager::is_admin($user_id);
45 45
 if ($isAdmin) {
46 46
     $userStatus = PLATFORM_ADMIN;
47
-    $tool_name= get_lang('AssignUsersToPlatformAdministrator');
47
+    $tool_name = get_lang('AssignUsersToPlatformAdministrator');
48 48
 } else if ($user_info['status'] == SESSIONADMIN) {
49
-    $tool_name= get_lang('AssignUsersToSessionsAdministrator');
50
-} else if  ($user_info['status'] == STUDENT_BOSS) {
51
-    $tool_name= get_lang('AssignUsersToBoss');
49
+    $tool_name = get_lang('AssignUsersToSessionsAdministrator');
50
+} else if ($user_info['status'] == STUDENT_BOSS) {
51
+    $tool_name = get_lang('AssignUsersToBoss');
52 52
 } else {
53
-    $tool_name= get_lang('AssignUsersToHumanResourcesManager');
53
+    $tool_name = get_lang('AssignUsersToHumanResourcesManager');
54 54
 }
55 55
 
56 56
 $add_type = 'multiple';
57
-if (isset($_GET['add_type']) && $_GET['add_type']!='') {
57
+if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
58 58
 	$add_type = Security::remove_XSS($_REQUEST['add_type']);
59 59
 }
60 60
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 function search_users($needle, $type)
66 66
 {
67
-    global $tbl_access_url_rel_user,  $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus;
67
+    global $tbl_access_url_rel_user, $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus;
68 68
 
69 69
     $xajax_response = new xajaxResponse();
70 70
     $return = '';
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                     LEFT JOIN $tbl_access_url_rel_user au ON (au.user_id = user.user_id)
103 103
                     WHERE
104 104
                         ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND
105
-                        status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND
105
+                        status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND
106 106
                         user.user_id NOT IN ($user_anonymous, $current_user_id, $user_id)
107 107
                         $without_assigned_users AND
108 108
                         access_url_id = ".api_get_current_access_url_id()."
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
                     FROM $tbl_user user
115 115
                     WHERE
116 116
                         ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND
117
-                        status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND
117
+                        status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND
118 118
                         user_id NOT IN ($user_anonymous, $current_user_id, $user_id)
119 119
                     $without_assigned_users
120 120
                     $order_clause
121 121
             ";
122 122
         }
123
-        $rs	= Database::query($sql);
123
+        $rs = Database::query($sql);
124 124
         $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
125 125
 
126 126
         if ($type == 'single') {
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 
141 141
             switch ($userStatus) {
142 142
                 case DRH:
143
-                    $sql .= " user.status <> 6 AND user.status <> " . DRH;
143
+                    $sql .= " user.status <> 6 AND user.status <> ".DRH;
144 144
                     break;
145 145
                 case STUDENT_BOSS:
146
-                    $sql .= " user.status <> 6 AND user.status <> " . STUDENT_BOSS;
146
+                    $sql .= " user.status <> 6 AND user.status <> ".STUDENT_BOSS;
147 147
                     break;
148 148
             }
149 149
 
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
                     $return .= '...<br />';
161 161
                 }
162 162
             }
163
-           $xajax_response->addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
163
+           $xajax_response->addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return));
164 164
         } else {
165 165
             $return .= '<select id="origin" class="form-control" name="NoAssignedUsersList[]" multiple="multiple" size="15" ">';
166
-            while($user = Database :: fetch_array($rs)) {
166
+            while ($user = Database :: fetch_array($rs)) {
167 167
                 $person_name = api_get_person_name($user['firstname'], $user['lastname']);
168
-                $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name,ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>';
168
+                $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name, ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>';
169 169
             }
170 170
             $return .= '</select>';
171 171
             $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 }
243 243
 </script>';
244 244
 
245
-$formSent=0;
245
+$formSent = 0;
246 246
 $errorMsg = '';
247 247
 $UserList = array();
248 248
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
 $searchForm = new FormValidator('search', 'get', api_get_self().'?user='.$user_id);
259 259
 $searchForm->addHeader(get_lang('AdvancedSearch'));
260
-$renderer =& $searchForm->defaultRenderer();
260
+$renderer = & $searchForm->defaultRenderer();
261 261
 
262 262
 $searchForm->addElement('hidden', 'user', $user_id);
263 263
 foreach ($filters as $param) {
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
             $affected_rows = 0;
300 300
     }
301 301
 
302
-    if ($affected_rows)	{
302
+    if ($affected_rows) {
303 303
         $msg = get_lang('AssignedUsersHaveBeenUpdatedSuccessfully');
304 304
     }
305 305
 }
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 }
323 323
 
324 324
 $actionsRight = Display::url(
325
-    '<em class="fa fa-search"></em> ' . get_lang('AdvancedSearch'),
325
+    '<em class="fa fa-search"></em> '.get_lang('AdvancedSearch'),
326 326
     '#',
327 327
     array('class' => 'btn btn-default advanced_options', 'id' => 'advanced_search')
328 328
 );
@@ -359,13 +359,13 @@  discard block
 block discarded – undo
359 359
 $assigned_users_id = array_keys($assigned_users_to_hrm);
360 360
 $without_assigned_users = '';
361 361
 if (count($assigned_users_id) > 0) {
362
-	$without_assigned_users = " user.user_id NOT IN(".implode(',',$assigned_users_id).") AND ";
362
+	$without_assigned_users = " user.user_id NOT IN(".implode(',', $assigned_users_id).") AND ";
363 363
 }
364 364
 
365 365
 $search_user = '';
366 366
 if (!empty($firstLetterUser)) {
367 367
 	$needle = Database::escape_string($firstLetterUser);
368
-	$search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
368
+	$search_user = "AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
369 369
 }
370 370
 
371 371
 $sqlConditions = null;
@@ -406,12 +406,12 @@  discard block
 block discarded – undo
406 406
 			    $sqlConditions
407 407
             ORDER BY firstname ";
408 408
 }
409
-$result	= Database::query($sql);
409
+$result = Database::query($sql);
410 410
 ?>
411
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" class="form-horizontal" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
411
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" class="form-horizontal" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
412 412
 <input type="hidden" name="formSent" value="1" />
413 413
 <?php
414
-if(!empty($msg)) {
414
+if (!empty($msg)) {
415 415
 	Display::display_normal_message($msg); //main API
416 416
 }
417 417
 ?>
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
                         <?php
428 428
                             while ($enreg = Database::fetch_array($result)) {
429 429
                                 $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']); ?>
430
-                                <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"';?>>
430
+                                <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>>
431 431
                                 <?php echo $person_name.' ('.$enreg['username'].')'; ?>
432 432
                                 </option>
433 433
                         <?php } ?>
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
     </div>
441 441
     <div class="col-md-4">
442 442
         <div class="code-course">
443
-            <?php if($add_type == 'multiple') { ?>
444
-                <p><?php echo get_lang('FirstLetterUser');?></p>
443
+            <?php if ($add_type == 'multiple') { ?>
444
+                <p><?php echo get_lang('FirstLetterUser'); ?></p>
445 445
                 <select class="selectpicker show-tick form-control" name="firstLetterUser" onchange = "xajax_search_users(this.value,'multiple')">
446 446
                     <option value="%">--</option>
447 447
                     <?php echo Display::get_alphabet_options($firstLetterUser); ?>
@@ -492,10 +492,10 @@  discard block
 block discarded – undo
492 492
                 <select id='destination' class="form-control" name="UsersList[]" multiple="multiple" size="15" >
493 493
                     <?php
494 494
                     if (is_array($assigned_users_to_hrm)) {
495
-                        foreach($assigned_users_to_hrm as $enreg) {
495
+                        foreach ($assigned_users_to_hrm as $enreg) {
496 496
                             $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']);
497 497
                     ?>
498
-                            <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"'; ?>>
498
+                            <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>>
499 499
                             <?php echo $person_name.' ('.$enreg['username'].')'; ?>
500 500
                             </option>
501 501
                         <?php }
Please login to merge, or discard this patch.
main/admin/dashboard_add_sessions_to_user.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 }
47 47
 
48 48
 $add_type = 'multiple';
49
-if (isset($_GET['add_type']) && $_GET['add_type']!='') {
49
+if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
50 50
     $add_type = Security::remove_XSS($_REQUEST['add_type']);
51 51
 }
52 52
 
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
             $sql = "SELECT s.id, s.name FROM $tbl_session s
83 83
                     WHERE  s.name LIKE '$needle%' $without_assigned_sessions ";
84 84
         }
85
-        $rs	= Database::query($sql);
85
+        $rs = Database::query($sql);
86 86
         $return .= '<select class="form-control" id="origin" name="NoAssignedSessionsList[]" multiple="multiple" size="20">';
87
-        while($session = Database :: fetch_array($rs)) {
88
-            $return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'],ENT_QUOTES).'">'.$session['name'].'</option>';
87
+        while ($session = Database :: fetch_array($rs)) {
88
+            $return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'], ENT_QUOTES).'">'.$session['name'].'</option>';
89 89
         }
90 90
         $return .= '</select>';
91
-        $xajax_response->addAssign('ajax_list_sessions_multiple','innerHTML',api_utf8_encode($return));
91
+        $xajax_response->addAssign('ajax_list_sessions_multiple', 'innerHTML', api_utf8_encode($return));
92 92
     }
93 93
 
94 94
     return $xajax_response;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 }
148 148
 </script>';
149 149
 
150
-$formSent=0;
150
+$formSent = 0;
151 151
 $firstLetterSession = isset($_POST['firstLetterSession']) ? $_POST['firstLetterSession'] : null;
152 152
 $errorMsg = '';
153 153
 $UserList = array();
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 
172 172
 // Actions
173 173
 if ($user_info['status'] != SESSIONADMIN) {
174
-    $actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">' .
175
-        Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM ) . '</a>';
176
-    $actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">' .
177
-        Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM) . '</a>';
174
+    $actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">'.
175
+        Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM).'</a>';
176
+    $actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">'.
177
+        Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM).'</a>';
178 178
 }
179 179
 
180 180
 echo Display::toolbarAction('toolbar-dashboard', array($actionsLeft));
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 $without_assigned_sessions = '';
191 191
 if (count($assigned_sessions_id) > 0) {
192
-    $without_assigned_sessions = " AND s.id NOT IN (".implode(',',$assigned_sessions_id).") ";
192
+    $without_assigned_sessions = " AND s.id NOT IN (".implode(',', $assigned_sessions_id).") ";
193 193
 }
194 194
 
195 195
 $needle = '%';
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
 		    WHERE  s.name LIKE '$needle%' $without_assigned_sessions
211 211
             ORDER BY s.name";
212 212
 }
213
-$result	= Database::query($sql);
213
+$result = Database::query($sql);
214 214
 ?>
215
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if($ajax_search){ echo ' onsubmit="valide();"';}?>>
215
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if ($ajax_search) { echo ' onsubmit="valide();"'; }?>>
216 216
     <input type="hidden" name="formSent" value="1" />
217 217
 
218 218
     <div class="row">
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                     <?php
224 224
                     while ($enreg = Database::fetch_array($result)) {
225 225
                     ?>
226
-                        <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"';?>>
226
+                        <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>>
227 227
                             <?php echo $enreg['name']; ?>
228 228
                         </option>
229 229
                     <?php } ?>
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         <div class="col-md-4">
234 234
             <div class="code-course">
235 235
                 <?php if ($add_type == 'multiple') { ?>
236
-                <p><?php echo get_lang('FirstLetterSession');?> :</p>
236
+                <p><?php echo get_lang('FirstLetterSession'); ?> :</p>
237 237
                 <select class="selectpicker form-control" name="firstLetterSession" onchange = "xajax_search_sessions(this.value, 'multiple')">
238 238
                     <option value="%">--</option>
239 239
                         <?php  echo Display :: get_alphabet_options($firstLetterSession); ?>
@@ -282,9 +282,9 @@  discard block
 block discarded – undo
282 282
              <select id='destination' name="SessionsList[]" multiple="multiple" size="20" style="width:320px;">
283 283
                 <?php
284 284
                 if (is_array($assigned_sessions_to_hrm)) {
285
-                    foreach($assigned_sessions_to_hrm as $enreg) {
285
+                    foreach ($assigned_sessions_to_hrm as $enreg) {
286 286
                         ?>
287
-                        <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; ?>>
287
+                        <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>>
288 288
                             <?php echo $enreg['name'] ?>
289 289
                         </option>
290 290
                 <?php }
Please login to merge, or discard this patch.
main/gradebook/gradebook_edit_link.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 }
25 25
 
26 26
 $linkcat  = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
27
-$linkedit = isset($_GET['editlink']) ? Security::remove_XSS($_GET['editlink']):'';
27
+$linkedit = isset($_GET['editlink']) ? Security::remove_XSS($_GET['editlink']) : '';
28 28
 $course_code = api_get_course_id();
29 29
 $session_id = api_get_session_id();
30 30
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     null,
49 49
     $link,
50 50
     'edit_link_form',
51
-    api_get_self() . '?selectcat=' . $linkcat. '&editlink=' . $linkedit.'&'.api_get_cidreq()
51
+    api_get_self().'?selectcat='.$linkcat.'&editlink='.$linkedit.'&'.api_get_cidreq()
52 52
 );
53 53
 if ($form->validate()) {
54 54
     $values = $form->exportValues();
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     //Update weight for attendance
66 66
     $sql = 'SELECT ref_id FROM '.$tbl_grade_links.'
67 67
             WHERE id = '.intval($_GET['editlink']).' AND type='.LINK_ATTENDANCE;
68
-    $rs_attendance  = Database::query($sql);
68
+    $rs_attendance = Database::query($sql);
69 69
     if (Database::num_rows($rs_attendance) > 0) {
70 70
         $row_attendance = Database::fetch_array($rs_attendance);
71 71
         $attendance_id  = $row_attendance['ref_id'];
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             'type' => LINK_STUDENTPUBLICATION
102 102
         ]);
103 103
 
104
-    header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat=' . $link->get_category_id().'&'.api_get_cidreq());
104
+    header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat='.$link->get_category_id().'&'.api_get_cidreq());
105 105
     exit;
106 106
 }
107 107
 
Please login to merge, or discard this patch.
main/admin/settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     Display::addFlash(Display::return_message(get_lang('FileDeleted')));
60 60
 }
61 61
 
62
-if (isset($_GET['action']) &&  $_GET['action'] == 'delete_grading') {
62
+if (isset($_GET['action']) && $_GET['action'] == 'delete_grading') {
63 63
     $id = intval($_GET['id']);
64 64
     api_delete_setting_option($id);
65 65
 }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
         // Set true for allow_message_tool variable if social tool is actived
227 227
         foreach ($convert_byte_to_mega_list as $item) {
228 228
             if (isset($values[$item])) {
229
-                $values[$item] = round($values[$item]*1024*1024);
229
+                $values[$item] = round($values[$item] * 1024 * 1024);
230 230
             }
231 231
         }
232 232
 
Please login to merge, or discard this patch.