Completed
Push — 1.11.x ( 566ea6...b264ab )
by José
110:20 queued 69:00
created
main/admin/course_import.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@
 block discarded – undo
12 12
  */
13 13
 function validate_data($courses)
14 14
 {
15
-    $errors = array ();
16
-    $coursecodes = array ();
15
+    $errors = array();
16
+    $coursecodes = array();
17 17
     foreach ($courses as $index => $course) {
18
-        $course['line'] = $index +1;
18
+        $course['line'] = $index + 1;
19 19
 
20 20
         // 1. Check whether mandatory fields are set.
21
-        $mandatory_fields = array ('Code', 'Title', 'CourseCategory');
21
+        $mandatory_fields = array('Code', 'Title', 'CourseCategory');
22 22
         foreach ($mandatory_fields as $field) {
23 23
             if (!isset($course[$field]) || strlen($course[$field]) == 0) {
24 24
                 $course['error'] = get_lang($field.'Mandatory');
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
 /**
152 152
  * Read the CSV-file
153 153
  * @param string $file Path to the CSV-file
154
- * @return array All course-information read from the file
154
+ * @return Ddeboer\DataImport\Reader\CsvReader All course-information read from the file
155 155
  */
156 156
 function parse_csv_data($file)
157 157
 {
Please login to merge, or discard this patch.
main/admin/subscribe_user2class.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
 $result = Database::query($sql);
33 33
 
34 34
 if (!list ($class_name) = Database::fetch_row($result)) {
35
-    header('Location: class_list.php?filtreCours=' . urlencode($course));
35
+    header('Location: class_list.php?filtreCours='.urlencode($course));
36 36
     exit();
37 37
 }
38 38
 
39 39
 $noPHP_SELF = true;
40 40
 
41
-$tool_name = get_lang('AddUsersToAClass') . ' (' . $class_name . ')';
41
+$tool_name = get_lang('AddUsersToAClass').' ('.$class_name.')';
42 42
 
43 43
 $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
44
-$interbreadcrumb[] = array("url" => "class_list.php?filtreCours=" . urlencode($course), "name" => get_lang('AdminClasses'));
44
+$interbreadcrumb[] = array("url" => "class_list.php?filtreCours=".urlencode($course), "name" => get_lang('AdminClasses'));
45 45
 
46 46
 if ($_POST['formSent']) {
47 47
     $form_sent = $_POST['formSent'];
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
                 foreach ($left_user_list as $user_id) {
60 60
                     ClassManager :: add_user($user_id, $class_id);
61 61
                 }
62
-                header('Location: class_list.php?filtreCours=' . urlencode($course));
62
+                header('Location: class_list.php?filtreCours='.urlencode($course));
63 63
                 exit();
64 64
             }
65 65
         } elseif ($remove_from_class) {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                 foreach ($right_user_list as $index => $user_id) {
70 70
                     ClassManager :: unsubscribe_user($user_id, $class_id);
71 71
                 }
72
-                header('Location: class_list.php?filtreCours=' . urlencode($course));
72
+                header('Location: class_list.php?filtreCours='.urlencode($course));
73 73
                 exit();
74 74
             }
75 75
         }
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 Display :: display_header($tool_name);
79 79
 //api_display_tool_title($tool_name);
80 80
 $target_name = api_sort_by_first_name() ? 'firstname' : 'lastname';
81
-$sql = "SELECT u.user_id,lastname,firstname,username FROM $tbl_user u LEFT JOIN $tbl_class_user cu ON u.user_id=cu.user_id AND class_id='$class_id' WHERE " . $target_name . " LIKE '" . $first_letter_left . "%' AND class_id IS NULL ORDER BY " . (count($left_user_list) > 0 ? "(user_id IN(" . implode(',', $left_user_list) . ")) DESC," : "") . " " . $target_name;
81
+$sql = "SELECT u.user_id,lastname,firstname,username FROM $tbl_user u LEFT JOIN $tbl_class_user cu ON u.user_id=cu.user_id AND class_id='$class_id' WHERE ".$target_name." LIKE '".$first_letter_left."%' AND class_id IS NULL ORDER BY ".(count($left_user_list) > 0 ? "(user_id IN(".implode(',', $left_user_list).")) DESC," : "")." ".$target_name;
82 82
 $result = Database::query($sql);
83 83
 $left_users = Database::store_result($result);
84
-$sql = "SELECT u.user_id,lastname,firstname,username FROM $tbl_user u,$tbl_class_user cu WHERE cu.user_id=u.user_id AND class_id='$class_id' AND " . $target_name . " LIKE '" . $first_letter_right . "%' ORDER BY " . (count($right_user_list) > 0 ? "(user_id IN(" . implode(',', $right_user_list) . ")) DESC," : "") . " " . $target_name;
84
+$sql = "SELECT u.user_id,lastname,firstname,username FROM $tbl_user u,$tbl_class_user cu WHERE cu.user_id=u.user_id AND class_id='$class_id' AND ".$target_name." LIKE '".$first_letter_right."%' ORDER BY ".(count($right_user_list) > 0 ? "(user_id IN(".implode(',', $right_user_list).")) DESC," : "")." ".$target_name;
85 85
 $result = Database::query($sql);
86 86
 $right_users = Database::store_result($result);
87 87
 if (!empty($error_message)) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                 <?php
123 123
                 foreach ($left_users as $user) {
124 124
                     ?>
125
-                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
125
+                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?></option>
126 126
                         <?php
127 127
                     }
128 128
                     ?>
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                     <?php
139 139
                     foreach ($right_users as $user) {
140 140
                         ?>
141
-                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
141
+                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?></option>
142 142
     <?php
143 143
 }
144 144
 ?>
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
                 exit();
64 64
             }
65 65
         } elseif ($remove_from_class) {
66
-            if (count($right_user_list) == 0)
67
-                $error_message = get_lang('AtLeastOneUser');
68
-            else {
66
+            if (count($right_user_list) == 0) {
67
+                            $error_message = get_lang('AtLeastOneUser');
68
+            } else {
69 69
                 foreach ($right_user_list as $index => $user_id) {
70 70
                     ClassManager :: unsubscribe_user($user_id, $class_id);
71 71
                 }
@@ -122,7 +122,10 @@  discard block
 block discarded – undo
122 122
                 <?php
123 123
                 foreach ($left_users as $user) {
124 124
                     ?>
125
-                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
125
+                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) {
126
+    echo 'selected="selected"';
127
+}
128
+?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
126 129
                         <?php
127 130
                     }
128 131
                     ?>
@@ -138,7 +141,10 @@  discard block
 block discarded – undo
138 141
                     <?php
139 142
                     foreach ($right_users as $user) {
140 143
                         ?>
141
-                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
144
+                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) {
145
+    echo 'selected="selected"';
146
+}
147
+?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
142 148
     <?php
143 149
 }
144 150
 ?>
Please login to merge, or discard this patch.
main/admin/subscribe_user2course.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
       <option value="">--</option>
264 264
       <?php
265 265
         echo Display :: get_alphabet_options($first_letter_user);
266
-      ?>
266
+        ?>
267 267
      </select>
268 268
     </td>
269 269
     <td width="20%">&nbsp;</td>
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
      <select name="firstLetterCourse" onchange="javascript:document.formulaire.form_sent.value='2'; document.formulaire.submit();">
275 275
       <option value="">--</option>
276 276
       <?php
277
-      echo Display :: get_alphabet_options($first_letter_course);
278
-      ?>
277
+        echo Display :: get_alphabet_options($first_letter_course);
278
+        ?>
279 279
      </select>
280 280
     </td>
281 281
    </tr>
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         }
296 296
 
297 297
         echo $userName;
298
-      ?>
298
+        ?>
299 299
       </option>
300 300
 <?php
301 301
 }
Please login to merge, or discard this patch.
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -287,7 +287,10 @@  discard block
 block discarded – undo
287 287
     <td width="40%" align="center">
288 288
      <select name="UserList[]" multiple="multiple" size="20" style="width:300px;">
289 289
     <?php foreach ($db_users as $user) { ?>
290
-          <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) echo 'selected="selected"'; ?>>
290
+          <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) {
291
+    echo 'selected="selected"';
292
+}
293
+?>>
291 294
       <?php
292 295
         $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')';
293 296
         if ($showOfficialCode) {
@@ -308,7 +311,10 @@  discard block
 block discarded – undo
308 311
    <td width="40%" align="center">
309 312
     <select name="CourseList[]" multiple="multiple" size="20" style="width:300px;">
310 313
     <?php foreach ($db_courses as $course) { ?>
311
-         <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>>
314
+         <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) {
315
+    echo 'selected="selected"';
316
+}
317
+?>>
312 318
              <?php echo '('.$course['visual_code'].') '.$course['title']; ?>
313 319
          </option>
314 320
     <?php } ?>
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
 /* Header */
32 32
 $tool_name = get_lang('AddUsersToACourse');
33
-$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
33
+$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
34 34
 
35 35
 $htmlHeadXtra[] = '<script>
36 36
 function validate_filter() {
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
                 if (isset($_POST[$varname]) && $_POST[$varname] != '0') {
143 143
                     $use_extra_fields = true;
144 144
                     if ($fieldtype == ExtraField::FIELD_TYPE_TAG) {
145
-                        $extra_field_result[]= UserManager::get_extra_user_data_by_tags(
145
+                        $extra_field_result[] = UserManager::get_extra_user_data_by_tags(
146 146
                             intval($_POST['field_id']),
147 147
                             $_POST[$varname]
148 148
                         );
149 149
                     } else {
150
-                        $extra_field_result[]= UserManager::get_extra_user_data_by_value(
150
+                        $extra_field_result[] = UserManager::get_extra_user_data_by_value(
151 151
                             $new_field['variable'],
152 152
                             $_POST[$varname]
153 153
                         );
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
     $final_result = array();
164 164
     if (count($extra_field_result) > 1) {
165 165
         for ($i = 0; $i < count($extra_field_result) - 1; $i++) {
166
-            if (is_array($extra_field_result[$i+1])) {
167
-                $final_result  = array_intersect($extra_field_result[$i], $extra_field_result[$i+1]);
166
+            if (is_array($extra_field_result[$i + 1])) {
167
+                $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i + 1]);
168 168
             }
169 169
         }
170 170
     } else {
@@ -172,14 +172,14 @@  discard block
 block discarded – undo
172 172
     }
173 173
 
174 174
     if (api_is_multiple_url_enabled()) {
175
-        if (is_array($final_result) && count($final_result)>0) {
176
-            $where_filter = " AND u.user_id IN  ('".implode("','",$final_result)."') ";
175
+        if (is_array($final_result) && count($final_result) > 0) {
176
+            $where_filter = " AND u.user_id IN  ('".implode("','", $final_result)."') ";
177 177
         } else {
178 178
             //no results
179 179
             $where_filter = " AND u.user_id  = -1";
180 180
         }
181 181
     } else {
182
-        if (is_array($final_result) && count($final_result)>0) {
182
+        if (is_array($final_result) && count($final_result) > 0) {
183 183
             $where_filter = " AND user_id IN  ('".implode("','", $final_result)."') ";
184 184
         } else {
185 185
             //no results
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
 $sql = "SELECT user_id, lastname, firstname, username, official_code
201 201
         FROM $tbl_user
202 202
         WHERE user_id<>2 AND ".$target_name." LIKE '".$first_letter_user."%' $where_filter
203
-        ORDER BY ". (count($users) > 0 ? "(user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy;
203
+        ORDER BY ".(count($users) > 0 ? "(user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy;
204 204
 
205 205
 if (api_is_multiple_url_enabled()) {
206
-    $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
206
+    $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
207 207
     $access_url_id = api_get_current_access_url_id();
208 208
     if ($access_url_id != -1) {
209 209
         $sql = "SELECT u.user_id,lastname,firstname,username, official_code
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                     access_url_id =  $access_url_id AND
216 216
                     (".$target_name." LIKE '".$first_letter_user."%' )
217 217
                     $where_filter
218
-                ORDER BY ". (count($users) > 0 ? "(u.user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy;
218
+                ORDER BY ".(count($users) > 0 ? "(u.user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy;
219 219
     }
220 220
 }
221 221
 
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
             $fieldtype = $new_field['type'];
259 259
             echo '&nbsp;<select name="'.$varname.'">';
260 260
             echo '<option value="0">--'.get_lang('Select').'--</option>';
261
-            foreach	($new_field['data'] as $option) {
262
-                $checked='';
261
+            foreach ($new_field['data'] as $option) {
262
+                $checked = '';
263 263
                 if ($fieldtype == ExtraField::FIELD_TYPE_TAG) {
264 264
                     if (isset($_POST[$varname])) {
265 265
                         if ($_POST[$varname] == $option['tag']) {
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
     <td width="40%" align="center">
318 318
      <select name="UserList[]" multiple="multiple" size="20" style="width:300px;">
319 319
     <?php foreach ($db_users as $user) { ?>
320
-          <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) echo 'selected="selected"'; ?>>
320
+          <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>>
321 321
       <?php
322 322
         $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')';
323 323
         if ($showOfficialCode) {
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
    <td width="40%" align="center">
339 339
     <select name="CourseList[]" multiple="multiple" size="20" style="width:300px;">
340 340
     <?php foreach ($db_courses as $course) { ?>
341
-         <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>>
341
+         <option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) echo 'selected="selected"'; ?>>
342 342
              <?php echo '('.$course['visual_code'].') '.$course['title']; ?>
343 343
          </option>
344 344
     <?php } ?>
Please login to merge, or discard this patch.
main/admin/teacher_time_report.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -295,7 +295,7 @@
 block discarded – undo
295 295
 if (isset($_GET['export'])) {
296 296
     $dataToExport = $timeReport->prepareDataToExport($withFilter);
297 297
 
298
-    $fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time();
298
+    $fileName = get_lang('TeacherTimeReport').' '.api_get_local_time();
299 299
 
300 300
     switch ($_GET['export']) {
301 301
         case 'pdf':
Please login to merge, or discard this patch.
main/admin/skills_gradebook.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
                         array('name'=>'certificate',    'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'),
51 51
                         array('name'=>'skills',         'index'=>'skills',      'width'=>'300', 'align'=>'left', 'sortable'=>'false'),
52 52
                         array('name'=>'actions',        'index'=>'actions',     'width'=>'30', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false')
53
-                       );
53
+                        );
54 54
 //Autowidth
55 55
 $extra_params['autowidth'] = 'true';
56 56
 //height auto
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 // setting breadcrumbs
26 26
 
27 27
 $tool_name = get_lang('SkillsAndGradebooks');
28
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
28
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
29 29
 if ($action == 'add_skill') {
30
-    $interbreadcrumb[]=array('url' => 'skills_gradebook.php','name' => get_lang('SkillsAndGradebooks'));
30
+    $interbreadcrumb[] = array('url' => 'skills_gradebook.php', 'name' => get_lang('SkillsAndGradebooks'));
31 31
     $tool_name = get_lang('Add');
32 32
 }
33 33
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
 //Column config
48 48
 $column_model   = array(
49
-                        array('name'=>'name',           'index'=>'name',        'width'=>'150', 'align'=>'left'),
50
-                        array('name'=>'certificate',    'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'),
51
-                        array('name'=>'skills',         'index'=>'skills',      'width'=>'300', 'align'=>'left', 'sortable'=>'false'),
52
-                        array('name'=>'actions',        'index'=>'actions',     'width'=>'30', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false')
49
+                        array('name'=>'name', 'index'=>'name', 'width'=>'150', 'align'=>'left'),
50
+                        array('name'=>'certificate', 'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'),
51
+                        array('name'=>'skills', 'index'=>'skills', 'width'=>'300', 'align'=>'left', 'sortable'=>'false'),
52
+                        array('name'=>'actions', 'index'=>'actions', 'width'=>'30', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false')
53 53
                        );
54 54
 //Autowidth
55 55
 $extra_params['autowidth'] = 'true';
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
61 61
                         //certificates
62 62
                         if (rowObject[4] == 1) {
63
-                            return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'),'',ICON_SIZE_SMALL).'</a>'.'\';
63
+                            return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'), '', ICON_SIZE_SMALL).'</a>'.'\';
64 64
                         } else {
65
-                            return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'),'',ICON_SIZE_SMALL).''.'\';
65
+                            return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'), '', ICON_SIZE_SMALL).''.'\';
66 66
                         }
67 67
                  }';
68 68
 ?>
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 $(function() {
71 71
 <?php
72 72
     // grid definition see the $career->display() function
73
-    echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links,true);
73
+    echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
74 74
 ?>
75 75
 });
76 76
 </script>
77 77
 <?php
78 78
 $gradebook = new Gradebook();
79 79
 
80
-switch($action) {
80
+switch ($action) {
81 81
     case 'display':
82 82
         $gradebook->display();
83 83
         break;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
86 86
         $gradebook_info = $gradebook->get($id);
87 87
         $url  = api_get_self().'?action='.$action.'&id='.$id;
88
-        $form =  $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
88
+        $form = $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
89 89
         if ($form->validate()) {
90 90
             $values = $form->exportValues();
91 91
             $res    = $gradebook->update_skills_to_gradebook($values['id'], $values['skill']);
Please login to merge, or discard this patch.
main/admin/access_url_edit_users_to_url.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 function send() {
63 63
 	if (document.formulaire.access_url_id.value!=0) {
64 64
 		document.formulaire.form_sent.value=0;
65
-		document.formulaire.add_type.value=\'' . $add_type . '\';
65
+		document.formulaire.add_type.value=\'' . $add_type.'\';
66 66
 		document.formulaire.submit();
67 67
 	}
68 68
 }
@@ -92,23 +92,23 @@  discard block
 block discarded – undo
92 92
     }
93 93
     if ($form_sent == 1) {
94 94
         if ($access_url_id == 0) {
95
-            header('Location: access_url_edit_users_to_url.php?action=show_message&message=' . get_lang('SelectURL'));
95
+            header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL'));
96 96
             exit;
97 97
         } elseif (is_array($UserList)) {
98 98
             $result = UrlManager::update_urls_rel_user($UserList, $access_url_id);
99 99
             $url_info = UrlManager::get_url_data_from_id($access_url_id);
100 100
             if (!empty($result)) {
101
-                $message .= 'URL: ' . $url_info['url'] . '<br />';
101
+                $message .= 'URL: '.$url_info['url'].'<br />';
102 102
             }
103 103
 
104 104
             if (!empty($result['users_added'])) {
105
-                $message .= '<h4>' . get_lang('UsersAdded') . ':</h4>';
105
+                $message .= '<h4>'.get_lang('UsersAdded').':</h4>';
106 106
                 $i = 1;
107 107
                 $user_added_list = array();
108 108
                 foreach ($result['users_added'] as $user) {
109 109
                     $user_info = api_get_user_info($user);
110 110
                     if (!empty($user_info)) {
111
-                        $user_added_list[] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']);
111
+                        $user_added_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']);
112 112
                         $i++;
113 113
                     }
114 114
                 }
@@ -118,13 +118,13 @@  discard block
 block discarded – undo
118 118
             }
119 119
 
120 120
             if (!empty($result['users_deleted'])) {
121
-                $message .= '<br /><h4>' . get_lang('UsersDeleted') . ': </h4>';
121
+                $message .= '<br /><h4>'.get_lang('UsersDeleted').': </h4>';
122 122
                 $user_deleted_list = array();
123 123
                 $i = 1;
124 124
                 foreach ($result['users_deleted'] as $user) {
125 125
                     $user_info = api_get_user_info($user);
126 126
                     if (!empty($user_info)) {
127
-                        $user_deleted_list [] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname']);
127
+                        $user_deleted_list [] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
128 128
                         $i++;
129 129
                     }
130 130
                 }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 }
144 144
 
145 145
 echo '<div class="actions">';
146
-echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH) . 'admin/access_url_add_users_to_url.php');
146
+echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_users_to_url.php');
147 147
 echo '</div>';
148 148
 
149 149
 api_display_tool_title($tool_name);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     }
172 172
 
173 173
     $sql = "SELECT u.user_id, lastname, firstname, username
174
-	  	  	FROM $tbl_user u WHERE status <> " . ANONYMOUS . " " .
174
+	  	  	FROM $tbl_user u WHERE status <> ".ANONYMOUS." ".
175 175
             $order_clause;
176 176
     $result = Database::query($sql);
177 177
     $Users = Database::store_result($result);
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 }
185 185
 
186 186
 if ($add_type == 'multiple') {
187
-    $link_add_type_unique = '<a href="' . api_get_self() . '?add_type=unique&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeUnique') . '</a>';
187
+    $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
188 188
     $link_add_type_multiple = get_lang('SessionAddTypeMultiple');
189 189
 } else {
190 190
     $link_add_type_unique = get_lang('SessionAddTypeUnique');
191
-    $link_add_type_multiple = '<a href="' . api_get_self() . '?add_type=multiple&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeMultiple') . '</a>';
191
+    $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>';
192 192
 }
193 193
 $url_list = UrlManager::get_url_data();
194 194
 ?>
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {
201 201
     echo ' onsubmit="valide();"';
202 202
 } ?> >
203
-    <?php echo get_lang('SelectUrl') . ' : '; ?>
203
+    <?php echo get_lang('SelectUrl').' : '; ?>
204 204
 <select name="access_url_id" onchange="javascript:send();">
205 205
 <option value="0"> <?php echo get_lang('SelectUrl') ?></option>
206 206
         <?php
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
     <td>
237 237
     <h3>
238 238
     <?php
239
-        $total_users = count($nosessionUsersList) +  count($sessionUsersList);
239
+        $total_users = count($nosessionUsersList) + count($sessionUsersList);
240 240
         echo get_lang('TotalAvailableUsers').' '.$total_users;
241 241
     ?>
242 242
     </h3>
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
   <td align="center"><b><?php echo get_lang('UserListInPlatform') ?> : <?php echo count($nosessionUsersList); ?></b>
247 247
   </td>
248 248
   <td></td>
249
-  <td align="center"><b><?php echo get_lang('UserListIn') . ' ' . $url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td>
249
+  <td align="center"><b><?php echo get_lang('UserListIn').' '.$url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td>
250 250
 </tr>
251 251
 <tr>
252 252
   <td align="center">
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 		<br />
307 307
         <?php
308 308
         if (isset($_GET['add'])) {
309
-            echo '<button class="save" type="button" onclick="valide()" >' . get_lang('AddUsersToURL') . '</button>';
309
+            echo '<button class="save" type="button" onclick="valide()" >'.get_lang('AddUsersToURL').'</button>';
310 310
         } else {
311
-            echo '<button class="save" type="button" onclick="valide()" >' . get_lang('EditUsersToURL') . '</button>';
311
+            echo '<button class="save" type="button" onclick="valide()" >'.get_lang('EditUsersToURL').'</button>';
312 312
         }
313 313
         ?>
314 314
 	</td>
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -261,7 +261,7 @@
 block discarded – undo
261 261
     ?>
262 262
     <option value="<?php echo $enreg['user_id']; ?>"><?php echo $enreg['username'].' - '.api_get_person_name($enreg['firstname'], $enreg['lastname']); ?></option>
263 263
     <?php
264
-     }
264
+        }
265 265
     unset($nosessionUsersList);
266 266
     ?>
267 267
     </select>
Please login to merge, or discard this patch.
main/admin/add_sessions_to_promotion.php 3 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
       <option value = "%">--</option>
198 198
       <?php
199 199
         echo Display :: get_alphabet_options();
200
-      ?>
200
+        ?>
201 201
      </select>
202 202
 </td>
203 203
 <td align="center">&nbsp;</td>
@@ -207,31 +207,31 @@  discard block
 block discarded – undo
207 207
   <td align="center">
208 208
   <div id="content_source">
209 209
       <?php
210
-      if (!($add_type=='multiple')) {
210
+        if (!($add_type=='multiple')) {
211 211
         ?>
212 212
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
213 213
         <div id="ajax_list_users_single"></div>
214 214
         <?php
215
-      } else {
216
-      ?>
215
+        } else {
216
+        ?>
217 217
       <div id="ajax_list_multiple">
218 218
         <?php echo Display::select('session_not_in_promotion_name',$session_not_in_promotion, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_not_in_promotion','size'=>'15px'),false); ?>
219 219
       </div>
220 220
     <?php
221
-      }
222
-     ?>
221
+        }
222
+        ?>
223 223
   </div>
224 224
   </td>
225 225
   <td width="10%" valign="middle" align="center">
226 226
   <?php
227
-  if ($ajax_search) {
228
-  ?>
227
+    if ($ajax_search) {
228
+    ?>
229 229
     <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('session_in_promotion'))" >
230 230
         <em class="fa fa-arrow-left"></em>
231 231
     </button>
232 232
   <?php
233
-  } else {
234
-  ?>
233
+    } else {
234
+    ?>
235 235
     <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))">
236 236
         <em class="fa fa-arrow-right"></em>
237 237
     </button>
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
         <em class="fa fa-arrow-left"></em>
241 241
     </button>
242 242
     <?php
243
-  }
244
-  ?>
243
+    }
244
+    ?>
245 245
     <br /><br /><br /><br /><br /><br />
246 246
   </td>
247 247
   <td align="center">
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 require_once '../inc/global.inc.php';
11 11
 
12 12
 $xajax = new xajax();
13
-$xajax->registerFunction ('search_sessions');
13
+$xajax->registerFunction('search_sessions');
14 14
 
15 15
 // setting the section (for the tabs)
16 16
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 api_protect_admin_script(true);
20 20
 
21 21
 // setting breadcrumbs
22
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
23
-$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions'));
22
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
23
+$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions'));
24 24
 
25 25
 // Setting the name of the tool
26 26
 $tool_name = get_lang('SubscribeSessionsToPromotions');
27 27
 $add_type = 'multiple';
28
-if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
28
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
29 29
     $add_type = Security::remove_XSS($_REQUEST['add_type']);
30 30
 }
31 31
 
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 
68 68
 $form_sent  = 0;
69 69
 $errorMsg   = '';
70
-$users      =$sessions=array();
70
+$users      = $sessions = array();
71 71
 $promotion = new Promotion();
72 72
 $id = intval($_GET['id']);
73 73
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
74 74
     $form_sent = $_POST['form_sent'];
75 75
     $session_in_promotion_posted = $_POST['session_in_promotion_name'];
76 76
     if (!is_array($session_in_promotion_posted)) {
77
-        $session_in_promotion_posted=array();
77
+        $session_in_promotion_posted = array();
78 78
     }
79 79
     if ($form_sent == 1) {
80 80
         // Added a parameter to send emails when registering a user
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 $promotion_data = $promotion->get($id);
88 88
 $session_list = SessionManager::get_sessions_list(array(), array('name'));
89
-$session_not_in_promotion = $session_in_promotion= array();
89
+$session_not_in_promotion = $session_in_promotion = array();
90 90
 
91 91
 if (!empty($session_list)) {
92 92
     foreach ($session_list as $session) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             }
123 123
         }
124 124
         $return .= '</select>';
125
-        $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return));
125
+        $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
126 126
     }
127 127
 
128 128
     return $xajax_response;
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 }
141 141
 
142 142
 echo '<div class="actions">';
143
-echo '<a href="promotions.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
143
+echo '<a href="promotions.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
144 144
 echo '</div>';
145 145
 ?>
146 146
 
147
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
147
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
148 148
 <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
149 149
 
150
-if ($add_type=='multiple') {
150
+if ($add_type == 'multiple') {
151 151
     if (is_array($extra_field_list)) {
152 152
         if (is_array($new_field_list) && count($new_field_list) > 0) {
153 153
             echo '<h3>'.get_lang('FilterUsers').'</h3>';
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
                 echo '&nbsp;<select name="'.$varname.'">';
158 158
                 echo '<option value="0">--'.get_lang('Select').'--</option>';
159 159
                 foreach ($new_field['data'] as $option) {
160
-                    $checked='';
160
+                    $checked = '';
161 161
                     if (isset($_POST[$varname])) {
162
-                        if ($_POST[$varname]==$option[1]) {
162
+                        if ($_POST[$varname] == $option[1]) {
163 163
                             $checked = 'selected="true"';
164 164
                         }
165 165
                     }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
   <td align="center"><b><?php echo get_lang('SessionsInPromotion') ?> :</b></td>
190 190
 </tr>
191 191
 
192
-<?php if ($add_type=='multiple') { ?>
192
+<?php if ($add_type == 'multiple') { ?>
193 193
 <tr>
194 194
 <td align="center">
195 195
 <?php echo get_lang('FirstLetterSessions'); ?> :
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
   <td align="center">
208 208
   <div id="content_source">
209 209
       <?php
210
-      if (!($add_type=='multiple')) {
210
+      if (!($add_type == 'multiple')) {
211 211
         ?>
212 212
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
213 213
         <div id="ajax_list_users_single"></div>
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
       } else {
216 216
       ?>
217 217
       <div id="ajax_list_multiple">
218
-        <?php echo Display::select('session_not_in_promotion_name',$session_not_in_promotion, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_not_in_promotion','size'=>'15px'),false); ?>
218
+        <?php echo Display::select('session_not_in_promotion_name', $session_not_in_promotion, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_not_in_promotion', 'size'=>'15px'), false); ?>
219 219
       </div>
220 220
     <?php
221 221
       }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         'session_in_promotion_name[]',
251 251
         $session_in_promotion,
252 252
         '',
253
-        array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_in_promotion','size'=>'15px'),
253
+        array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_in_promotion', 'size'=>'15px'),
254 254
         false
255 255
     );
256 256
     unset($sessionUsersList);
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,10 @@
 block discarded – undo
144 144
 echo '</div>';
145 145
 ?>
146 146
 
147
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
147
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) {
148
+    echo '&add=true' ;
149
+}
150
+?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
148 151
 <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
149 152
 
150 153
 if ($add_type=='multiple') {
Please login to merge, or discard this patch.
main/admin/skill_badge_list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,18 +29,18 @@
 block discarded – undo
29 29
 
30 30
 $interbreadcrumb = array(
31 31
     array(
32
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php',
32
+        'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
33 33
         'name' => get_lang('Administration')
34 34
     ),
35 35
     array(
36
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php',
36
+        'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
37 37
         'name' => get_lang('Badges')
38 38
     )
39 39
 );
40 40
 
41 41
 $toolbar = Display::toolbarButton(
42 42
     get_lang('ManageSkills'),
43
-    api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php',
43
+    api_get_path(WEB_CODE_PATH).'admin/skill_list.php',
44 44
     'list',
45 45
     'primary',
46 46
     ['title' => get_lang('ManageSkills')]
Please login to merge, or discard this patch.
main/admin/course_edit.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         WHERE
43 43
             course_user.status='1' AND
44 44
             course_user.user_id=user.user_id AND
45
-            course_user.c_id ='" . $courseId . "'" .
45
+            course_user.c_id ='".$courseId."'".
46 46
         $order_clause;
47 47
 $res = Database::query($sql);
48 48
 $course_teachers = array();
@@ -58,18 +58,18 @@  discard block
 block discarded – undo
58 58
             INNER JOIN $access_url_rel_user_table url_rel_user
59 59
             ON (u.user_id=url_rel_user.user_id)
60 60
             WHERE
61
-                url_rel_user.access_url_id=" . api_get_current_access_url_id() . " AND
61
+                url_rel_user.access_url_id=".api_get_current_access_url_id()." AND
62 62
                 status=1" . $order_clause;
63 63
 } else {
64 64
     $sql = "SELECT user_id, lastname, firstname
65
-            FROM $table_user WHERE status='1'" . $order_clause;
65
+            FROM $table_user WHERE status='1'".$order_clause;
66 66
 }
67 67
 $courseInfo['tutor_name'] = null;
68 68
 
69 69
 $res = Database::query($sql);
70 70
 $teachers = array();
71 71
 $allTeachers = array();
72
-$platform_teachers[0] = '-- ' . get_lang('NoManager') . ' --';
72
+$platform_teachers[0] = '-- '.get_lang('NoManager').' --';
73 73
 while ($obj = Database::fetch_object($res)) {
74 74
     $allTeachers[$obj->user_id] = api_get_person_name($obj->firstname, $obj->lastname);
75 75
     if (!array_key_exists($obj->user_id, $course_teachers)) {
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 // Case where there is no teacher in the course
89 89
 if (count($course_teachers) == 0) {
90
-    $sql = 'SELECT tutor_name FROM ' . $course_table . ' WHERE code="' . $course_code . '"';
90
+    $sql = 'SELECT tutor_name FROM '.$course_table.' WHERE code="'.$course_code.'"';
91 91
     $res = Database::query($sql);
92 92
     $tutor_name = Database::result($res, 0, 0);
93 93
     $courseInfo['tutor_name'] = array_search($tutor_name, $platform_teachers);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 // Build the form
97 97
 $form = new FormValidator('update_course', 'post', api_get_self().'?id='.$courseId);
98
-$form->addElement('header', get_lang('Course') . '  #' . $courseInfo['real_id'] . ' ' . $course_code);
98
+$form->addElement('header', get_lang('Course').'  #'.$courseInfo['real_id'].' '.$course_code);
99 99
 $form->addElement('hidden', 'code', $course_code);
100 100
 
101 101
 //title
@@ -151,20 +151,20 @@  discard block
 block discarded – undo
151 151
             }
152 152
         }
153 153
 
154
-        $groupName = 'session_coaches[' . $sessionId . ']';
155
-        $platformTeacherId = 'platform_teachers_by_session_' . $sessionId;
156
-        $coachId = 'coaches_by_session_' . $sessionId;
154
+        $groupName = 'session_coaches['.$sessionId.']';
155
+        $platformTeacherId = 'platform_teachers_by_session_'.$sessionId;
156
+        $coachId = 'coaches_by_session_'.$sessionId;
157 157
 
158 158
         $platformTeacherName = 'platform_teachers_by_session';
159 159
         $coachName = 'coaches_by_session';
160 160
 
161
-        $sessionUrl = api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . $sessionId;
161
+        $sessionUrl = api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$sessionId;
162 162
         $form->addElement(
163 163
             'advmultiselect',
164 164
             $groupName,
165 165
             Display::url(
166 166
                 $session['name'], $sessionUrl, array('target' => '_blank')
167
-            ) . ' - ' . get_lang('Coaches'),
167
+            ).' - '.get_lang('Coaches'),
168 168
             $allTeachers
169 169
         );
170 170
         $courseInfo[$groupName] = $sessionTeachers;
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 }
173 173
 
174 174
 // Category code
175
-$url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_category';
175
+$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category';
176 176
 
177 177
 $categorySelect = $form->addElement(
178 178
     'select_ajax',
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 $form->applyFilter('select_language', 'html_filter');
201 201
 
202 202
 $group = array();
203
-$group[]= $form->createElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD);
204
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM);
205
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED);
206
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED);
207
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN);
203
+$group[] = $form->createElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD);
204
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM);
205
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED);
206
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED);
207
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN);
208 208
 $form->addGroup($group, '', get_lang('CourseAccess'), '<br />');
209 209
 
210 210
 $group = array();
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 $htmlHeadXtra[] = '
257 257
 <script>
258 258
 $(function() {
259
-    ' . $extra['jquery_ready_content'] . '
259
+    ' . $extra['jquery_ready_content'].'
260 260
 });
261 261
 </script>';
262 262
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
                 api_set_failure(get_lang('PortalActiveCoursesLimitReached'));
293 293
 
294
-                header('Location: course_list.php?action=show_msg&warn=' . urlencode(get_lang('PortalActiveCoursesLimitReached')));
294
+                header('Location: course_list.php?action=show_msg&warn='.urlencode(get_lang('PortalActiveCoursesLimitReached')));
295 295
                 exit;
296 296
             }
297 297
         }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         foreach ($list as $course_temp) {
310 310
             if ($course_temp['code'] != $course_code) {
311 311
                 $visual_code_is_used = true;
312
-                $warn .= ' ' . $course_temp['title'] . ' (' . $course_temp['code'] . '),';
312
+                $warn .= ' '.$course_temp['title'].' ('.$course_temp['code'].'),';
313 313
             }
314 314
         }
315 315
         $warn = substr($warn, 0, -1);
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
     $course['course_code'] = $course_code;
330 330
 
331 331
     if (!stristr($department_url, 'http://')) {
332
-        $department_url = 'http://' . $department_url;
332
+        $department_url = 'http://'.$department_url;
333 333
     }
334 334
 
335 335
     Database::query($sql);
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
     if (array_key_exists('add_teachers_to_sessions_courses', $courseInfo)) {
395 395
         $sql = "UPDATE $course_table SET
396 396
                 add_teachers_to_sessions_courses = '$addTeacherToSessionCourses'
397
-                WHERE id = " . $courseInfo['real_id'];
397
+                WHERE id = ".$courseInfo['real_id'];
398 398
         Database::query($sql);
399 399
     }
400 400
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
     Display::addFlash(Display::return_message(get_lang('ItemUpdated')));
404 404
 
405 405
     if ($visual_code_is_used) {
406
-        header('Location: course_list.php?action=show_msg&warn=' . urlencode($warn));
406
+        header('Location: course_list.php?action=show_msg&warn='.urlencode($warn));
407 407
     } else {
408 408
         header('Location: course_list.php');
409 409
     }
Please login to merge, or discard this patch.