@@ -157,27 +157,27 @@ discard block |
||
157 | 157 | $form->addElement('hidden', 'user_id', $user_id); |
158 | 158 | |
159 | 159 | if (api_is_western_name_order()) { |
160 | - // Firstname |
|
161 | - $form->addElement('text', 'firstname', get_lang('FirstName')); |
|
162 | - $form->applyFilter('firstname', 'html_filter'); |
|
163 | - $form->applyFilter('firstname', 'trim'); |
|
164 | - $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required'); |
|
165 | - // Lastname |
|
166 | - $form->addElement('text', 'lastname', get_lang('LastName')); |
|
167 | - $form->applyFilter('lastname', 'html_filter'); |
|
168 | - $form->applyFilter('lastname', 'trim'); |
|
169 | - $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required'); |
|
160 | + // Firstname |
|
161 | + $form->addElement('text', 'firstname', get_lang('FirstName')); |
|
162 | + $form->applyFilter('firstname', 'html_filter'); |
|
163 | + $form->applyFilter('firstname', 'trim'); |
|
164 | + $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required'); |
|
165 | + // Lastname |
|
166 | + $form->addElement('text', 'lastname', get_lang('LastName')); |
|
167 | + $form->applyFilter('lastname', 'html_filter'); |
|
168 | + $form->applyFilter('lastname', 'trim'); |
|
169 | + $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required'); |
|
170 | 170 | } else { |
171 | - // Lastname |
|
172 | - $form->addElement('text', 'lastname', get_lang('LastName')); |
|
173 | - $form->applyFilter('lastname', 'html_filter'); |
|
174 | - $form->applyFilter('lastname', 'trim'); |
|
175 | - $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required'); |
|
176 | - // Firstname |
|
177 | - $form->addElement('text', 'firstname', get_lang('FirstName')); |
|
178 | - $form->applyFilter('firstname', 'html_filter'); |
|
179 | - $form->applyFilter('firstname', 'trim'); |
|
180 | - $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required'); |
|
171 | + // Lastname |
|
172 | + $form->addElement('text', 'lastname', get_lang('LastName')); |
|
173 | + $form->applyFilter('lastname', 'html_filter'); |
|
174 | + $form->applyFilter('lastname', 'trim'); |
|
175 | + $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required'); |
|
176 | + // Firstname |
|
177 | + $form->addElement('text', 'firstname', get_lang('FirstName')); |
|
178 | + $form->applyFilter('firstname', 'html_filter'); |
|
179 | + $form->applyFilter('firstname', 'trim'); |
|
180 | + $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required'); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | // Official code |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | // OpenID |
201 | 201 | if (api_get_setting('openid_authentication') == 'true') { |
202 | - $form->addElement('text', 'openid', get_lang('OpenIDURL')); |
|
202 | + $form->addElement('text', 'openid', get_lang('OpenIDURL')); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | // Phone |
@@ -225,18 +225,18 @@ discard block |
||
225 | 225 | $form->addHidden('cropResult', ''); |
226 | 226 | |
227 | 227 | $form->addRule( |
228 | - 'picture', |
|
229 | - get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', |
|
230 | - 'filetype', |
|
231 | - $allowed_picture_types |
|
228 | + 'picture', |
|
229 | + get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', |
|
230 | + 'filetype', |
|
231 | + $allowed_picture_types |
|
232 | 232 | ); |
233 | 233 | if (strlen($user_data['picture_uri']) > 0) { |
234 | - $form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage')); |
|
234 | + $form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage')); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | // Username |
238 | 238 | if (api_get_setting('login_is_email') != 'true') { |
239 | - $form->addElement('text', 'username', get_lang('LoginName'), array('maxlength' => USERNAME_MAX_LENGTH)); |
|
239 | + $form->addElement('text', 'username', get_lang('LoginName'), array('maxlength' => USERNAME_MAX_LENGTH)); |
|
240 | 240 | $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required'); |
241 | 241 | $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH); |
242 | 242 | $form->addRule('username', get_lang('OnlyLettersAndNumbersAllowed'), 'username'); |
@@ -308,15 +308,15 @@ discard block |
||
308 | 308 | |
309 | 309 | // Platform admin |
310 | 310 | if (api_is_platform_admin()) { |
311 | - $group = array(); |
|
312 | - $group[] =$form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1); |
|
313 | - $group[] =$form->createElement('radio', 'platform_admin', null, get_lang('No'), 0); |
|
311 | + $group = array(); |
|
312 | + $group[] =$form->createElement('radio', 'platform_admin', null, get_lang('Yes'), 1); |
|
313 | + $group[] =$form->createElement('radio', 'platform_admin', null, get_lang('No'), 0); |
|
314 | 314 | |
315 | - $user_data['status'] == 1 ? $display = 'block':$display = 'none'; |
|
315 | + $user_data['status'] == 1 ? $display = 'block':$display = 'none'; |
|
316 | 316 | |
317 | - $form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">'); |
|
318 | - $form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false); |
|
319 | - $form->addElement('html', '</div>'); |
|
317 | + $form->addElement('html', '<div id="id_platform_admin" style="display:'.$display.'">'); |
|
318 | + $form->addGroup($group, 'admin', get_lang('PlatformAdmin'), null, false); |
|
319 | + $form->addElement('html', '</div>'); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | //Language |
@@ -334,16 +334,16 @@ discard block |
||
334 | 334 | $form->addElement('label', get_lang('RegistrationDate'), $date); |
335 | 335 | |
336 | 336 | if (!$user_data['platform_admin']) { |
337 | - // Expiration Date |
|
338 | - $form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0); |
|
339 | - $group = array (); |
|
340 | - $group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1); |
|
341 | - $group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();')); |
|
342 | - $form->addGroup($group, 'max_member_group', null, '', false); |
|
343 | - |
|
344 | - // Active account or inactive account |
|
345 | - $form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active'), 1); |
|
346 | - $form->addElement('radio', 'active', '', get_lang('Inactive'), 0); |
|
337 | + // Expiration Date |
|
338 | + $form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0); |
|
339 | + $group = array (); |
|
340 | + $group[] = $form->createElement('radio', 'radio_expiration_date', null, get_lang('Enabled'), 1); |
|
341 | + $group[] = $form->createElement('DateTimePicker', 'expiration_date', null, array('onchange' => 'javascript: enable_expiration_date();')); |
|
342 | + $form->addGroup($group, 'max_member_group', null, '', false); |
|
343 | + |
|
344 | + // Active account or inactive account |
|
345 | + $form->addElement('radio', 'active', get_lang('ActiveAccount'), get_lang('Active'), 1); |
|
346 | + $form->addElement('radio', 'active', '', get_lang('Inactive'), 0); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | // EXTRA FIELDS |
@@ -366,18 +366,18 @@ discard block |
||
366 | 366 | $expiration_date = $user_data['expiration_date']; |
367 | 367 | |
368 | 368 | if (empty($expiration_date)) { |
369 | - $user_data['radio_expiration_date'] = 0; |
|
370 | - $user_data['expiration_date'] = api_get_local_time(); |
|
369 | + $user_data['radio_expiration_date'] = 0; |
|
370 | + $user_data['expiration_date'] = api_get_local_time(); |
|
371 | 371 | } else { |
372 | - $user_data['radio_expiration_date'] = 1; |
|
373 | - $user_data['expiration_date'] = api_get_local_time($expiration_date); |
|
372 | + $user_data['radio_expiration_date'] = 1; |
|
373 | + $user_data['expiration_date'] = api_get_local_time($expiration_date); |
|
374 | 374 | } |
375 | 375 | $form->setDefaults($user_data); |
376 | 376 | |
377 | 377 | $error_drh = false; |
378 | 378 | // Validate form |
379 | 379 | if ($form->validate()) { |
380 | - $user = $form->getSubmitValues(1); |
|
380 | + $user = $form->getSubmitValues(1); |
|
381 | 381 | $reset_password = intval($user['reset_password']); |
382 | 382 | if ($reset_password == 2 && empty($user['password'])) { |
383 | 383 | Display::addFlash(Display::return_message(get_lang('PasswordIsTooShort'))); |
@@ -385,18 +385,18 @@ discard block |
||
385 | 385 | exit(); |
386 | 386 | } |
387 | 387 | |
388 | - $is_user_subscribed_in_course = CourseManager::is_user_subscribed_in_course($user['user_id']); |
|
388 | + $is_user_subscribed_in_course = CourseManager::is_user_subscribed_in_course($user['user_id']); |
|
389 | 389 | |
390 | - if ($user['status'] == DRH && $is_user_subscribed_in_course) { |
|
391 | - $error_drh = true; |
|
392 | - } else { |
|
393 | - $picture_element = $form->getElement('picture'); |
|
394 | - $picture = $picture_element->getValue(); |
|
390 | + if ($user['status'] == DRH && $is_user_subscribed_in_course) { |
|
391 | + $error_drh = true; |
|
392 | + } else { |
|
393 | + $picture_element = $form->getElement('picture'); |
|
394 | + $picture = $picture_element->getValue(); |
|
395 | 395 | |
396 | - $picture_uri = $user_data['picture_uri']; |
|
397 | - if (isset($user['delete_picture']) && $user['delete_picture']) { |
|
398 | - $picture_uri = UserManager::delete_user_picture($user_id); |
|
399 | - } elseif (!empty($picture['name'])) { |
|
396 | + $picture_uri = $user_data['picture_uri']; |
|
397 | + if (isset($user['delete_picture']) && $user['delete_picture']) { |
|
398 | + $picture_uri = UserManager::delete_user_picture($user_id); |
|
399 | + } elseif (!empty($picture['name'])) { |
|
400 | 400 | $picture_uri = UserManager::update_user_picture( |
401 | 401 | $user_id, |
402 | 402 | $_FILES['picture']['name'], |
@@ -404,30 +404,30 @@ discard block |
||
404 | 404 | $user['cropResult'] |
405 | 405 | |
406 | 406 | ); |
407 | - } |
|
407 | + } |
|
408 | 408 | |
409 | - $lastname = $user['lastname']; |
|
410 | - $firstname = $user['firstname']; |
|
409 | + $lastname = $user['lastname']; |
|
410 | + $firstname = $user['firstname']; |
|
411 | 411 | $password = $user['password']; |
412 | 412 | $auth_source = isset($user['auth_source']) ? $user['auth_source'] : $userInfo['auth_source']; |
413 | - $official_code = $user['official_code']; |
|
414 | - $email = $user['email']; |
|
415 | - $phone = $user['phone']; |
|
416 | - $username = isset($user['username']) ? $user['username'] : $userInfo['username']; |
|
417 | - $status = intval($user['status']); |
|
418 | - $platform_admin = intval($user['platform_admin']); |
|
419 | - $send_mail = intval($user['send_mail']); |
|
420 | - $reset_password = intval($user['reset_password']); |
|
421 | - $hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : null; |
|
422 | - $language = $user['language']; |
|
423 | - |
|
424 | - if ($user['radio_expiration_date'] == '1' && !$user_data['platform_admin']) { |
|
413 | + $official_code = $user['official_code']; |
|
414 | + $email = $user['email']; |
|
415 | + $phone = $user['phone']; |
|
416 | + $username = isset($user['username']) ? $user['username'] : $userInfo['username']; |
|
417 | + $status = intval($user['status']); |
|
418 | + $platform_admin = intval($user['platform_admin']); |
|
419 | + $send_mail = intval($user['send_mail']); |
|
420 | + $reset_password = intval($user['reset_password']); |
|
421 | + $hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : null; |
|
422 | + $language = $user['language']; |
|
423 | + |
|
424 | + if ($user['radio_expiration_date'] == '1' && !$user_data['platform_admin']) { |
|
425 | 425 | $expiration_date = $user['expiration_date']; |
426 | - } else { |
|
427 | - $expiration_date = null; |
|
428 | - } |
|
426 | + } else { |
|
427 | + $expiration_date = null; |
|
428 | + } |
|
429 | 429 | |
430 | - $active = $user_data['platform_admin'] ? 1 : intval($user['active']); |
|
430 | + $active = $user_data['platform_admin'] ? 1 : intval($user['active']); |
|
431 | 431 | |
432 | 432 | //If the user is set to admin the status will be overwrite by COURSEMANAGER = 1 |
433 | 433 | if ($platform_admin == 1) { |
@@ -461,31 +461,31 @@ discard block |
||
461 | 461 | $reset_password |
462 | 462 | ); |
463 | 463 | |
464 | - if (api_get_setting('openid_authentication') == 'true' && !empty($user['openid'])) { |
|
465 | - $up = UserManager::update_openid($user_id, $user['openid']); |
|
466 | - } |
|
464 | + if (api_get_setting('openid_authentication') == 'true' && !empty($user['openid'])) { |
|
465 | + $up = UserManager::update_openid($user_id, $user['openid']); |
|
466 | + } |
|
467 | 467 | $currentUserId = api_get_user_id(); |
468 | - if ($user_id != $currentUserId) { |
|
469 | - if ($platform_admin == 1) { |
|
468 | + if ($user_id != $currentUserId) { |
|
469 | + if ($platform_admin == 1) { |
|
470 | 470 | UserManager::add_user_as_admin($user_id); |
471 | - } else { |
|
471 | + } else { |
|
472 | 472 | UserManager::remove_user_admin($user_id); |
473 | - } |
|
474 | - } |
|
473 | + } |
|
474 | + } |
|
475 | 475 | |
476 | 476 | $extraFieldValue = new ExtraFieldValue('user'); |
477 | 477 | $extraFieldValue->saveFieldValues($user); |
478 | 478 | |
479 | - $tok = Security::get_token(); |
|
480 | - header('Location: user_list.php?action=show_message&message='.urlencode(get_lang('UserUpdated')).'&sec_token='.$tok); |
|
481 | - exit(); |
|
482 | - } |
|
479 | + $tok = Security::get_token(); |
|
480 | + header('Location: user_list.php?action=show_message&message='.urlencode(get_lang('UserUpdated')).'&sec_token='.$tok); |
|
481 | + exit(); |
|
482 | + } |
|
483 | 483 | } |
484 | 484 | |
485 | 485 | $message = null; |
486 | 486 | if ($error_drh) { |
487 | - $err_msg = get_lang('StatusCanNotBeChangedToHumanResourcesManager'); |
|
488 | - $message = Display::return_message($err_msg, 'error'); |
|
487 | + $err_msg = get_lang('StatusCanNotBeChangedToHumanResourcesManager'); |
|
488 | + $message = Display::return_message($err_msg, 'error'); |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | $content = null; |
@@ -229,31 +229,31 @@ discard block |
||
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 |
||
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"> |
@@ -46,7 +46,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -11,58 +11,58 @@ |
||
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 />'; |
@@ -54,7 +54,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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"> |
@@ -59,30 +59,30 @@ discard block |
||
59 | 59 | $sublanguage_folder_error = false; |
60 | 60 | |
61 | 61 | if (isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) { |
62 | - $language_name = SubLanguageManager::get_name_of_language_by_id ($_GET['id']); |
|
63 | - $sub_language_name = SubLanguageManager::get_name_of_language_by_id ($_GET['sub_language_id']); |
|
64 | - $all_data_of_language = SubLanguageManager::get_all_information_of_language($_GET['id']); |
|
65 | - $all_data_of_sublanguage = SubLanguageManager::get_all_information_of_language($_GET['sub_language_id']); |
|
66 | - $sub_language_file = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder']; |
|
62 | + $language_name = SubLanguageManager::get_name_of_language_by_id ($_GET['id']); |
|
63 | + $sub_language_name = SubLanguageManager::get_name_of_language_by_id ($_GET['sub_language_id']); |
|
64 | + $all_data_of_language = SubLanguageManager::get_all_information_of_language($_GET['id']); |
|
65 | + $all_data_of_sublanguage = SubLanguageManager::get_all_information_of_language($_GET['sub_language_id']); |
|
66 | + $sub_language_file = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder']; |
|
67 | 67 | |
68 | - if (!file_exists($sub_language_file) || !is_writable($sub_language_file)) { |
|
69 | - $sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable'); |
|
70 | - } |
|
71 | - if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) { |
|
72 | - $language_id_exist = true; |
|
73 | - } else { |
|
74 | - $language_id_exist = false; |
|
75 | - } |
|
68 | + if (!file_exists($sub_language_file) || !is_writable($sub_language_file)) { |
|
69 | + $sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable'); |
|
70 | + } |
|
71 | + if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) { |
|
72 | + $language_id_exist = true; |
|
73 | + } else { |
|
74 | + $language_id_exist = false; |
|
75 | + } |
|
76 | 76 | } else { |
77 | - $language_name=''; |
|
78 | - $language_id_exist=false; |
|
77 | + $language_name=''; |
|
78 | + $language_id_exist=false; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | $intro = sprintf(get_lang('RegisterTermsOfSubLanguageForX'), strtolower($sub_language_name)); |
82 | 82 | $path_folder = api_get_path(SYS_LANG_PATH).$all_data_of_language['dokeos_folder']; |
83 | 83 | |
84 | 84 | if (!is_dir($path_folder) || strlen($all_data_of_language['dokeos_folder'])==0) { |
85 | - api_not_allowed(true); |
|
85 | + api_not_allowed(true); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | Display :: display_header($language_name); |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | echo '</div>'; |
95 | 95 | |
96 | 96 | if (!empty($_SESSION['msg'])) { |
97 | - echo $_SESSION['msg']; |
|
98 | - unset($_SESSION['msg']); |
|
97 | + echo $_SESSION['msg']; |
|
98 | + unset($_SESSION['msg']); |
|
99 | 99 | } else { |
100 | - echo '<br />'; |
|
100 | + echo '<br />'; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | echo $html; |
116 | 116 | echo '<br /><br /><br />'; |
117 | 117 | if (!empty($sublanguage_folder_error)) { |
118 | - Display::display_warning_message($sublanguage_folder_error); |
|
118 | + Display::display_warning_message($sublanguage_folder_error); |
|
119 | 119 | } |
120 | 120 | echo '<div id="div_message_information_id"> </div>'; |
121 | 121 | |
@@ -130,182 +130,182 @@ discard block |
||
130 | 130 | * |
131 | 131 | */ |
132 | 132 | function search_language_term( |
133 | - $term, |
|
134 | - $search_in_variable = true, |
|
135 | - $search_in_english = true, |
|
136 | - $search_in_parent = true, |
|
137 | - $search_in_sub_language = true |
|
133 | + $term, |
|
134 | + $search_in_variable = true, |
|
135 | + $search_in_english = true, |
|
136 | + $search_in_parent = true, |
|
137 | + $search_in_sub_language = true |
|
138 | 138 | ) { |
139 | - //These the $_REQUEST['id'] and the $_REQUEST['sub_language_id'] variables are process in global.inc.php (LOAD LANGUAGE FILES SECTION) |
|
140 | - /* |
|
139 | + //These the $_REQUEST['id'] and the $_REQUEST['sub_language_id'] variables are process in global.inc.php (LOAD LANGUAGE FILES SECTION) |
|
140 | + /* |
|
141 | 141 | These 4 arrays are set in global.inc.php with the condition that will be load from sub_language.php or sub_language_ajax.inc.php |
142 | 142 | $english_language_array |
143 | 143 | $parent_language_array |
144 | 144 | $sub_language_array |
145 | 145 | $language_files_to_load |
146 | 146 | */ |
147 | - global $language_files_to_load, $sub_language_array, $english_language_array, $parent_language_array; |
|
148 | - $language_files_to_load_keys = array_flip($language_files_to_load); |
|
149 | - $array_to_search = $parent_language_array; |
|
150 | - $list_info = array(); |
|
151 | - $term='/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i'; |
|
152 | - //@todo optimize this foreach |
|
153 | - foreach ($language_files_to_load as $lang_file) { |
|
154 | - //searching in parent language of the sub language |
|
155 | - if ($search_in_parent) { |
|
156 | - $variables = $parent_language_array[$lang_file]; |
|
157 | - foreach ($variables as $parent_name_variable =>$parent_variable_value) { |
|
158 | - //arrays are avoided |
|
159 | - if (is_array($parent_variable_value)) { |
|
160 | - continue; |
|
161 | - } |
|
162 | - $founded = false; |
|
163 | - // searching the item in the parent tool |
|
164 | - if (preg_match($term,$parent_variable_value)!==0) { |
|
165 | - $founded = true; |
|
166 | - } |
|
167 | - if ($founded) { |
|
168 | - //loading variable from the english array |
|
169 | - $sub_language_name_variable = $sub_language_array[$lang_file][$parent_name_variable]; |
|
170 | - //loading variable from the english array |
|
171 | - $english_name_variable = $english_language_array[$lang_file][$parent_name_variable]; |
|
147 | + global $language_files_to_load, $sub_language_array, $english_language_array, $parent_language_array; |
|
148 | + $language_files_to_load_keys = array_flip($language_files_to_load); |
|
149 | + $array_to_search = $parent_language_array; |
|
150 | + $list_info = array(); |
|
151 | + $term='/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i'; |
|
152 | + //@todo optimize this foreach |
|
153 | + foreach ($language_files_to_load as $lang_file) { |
|
154 | + //searching in parent language of the sub language |
|
155 | + if ($search_in_parent) { |
|
156 | + $variables = $parent_language_array[$lang_file]; |
|
157 | + foreach ($variables as $parent_name_variable =>$parent_variable_value) { |
|
158 | + //arrays are avoided |
|
159 | + if (is_array($parent_variable_value)) { |
|
160 | + continue; |
|
161 | + } |
|
162 | + $founded = false; |
|
163 | + // searching the item in the parent tool |
|
164 | + if (preg_match($term,$parent_variable_value)!==0) { |
|
165 | + $founded = true; |
|
166 | + } |
|
167 | + if ($founded) { |
|
168 | + //loading variable from the english array |
|
169 | + $sub_language_name_variable = $sub_language_array[$lang_file][$parent_name_variable]; |
|
170 | + //loading variable from the english array |
|
171 | + $english_name_variable = $english_language_array[$lang_file][$parent_name_variable]; |
|
172 | 172 | |
173 | - //config buttons |
|
174 | - /*if (strlen($english_name_variable)>1500) { |
|
173 | + //config buttons |
|
174 | + /*if (strlen($english_name_variable)>1500) { |
|
175 | 175 | $size =20; |
176 | 176 | } else { |
177 | 177 | $size =4; |
178 | 178 | }*/ |
179 | 179 | |
180 | - $obj_text='<textarea rows="10" cols="40" name="txt|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$parent_name_variable.'" >'.$sub_language_name_variable.'</textarea>'; |
|
181 | - $obj_button='<button class="save" type="button" name="btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$parent_name_variable.'" />'.get_lang('Save').'</button>'; |
|
180 | + $obj_text='<textarea rows="10" cols="40" name="txt|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$parent_name_variable.'" >'.$sub_language_name_variable.'</textarea>'; |
|
181 | + $obj_button='<button class="save" type="button" name="btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$parent_name_variable.'" />'.get_lang('Save').'</button>'; |
|
182 | 182 | |
183 | - $list_info[] = array( |
|
184 | - $lang_file . '.inc.php', |
|
185 | - $parent_name_variable, |
|
186 | - $english_name_variable, |
|
187 | - $parent_variable_value, |
|
188 | - $obj_text, |
|
189 | - $obj_button |
|
190 | - ); |
|
191 | - } |
|
192 | - } |
|
193 | - } |
|
183 | + $list_info[] = array( |
|
184 | + $lang_file . '.inc.php', |
|
185 | + $parent_name_variable, |
|
186 | + $english_name_variable, |
|
187 | + $parent_variable_value, |
|
188 | + $obj_text, |
|
189 | + $obj_button |
|
190 | + ); |
|
191 | + } |
|
192 | + } |
|
193 | + } |
|
194 | 194 | |
195 | - //search in english |
|
196 | - if ($search_in_english || $search_in_variable) { |
|
197 | - $variables = $english_language_array[$lang_file]; |
|
198 | - foreach ($variables as $name_variable =>$variable_value) { |
|
199 | - if (is_array($variable_value)) { |
|
200 | - continue; |
|
201 | - } |
|
195 | + //search in english |
|
196 | + if ($search_in_english || $search_in_variable) { |
|
197 | + $variables = $english_language_array[$lang_file]; |
|
198 | + foreach ($variables as $name_variable =>$variable_value) { |
|
199 | + if (is_array($variable_value)) { |
|
200 | + continue; |
|
201 | + } |
|
202 | 202 | |
203 | - if (is_array($variable_value)) |
|
204 | - echo $lang_file; |
|
205 | - $founded = false; |
|
206 | - if ($search_in_english && $search_in_variable) { |
|
207 | - // searching the item in the parent tool |
|
208 | - if (preg_match($term,$variable_value)!==0 || preg_match($term,$name_variable)!==0 ) { |
|
209 | - $founded = true; |
|
210 | - } |
|
211 | - } else { |
|
212 | - if ($search_in_english) { |
|
213 | - if (preg_match($term,$variable_value)!==0) { |
|
214 | - $founded = true; |
|
215 | - } |
|
216 | - } else { |
|
217 | - if (preg_match($term,$name_variable)!==0) { |
|
218 | - $founded = true; |
|
219 | - } |
|
220 | - } |
|
221 | - } |
|
203 | + if (is_array($variable_value)) |
|
204 | + echo $lang_file; |
|
205 | + $founded = false; |
|
206 | + if ($search_in_english && $search_in_variable) { |
|
207 | + // searching the item in the parent tool |
|
208 | + if (preg_match($term,$variable_value)!==0 || preg_match($term,$name_variable)!==0 ) { |
|
209 | + $founded = true; |
|
210 | + } |
|
211 | + } else { |
|
212 | + if ($search_in_english) { |
|
213 | + if (preg_match($term,$variable_value)!==0) { |
|
214 | + $founded = true; |
|
215 | + } |
|
216 | + } else { |
|
217 | + if (preg_match($term,$name_variable)!==0) { |
|
218 | + $founded = true; |
|
219 | + } |
|
220 | + } |
|
221 | + } |
|
222 | 222 | |
223 | - if ($founded) { |
|
224 | - //loading variable from the english array |
|
225 | - $sub_language_name_variable = null; |
|
226 | - if (isset($sub_language_array[$lang_file][$name_variable])) { |
|
227 | - $sub_language_name_variable = $sub_language_array[$lang_file][$name_variable]; |
|
228 | - } |
|
229 | - $parent_variable_value = null; |
|
230 | - if (isset($parent_language_array[$lang_file][$name_variable])) { |
|
231 | - $parent_variable_value = $parent_language_array[$lang_file][$name_variable]; |
|
232 | - } |
|
233 | - //config buttons |
|
234 | - $obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'. |
|
235 | - $sub_language_name_variable.' |
|
223 | + if ($founded) { |
|
224 | + //loading variable from the english array |
|
225 | + $sub_language_name_variable = null; |
|
226 | + if (isset($sub_language_array[$lang_file][$name_variable])) { |
|
227 | + $sub_language_name_variable = $sub_language_array[$lang_file][$name_variable]; |
|
228 | + } |
|
229 | + $parent_variable_value = null; |
|
230 | + if (isset($parent_language_array[$lang_file][$name_variable])) { |
|
231 | + $parent_variable_value = $parent_language_array[$lang_file][$name_variable]; |
|
232 | + } |
|
233 | + //config buttons |
|
234 | + $obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'. |
|
235 | + $sub_language_name_variable.' |
|
236 | 236 | </textarea>'; |
237 | - $obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'" />'.get_lang('Save').'</button>'; |
|
237 | + $obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'" />'.get_lang('Save').'</button>'; |
|
238 | 238 | |
239 | - //loading variable from the english array |
|
240 | - $english_name_variable = $english_language_array[$lang_file][$name_variable]; |
|
239 | + //loading variable from the english array |
|
240 | + $english_name_variable = $english_language_array[$lang_file][$name_variable]; |
|
241 | 241 | |
242 | - $list_info[] = array( |
|
243 | - $lang_file . '.inc.php', |
|
244 | - $name_variable, |
|
245 | - $english_name_variable, |
|
246 | - $parent_variable_value, |
|
247 | - $obj_text, |
|
248 | - $obj_button |
|
249 | - ); |
|
250 | - } |
|
251 | - } |
|
252 | - } |
|
242 | + $list_info[] = array( |
|
243 | + $lang_file . '.inc.php', |
|
244 | + $name_variable, |
|
245 | + $english_name_variable, |
|
246 | + $parent_variable_value, |
|
247 | + $obj_text, |
|
248 | + $obj_button |
|
249 | + ); |
|
250 | + } |
|
251 | + } |
|
252 | + } |
|
253 | 253 | |
254 | - // Search in sub language |
|
255 | - if ($search_in_sub_language) { |
|
256 | - $variables = $sub_language_array[$lang_file]; |
|
257 | - foreach ($variables as $name_variable =>$variable_value) { |
|
258 | - if (is_array($parent_variable_value)) { |
|
259 | - continue; |
|
260 | - } |
|
254 | + // Search in sub language |
|
255 | + if ($search_in_sub_language) { |
|
256 | + $variables = $sub_language_array[$lang_file]; |
|
257 | + foreach ($variables as $name_variable =>$variable_value) { |
|
258 | + if (is_array($parent_variable_value)) { |
|
259 | + continue; |
|
260 | + } |
|
261 | 261 | |
262 | - $founded = false; |
|
263 | - // searching the item in the parent tool |
|
264 | - if (preg_match($term,$variable_value)!==0) { |
|
265 | - $founded = true; |
|
266 | - } |
|
267 | - if ($founded) { |
|
268 | - //loading variable from the english array |
|
269 | - $sub_language_name_variable = $sub_language_array[$lang_file][$name_variable]; |
|
270 | - $parent_variable_value = $parent_language_array[$lang_file][$name_variable]; |
|
271 | - //config buttons |
|
272 | - $obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.$sub_language_name_variable.'</textarea>'; |
|
273 | - $obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'" />'.get_lang('Save').'</button>'; |
|
262 | + $founded = false; |
|
263 | + // searching the item in the parent tool |
|
264 | + if (preg_match($term,$variable_value)!==0) { |
|
265 | + $founded = true; |
|
266 | + } |
|
267 | + if ($founded) { |
|
268 | + //loading variable from the english array |
|
269 | + $sub_language_name_variable = $sub_language_array[$lang_file][$name_variable]; |
|
270 | + $parent_variable_value = $parent_language_array[$lang_file][$name_variable]; |
|
271 | + //config buttons |
|
272 | + $obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.$sub_language_name_variable.'</textarea>'; |
|
273 | + $obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'" />'.get_lang('Save').'</button>'; |
|
274 | 274 | |
275 | - //loading variable from the english array |
|
276 | - $english_name_variable = $english_language_array[$lang_file][$name_variable]; |
|
277 | - $list_info[]=array($lang_file.'.inc.php', |
|
278 | - $name_variable, |
|
279 | - $english_name_variable, |
|
280 | - $parent_variable_value,$obj_text,$obj_button); |
|
281 | - } |
|
282 | - } |
|
283 | - } |
|
284 | - } |
|
275 | + //loading variable from the english array |
|
276 | + $english_name_variable = $english_language_array[$lang_file][$name_variable]; |
|
277 | + $list_info[]=array($lang_file.'.inc.php', |
|
278 | + $name_variable, |
|
279 | + $english_name_variable, |
|
280 | + $parent_variable_value,$obj_text,$obj_button); |
|
281 | + } |
|
282 | + } |
|
283 | + } |
|
284 | + } |
|
285 | 285 | |
286 | - $list_info = array_unique_dimensional($list_info); |
|
287 | - return $list_info; |
|
286 | + $list_info = array_unique_dimensional($list_info); |
|
287 | + return $list_info; |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | // Allow see data in sort table |
291 | 291 | $list_info = array(); |
292 | 292 | if (isset($_REQUEST['txt_search_word'])) { |
293 | - //@todo fix to accept a char with 1 char |
|
294 | - if (strlen(trim($_REQUEST['txt_search_word']))>2) { |
|
295 | - $list_info = search_language_term( |
|
296 | - $_REQUEST['txt_search_word'], |
|
297 | - true, |
|
298 | - true, |
|
299 | - true, |
|
300 | - true |
|
301 | - ); |
|
302 | - } |
|
293 | + //@todo fix to accept a char with 1 char |
|
294 | + if (strlen(trim($_REQUEST['txt_search_word']))>2) { |
|
295 | + $list_info = search_language_term( |
|
296 | + $_REQUEST['txt_search_word'], |
|
297 | + true, |
|
298 | + true, |
|
299 | + true, |
|
300 | + true |
|
301 | + ); |
|
302 | + } |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | $parameters = array( |
306 | - 'id' => intval($_GET['id']), |
|
307 | - 'sub_language_id' => intval($_GET['sub_language_id']), |
|
308 | - 'txt_search_word' => $txt_search_word |
|
306 | + 'id' => intval($_GET['id']), |
|
307 | + 'sub_language_id' => intval($_GET['sub_language_id']), |
|
308 | + 'txt_search_word' => $txt_search_word |
|
309 | 309 | ); |
310 | 310 | $table = new SortableTableFromArrayConfig($list_info, 1,20,'data_info'); |
311 | 311 | $table->set_additional_parameters($parameters); |
@@ -149,27 +149,27 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | if (!empty($needle) && !empty($type)) { |
127 | 127 | if ($type == 'single') { |
128 | 128 | // search users where username or firstname or lastname begins likes $needle |
129 | - /* $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user |
|
129 | + /* $sql = 'SELECT user.user_id, username, lastname, firstname FROM '.$tbl_user.' user |
|
130 | 130 | WHERE (username LIKE "'.$needle.'%" |
131 | 131 | OR firstname LIKE "'.$needle.'%" |
132 | 132 | OR lastname LIKE "'.$needle.'%") AND user.user_id<>"'.$user_anonymous.'" AND user.status<>'.DRH.''. |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | <option value = "%">--</option> |
232 | 232 | <?php |
233 | 233 | echo Display :: get_alphabet_options(); |
234 | - ?> |
|
234 | + ?> |
|
235 | 235 | </select> |
236 | 236 | <?php echo '<br />'; ?> |
237 | 237 | </td> |
@@ -242,31 +242,31 @@ discard block |
||
242 | 242 | <td align="center"> |
243 | 243 | <div id="content_source"> |
244 | 244 | <?php |
245 | - if (!($add_type=='multiple')) { |
|
245 | + if (!($add_type=='multiple')) { |
|
246 | 246 | ?> |
247 | 247 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
248 | 248 | <div id="ajax_list_users_single"></div> |
249 | 249 | <?php |
250 | - } else { |
|
251 | - ?> |
|
250 | + } else { |
|
251 | + ?> |
|
252 | 252 | <div id="ajax_list_multiple"> |
253 | 253 | <?php echo Display::select('elements_not_in_name',$elements_not_in, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?> |
254 | 254 | </div> |
255 | 255 | <?php |
256 | - } |
|
257 | - ?> |
|
256 | + } |
|
257 | + ?> |
|
258 | 258 | </div> |
259 | 259 | </td> |
260 | 260 | <td width="10%" valign="middle" align="center"> |
261 | 261 | <?php |
262 | - if ($ajax_search) { |
|
263 | - ?> |
|
262 | + if ($ajax_search) { |
|
263 | + ?> |
|
264 | 264 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('elements_in'))" > |
265 | 265 | <em class="fa fa-arrow-left"></em> |
266 | 266 | </button> |
267 | 267 | <?php |
268 | - } else { |
|
269 | - ?> |
|
268 | + } else { |
|
269 | + ?> |
|
270 | 270 | <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'))"> |
271 | 271 | <em class="fa fa-arrow-right"></em> |
272 | 272 | </button> |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | <em class="fa fa-arrow-left"></em> |
276 | 276 | </button> |
277 | 277 | <?php |
278 | - } |
|
279 | - ?> |
|
278 | + } |
|
279 | + ?> |
|
280 | 280 | <br /><br /><br /><br /><br /><br /> |
281 | 281 | </td> |
282 | 282 | <td align="center"> |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | $sql = "SELECT * FROM $table_group WHERE id = '".$group_id."'"; |
36 | 36 | $res = Database::query($sql); |
37 | 37 | if (Database::num_rows($res) != 1) { |
38 | - header('Location: group_list.php'); |
|
39 | - exit; |
|
38 | + header('Location: group_list.php'); |
|
39 | + exit; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $group_data = Database::fetch_array($res, 'ASSOC'); |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | |
55 | 55 | // Description |
56 | 56 | $form->addElement( |
57 | - 'textarea', |
|
58 | - 'description', |
|
59 | - get_lang('Description'), |
|
60 | - array( |
|
61 | - 'rows' => 3, |
|
62 | - 'cols' => 58, |
|
63 | - 'onKeyDown' => "text_longitud()", |
|
64 | - 'onKeyUp' => "text_longitud()", |
|
65 | - ) |
|
57 | + 'textarea', |
|
58 | + 'description', |
|
59 | + get_lang('Description'), |
|
60 | + array( |
|
61 | + 'rows' => 3, |
|
62 | + 'cols' => 58, |
|
63 | + 'onKeyDown' => "text_longitud()", |
|
64 | + 'onKeyUp' => "text_longitud()", |
|
65 | + ) |
|
66 | 66 | ); |
67 | 67 | $form->applyFilter('description', 'html_filter'); |
68 | 68 | $form->applyFilter('description', 'trim'); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif'); |
77 | 77 | $form->addRule('picture', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types); |
78 | 78 | if (strlen($group_data['picture_uri']) > 0) { |
79 | - $form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage')); |
|
79 | + $form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage')); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | // Group parent |
@@ -101,28 +101,28 @@ discard block |
||
101 | 101 | |
102 | 102 | // Validate form |
103 | 103 | if ( $form->validate()) { |
104 | - $group = $form->exportValues(); |
|
104 | + $group = $form->exportValues(); |
|
105 | 105 | |
106 | - $picture_element = $form->getElement('picture'); |
|
107 | - $picture = $picture_element->getValue(); |
|
106 | + $picture_element = $form->getElement('picture'); |
|
107 | + $picture = $picture_element->getValue(); |
|
108 | 108 | |
109 | - $picture_uri = $group_data['picture_uri']; |
|
110 | - if ($group['delete_picture']) { |
|
111 | - $picture_uri = GroupPortalManager::delete_group_picture($group_id); |
|
112 | - } |
|
113 | - elseif (!empty($picture['name'])) { |
|
109 | + $picture_uri = $group_data['picture_uri']; |
|
110 | + if ($group['delete_picture']) { |
|
111 | + $picture_uri = GroupPortalManager::delete_group_picture($group_id); |
|
112 | + } |
|
113 | + elseif (!empty($picture['name'])) { |
|
114 | 114 | $picture_uri = GroupPortalManager::update_group_picture( |
115 | 115 | $group_id, |
116 | 116 | $_FILES['picture']['name'], |
117 | 117 | $_FILES['picture']['tmp_name'] |
118 | 118 | ); |
119 | - } |
|
119 | + } |
|
120 | 120 | |
121 | - $name = $group['name']; |
|
122 | - $description = $group['description']; |
|
123 | - $url = $group['url']; |
|
124 | - $status = intval($group['visibility']); |
|
125 | - $parent_group_id = intval($group['parent_group']); |
|
121 | + $name = $group['name']; |
|
122 | + $description = $group['description']; |
|
123 | + $url = $group['url']; |
|
124 | + $status = intval($group['visibility']); |
|
125 | + $parent_group_id = intval($group['parent_group']); |
|
126 | 126 | |
127 | 127 | GroupPortalManager::update( |
128 | 128 | $group_id, |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | ); |
135 | 135 | GroupPortalManager::set_parent_group($group_id, $parent_group_id); |
136 | 136 | |
137 | - $tok = Security::get_token(); |
|
138 | - header('Location: group_list.php?action=show_message&message='.urlencode(get_lang('GroupUpdated')).'&sec_token='.$tok); |
|
139 | - exit(); |
|
137 | + $tok = Security::get_token(); |
|
138 | + header('Location: group_list.php?action=show_message&message='.urlencode(get_lang('GroupUpdated')).'&sec_token='.$tok); |
|
139 | + exit(); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | Display::display_header($tool_name); |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | $image_size = api_getimagesize($image_file); |
150 | 150 | |
151 | 151 | $img_attributes = 'src="'.$image_file.'?rand='.time().'" ' |
152 | - .'style="float:'.($text_dir == 'rtl' ? 'left' : 'right').'; padding:5px;" '; |
|
152 | + .'style="float:'.($text_dir == 'rtl' ? 'left' : 'right').'; padding:5px;" '; |
|
153 | 153 | |
154 | 154 | if ($image_size['width'] > 300) { |
155 | 155 | // limit display width to 300px |
156 | - $img_attributes .= 'width="300" '; |
|
156 | + $img_attributes .= 'width="300" '; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | // get the path,width and height from original picture |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | $url_big_image = $big_image.'?rnd='.time(); |
165 | 165 | |
166 | 166 | if ($image == '') { |
167 | - echo '<img '.$img_attributes.' />'; |
|
167 | + echo '<img '.$img_attributes.' />'; |
|
168 | 168 | } else { |
169 | - echo '<input type="image" '.$img_attributes.' onclick="javascript: return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>'; |
|
169 | + echo '<input type="image" '.$img_attributes.' onclick="javascript: return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>'; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | // Display form |