Completed
Push — 1.11.x ( 3ca1af...7f27ad )
by José
93:15 queued 54:45
created
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.
main/admin/dashboard_add_courses_to_user.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 // setting breadcrumbs
23 23
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
24
-$interbreadcrumb[] = array('url' => 'user_list.php','name' => get_lang('UserList'));
24
+$interbreadcrumb[] = array('url' => 'user_list.php', 'name' => get_lang('UserList'));
25 25
 
26 26
 // Database Table Definitions
27 27
 $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 
37 37
 // setting the name of the tool
38 38
 if (UserManager::is_admin($user_id)) {
39
-	$tool_name= get_lang('AssignCoursesToPlatformAdministrator');
39
+	$tool_name = get_lang('AssignCoursesToPlatformAdministrator');
40 40
 } else if ($user_info['status'] == SESSIONADMIN) {
41
-	$tool_name= get_lang('AssignCoursesToSessionsAdministrator');
41
+	$tool_name = get_lang('AssignCoursesToSessionsAdministrator');
42 42
 } else {
43
-	$tool_name= get_lang('AssignCoursesToHumanResourcesManager');
43
+	$tool_name = get_lang('AssignCoursesToHumanResourcesManager');
44 44
 }
45 45
 
46 46
 $add_type = 'multiple';
47
-if(isset($_GET['add_type']) && $_GET['add_type']!='') {
47
+if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
48 48
 	$add_type = Security::remove_XSS($_REQUEST['add_type']);
49 49
 }
50 50
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 function search_courses($needle, $type)
56 56
 {
57
-    global $tbl_course, $tbl_course_rel_access_url,$user_id;
57
+    global $tbl_course, $tbl_course_rel_access_url, $user_id;
58 58
 
59 59
     $xajax_response = new xajaxResponse();
60 60
     $return = '';
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         }
70 70
         $without_assigned_courses = '';
71 71
         if (count($assigned_courses_code) > 0) {
72
-            $without_assigned_courses = " AND c.code NOT IN(".implode(',',$assigned_courses_code).")";
72
+            $without_assigned_courses = " AND c.code NOT IN(".implode(',', $assigned_courses_code).")";
73 73
         }
74 74
 
75 75
         if (api_is_multiple_url_enabled()) {
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
                 		$without_assigned_courses ";
89 89
         }
90 90
 
91
-		$rs	= Database::query($sql);
91
+		$rs = Database::query($sql);
92 92
 
93 93
 		$return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >';
94
-		while($course = Database :: fetch_array($rs)) {
95
-			$return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
94
+		while ($course = Database :: fetch_array($rs)) {
95
+			$return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'], ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
96 96
 		}
97 97
 		$return .= '</select>';
98
-		$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
98
+		$xajax_response -> addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
99 99
 	}
100 100
 	return $xajax_response;
101 101
 }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 }
154 154
 </script>';
155 155
 
156
-$formSent=0;
156
+$formSent = 0;
157 157
 $errorMsg = $firstLetterCourse = '';
158 158
 $UserList = array();
159 159
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 if (isset($_POST['formSent']) && intval($_POST['formSent']) == 1) {
162 162
     $courses_list = $_POST['CoursesList'];
163 163
     $affected_rows = CourseManager::subscribeCoursesToDrhManager($user_id, $courses_list);
164
-    if ($affected_rows)	{
164
+    if ($affected_rows) {
165 165
         $msg = get_lang('AssignedCoursesHaveBeenUpdatedSuccessfully');
166 166
     }
167 167
 }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
 $without_assigned_courses = '';
188 188
 if (count($assigned_courses_code) > 0) {
189
-	$without_assigned_courses = " AND c.code NOT IN(".implode(',',$assigned_courses_code).")";
189
+	$without_assigned_courses = " AND c.code NOT IN(".implode(',', $assigned_courses_code).")";
190 190
 }
191 191
 
192 192
 $needle = '%';
@@ -207,20 +207,20 @@  discard block
 block discarded – undo
207 207
             ORDER BY c.title";
208 208
 
209 209
 } else {
210
-	$sql= " SELECT c.code, c.title
210
+	$sql = " SELECT c.code, c.title
211 211
 	        FROM $tbl_course c
212 212
             WHERE  c.code LIKE '$needle' $without_assigned_courses
213 213
             ORDER BY c.title";
214 214
 }
215 215
 
216 216
 
217
-$result	= Database::query($sql);
217
+$result = Database::query($sql);
218 218
 
219 219
 ?>
220 220
 <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;">
221 221
 <input type="hidden" name="formSent" value="1" />
222 222
 <?php
223
-if(!empty($msg)) {
223
+if (!empty($msg)) {
224 224
 	Display::display_normal_message($msg); //main API
225 225
 }
226 226
 ?>
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         <div id="ajax_list_courses_multiple">
233 233
 	<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" style="width:340px;">
234 234
 	<?php while ($enreg = Database::fetch_array($result)) { ?>
235
-            <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'],ENT_QUOTES).'"';?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option>
235
+            <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'], ENT_QUOTES).'"'; ?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option>
236 236
 	<?php } ?>
237 237
 	</select>
238 238
         </div>
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
     </div>
241 241
     <div class="col-md-4">
242 242
         <div class="code-course">
243
-        <?php if($add_type == 'multiple') { ?>
244
-        <p><?php echo get_lang('FirstLetterCourse');?> :</p>
243
+        <?php if ($add_type == 'multiple') { ?>
244
+        <p><?php echo get_lang('FirstLetterCourse'); ?> :</p>
245 245
         <select name="firstLetterCourse" class="selectpicker form-control" onchange = "xajax_search_courses(this.value,'multiple')">
246 246
             <option value="%">--</option>
247 247
             <?php  echo Display :: get_alphabet_options($firstLetter); ?>
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
             if (is_array($assigned_courses_to_hrm)) {
284 284
                 foreach ($assigned_courses_to_hrm as $enreg) {
285 285
             ?>
286
-                <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="' . htmlspecialchars($enreg['title'], ENT_QUOTES) . '"'; ?>><?php echo $enreg['title'] . ' (' . $enreg['code'] . ')'; ?></option>
286
+                <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'], ENT_QUOTES).'"'; ?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option>
287 287
             <?php
288 288
                     }
289 289
                 }
Please login to merge, or discard this patch.
main/admin/access_url_edit_usergroup_to_url.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 
26 26
 // setting breadcrumbs
27 27
 $tool_name = get_lang('EditUserGroupToURL');
28
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
29
-$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
28
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
29
+$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
30 30
 
31 31
 $add_type = 'multiple';
32 32
 if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
 }
74 74
 </script>';
75 75
 
76
-$form_sent=0;
77
-$errorMsg='';
78
-$UserList=$SessionList=array();
79
-$users=$sessions=array();
76
+$form_sent = 0;
77
+$errorMsg = '';
78
+$UserList = $SessionList = array();
79
+$users = $sessions = array();
80 80
 
81 81
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
82 82
     $form_sent = $_POST['form_sent'];
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
     foreach ($userGroups as $item) {
127 127
         if ($item['access_url_id'] == $access_url_id) {
128
-            $userGroupList[$item['id']] = $item ;
128
+            $userGroupList[$item['id']] = $item;
129 129
         }
130 130
     }
131 131
     $noUserGroupList = $userGroup->getUserGroupNotInList(array_keys($userGroupList));
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     name="formulaire"
150 150
     method="post"
151 151
     action="<?php echo api_get_self(); ?>"
152
-    style="margin:0px;" <?php if ($ajax_search){ echo ' onsubmit="valide();"'; } ?>
152
+    style="margin:0px;" <?php if ($ajax_search) { echo ' onsubmit="valide();"'; } ?>
153 153
 >
154 154
 <?php echo get_lang('SelectUrl').' : '; ?>
155 155
 <select name="access_url_id" onchange="javascript:send();">
@@ -161,11 +161,11 @@  discard block
 block discarded – undo
161 161
         if (!empty($access_url_id)) {
162 162
             if ($url_obj[0] == $access_url_id) {
163 163
                 $checked = 'selected=true';
164
-                $url_selected=$url_obj[1];
164
+                $url_selected = $url_obj[1];
165 165
             }
166 166
         }
167
-        if ($url_obj['active']==1) { ?>
168
-            <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?>
167
+        if ($url_obj['active'] == 1) { ?>
168
+            <option <?php echo $checked; ?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?>
169 169
             </option>
170 170
         <?php
171 171
         }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
   <td align="center"><b><?php echo get_lang('UserGroupListInPlatform') ?> :</b>
189 189
   </td>
190 190
   <td></td>
191
-  <td align="center"><b><?php printf(get_lang('UserGroupListInX'),$url_selected); ?></b></td>
191
+  <td align="center"><b><?php printf(get_lang('UserGroupListInX'), $url_selected); ?></b></td>
192 192
 </tr>
193 193
 
194 194
 <tr>
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
   <td align="center">
240 240
   <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;">
241 241
 <?php
242
-foreach($userGroupList as $item) {
242
+foreach ($userGroupList as $item) {
243 243
 ?>
244 244
 	<option value="<?php echo $item['id']; ?>">
245 245
         <?php echo $item['name']; ?>
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 	<td colspan="3" align="center">
255 255
 		<br />
256 256
 		<?php
257
-		if(isset($_GET['add']))
257
+		if (isset($_GET['add']))
258 258
 			echo '<button class="save" onclick="valide()" >'.get_lang('AddUserGroupToURL').'</button>';
259 259
 		else
260 260
 			echo '<button class="save" onclick="valide()" >'.get_lang('EditUserGroupToURL').'</button>';
Please login to merge, or discard this patch.
main/admin/extra_field_workflow.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 api_protect_admin_script();
16 16
 
17 17
 // setting breadcrumbs
18
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
18
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
19 19
 
20 20
 $tool_name = null;
21 21
 
@@ -36,35 +36,35 @@  discard block
 block discarded – undo
36 36
 $token = Security::get_token();
37 37
 
38 38
 if ($action == 'add') {
39
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extraField->type,'name' => $extraField->pageName);
40
-    $interbreadcrumb[]=array(
39
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extraField->type, 'name' => $extraField->pageName);
40
+    $interbreadcrumb[] = array(
41 41
         'url' => 'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
42 42
         'name' => $extraFieldInfo['display_text']
43 43
     );
44
-    $interbreadcrumb[]=array(
44
+    $interbreadcrumb[] = array(
45 45
         'url' => 'extra_field_options.php?type='.$extraField->type.'&field_id='.$extraFieldInfo['id'],
46 46
         'name' => get_lang('EditExtraFieldOptions')
47 47
     );
48
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
48
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
49 49
 } elseif ($action == 'edit') {
50
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extraField->type,'name' => $extraField->pageName);
51
-    $interbreadcrumb[]=array(
50
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extraField->type, 'name' => $extraField->pageName);
51
+    $interbreadcrumb[] = array(
52 52
         'url' => 'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
53 53
         'name' => $extraFieldInfo['display_text']
54 54
     );
55
-    $interbreadcrumb[]=array(
55
+    $interbreadcrumb[] = array(
56 56
         'url' => 'extra_field_options.php?type='.$extraField->type.'&field_id='.$extraFieldInfo['id'],
57 57
         'name' => get_lang('EditExtraFieldOptions')
58 58
     );
59 59
 
60
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit'));
60
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
61 61
 } else {
62
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extraField->type,'name' => $extraField->pageName);
63
-    $interbreadcrumb[]=array(
62
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extraField->type, 'name' => $extraField->pageName);
63
+    $interbreadcrumb[] = array(
64 64
         'url' =>  'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
65 65
         'name' => $extraFieldInfo['display_text']
66 66
     );
67
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('EditExtraFieldOptions'));
67
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditExtraFieldOptions'));
68 68
 }
69 69
 
70 70
 $roleId = isset($_REQUEST['roleId']) ? $_REQUEST['roleId'] : null;
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 $paramsNoRole = 'field_id='.$field_id.'&type='.$extraField->type;
75 75
 
76 76
 //The order is important you need to check the the $column variable in the model.ajax.php file
77
-$columns = array(get_lang('Name'), get_lang('Value'),  get_lang('Order'), get_lang('Actions'));
77
+$columns = array(get_lang('Name'), get_lang('Value'), get_lang('Order'), get_lang('Actions'));
78 78
 
79
-$htmlHeadXtra[]='<script>
79
+$htmlHeadXtra[] = '<script>
80 80
 
81 81
     function setHidden(obj) {
82 82
         var name = $(obj).attr("name");
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 if (!empty($roleId)) {
178 178
     $form->addElement('html', $table->toHtml());
179 179
     $group = array();
180
-    $group[]= $form->createElement('button', 'submit', get_lang('Save'));
181
-    $group[]= $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all'));
182
-    $group[]= $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all'));
180
+    $group[] = $form->createElement('button', 'submit', get_lang('Save'));
181
+    $group[] = $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all'));
182
+    $group[] = $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all'));
183 183
     $form->addGroup($group, '', null, ' ');
184 184
 
185 185
     $form->setDefaults(array('status' => $roleId));
Please login to merge, or discard this patch.
main/admin/skills_wheel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
38 38
 $tpl->assign('wheel_url', $url);
39 39
 
40
-$url  = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
40
+$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
41 41
 $tpl->assign('url', $url);
42 42
 $tpl->assign('isAdministration', true);
43 43
 
Please login to merge, or discard this patch.
main/admin/usergroup_import.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
             // 2. Check whether class doesn't exist yet.
24 24
             if ($usergroup->usergroup_exists($class['name'])) {
25 25
                 $class['line'] = $index + 2;
26
-                $class['error'] = get_lang('ClassNameExists') .
27
-                    ': <strong>' .$class['name'] . '</strong>';
26
+                $class['error'] = get_lang('ClassNameExists').
27
+                    ': <strong>'.$class['name'].'</strong>';
28 28
                 $errors[] = $class;
29 29
             }
30 30
         }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 $form = new FormValidator('import_classes');
99 99
 $form->addElement('file', 'import_file', get_lang('ImportCSVFileLocation'));
100 100
 $group = array();
101
-$group[] = $form->createElement('radio', 'file_type', '', 'CSV (<a href="example_class.csv" target="_blank">' . get_lang('ExampleCSVFile') . '</a>)', 'csv');
101
+$group[] = $form->createElement('radio', 'file_type', '', 'CSV (<a href="example_class.csv" target="_blank">'.get_lang('ExampleCSVFile').'</a>)', 'csv');
102 102
 $form->addGroup($group, '', get_lang('FileType'), '<br/>');
103 103
 $form->addButtonImport(get_lang('Import'));
104 104
 
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
     $errors = validate_data($classes);
108 108
     if (count($errors) == 0) {
109 109
         $number_of_added_classes = save_data($classes);
110
-        Display::display_normal_message($number_of_added_classes . ' ' . get_lang('Added'));
110
+        Display::display_normal_message($number_of_added_classes.' '.get_lang('Added'));
111 111
     } else {
112 112
         $error_message = get_lang('ErrorsWhenImportingFile');
113 113
         $error_message .= '<ul>';
114 114
         foreach ($errors as $index => $error_class) {
115
-            $error_message .= '<li>' . $error_class['error'] . ' (' . get_lang('Line') . ' ' . $error_class['line'] . ')';
115
+            $error_message .= '<li>'.$error_class['error'].' ('.get_lang('Line').' '.$error_class['line'].')';
116 116
             $error_message .= '</li>';
117 117
         }
118 118
         $error_message .= '</ul>';
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
 $form->display();
125 125
 ?>
126
-<p><?php echo get_lang('CSVMustLookLike') . ' (' . get_lang('MandatoryFields') . ')'; ?> :</p>
126
+<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
127 127
 
128 128
 <pre>
129 129
 <b>name;description;</b>users
Please login to merge, or discard this patch.
main/admin/promotions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 $htmlHeadXtra[] = api_get_jqgrid_js();
17 17
 
18 18
 // setting breadcrumbs
19
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
20
-$interbreadcrumb[] = array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions'));
19
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
20
+$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions'));
21 21
 
22 22
 $action = isset($_GET['action']) ? $_GET['action'] : null;
23 23
 
@@ -102,10 +102,10 @@  discard block
 block discarded – undo
102 102
 $extra_params['height'] = 'auto'; //use the width of the parent
103 103
 //With this function we can add actions to the jgrid
104 104
 $action_links = 'function action_formatter (cellvalue, options, rowObject) {
105
-    return \'<a href="add_sessions_to_promotion.php?id=\'+options.rowId+\'">'.Display::return_icon('session_to_promotion.png',get_lang('SubscribeSessionsToPromotions'),'',ICON_SIZE_SMALL).'</a>'.
106
-    '&nbsp;<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
107
-    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'.
108
-    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a> \';
105
+    return \'<a href="add_sessions_to_promotion.php?id=\'+options.rowId+\'">'.Display::return_icon('session_to_promotion.png', get_lang('SubscribeSessionsToPromotions'), '', ICON_SIZE_SMALL).'</a>'.
106
+    '&nbsp;<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
107
+    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).'</a>'.
108
+    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a> \';
109 109
 }';
110 110
 
111 111
 ?>
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             $promotion->display();
151 151
         } else {
152 152
             echo '<div class="actions">';
153
-            echo Display::url(Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM), api_get_self());
153
+            echo Display::url(Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM), api_get_self());
154 154
             echo '</div>';
155 155
             $form->addElement('hidden', 'sec_token');
156 156
             $form->setConstants(array('sec_token' => $token));
Please login to merge, or discard this patch.
main/admin/access_url_add_courses_to_url.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $cidReset = true;
11 11
 require_once '../inc/global.inc.php';
12 12
 
13
-$this_section=SECTION_PLATFORM_ADMIN;
13
+$this_section = SECTION_PLATFORM_ADMIN;
14 14
 
15 15
 api_protect_global_admin_script();
16 16
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 $form_sent = 0;
23 23
 $first_letter_course = '';
24
-$courses = array ();
24
+$courses = array();
25 25
 $url_list = array();
26 26
 $users = array();
27 27
 
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 
33 33
 /*	Header   */
34 34
 $tool_name = get_lang('AddCoursesToURL');
35
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
36
-$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
35
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
36
+$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
37 37
 
38 38
 Display :: display_header($tool_name);
39 39
 
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
50 50
     $form_sent = $_POST['form_sent'];
51
-    $courses = is_array($_POST['course_list']) ? $_POST['course_list'] : array() ;
52
-    $url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ;
51
+    $courses = is_array($_POST['course_list']) ? $_POST['course_list'] : array();
52
+    $url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array();
53 53
     $first_letter_course = $_POST['first_letter_course'];
54 54
 
55 55
     foreach ($users as $key => $value) {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     $sql = "SELECT count(*) as num_courses FROM $tbl_course";
71 71
     $result = Database::query($sql);
72 72
     $num_row = Database::fetch_array($result);
73
-    if ($num_row['num_courses']>1000) {
73
+    if ($num_row['num_courses'] > 1000) {
74 74
         //if there are too much num_courses to gracefully handle with the HTML select list,
75 75
         // assign a default filter on users names
76 76
         $first_letter_user = 'A';
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
       <option value="">--</option>
107 107
       <?php
108 108
         echo Display :: get_alphabet_options($first_letter_course);
109
-        echo Display :: get_numeric_options(0,9,$first_letter_course);
109
+        echo Display :: get_numeric_options(0, 9, $first_letter_course);
110 110
       ?>
111 111
      </select>
112 112
     </td>
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     <td width="40%" align="center">
120 120
      <select name="course_list[]" multiple="multiple" size="20" style="width:400px;">
121 121
 		<?php foreach ($db_courses as $course) { ?>
122
-			<option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>><?php echo $course['title'].' ('.$course['code'].')'; ?>
122
+			<option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) echo 'selected="selected"'; ?>><?php echo $course['title'].' ('.$course['code'].')'; ?>
123 123
             </option>
124 124
         <?php } ?>
125 125
     </select>
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
    <td width="40%" align="center">
131 131
     <select name="url_list[]" multiple="multiple" size="20" style="width:300px;">
132 132
 		<?php foreach ($db_urls as $url_obj) { ?>
133
-        <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?>
133
+        <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?>
134 134
         </option>
135 135
 		<?php } ?>
136 136
     </select>
Please login to merge, or discard this patch.
main/admin/ldap_import_students_to_session.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * Code
10 10
  */
11 11
 // resetting the course id
12
-$cidReset=true;
12
+$cidReset = true;
13 13
 require_once('../inc/global.inc.php');
14 14
 // setting the section (for the tabs)
15 15
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 api_protect_admin_script();
18 18
 require('../auth/ldap/authldap.php');
19 19
 
20
-$annee_base=date('Y');
20
+$annee_base = date('Y');
21 21
 
22 22
 $tool_name = get_lang('LDAPImport');
23 23
 // setting breadcrumbs
24
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
24
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
25 25
 
26 26
 $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
27 27
 var buttoncheck = 1;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 		echo '</div>';
65 65
 
66 66
 }
67
-elseif(!empty($annee) && empty($id_session))
67
+elseif (!empty($annee) && empty($id_session))
68 68
 {
69 69
 	Display::display_header($tool_name);
70 70
 	echo '<div style="align:center">';
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
 	echo '<select name="id_session">';
74 74
 
75 75
 	$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
76
-	$sql = "SELECT id,name,nbr_courses,access_start_date,access_end_date " .
76
+	$sql = "SELECT id,name,nbr_courses,access_start_date,access_end_date ".
77 77
 		" FROM $tbl_session ".
78 78
 		" ORDER BY name";
79 79
 	$result = Database::query($sql);
80 80
 
81
-	$sessions=Database::store_result($result);
82
-	$nbr_results=count($sessions);
83
-	foreach($sessions as $row) {
81
+	$sessions = Database::store_result($result);
82
+	$nbr_results = count($sessions);
83
+	foreach ($sessions as $row) {
84 84
 		echo '<option value="'.$row['id'].'">'.api_htmlentities($row['name']).' ('.$row['access_start_date'].' - '.$row['access_end_date'].')</option>';
85 85
 	}
86 86
 	echo '</select>';
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
 		$info = ldap_get_entries($ds, $sr);
114 114
 
115
-		for ($key = 0; $key < $info["count"]; $key ++) {
115
+		for ($key = 0; $key < $info["count"]; $key++) {
116 116
 			$nom_form[] = $info[$key]["sn"][0];
117 117
 			$prenom_form[] = $info[$key]["givenname"][0];
118 118
 			$email_form[] = $info[$key]["mail"][0];
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		asort($nom_form);
133 133
 		reset($nom_form);
134 134
 
135
-		$statut=5;
135
+		$statut = 5;
136 136
 		include ('ldap_form_add_users_group.php');
137 137
 	} else {
138 138
 		echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>';
@@ -143,24 +143,24 @@  discard block
 block discarded – undo
143 143
     echo '</div>';
144 144
 
145 145
 }
146
-elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes'))
146
+elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed'] == 'yes'))
147 147
 {
148
-	$id=$_POST['username_form'];
149
-	$UserList=array();
148
+	$id = $_POST['username_form'];
149
+	$UserList = array();
150 150
 	$userid_match_login = array();
151 151
 	foreach ($id as $form_index=>$user_id)
152 152
 	{
153
-		if(is_array($_POST['checkboxes']) && in_array($form_index,array_values($_POST['checkboxes'])))
153
+		if (is_array($_POST['checkboxes']) && in_array($form_index, array_values($_POST['checkboxes'])))
154 154
 		{
155 155
 			$tmp = ldap_add_user($user_id);
156
-			$UserList[]= $tmp;
156
+			$UserList[] = $tmp;
157 157
 			$userid_match_login[$tmp] = $user_id;
158 158
 		}
159 159
 	}
160 160
 	if (!empty($_POST['id_session'])) {
161 161
 		$num = 0;
162 162
 		$tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
163
-		$tbl_session	  = Database::get_main_table(TABLE_MAIN_SESSION);
163
+		$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
164 164
 		foreach ($UserList as $user_id) {
165 165
                     $res_user = Database::insert(
166 166
                         $tbl_session_user,
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                     }
176 176
 		}
177 177
 
178
-		if($num>0) {
178
+		if ($num > 0) {
179 179
 			$sql = 'UPDATE '.$tbl_session.' SET nbr_users = (nbr_users + '.$num.') WHERE id = '.intval($id_session);
180 180
 			$res = Database::query($sql);
181 181
 		}
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 	else
204 204
 	{
205 205
 		Display::display_header($tool_name);
206
-		$message=get_lang('NoUserAdded');
207
-		Display :: display_normal_message($message,false);
206
+		$message = get_lang('NoUserAdded');
207
+		Display :: display_normal_message($message, false);
208 208
 	}
209 209
 	echo '<br /><br />';
210 210
     echo '<a href="ldap_import_students.php?annee=&composante=&etape=">'.get_lang('BackToNewSearch').'</a>';
Please login to merge, or discard this patch.