Completed
Push — 1.11.x ( d4cbce...fbf9a8 )
by José
48:27
created
main/admin/grade_models.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                         array('name'=>'name',           'index'=>'name',        'width'=>'80',   'align'=>'left'),
81 81
                         array('name'=>'description',    'index'=>'description', 'width'=>'500',  'align'=>'left','sortable'=>'false'),
82 82
                         array('name'=>'actions',        'index'=>'actions',     'width'=>'100',  'align'=>'left','formatter'=>'action_formatter','sortable'=>'false')
83
-                       );
83
+                        );
84 84
 //Autowidth
85 85
 $extra_params['autowidth'] = 'true';
86 86
 //height auto
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 //With this function we can add actions to the jgrid (edit, delete, etc)
90 90
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
91 91
                          return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
92
-                         '&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>'.
93
-                         '\';
92
+                            '&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>'.
93
+                            '\';
94 94
                  }';
95 95
 ?>
96 96
 <script>
Please login to merge, or discard this patch.
main/admin/access_url_add_usergroup_to_url.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
                   <?php
88 88
                     echo Display::get_alphabet_options($firstLetterUserGroup);
89 89
                     echo Display::get_numeric_options(0, 9, $firstLetterUserGroup);
90
-                  ?>
90
+                    ?>
91 91
             </select>
92 92
         </td>
93 93
         <td width="20%">&nbsp;</td>
Please login to merge, or discard this patch.
main/admin/subscribe_class2course.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
     <select name="firstLetterClass" onchange="javascript:document.formulaire.formSent.value='2'; document.formulaire.submit();">
91 91
      <option value="">--</option>
92 92
      <?php
93
-     echo Display::get_alphabet_options($first_letter_class);
94
-     ?>
93
+        echo Display::get_alphabet_options($first_letter_class);
94
+        ?>
95 95
     </select>
96 96
    </td>
97 97
    <td width="20%">&nbsp;</td>
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
     <select name="firstLetterCourse" onchange="javascript:document.formulaire.formSent.value='2'; document.formulaire.submit();">
103 103
      <option value="">--</option>
104 104
      <?php
105
-     echo Display::get_alphabet_options($first_letter_course);
106
-     ?>
105
+        echo Display::get_alphabet_options($first_letter_course);
106
+        ?>
107 107
     </select>
108 108
    </td>
109 109
   </tr>
Please login to merge, or discard this patch.
main/admin/add_courses_to_usergroup.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -229,31 +229,31 @@  discard block
 block discarded – undo
229 229
   <td align="center">
230 230
   <div id="content_source">
231 231
       <?php
232
-      if (!($add_type=='multiple')) {
232
+        if (!($add_type=='multiple')) {
233 233
         ?>
234 234
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
235 235
         <div id="ajax_list_users_single"></div>
236 236
         <?php
237
-      } else {
238
-      ?>
237
+        } else {
238
+        ?>
239 239
       <div id="ajax_list_multiple">
240 240
         <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?>
241 241
       </div>
242 242
     <?php
243
-      }
244
-     ?>
243
+        }
244
+        ?>
245 245
   </div>
246 246
   </td>
247 247
   <td width="10%" valign="middle" align="center">
248 248
   <?php
249
-  if ($ajax_search) {
250
-  ?>
249
+    if ($ajax_search) {
250
+    ?>
251 251
     <button class="btn bt-default" type="button" onclick="remove_item(document.getElementById('elements_in'))" >
252 252
         <em class="fa fa-arrow-left"></em>
253 253
     </button>
254 254
   <?php
255
-  } else {
256
-  ?>
255
+    } else {
256
+    ?>
257 257
     <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))">
258 258
         <em class="fa fa-arrow-right"></em>
259 259
     </button>
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
         <em class="fa fa-arrow-left"></em>
263 263
     </button>
264 264
     <?php
265
-  }
266
-  ?>
265
+    }
266
+    ?>
267 267
     <br /><br /><br /><br /><br /><br />
268 268
   </td>
269 269
   <td align="center">
Please login to merge, or discard this patch.
main/admin/course_export.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $courses = $course_list;
47 47
     }
48 48
 
49
-	if (!empty($courses)) {
49
+    if (!empty($courses)) {
50 50
 
51 51
         $archiveFile = 'export_courses_list_'.api_get_local_time();
52 52
 
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
                 Export::arrayToXls($listToExport, $archiveFile);
99 99
                 break;
100 100
         }
101
-	} else {
101
+    } else {
102 102
         Display::addFlash(
103 103
             Display::return_message(
104 104
                 get_lang('ThereAreNotSelectedCoursesOrCoursesListIsEmpty')
105 105
             )
106 106
         );
107
-	}
107
+    }
108 108
 }
109 109
 
110 110
 
@@ -114,29 +114,29 @@  discard block
 block discarded – undo
114 114
 $form->addHeader($tool_name);
115 115
 $form->addHidden('formSent', 1);
116 116
 $form->addElement(
117
-	'radio',
118
-	'select_type',
119
-	get_lang('Option'),
120
-	get_lang('ExportAllCoursesList'),
121
-	 '1',
122
-	 ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"]
117
+    'radio',
118
+    'select_type',
119
+    get_lang('Option'),
120
+    get_lang('ExportAllCoursesList'),
121
+        '1',
122
+        ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"]
123 123
 );
124 124
 
125 125
 $form->addElement(
126
-	'radio',
127
-	'select_type',
128
-	'',
129
-	get_lang('ExportSelectedCoursesFromCoursesList'),
130
-	'2',
131
-	['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"]
126
+    'radio',
127
+    'select_type',
128
+    '',
129
+    get_lang('ExportSelectedCoursesFromCoursesList'),
130
+    '2',
131
+    ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"]
132 132
 );
133 133
 
134 134
 if (!empty($course_list)) {
135
-	$form->addHtml('<div id="div-course-list" style="display:none">');
136
-	$coursesInList = [];
137
-	foreach ($course_list as $course) {
138
-		$coursesInList[$course['code']] = $course['title'].' ('.$course['code'].')';
139
-	}
135
+    $form->addHtml('<div id="div-course-list" style="display:none">');
136
+    $coursesInList = [];
137
+    foreach ($course_list as $course) {
138
+        $coursesInList[$course['code']] = $course['title'].' ('.$course['code'].')';
139
+    }
140 140
 
141 141
     $form->addSelect(
142 142
         'course_code',
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         ['multiple' => 'multiple']
146 146
     );
147 147
 
148
-	$form->addHtml('</div>');
148
+    $form->addHtml('</div>');
149 149
 }
150 150
 
151 151
 $form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null);
Please login to merge, or discard this patch.
main/admin/ldap_form_add_users_group.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,58 +11,58 @@
 block discarded – undo
11 11
  */
12 12
 $nbre=0;
13 13
 echo '<form name="form" method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'">';
14
-	if($statut==1)
15
-	{
16
-		echo get_lang('EmailNotifySubscription').': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang('DontUnchek').'</i>';
17
-	}
18
-	else
19
-	{
20
-		echo '<input type="hidden" name="mailling" value="1">';
21
-	}
14
+    if($statut==1)
15
+    {
16
+        echo get_lang('EmailNotifySubscription').': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang('DontUnchek').'</i>';
17
+    }
18
+    else
19
+    {
20
+        echo '<input type="hidden" name="mailling" value="1">';
21
+    }
22 22
 if(!empty($course))
23 23
 {
24
-	echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">';
24
+    echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">';
25 25
 }
26 26
 elseif(!empty($id_session))
27 27
 {
28
-	echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">';
28
+    echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">';
29 29
 }
30 30
 $is_western_name_order = api_is_western_name_order();
31 31
 echo '<input type="hidden" name="confirmed" value="yes">';
32 32
 echo '<table border="0" cellspacing="0" width="100%">';
33 33
 echo '<tr align="center" id="header3">' .
34
-		'<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' .
35
-		'<td width="40%"><b>'.get_lang('Email').'</b></td>' .
36
-		($is_western_name_order
37
-			? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' .
38
-			'<td width="15%"><b>'.get_lang('Name').'</b></td>'
39
-			: '<td width="15%"><b>'.get_lang('Name').'</b></td>' .
40
-			'<td width="15%"><b>'.get_lang('FirstName').'</b></td>') .
41
-		'<td width="15%"><b>'.get_lang('Login').'</b></td>' .
42
-	  '</tr>'."\n";
34
+        '<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' .
35
+        '<td width="40%"><b>'.get_lang('Email').'</b></td>' .
36
+        ($is_western_name_order
37
+            ? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' .
38
+            '<td width="15%"><b>'.get_lang('Name').'</b></td>'
39
+            : '<td width="15%"><b>'.get_lang('Name').'</b></td>' .
40
+            '<td width="15%"><b>'.get_lang('FirstName').'</b></td>') .
41
+        '<td width="15%"><b>'.get_lang('Login').'</b></td>' .
42
+        '</tr>'."\n";
43 43
 while (list ($key, $val) = each($nom_form)) {
44
-	$nbre=$nbre+1;
45
-	if($nbre & 1) $ndiv=2; else $ndiv=3;
46
-	echo '<tr align="center" id="header'.$ndiv.'">';
47
-	echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
48
-	echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
49
-	if ($is_western_name_order)
50
-	{
51
-		echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
52
-		echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
53
-	}
54
-	else
55
-	{
56
-		echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
57
-		echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
58
-	}
59
-	echo '<td>'.$username_form[$key].'<input type="hidden" name="username_form['.$key.']" size="10" value="'.$username_form[$key].'">';
60
-	echo '<input type="hidden" name="tutor_form['.$key.']" value="0">';
61
-	echo '<input type="hidden" name="admin_form['.$key.']" value="1">';
62
-	echo '<input type="hidden" name="password_form['.$key.']"  value="'.$password_form[$key].'">';
63
-	echo '<input type="hidden" name="statut['.$key.']"  value="'.$statut.'">';
64
-	echo '</td>';
65
-	echo '</tr>';
44
+    $nbre=$nbre+1;
45
+    if($nbre & 1) $ndiv=2; else $ndiv=3;
46
+    echo '<tr align="center" id="header'.$ndiv.'">';
47
+    echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>';
48
+    echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>';
49
+    if ($is_western_name_order)
50
+    {
51
+        echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
52
+        echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
53
+    }
54
+    else
55
+    {
56
+        echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>';
57
+        echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>';
58
+    }
59
+    echo '<td>'.$username_form[$key].'<input type="hidden" name="username_form['.$key.']" size="10" value="'.$username_form[$key].'">';
60
+    echo '<input type="hidden" name="tutor_form['.$key.']" value="0">';
61
+    echo '<input type="hidden" name="admin_form['.$key.']" value="1">';
62
+    echo '<input type="hidden" name="password_form['.$key.']"  value="'.$password_form[$key].'">';
63
+    echo '<input type="hidden" name="statut['.$key.']"  value="'.$statut.'">';
64
+    echo '</td>';
65
+    echo '</tr>';
66 66
 }
67 67
 echo '</table>';
68 68
 echo '<br />';
Please login to merge, or discard this patch.
main/admin/dashboard_add_users_to_user.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 $add_type = 'multiple';
56 56
 if (isset($_GET['add_type']) && $_GET['add_type']!='') {
57
-	$add_type = Security::remove_XSS($_REQUEST['add_type']);
57
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
58 58
 }
59 59
 
60 60
 if (!api_is_platform_admin()) {
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
             ";
121 121
         }
122 122
 
123
-		$rs	= Database::query($sql);
124
-		$xajax_response->addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return));
123
+        $rs	= Database::query($sql);
124
+        $xajax_response->addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return));
125 125
 
126 126
         if ($type == 'single') {
127 127
             $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                     $return .= '...<br />';
161 161
                 }
162 162
             }
163
-           $xajax_response->addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
163
+            $xajax_response->addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
164 164
         } else {
165 165
             $return .= '<select id="origin" class="form-control" name="NoAssignedUsersList[]" multiple="multiple" size="15" ">';
166 166
             while($user = Database :: fetch_array($rs)) {
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
             $return .= '</select>';
171 171
             $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
172 172
         }
173
-	}
174
-	return $xajax_response;
173
+    }
174
+    return $xajax_response;
175 175
 }
176 176
 
177 177
 $xajax->processRequests();
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
 $msg = '';
286 286
 if (isset($_POST['formSent']) && intval($_POST['formSent']) == 1) {
287
-	$user_list = $_POST['UsersList'];
287
+    $user_list = $_POST['UsersList'];
288 288
 
289 289
     switch ($userStatus) {
290 290
         case DRH:
@@ -349,13 +349,13 @@  discard block
 block discarded – undo
349 349
 $assigned_users_id = array_keys($assigned_users_to_hrm);
350 350
 $without_assigned_users = '';
351 351
 if (count($assigned_users_id) > 0) {
352
-	$without_assigned_users = " user.user_id NOT IN(".implode(',',$assigned_users_id).") AND ";
352
+    $without_assigned_users = " user.user_id NOT IN(".implode(',',$assigned_users_id).") AND ";
353 353
 }
354 354
 
355 355
 $search_user = '';
356 356
 if (!empty($firstLetterUser)) {
357
-	$needle = Database::escape_string($firstLetterUser);
358
-	$search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
357
+    $needle = Database::escape_string($firstLetterUser);
358
+    $search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
359 359
 }
360 360
 
361 361
 $sqlConditions = null;
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 }
376 376
 
377 377
 if (api_is_multiple_url_enabled()) {
378
-	$sql = "SELECT user.user_id, username, lastname, firstname
378
+    $sql = "SELECT user.user_id, username, lastname, firstname
379 379
 	        FROM $tbl_user user  LEFT JOIN $tbl_access_url_rel_user au ON (au.user_id = user.user_id)
380 380
 			WHERE
381 381
                 $without_assigned_users
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                 $sqlConditions
386 386
             ORDER BY firstname";
387 387
 } else {
388
-	$sql = "SELECT user_id, username, lastname, firstname
388
+    $sql = "SELECT user_id, username, lastname, firstname
389 389
 	        FROM $tbl_user user
390 390
 			WHERE
391 391
 			    $without_assigned_users
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 <input type="hidden" name="formSent" value="1" />
402 402
 <?php
403 403
 if(!empty($msg)) {
404
-	Display::display_normal_message($msg); //main API
404
+    Display::display_normal_message($msg); //main API
405 405
 }
406 406
 ?>
407 407
 
@@ -454,26 +454,26 @@  discard block
 block discarded – undo
454 454
             </div>
455 455
             
456 456
           <?php
457
-          }
458
-          ?>
457
+            }
458
+            ?>
459 459
             <div class="separate-action">
460 460
                 <?php
461
-		echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>';
461
+        echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>';
462 462
             ?>
463 463
             </div>
464 464
         </div>
465 465
     </div>
466 466
     <div class="col-md-4">
467 467
         <?php
468
-	if (UserManager::is_admin($user_id)) {
469
-		echo get_lang('AssignedUsersListToPlatformAdministrator');
468
+    if (UserManager::is_admin($user_id)) {
469
+        echo get_lang('AssignedUsersListToPlatformAdministrator');
470 470
             } else if ($user_info['status'] == SESSIONADMIN) {
471 471
                     echo get_lang('AssignedUsersListToSessionsAdministrator');
472 472
             } else if ($user_info['status'] == STUDENT_BOSS) {
473 473
                     echo get_lang('AssignedUsersListToStudentBoss');
474 474
             } else {
475 475
                     echo get_lang('AssignedUsersListToHumanResourcesManager');
476
-	}
476
+    }
477 477
         ?>
478 478
         <div class="form-group">
479 479
             <div class="col-sm-12">
Please login to merge, or discard this patch.
main/admin/user_add.php 1 patch
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -149,27 +149,27 @@  discard block
 block discarded – undo
149 149
 $form = new FormValidator('user_add');
150 150
 $form->addElement('header', '', $tool_name);
151 151
 if (api_is_western_name_order()) {
152
-	// Firstname
153
-	$form->addElement('text', 'firstname', get_lang('FirstName'));
154
-	$form->applyFilter('firstname', 'html_filter');
155
-	$form->applyFilter('firstname', 'trim');
156
-	$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
157
-	// Lastname
158
-	$form->addElement('text', 'lastname', get_lang('LastName'));
159
-	$form->applyFilter('lastname', 'html_filter');
160
-	$form->applyFilter('lastname', 'trim');
161
-	$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
152
+    // Firstname
153
+    $form->addElement('text', 'firstname', get_lang('FirstName'));
154
+    $form->applyFilter('firstname', 'html_filter');
155
+    $form->applyFilter('firstname', 'trim');
156
+    $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
157
+    // Lastname
158
+    $form->addElement('text', 'lastname', get_lang('LastName'));
159
+    $form->applyFilter('lastname', 'html_filter');
160
+    $form->applyFilter('lastname', 'trim');
161
+    $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
162 162
 } else {
163
-	// Lastname
164
-	$form->addElement('text', 'lastname', get_lang('LastName'));
165
-	$form->applyFilter('lastname', 'html_filter');
166
-	$form->applyFilter('lastname', 'trim');
167
-	$form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
168
-	// Firstname
169
-	$form->addElement('text', 'firstname', get_lang('FirstName'));
170
-	$form->applyFilter('firstname', 'html_filter');
171
-	$form->applyFilter('firstname', 'trim');
172
-	$form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
163
+    // Lastname
164
+    $form->addElement('text', 'lastname', get_lang('LastName'));
165
+    $form->applyFilter('lastname', 'html_filter');
166
+    $form->applyFilter('lastname', 'trim');
167
+    $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required');
168
+    // Firstname
169
+    $form->addElement('text', 'firstname', get_lang('FirstName'));
170
+    $form->applyFilter('firstname', 'html_filter');
171
+    $form->applyFilter('firstname', 'trim');
172
+    $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required');
173 173
 }
174 174
 // Official code
175 175
 $form->addElement('text', 'official_code', get_lang('OfficialCode'), array('size' => '40'));
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 $auth_sources = 0; //make available wider as we need it in case of form reset (see below)
225 225
 $nb_ext_auth_source_added = 0;
226 226
 if (isset($extAuthSource) && count($extAuthSource) > 0) {
227
-	$auth_sources = array();
227
+    $auth_sources = array();
228 228
     foreach ($extAuthSource as $key => $info) {
229 229
         // @todo : make uniform external authentification configuration (ex : cas and external_login ldap)
230 230
         // Special case for CAS. CAS is activated from Chamilo > Administration > Configuration > CAS
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
             $nb_ext_auth_source_added++;
236 236
         }
237 237
     }
238
-	if ($nb_ext_auth_source_added > 0) {
239
-    	$group[] = $form->createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
240
-    	$group[] = $form->createElement('select', 'auth_source', null, $auth_sources);
241
-    	$group[] = $form->createElement('static', '', '', '<br />');
238
+    if ($nb_ext_auth_source_added > 0) {
239
+        $group[] = $form->createElement('radio', 'password_auto', null, get_lang('ExternalAuthentication').' ', 2);
240
+        $group[] = $form->createElement('select', 'auth_source', null, $auth_sources);
241
+        $group[] = $form->createElement('static', '', '', '<br />');
242 242
     }
243 243
 }
244 244
 
@@ -307,12 +307,12 @@  discard block
 block discarded – undo
307 307
 $form->addElement('html', '<div id="drh_list" style="display:'.$display.';">');
308 308
 
309 309
 if (isset($drh_list) && is_array($drh_list)) {
310
-	foreach ($drh_list as $drh) {
310
+    foreach ($drh_list as $drh) {
311 311
         $drh_select->addOption(
312 312
             api_get_person_name($drh['firstname'], $drh['lastname']),
313 313
             $drh['user_id']
314 314
         );
315
-	}
315
+    }
316 316
 }
317 317
 $form->addElement('html', '</div>');
318 318
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
 // Validate form
388 388
 if ($form->validate()) {
389
-	$check = Security::check_token('post');
389
+    $check = Security::check_token('post');
390 390
     if ($check) {
391 391
         $user = $form->exportValues();
392 392
         $lastname = $user['lastname'];
@@ -402,15 +402,15 @@  discard block
 block discarded – undo
402 402
         $send_mail = intval($user['mail']['send_mail']);
403 403
         $hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : 0;
404 404
 
405
-		if (isset($extAuthSource) && count($extAuthSource) > 0 &&
405
+        if (isset($extAuthSource) && count($extAuthSource) > 0 &&
406 406
             $user['password']['password_auto'] == '2'
407 407
         ) {
408
-			$auth_source = $user['password']['auth_source'];
409
-			$password = 'PLACEHOLDER';
410
-		} else {
411
-			$auth_source = PLATFORM_AUTH_SOURCE;
412
-			$password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
413
-		}
408
+            $auth_source = $user['password']['auth_source'];
409
+            $password = 'PLACEHOLDER';
410
+        } else {
411
+            $auth_source = PLATFORM_AUTH_SOURCE;
412
+            $password = $user['password']['password_auto'] == '1' ? api_generate_password() : $user['password']['password'];
413
+        }
414 414
 
415 415
         if ($user['radio_expiration_date'] == '1') {
416 416
             $expiration_date = $user['expiration_date'];
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
             $expiration_date = null;
419 419
         }
420 420
 
421
-		$active = intval($user['active']);
421
+        $active = intval($user['active']);
422 422
 
423 423
         if (api_get_setting('login_is_email') == 'true') {
424 424
             $username = $email;
@@ -449,21 +449,21 @@  discard block
 block discarded – undo
449 449
             $extra,
450 450
             null,
451 451
             $send_mail,
452
-			$platform_admin
452
+            $platform_admin
453 453
         );
454 454
 
455
-		Security::clear_token();
456
-		$tok = Security::get_token();
457
-		if ($user_id === false) {
458
-			//If any error ocurred during user creation, print it (api_failureList
459
-			// stores values as separate words, so rework it
460
-			$message = '';
461
-			$message_bits = explode(' ',api_get_last_failure());
462
-			foreach ($message_bits as $bit) {
463
-				$message .= ucfirst($bit);
464
-			}
465
-		} else {
466
- 			if (!empty($picture['name'])) {
455
+        Security::clear_token();
456
+        $tok = Security::get_token();
457
+        if ($user_id === false) {
458
+            //If any error ocurred during user creation, print it (api_failureList
459
+            // stores values as separate words, so rework it
460
+            $message = '';
461
+            $message_bits = explode(' ',api_get_last_failure());
462
+            foreach ($message_bits as $bit) {
463
+                $message .= ucfirst($bit);
464
+            }
465
+        } else {
466
+                if (!empty($picture['name'])) {
467 467
                 $picture_uri = UserManager::update_user_picture(
468 468
                     $user_id,
469 469
                     $_FILES['picture']['name'],
@@ -489,35 +489,35 @@  discard block
 block discarded – undo
489 489
                     null,
490 490
                     $language
491 491
                 );
492
-			}
492
+            }
493 493
 
494 494
             $extraFieldValues = new ExtraFieldValue('user');
495 495
             $user['item_id'] = $user_id;
496 496
             $extraFieldValues->saveFieldValues($user);
497 497
 
498
-			$message = get_lang('UserAdded');
499
-		}
500
-		if (isset($user['submit_plus'])) {
501
-			//we want to add more. Prepare report message and redirect to the same page (to clean the form)
502
-			header('Location: user_add.php?message='.urlencode($message).'&sec_token='.$tok);
503
-			exit ();
504
-		} else {
505
-			$tok = Security::get_token();
506
-			header('Location: user_list.php?action=show_message&message='.urlencode($message).'&sec_token='.$tok);
507
-			exit ();
508
-		}
509
-	}
498
+            $message = get_lang('UserAdded');
499
+        }
500
+        if (isset($user['submit_plus'])) {
501
+            //we want to add more. Prepare report message and redirect to the same page (to clean the form)
502
+            header('Location: user_add.php?message='.urlencode($message).'&sec_token='.$tok);
503
+            exit ();
504
+        } else {
505
+            $tok = Security::get_token();
506
+            header('Location: user_list.php?action=show_message&message='.urlencode($message).'&sec_token='.$tok);
507
+            exit ();
508
+        }
509
+    }
510 510
 } else {
511
-	if (isset($_POST['submit'])) {
512
-		Security::clear_token();
513
-	}
514
-	$token = Security::get_token();
515
-	$form->addElement('hidden', 'sec_token');
516
-	$form->setConstants(array('sec_token' => $token));
511
+    if (isset($_POST['submit'])) {
512
+        Security::clear_token();
513
+    }
514
+    $token = Security::get_token();
515
+    $form->addElement('hidden', 'sec_token');
516
+    $form->setConstants(array('sec_token' => $token));
517 517
 }
518 518
 
519 519
 if (!empty($message)){
520
-	$message = Display::return_message(stripslashes($message));
520
+    $message = Display::return_message(stripslashes($message));
521 521
 }
522 522
 $content = $form->returnForm();
523 523
 
Please login to merge, or discard this patch.
main/admin/access_url_edit_courses_to_url.php 1 patch
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 $xajax = new xajax();
13 13
 $xajax->registerFunction(
14
-	array('search_courses', 'Accessurleditcoursestourl', 'search_courses')
14
+    array('search_courses', 'Accessurleditcoursestourl', 'search_courses')
15 15
 );
16 16
 
17 17
 // setting the section (for the tabs)
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 // Access restrictions
21 21
 api_protect_global_admin_script();
22 22
 if (!api_get_multiple_access_url()) {
23
-	header('Location: index.php');
24
-	exit;
23
+    header('Location: index.php');
24
+    exit;
25 25
 }
26 26
 
27 27
 // Database Table Definitions
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
 
37 37
 $add_type = 'multiple';
38 38
 if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
39
-	$add_type = Security::remove_XSS($_REQUEST['add_type']);
39
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
40 40
 }
41 41
 
42 42
 $access_url_id = 1;
43 43
 if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') {
44
-	$access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
44
+    $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
45 45
 }
46 46
 
47 47
 $xajax -> processRequests();
@@ -83,21 +83,21 @@  discard block
 block discarded – undo
83 83
 $users = $sessions = array();
84 84
 
85 85
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
86
-	$form_sent = $_POST['form_sent'];
87
-	$course_list = $_POST['course_list'];
88
-
89
-	if (!is_array($course_list)) {
90
-		$course_list = array();
91
-	}
92
-
93
-	if ($form_sent == 1) {
94
-		if ($access_url_id==0) {
95
-			header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL'));
96
-		} elseif (is_array($course_list)) {
97
-			UrlManager::update_urls_rel_course($course_list, $access_url_id);
98
-			header('Location: access_urls.php?action=show_message&message='.get_lang('CoursesWereEdited'));
99
-		}
100
-	}
86
+    $form_sent = $_POST['form_sent'];
87
+    $course_list = $_POST['course_list'];
88
+
89
+    if (!is_array($course_list)) {
90
+        $course_list = array();
91
+    }
92
+
93
+    if ($form_sent == 1) {
94
+        if ($access_url_id==0) {
95
+            header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL'));
96
+        } elseif (is_array($course_list)) {
97
+            UrlManager::update_urls_rel_course($course_list, $access_url_id);
98
+            header('Location: access_urls.php?action=show_message&message='.get_lang('CoursesWereEdited'));
99
+        }
100
+    }
101 101
 }
102 102
 
103 103
 Display::display_header($tool_name);
@@ -109,45 +109,45 @@  discard block
 block discarded – undo
109 109
 api_display_tool_title($tool_name);
110 110
 
111 111
 if (isset($_GET['action']) && $_GET['action'] == 'show_message')
112
-	Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
112
+    Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
113 113
 
114 114
 $no_course_list = $course_list = array();
115 115
 $ajax_search = $add_type == 'unique' ? true : false;
116 116
 
117 117
 if($ajax_search) {
118
-	$courses = UrlManager::get_url_rel_course_data($access_url_id);
119
-	foreach ($courses as $course) {
120
-		$course_list[$course['c_id']] = $course;
121
-	}
118
+    $courses = UrlManager::get_url_rel_course_data($access_url_id);
119
+    foreach ($courses as $course) {
120
+        $course_list[$course['c_id']] = $course;
121
+    }
122 122
 } else {
123
-	$courses = UrlManager::get_url_rel_course_data();
123
+    $courses = UrlManager::get_url_rel_course_data();
124 124
 
125
-	foreach ($courses as $course) {
126
-		if ($course['access_url_id'] == $access_url_id) {
127
-			$course_list[$course['c_id']] = $course;
128
-		}
129
-	}
125
+    foreach ($courses as $course) {
126
+        if ($course['access_url_id'] == $access_url_id) {
127
+            $course_list[$course['c_id']] = $course;
128
+        }
129
+    }
130 130
 
131
-	$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
132
-	$sql="SELECT id, code, title
131
+    $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
132
+    $sql="SELECT id, code, title
133 133
 	  	  	FROM $tbl_course u
134 134
 			ORDER BY title, code";
135
-	$result = Database::query($sql);
136
-	$courses = Database::store_result($result);
137
-	$course_list_leys = array_keys($course_list);
138
-	foreach ($courses as $course) {
139
-		if (!in_array($course['id'], $course_list_leys)) {
140
-			$no_course_list[$course['id']] = $course;
141
-		}
142
-	}
135
+    $result = Database::query($sql);
136
+    $courses = Database::store_result($result);
137
+    $course_list_leys = array_keys($course_list);
138
+    foreach ($courses as $course) {
139
+        if (!in_array($course['id'], $course_list_leys)) {
140
+            $no_course_list[$course['id']] = $course;
141
+        }
142
+    }
143 143
 }
144 144
 
145 145
 if($add_type == 'multiple') {
146
-	$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
147
-	$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
146
+    $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
147
+    $link_add_type_multiple = get_lang('SessionAddTypeMultiple');
148 148
 } else {
149
-	$link_add_type_unique = get_lang('SessionAddTypeUnique');
150
-	$link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>';
149
+    $link_add_type_unique = get_lang('SessionAddTypeUnique');
150
+    $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>';
151 151
 }
152 152
 $url_list = UrlManager::get_url_data();
153 153
 ?>
@@ -160,31 +160,31 @@  discard block
 block discarded – undo
160 160
 		<select name="access_url_id" onchange="javascript:send();">
161 161
 			<option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option>
162 162
 			<?php
163
-			$url_selected='';
164
-			foreach ($url_list as $url_obj) {
165
-				$checked = '';
166
-				if (!empty($access_url_id)) {
167
-					if ($url_obj[0]==$access_url_id) {
168
-						$checked = 'selected=true';
169
-						$url_selected=$url_obj[1];
170
-					}
171
-				}
172
-				if ($url_obj['active']==1) {
173
-					?>
163
+            $url_selected='';
164
+            foreach ($url_list as $url_obj) {
165
+                $checked = '';
166
+                if (!empty($access_url_id)) {
167
+                    if ($url_obj[0]==$access_url_id) {
168
+                        $checked = 'selected=true';
169
+                        $url_selected=$url_obj[1];
170
+                    }
171
+                }
172
+                if ($url_obj['active']==1) {
173
+                    ?>
174 174
 					<option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option>
175 175
 				<?php
176
-				}
177
-			}
178
-			?>
176
+                }
177
+            }
178
+            ?>
179 179
 		</select>
180 180
 		<br /><br />
181 181
 		<input type="hidden" name="form_sent" value="1" />
182 182
 		<input type="hidden" name="add_type" value = "<?php echo $add_type ?>" />
183 183
 		<?php
184
-		if(!empty($errorMsg)) {
185
-			Display::display_normal_message($errorMsg); //main API
186
-		}
187
-		?>
184
+        if(!empty($errorMsg)) {
185
+            Display::display_normal_message($errorMsg); //main API
186
+        }
187
+        ?>
188 188
 		<table border="0" cellpadding="5" cellspacing="0" width="100%">
189 189
 
190 190
 			<!-- Users -->
@@ -199,38 +199,38 @@  discard block
 block discarded – undo
199 199
 				<td align="center">
200 200
 					<div id="content_source">
201 201
 						<?php
202
-						if($ajax_search) {
203
-							?>
202
+                        if($ajax_search) {
203
+                            ?>
204 204
 							<input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" />
205 205
 							<div id="ajax_list_courses"></div>
206 206
 						<?php
207
-						} else {
208
-							?>
207
+                        } else {
208
+                            ?>
209 209
 							<select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;">
210 210
 								<?php
211
-								foreach($no_course_list as $no_course) {
212
-									?>
211
+                                foreach($no_course_list as $no_course) {
212
+                                    ?>
213 213
 									<option value="<?php echo $no_course['id']; ?>"><?php echo $no_course['title'].' ('.$no_course['code'].')'; ?></option>
214 214
 								<?php
215
-								}
216
-								unset($no_course_list);
217
-								?>
215
+                                }
216
+                                unset($no_course_list);
217
+                                ?>
218 218
 							</select>
219 219
 						<?php
220
-						}
221
-						?>
220
+                        }
221
+                        ?>
222 222
 					</div>
223 223
 				</td>
224 224
 				<td width="10%" valign="middle" align="center">
225 225
 					<?php
226
-					if($ajax_search) {
227
-						?>
226
+                    if($ajax_search) {
227
+                        ?>
228 228
 						<button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" >
229 229
                             <em class="fa fa-arrow-left"></em>
230 230
 						</button>
231 231
 					<?php
232
-					} else {
233
-						?>
232
+                    } else {
233
+                        ?>
234 234
 						<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" >
235 235
                             <em class="fa fa-arrow-right"></em>
236 236
 						</button>
@@ -239,21 +239,21 @@  discard block
 block discarded – undo
239 239
                             <em class="fa fa-arrow-left"></em>
240 240
 						</button>
241 241
 					<?php
242
-					}
243
-					?>
242
+                    }
243
+                    ?>
244 244
 					<br /><br /><br /><br /><br /><br />
245 245
 				</td>
246 246
 				<td align="center">
247 247
 					<select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;">
248 248
 						<?php
249
-						foreach($course_list as $course) {
250
-							$courseInfo = api_get_course_info_by_id($course['id']);
251
-							?>
249
+                        foreach($course_list as $course) {
250
+                            $courseInfo = api_get_course_info_by_id($course['id']);
251
+                            ?>
252 252
 							<option value="<?php echo $course['id']; ?>"><?php echo $course['title'].' ('.$courseInfo['code'].')'; ?></option>
253 253
 						<?php
254
-						}
255
-						unset($course_list);
256
-						?>
254
+                        }
255
+                        unset($course_list);
256
+                        ?>
257 257
 
258 258
 					</select></td>
259 259
 			</tr>
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
 				<td colspan="3" align="center">
262 262
 					<br />
263 263
 					<?php
264
-					if(isset($_GET['add']))
265
-						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
266
-					else
267
-						echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';
268
-					?>
264
+                    if(isset($_GET['add']))
265
+                        echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>';
266
+                    else
267
+                        echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>';
268
+                    ?>
269 269
 				</td>
270 270
 			</tr>
271 271
 		</table>
Please login to merge, or discard this patch.