@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | $resubscriptionLimit = Resubscription::create()->get('resubscription_limit'); |
33 | 33 | |
34 | - // Initialize variables as a calendar year by default |
|
34 | + // Initialize variables as a calendar year by default |
|
35 | 35 | $limitDateFormat = 'Y-01-01'; |
36 | 36 | $limitDate = gmdate($limitDateFormat); |
37 | 37 | $resubscriptionOffset = "1 year"; |
@@ -581,7 +581,7 @@ |
||
581 | 581 | /*$sessionIdName = isset($params['session_id_name']) ? $params['session_id_name'] : null; |
582 | 582 | $sessionIdValue = isset($params['session_id_value']) ? $params['session_id_value'] : null;*/ |
583 | 583 | |
584 | - $courseInfo = CourseManager::getCourseInfoFromOriginalId( |
|
584 | + $courseInfo = CourseManager::getCourseInfoFromOriginalId( |
|
585 | 585 | $courseIdValue, |
586 | 586 | $courseIdName |
587 | 587 | ); |
@@ -14,45 +14,45 @@ |
||
14 | 14 | */ |
15 | 15 | function import_users_from_file($filepath, $security_key) { |
16 | 16 | |
17 | - global $_configuration; |
|
18 | - |
|
19 | - $errors_returned = array( |
|
20 | - 0 => 'success', |
|
21 | - 1 => 'file import does not exist', |
|
22 | - 2 => 'no users to import', |
|
23 | - 3 => 'wrong datas in file', |
|
24 | - 4 => 'security error' |
|
25 | - ); |
|
26 | - |
|
27 | - // Check whether this script is launch by server and security key is ok. |
|
28 | - if (empty($_SERVER['REMOTE_ADDR']) || $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] || $security_key != $_configuration['security_key']) { |
|
29 | - return $errors_returned[4]; |
|
30 | - } |
|
31 | - |
|
32 | - // Libraries |
|
33 | - require_once 'import.lib.php'; |
|
34 | - |
|
35 | - // Check is users file exists. |
|
36 | - if (!is_file($filepath)) { |
|
37 | - return $errors_returned[1]; |
|
38 | - } |
|
39 | - |
|
40 | - // Get list of users |
|
41 | - $users = parse_csv_data($filepath); |
|
42 | - if (count($users) == 0) { |
|
43 | - return $errors_returned[2]; |
|
44 | - } |
|
45 | - |
|
46 | - // Check the datas for each user |
|
47 | - $errors = validate_data($users); |
|
48 | - if (count($errors) > 0) { |
|
49 | - return $errors_returned[3]; |
|
50 | - } |
|
51 | - |
|
52 | - // Apply modifications in database |
|
53 | - save_data($users); |
|
54 | - |
|
55 | - return $errors_returned[0]; // Import successfull |
|
17 | + global $_configuration; |
|
18 | + |
|
19 | + $errors_returned = array( |
|
20 | + 0 => 'success', |
|
21 | + 1 => 'file import does not exist', |
|
22 | + 2 => 'no users to import', |
|
23 | + 3 => 'wrong datas in file', |
|
24 | + 4 => 'security error' |
|
25 | + ); |
|
26 | + |
|
27 | + // Check whether this script is launch by server and security key is ok. |
|
28 | + if (empty($_SERVER['REMOTE_ADDR']) || $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] || $security_key != $_configuration['security_key']) { |
|
29 | + return $errors_returned[4]; |
|
30 | + } |
|
31 | + |
|
32 | + // Libraries |
|
33 | + require_once 'import.lib.php'; |
|
34 | + |
|
35 | + // Check is users file exists. |
|
36 | + if (!is_file($filepath)) { |
|
37 | + return $errors_returned[1]; |
|
38 | + } |
|
39 | + |
|
40 | + // Get list of users |
|
41 | + $users = parse_csv_data($filepath); |
|
42 | + if (count($users) == 0) { |
|
43 | + return $errors_returned[2]; |
|
44 | + } |
|
45 | + |
|
46 | + // Check the datas for each user |
|
47 | + $errors = validate_data($users); |
|
48 | + if (count($errors) > 0) { |
|
49 | + return $errors_returned[3]; |
|
50 | + } |
|
51 | + |
|
52 | + // Apply modifications in database |
|
53 | + save_data($users); |
|
54 | + |
|
55 | + return $errors_returned[0]; // Import successfull |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | $server = new soap_server(); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | <option value = "%">--</option> |
198 | 198 | <?php |
199 | 199 | echo Display :: get_alphabet_options(); |
200 | - ?> |
|
200 | + ?> |
|
201 | 201 | </select> |
202 | 202 | </td> |
203 | 203 | <td align="center"> </td> |
@@ -207,31 +207,31 @@ discard block |
||
207 | 207 | <td align="center"> |
208 | 208 | <div id="content_source"> |
209 | 209 | <?php |
210 | - if (!($add_type=='multiple')) { |
|
210 | + if (!($add_type=='multiple')) { |
|
211 | 211 | ?> |
212 | 212 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
213 | 213 | <div id="ajax_list_users_single"></div> |
214 | 214 | <?php |
215 | - } else { |
|
216 | - ?> |
|
215 | + } else { |
|
216 | + ?> |
|
217 | 217 | <div id="ajax_list_multiple"> |
218 | 218 | <?php echo Display::select('session_not_in_promotion_name',$session_not_in_promotion, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_not_in_promotion','size'=>'15px'),false); ?> |
219 | 219 | </div> |
220 | 220 | <?php |
221 | - } |
|
222 | - ?> |
|
221 | + } |
|
222 | + ?> |
|
223 | 223 | </div> |
224 | 224 | </td> |
225 | 225 | <td width="10%" valign="middle" align="center"> |
226 | 226 | <?php |
227 | - if ($ajax_search) { |
|
228 | - ?> |
|
227 | + if ($ajax_search) { |
|
228 | + ?> |
|
229 | 229 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('session_in_promotion'))" > |
230 | 230 | <em class="fa fa-arrow-left"></em> |
231 | 231 | </button> |
232 | 232 | <?php |
233 | - } else { |
|
234 | - ?> |
|
233 | + } else { |
|
234 | + ?> |
|
235 | 235 | <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))"> |
236 | 236 | <em class="fa fa-arrow-right"></em> |
237 | 237 | </button> |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | <em class="fa fa-arrow-left"></em> |
241 | 241 | </button> |
242 | 242 | <?php |
243 | - } |
|
244 | - ?> |
|
243 | + } |
|
244 | + ?> |
|
245 | 245 | <br /><br /><br /><br /><br /><br /> |
246 | 246 | </td> |
247 | 247 | <td align="center"> |
@@ -112,7 +112,7 @@ |
||
112 | 112 | <script> |
113 | 113 | $(function() { |
114 | 114 | <?php |
115 | - echo Display::grid_js('promotions', $url, $columns, $column_model, $extra_params, array(), $action_links, true); |
|
115 | + echo Display::grid_js('promotions', $url, $columns, $column_model, $extra_params, array(), $action_links, true); |
|
116 | 116 | ?> |
117 | 117 | }); |
118 | 118 | </script> |
@@ -488,7 +488,7 @@ |
||
488 | 488 | $remind_list |
489 | 489 | ); |
490 | 490 | |
491 | - // Destruction of the Question object |
|
491 | + // Destruction of the Question object |
|
492 | 492 | unset($objQuestionTmp); |
493 | 493 | if ($debug) { |
494 | 494 | error_log(" -- end question -- "); |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | } |
732 | 732 | |
733 | 733 | break; |
734 | - case 'get_user_skill_ranking': |
|
734 | + case 'get_user_skill_ranking': |
|
735 | 735 | $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank'); |
736 | 736 | $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $whereCondition); |
737 | 737 | $result = msort($result, 'skills_acquired', 'asc'); |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | |
1282 | 1282 | if (!empty($item['certif_min_score']) && !empty($item['document_id'])) { |
1283 | 1283 | $item['certificates'] = Display::return_icon('accept.png', get_lang('WithCertificate'), array(), ICON_SIZE_SMALL); |
1284 | - $item['has_certificates'] = '1'; |
|
1284 | + $item['has_certificates'] = '1'; |
|
1285 | 1285 | } else { |
1286 | 1286 | $item['certificates'] = Display::return_icon('warning.png', get_lang('NoCertificate'), array(), ICON_SIZE_SMALL); |
1287 | 1287 | $item['has_certificates'] = '0'; |
@@ -758,7 +758,7 @@ |
||
758 | 758 | // $gidReset = true; |
759 | 759 | } // end else |
760 | 760 | |
761 | - // Now check for anonymous user mode |
|
761 | + // Now check for anonymous user mode |
|
762 | 762 | if (isset($use_anonymous) && $use_anonymous) { |
763 | 763 | //if anonymous mode is set, then try to set the current user as anonymous |
764 | 764 | //if he doesn't have a login yet |
@@ -720,11 +720,11 @@ discard block |
||
720 | 720 | return false; |
721 | 721 | } |
722 | 722 | |
723 | - /** |
|
724 | - * @param int $itemId |
|
725 | - * @param int $fieldId |
|
726 | - * @return array |
|
727 | - */ |
|
723 | + /** |
|
724 | + * @param int $itemId |
|
725 | + * @param int $fieldId |
|
726 | + * @return array |
|
727 | + */ |
|
728 | 728 | public function getAllValuesByItemAndField($itemId, $fieldId) |
729 | 729 | { |
730 | 730 | $fieldId = intval($fieldId); |
@@ -847,7 +847,6 @@ discard block |
||
847 | 847 | /** |
848 | 848 | * Deletes all values from an item |
849 | 849 | * @param int $itemId (session id, course id, etc) |
850 | - |
|
851 | 850 | * @assert (-1,-1) == null |
852 | 851 | */ |
853 | 852 | public function deleteValuesByItem($itemId) |