@@ -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(); |
@@ -12,7 +12,8 @@ |
||
12 | 12 | * @param string Security key (as found in configuration file) |
13 | 13 | * @return string Error message |
14 | 14 | */ |
15 | -function import_users_from_file($filepath, $security_key) { |
|
15 | +function import_users_from_file($filepath, $security_key) |
|
16 | +{ |
|
16 | 17 | |
17 | 18 | global $_configuration; |
18 | 19 |
@@ -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"> |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | require_once __DIR__.'/../inc/global.inc.php'; |
11 | 11 | |
12 | 12 | $xajax = new xajax(); |
13 | -$xajax->registerFunction ('search_sessions'); |
|
13 | +$xajax->registerFunction('search_sessions'); |
|
14 | 14 | |
15 | 15 | // setting the section (for the tabs) |
16 | 16 | $this_section = SECTION_PLATFORM_ADMIN; |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | api_protect_admin_script(true); |
20 | 20 | |
21 | 21 | // setting breadcrumbs |
22 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
23 | -$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions')); |
|
22 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
23 | +$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions')); |
|
24 | 24 | |
25 | 25 | // Setting the name of the tool |
26 | 26 | $tool_name = get_lang('SubscribeSessionsToPromotions'); |
27 | 27 | $add_type = 'multiple'; |
28 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){ |
|
28 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
29 | 29 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
30 | 30 | } |
31 | 31 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $form_sent = $_POST['form_sent']; |
75 | 75 | $session_in_promotion_posted = $_POST['session_in_promotion_name']; |
76 | 76 | if (!is_array($session_in_promotion_posted)) { |
77 | - $session_in_promotion_posted=array($session_in_promotion_posted); |
|
77 | + $session_in_promotion_posted = array($session_in_promotion_posted); |
|
78 | 78 | } |
79 | 79 | if ($form_sent == 1) { |
80 | 80 | // Added a parameter to send emails when registering a user |
@@ -119,15 +119,15 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | echo '<div class="actions">'; |
122 | -echo '<a href="promotions.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
122 | +echo '<a href="promotions.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
123 | 123 | echo '</div>'; |
124 | 124 | ?> |
125 | 125 | |
126 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
126 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
127 | 127 | <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>'; |
128 | 128 | |
129 | 129 | |
130 | -if ($add_type=='multiple') { |
|
130 | +if ($add_type == 'multiple') { |
|
131 | 131 | $extraField = new \ExtraField('session'); |
132 | 132 | $extra_field_list = $extraField->get_all_extra_field_by_type(ExtraField::FIELD_TYPE_SELECT); |
133 | 133 | $new_field_list = array(); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | echo ' <select name="'.$varname.'">'; |
140 | 140 | echo '<option value="0">--'.get_lang('Select').'--</option>'; |
141 | 141 | foreach ($new_field['data'] as $option) { |
142 | - $checked=''; |
|
142 | + $checked = ''; |
|
143 | 143 | if (isset($_POST[$varname])) { |
144 | 144 | if ($_POST[$varname] == $option[1]) { |
145 | 145 | $checked = 'selected="true"'; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | <td align="center"><b><?php echo get_lang('SessionsInPromotion') ?> :</b></td> |
171 | 171 | </tr> |
172 | 172 | |
173 | -<?php if ($add_type=='multiple') { ?> |
|
173 | +<?php if ($add_type == 'multiple') { ?> |
|
174 | 174 | <tr> |
175 | 175 | <td align="center"> |
176 | 176 | <?php echo get_lang('FirstLetterSessions'); ?> : |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | <td align="center"> |
189 | 189 | <div id="content_source"> |
190 | 190 | <?php |
191 | - if (!($add_type=='multiple')) { |
|
191 | + if (!($add_type == 'multiple')) { |
|
192 | 192 | ?> |
193 | 193 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
194 | 194 | <div id="ajax_list_users_single"></div> |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } else { |
197 | 197 | ?> |
198 | 198 | <div id="ajax_list_multiple"> |
199 | - <?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); ?> |
|
199 | + <?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); ?> |
|
200 | 200 | </div> |
201 | 201 | <?php |
202 | 202 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | 'session_in_promotion_name[]', |
232 | 232 | $session_in_promotion, |
233 | 233 | '', |
234 | - array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_in_promotion','size'=>'15px'), |
|
234 | + array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_in_promotion', 'size'=>'15px'), |
|
235 | 235 | false |
236 | 236 | ); |
237 | 237 | unset($sessionUsersList); |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | } |
342 | 342 | } |
343 | 343 | $return .= '</select>'; |
344 | - $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return)); |
|
344 | + $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return)); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | return $xajax_response; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | // Setting the name of the tool |
26 | 26 | $tool_name = get_lang('SubscribeSessionsToPromotions'); |
27 | 27 | $add_type = 'multiple'; |
28 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){ |
|
28 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { |
|
29 | 29 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
30 | 30 | } |
31 | 31 | |
@@ -123,7 +123,10 @@ discard block |
||
123 | 123 | echo '</div>'; |
124 | 124 | ?> |
125 | 125 | |
126 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
126 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) { |
|
127 | + echo '&add=true' ; |
|
128 | +} |
|
129 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
127 | 130 | <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>'; |
128 | 131 | |
129 | 132 |
@@ -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> |
@@ -505,8 +505,14 @@ |
||
505 | 505 | <p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p> |
506 | 506 | <blockquote> |
507 | 507 | <pre> |
508 | -<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) echo implode(';', $list).';'; ?></span>Courses;ClassId; |
|
509 | -<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br /> |
|
508 | +<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) { |
|
509 | + echo implode(';', $list).';'; |
|
510 | +} |
|
511 | +?></span>Courses;ClassId; |
|
512 | +<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) { |
|
513 | + echo implode(';', $list_reponse).';'; |
|
514 | +} |
|
515 | +?></span>xxx1|xxx2|xxx3;1;<br /> |
|
510 | 516 | </pre> |
511 | 517 | </blockquote> |
512 | 518 | <p><?php echo get_lang('XMLMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p> |
@@ -227,7 +227,7 @@ |
||
227 | 227 | /** |
228 | 228 | * Read the CSV-file |
229 | 229 | * @param string $file Path to the CSV-file |
230 | - * @return array All userinformation read from the file |
|
230 | + * @return Ddeboer\DataImport\Reader\CsvReader All userinformation read from the file |
|
231 | 231 | */ |
232 | 232 | function parse_csv_data($file) |
233 | 233 | { |
@@ -364,7 +364,7 @@ |
||
364 | 364 | $user_id_error = array(); |
365 | 365 | $error_message = ''; |
366 | 366 | |
367 | -if (isset($_POST['formSent']) && $_POST['formSent'] AND |
|
367 | +if (isset($_POST['formSent']) && $_POST['formSent'] and |
|
368 | 368 | $_FILES['import_file']['size'] !== 0 |
369 | 369 | ) { |
370 | 370 | $file_type = $_POST['file_type']; |
@@ -345,7 +345,10 @@ discard block |
||
345 | 345 | $searchForm->display(); |
346 | 346 | echo '</div>'; |
347 | 347 | ?> |
348 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;"> |
|
348 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) { |
|
349 | + echo '&add=true' ; |
|
350 | +} |
|
351 | +?>" style="margin:0px;"> |
|
349 | 352 | <?php |
350 | 353 | echo '<legend>'.$tool_name.': '.$data['name'].'</legend>'; |
351 | 354 | |
@@ -420,7 +423,10 @@ discard block |
||
420 | 423 | ?> |
421 | 424 | <br /> |
422 | 425 | <label class="control-label"> |
423 | - <input type="checkbox" <?php if ($user_with_any_group) echo 'checked="checked"';?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id"> |
|
426 | + <input type="checkbox" <?php if ($user_with_any_group) { |
|
427 | + echo 'checked="checked"'; |
|
428 | +} |
|
429 | +?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id"> |
|
424 | 430 | <?php echo get_lang('UsersRegisteredInAnyGroup'); ?> |
425 | 431 | </label> |
426 | 432 | </div> |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | api_protect_admin_script(true); |
19 | 19 | |
20 | 20 | // setting breadcrumbs |
21 | -$interbreadcrumb[]= array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
22 | -$interbreadcrumb[]= array('url' => 'usergroups.php','name' => get_lang('Classes')); |
|
21 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | +$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
23 | 23 | |
24 | 24 | // Database Table Definitions |
25 | 25 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | </script>'; |
92 | 92 | |
93 | -$form_sent = 0; |
|
93 | +$form_sent = 0; |
|
94 | 94 | |
95 | 95 | $extra_field_list = UserManager::get_extra_fields(); |
96 | 96 | $new_field_list = array(); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | foreach ($users as $user) { |
145 | 145 | $data[] = array($user['username'], $groupInfo['name']); |
146 | 146 | } |
147 | - $filename = 'export_user_class_' . api_get_local_time(); |
|
147 | + $filename = 'export_user_class_'.api_get_local_time(); |
|
148 | 148 | Export::arrayToCsv($data, $filename); |
149 | 149 | exit; |
150 | 150 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | foreach ($new_field_list as $new_field) { |
158 | 158 | $varname = 'field_'.$new_field['variable']; |
159 | 159 | if (UserManager::is_extra_field_available($new_field['variable'])) { |
160 | - if (isset($_POST[$varname]) && $_POST[$varname]!='0') { |
|
160 | + if (isset($_POST[$varname]) && $_POST[$varname] != '0') { |
|
161 | 161 | $use_extra_fields = true; |
162 | 162 | $extra_field_result[] = UserManager::get_extra_user_data_by_value( |
163 | 163 | $new_field['variable'], |
@@ -171,10 +171,10 @@ discard block |
||
171 | 171 | |
172 | 172 | if ($use_extra_fields) { |
173 | 173 | $final_result = array(); |
174 | - if (count($extra_field_result)>1) { |
|
175 | - for ($i=0; $i<count($extra_field_result)-1; $i++) { |
|
176 | - if (is_array($extra_field_result[$i+1])) { |
|
177 | - $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i+1]); |
|
174 | + if (count($extra_field_result) > 1) { |
|
175 | + for ($i = 0; $i < count($extra_field_result) - 1; $i++) { |
|
176 | + if (is_array($extra_field_result[$i + 1])) { |
|
177 | + $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i + 1]); |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | } else { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | $searchForm = new FormValidator('search', 'get', api_get_self().'?id='.$id); |
195 | 195 | $searchForm->addHeader(get_lang('AdvancedSearch')); |
196 | -$renderer =& $searchForm->defaultRenderer(); |
|
196 | +$renderer = & $searchForm->defaultRenderer(); |
|
197 | 197 | |
198 | 198 | $searchForm->addElement('hidden', 'id', $id); |
199 | 199 | foreach ($filters as $param) { |
@@ -341,12 +341,12 @@ discard block |
||
341 | 341 | $searchForm->display(); |
342 | 342 | echo '</div>'; |
343 | 343 | ?> |
344 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;"> |
|
344 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;"> |
|
345 | 345 | <?php |
346 | 346 | echo '<legend>'.$tool_name.': '.$data['name'].'</legend>'; |
347 | 347 | |
348 | 348 | if (is_array($extra_field_list)) { |
349 | - if (is_array($new_field_list) && count($new_field_list)>0) { |
|
349 | + if (is_array($new_field_list) && count($new_field_list) > 0) { |
|
350 | 350 | echo '<h3>'.get_lang('FilterByUser').'</h3>'; |
351 | 351 | foreach ($new_field_list as $new_field) { |
352 | 352 | echo $new_field['name']; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | echo ' <select name="'.$varname.'">'; |
355 | 355 | echo '<option value="0">--'.get_lang('Select').'--</option>'; |
356 | 356 | foreach ($new_field['data'] as $option) { |
357 | - $checked=''; |
|
357 | + $checked = ''; |
|
358 | 358 | if (isset($_POST[$varname])) { |
359 | 359 | if ($_POST[$varname] == $option[1]) { |
360 | 360 | $checked = 'selected="true"'; |
@@ -380,15 +380,15 @@ discard block |
||
380 | 380 | <?php if ($data['group_type'] == UserGroup::SOCIAL_CLASS) { ?> |
381 | 381 | <select name="relation" id="relation"> |
382 | 382 | <option value=""><?php echo get_lang('SelectARelationType')?></option> |
383 | - <option value="<?php echo GROUP_USER_PERMISSION_ADMIN ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_ADMIN)?'selected=selected':'') ?> > |
|
383 | + <option value="<?php echo GROUP_USER_PERMISSION_ADMIN ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_ADMIN) ? 'selected=selected' : '') ?> > |
|
384 | 384 | <?php echo get_lang('Admin') ?></option> |
385 | - <option value="<?php echo GROUP_USER_PERMISSION_READER ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_READER)?'selected=selected':'') ?> > |
|
385 | + <option value="<?php echo GROUP_USER_PERMISSION_READER ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_READER) ? 'selected=selected' : '') ?> > |
|
386 | 386 | <?php echo get_lang('Reader') ?></option> |
387 | - <option value="<?php echo GROUP_USER_PERMISSION_PENDING_INVITATION ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_PENDING_INVITATION)?'selected=selected':'') ?> > |
|
387 | + <option value="<?php echo GROUP_USER_PERMISSION_PENDING_INVITATION ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_PENDING_INVITATION) ? 'selected=selected' : '') ?> > |
|
388 | 388 | <?php echo get_lang('PendingInvitation') ?></option> |
389 | - <option value="<?php echo GROUP_USER_PERMISSION_MODERATOR ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_MODERATOR)?'selected=selected':'') ?> > |
|
389 | + <option value="<?php echo GROUP_USER_PERMISSION_MODERATOR ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_MODERATOR) ? 'selected=selected' : '') ?> > |
|
390 | 390 | <?php echo get_lang('Moderator') ?></option> |
391 | - <option value="<?php echo GROUP_USER_PERMISSION_HRM ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_HRM)?'selected=selected':'') ?> > |
|
391 | + <option value="<?php echo GROUP_USER_PERMISSION_HRM ?>" <?php echo ((isset($relation) && $relation == GROUP_USER_PERMISSION_HRM) ? 'selected=selected' : '') ?> > |
|
392 | 392 | <?php echo get_lang('Drh') ?></option> |
393 | 393 | </select> |
394 | 394 | <?php } ?> |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | ?> |
420 | 420 | <br /> |
421 | 421 | <label class="control-label"> |
422 | - <input type="checkbox" <?php if ($user_with_any_group) echo 'checked="checked"';?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id"> |
|
422 | + <input type="checkbox" <?php if ($user_with_any_group) echo 'checked="checked"'; ?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id"> |
|
423 | 423 | <?php echo get_lang('UsersRegisteredInAnyGroup'); ?> |
424 | 424 | </label> |
425 | 425 | </div> |
@@ -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'; |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | $action = $_GET['a']; |
12 | 12 | $page = intval($_REQUEST['page']); //page |
13 | 13 | $limit = intval($_REQUEST['rows']); //quantity of rows |
14 | -$sidx = $_REQUEST['sidx']; //index (field) to filter |
|
15 | -$sord = $_REQUEST['sord']; //asc or desc |
|
14 | +$sidx = $_REQUEST['sidx']; //index (field) to filter |
|
15 | +$sord = $_REQUEST['sord']; //asc or desc |
|
16 | 16 | |
17 | 17 | if (strpos(strtolower($sidx), 'asc') !== false) { |
18 | 18 | $sidx = str_replace(array('asc', ','), '', $sidx); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $sord = 'desc'; |
25 | 25 | } |
26 | 26 | |
27 | -if (!in_array($sord, array('asc','desc'))) { |
|
27 | +if (!in_array($sord, array('asc', 'desc'))) { |
|
28 | 28 | $sord = 'desc'; |
29 | 29 | } |
30 | 30 | |
@@ -64,19 +64,19 @@ discard block |
||
64 | 64 | function getWhereClause($col, $oper, $val) |
65 | 65 | { |
66 | 66 | $ops = array( |
67 | - 'eq' => '=', //equal |
|
68 | - 'ne' => '<>', //not equal |
|
69 | - 'lt' => '<', //less than |
|
70 | - 'le' => '<=', //less than or equal |
|
71 | - 'gt' => '>', //greater than |
|
72 | - 'ge' => '>=', //greater than or equal |
|
73 | - 'bw' => 'LIKE', //begins with |
|
67 | + 'eq' => '=', //equal |
|
68 | + 'ne' => '<>', //not equal |
|
69 | + 'lt' => '<', //less than |
|
70 | + 'le' => '<=', //less than or equal |
|
71 | + 'gt' => '>', //greater than |
|
72 | + 'ge' => '>=', //greater than or equal |
|
73 | + 'bw' => 'LIKE', //begins with |
|
74 | 74 | 'bn' => 'NOT LIKE', //doesn't begin with |
75 | - 'in' => 'LIKE', //is in |
|
75 | + 'in' => 'LIKE', //is in |
|
76 | 76 | 'ni' => 'NOT LIKE', //is not in |
77 | - 'ew' => 'LIKE', //ends with |
|
77 | + 'ew' => 'LIKE', //ends with |
|
78 | 78 | 'en' => 'NOT LIKE', //doesn't end with |
79 | - 'cn' => 'LIKE', //contains |
|
79 | + 'cn' => 'LIKE', //contains |
|
80 | 80 | 'nc' => 'NOT LIKE' //doesn't contain |
81 | 81 | ); |
82 | 82 | |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | |
101 | 101 | // If there is no search request sent by jqgrid, $where should be empty |
102 | 102 | $whereCondition = ''; |
103 | -$operation = isset($_REQUEST['oper']) ? $_REQUEST['oper'] : false; |
|
104 | -$exportFormat = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : 'csv'; |
|
105 | -$searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : false; |
|
106 | -$searchOperator = isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : false; |
|
103 | +$operation = isset($_REQUEST['oper']) ? $_REQUEST['oper'] : false; |
|
104 | +$exportFormat = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : 'csv'; |
|
105 | +$searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : false; |
|
106 | +$searchOperator = isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : false; |
|
107 | 107 | $searchString = isset($_REQUEST['searchString']) ? $_REQUEST['searchString'] : false; |
108 | 108 | $search = isset($_REQUEST['_search']) ? $_REQUEST['_search'] : false; |
109 | 109 | $forceSearch = isset($_REQUEST['_force_search']) ? $_REQUEST['_force_search'] : false; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | foreach ($filters->rules as $key => $rule) { |
172 | 172 | $whereCondition .= getWhereClause($rule->field, $rule->op, $rule->data); |
173 | 173 | |
174 | - if ($counter < count($filters->rules) -1) { |
|
174 | + if ($counter < count($filters->rules) - 1) { |
|
175 | 175 | $whereCondition .= $filters->groupOp; |
176 | 176 | } |
177 | 177 | $counter++; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $userId = api_get_user_id(); |
203 | 203 | $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0; |
204 | 204 | $courseCodeList = array(); |
205 | - $userIdList = array(); |
|
205 | + $userIdList = array(); |
|
206 | 206 | $sessionIdList = []; |
207 | 207 | $searchByGroups = false; |
208 | 208 | if (api_is_drh()) { |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | $total_pages = 0; |
651 | 651 | if ($count > 0) { |
652 | 652 | if (!empty($limit)) { |
653 | - $total_pages = ceil((float)$count/(float)$limit); |
|
653 | + $total_pages = ceil((float) $count / (float) $limit); |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 | if ($page > $total_pages) { |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | |
810 | 810 | //get sessions |
811 | 811 | $arrSessions = array(); |
812 | - if(count($sessionIdList) > 0) { |
|
812 | + if (count($sessionIdList) > 0) { |
|
813 | 813 | $arrSessions = CourseManager::get_user_list_from_course_code( |
814 | 814 | null, |
815 | 815 | null, |
@@ -955,10 +955,10 @@ discard block |
||
955 | 955 | case 'get_work_user_list_others': |
956 | 956 | if (isset($_GET['type']) && $_GET['type'] === 'simple') { |
957 | 957 | $columns = array( |
958 | - 'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions' |
|
958 | + 'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions' |
|
959 | 959 | ); |
960 | 960 | } else { |
961 | - $columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions'); |
|
961 | + $columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions'); |
|
962 | 962 | } |
963 | 963 | $whereCondition .= " AND u.user_id <> ".api_get_user_id(); |
964 | 964 | $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition); |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | case 'get_exercise_results': |
993 | 993 | $course = api_get_course_info(); |
994 | 994 | // Used inside ExerciseLib::get_exam_results_data() |
995 | - $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document"; |
|
995 | + $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document"; |
|
996 | 996 | if ($is_allowedToEdit || api_is_student_boss()) { |
997 | 997 | $columns = array( |
998 | 998 | 'firstname', |
@@ -1024,11 +1024,11 @@ discard block |
||
1024 | 1024 | break; |
1025 | 1025 | case 'get_hotpotatoes_exercise_results': |
1026 | 1026 | $course = api_get_course_info(); |
1027 | - $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document"; |
|
1027 | + $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document"; |
|
1028 | 1028 | if (api_is_allowed_to_edit()) { |
1029 | - $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions'); |
|
1029 | + $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions'); |
|
1030 | 1030 | } else { |
1031 | - $columns = array('exe_date', 'score', 'actions'); |
|
1031 | + $columns = array('exe_date', 'score', 'actions'); |
|
1032 | 1032 | } |
1033 | 1033 | $result = ExerciseLib::get_exam_results_hotpotatoes_data( |
1034 | 1034 | $start, |
@@ -1061,12 +1061,12 @@ discard block |
||
1061 | 1061 | break; |
1062 | 1062 | case 'get_hotpotatoes_exercise_results': |
1063 | 1063 | $course = api_get_course_info(); |
1064 | - $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document"; |
|
1064 | + $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document"; |
|
1065 | 1065 | |
1066 | 1066 | if (api_is_allowed_to_edit(null, true) || api_is_drh()) { |
1067 | - $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions'); |
|
1067 | + $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions'); |
|
1068 | 1068 | } else { |
1069 | - $columns = array('exe_date', 'score', 'actions'); |
|
1069 | + $columns = array('exe_date', 'score', 'actions'); |
|
1070 | 1070 | } |
1071 | 1071 | $result = ExerciseLib::get_exam_results_hotpotatoes_data( |
1072 | 1072 | $start, |
@@ -1138,17 +1138,17 @@ discard block |
||
1138 | 1138 | $detailButtons = []; |
1139 | 1139 | $detailButtons[] = Display::url( |
1140 | 1140 | Display::return_icon('works.png', get_lang('WorksReport')), |
1141 | - api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php?session=' . $session['id'] |
|
1141 | + api_get_path(WEB_CODE_PATH).'mySpace/works_in_session_report.php?session='.$session['id'] |
|
1142 | 1142 | ); |
1143 | 1143 | $detailButtons[] = Display::url( |
1144 | 1144 | Display::return_icon('2rightarrow.png'), |
1145 | - api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?session_id=' . $session['id'] |
|
1145 | + api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'] |
|
1146 | 1146 | ); |
1147 | 1147 | |
1148 | 1148 | $result[] = array( |
1149 | 1149 | 'name' => Display::url( |
1150 | 1150 | $session['name'], |
1151 | - api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?session_id=' . $session['id'] |
|
1151 | + api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'] |
|
1152 | 1152 | ), |
1153 | 1153 | 'date' => $session_date_string, |
1154 | 1154 | 'course_per_session' => $count_courses_in_session, |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | $result = $new_result; |
1461 | 1461 | break; |
1462 | 1462 | case 'get_gradebooks': |
1463 | - $columns = array('name', 'certificates','skills', 'actions', 'has_certificates'); |
|
1463 | + $columns = array('name', 'certificates', 'skills', 'actions', 'has_certificates'); |
|
1464 | 1464 | if (!in_array($sidx, $columns)) { |
1465 | 1465 | $sidx = 'name'; |
1466 | 1466 | } |
@@ -1629,7 +1629,7 @@ discard block |
||
1629 | 1629 | if (!empty($exercises[$cnt - 4]['title'])) { |
1630 | 1630 | $title = ucwords(strtolower(trim($exercises[$cnt - 4]['title']))); |
1631 | 1631 | } |
1632 | - $columns[] = 'exer' . $i; |
|
1632 | + $columns[] = 'exer'.$i; |
|
1633 | 1633 | $column_names[] = $title; |
1634 | 1634 | $i++; |
1635 | 1635 | break; |
@@ -1662,7 +1662,7 @@ discard block |
||
1662 | 1662 | $sessionInfo = SessionManager::fetch($listUserSess[$user['user_id']]['id_session']); |
1663 | 1663 | $result[$i]['session'] = $sessionInfo['name']; |
1664 | 1664 | $result[$i]['username'] = $user['username']; |
1665 | - $result[$i]['name'] = $user['lastname'] . " " . $user['firstname']; |
|
1665 | + $result[$i]['name'] = $user['lastname']." ".$user['firstname']; |
|
1666 | 1666 | $j = 1; |
1667 | 1667 | $finalScore = 0; |
1668 | 1668 | foreach ($quizIds as $quizID) { |
@@ -1670,7 +1670,7 @@ discard block |
||
1670 | 1670 | if (!empty($arrGrade [$user['user_id']][$quizID]) || $arrGrade [$user['user_id']][$quizID] == 0) { |
1671 | 1671 | $finalScore += $grade = $arrGrade [$user['user_id']][$quizID]; |
1672 | 1672 | } |
1673 | - $result[$i]['exer' . $j] = $grade; |
|
1673 | + $result[$i]['exer'.$j] = $grade; |
|
1674 | 1674 | $j++; |
1675 | 1675 | } |
1676 | 1676 | |
@@ -1838,9 +1838,9 @@ discard block |
||
1838 | 1838 | foreach ($result as $row) { |
1839 | 1839 | // if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235 |
1840 | 1840 | if (!isset($row['id']) || isset($row['id']) && $row['id'] == '') { |
1841 | - $response->rows[$i]['id']= $i; |
|
1841 | + $response->rows[$i]['id'] = $i; |
|
1842 | 1842 | } else { |
1843 | - $response->rows[$i]['id']= $row['id']; |
|
1843 | + $response->rows[$i]['id'] = $row['id']; |
|
1844 | 1844 | } |
1845 | 1845 | $array = array(); |
1846 | 1846 | foreach ($columns as $col) { |
@@ -1850,7 +1850,7 @@ discard block |
||
1850 | 1850 | $array[] = isset($row[$col]) ? Security::remove_XSS($row[$col]) : ''; |
1851 | 1851 | } |
1852 | 1852 | } |
1853 | - $response->rows[$i]['cell']=$array; |
|
1853 | + $response->rows[$i]['cell'] = $array; |
|
1854 | 1854 | $i++; |
1855 | 1855 | } |
1856 | 1856 | } |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | $result = CourseManager::get_user_list_from_course_code( |
743 | 743 | null, |
744 | 744 | null, |
745 | - "LIMIT $start, $limit", |
|
745 | + "limit $start, $limit", |
|
746 | 746 | null, //" $sidx $sord", |
747 | 747 | null, |
748 | 748 | null, |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | $arrSessions = CourseManager::get_user_list_from_course_code( |
814 | 814 | null, |
815 | 815 | null, |
816 | - "LIMIT $start, $limit", |
|
816 | + "limit $start, $limit", |
|
817 | 817 | " $sidx $sord", |
818 | 818 | null, |
819 | 819 | null, |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | $arrCourses = CourseManager::get_user_list_from_course_code( |
832 | 832 | null, |
833 | 833 | null, |
834 | - "LIMIT $start, $limit", |
|
834 | + "limit $start, $limit", |
|
835 | 835 | " $sidx $sord", |
836 | 836 | null, |
837 | 837 | null, |
@@ -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 |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $cidReq = $c; |
164 | 164 | } |
165 | 165 | if (empty($cidReset)) { |
166 | - if (!isset($_SESSION['_cid']) OR (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid'])) { |
|
166 | + if (!isset($_SESSION['_cid']) or (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid'])) { |
|
167 | 167 | $cidReset = $cidReq; |
168 | 168 | } |
169 | 169 | } |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | if (Database::num_rows($result) > 0) { |
917 | 917 | $i_course_access_id = Database::result($result, 0, 0); |
918 | 918 | // We update the course tracking table |
919 | - $sql = "UPDATE $course_tracking_table |
|
919 | + $sql = "update $course_tracking_table |
|
920 | 920 | SET logout_course_date = '$time', counter = counter+1 |
921 | 921 | WHERE |
922 | 922 | course_access_id = ".intval($i_course_access_id)." AND |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | if (isset($_cid)) { |
1497 | 1497 | $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
1498 | 1498 | $time = api_get_utc_datetime(); |
1499 | - $sql = "UPDATE $tbl_course SET last_visit = '$time' WHERE code='$_cid'"; |
|
1499 | + $sql = "update $tbl_course SET last_visit = '$time' WHERE code='$_cid'"; |
|
1500 | 1500 | Database::query($sql); |
1501 | 1501 | } |
1502 | 1502 |
@@ -523,7 +523,8 @@ discard block |
||
523 | 523 | // see configuration.php to define these |
524 | 524 | include_once($extAuthSource[$key]['login']); |
525 | 525 | /* >>>>>>>> External authentication modules <<<<<<<<< */ |
526 | - } else { // no standard Chamilo login - try external authentification |
|
526 | + } else { |
|
527 | +// no standard Chamilo login - try external authentification |
|
527 | 528 | //huh... nothing to do... we shouldn't get here |
528 | 529 | error_log( |
529 | 530 | 'Chamilo Authentication file defined in'. |
@@ -868,7 +869,8 @@ discard block |
||
868 | 869 | } |
869 | 870 | Session::write('is_platformAdmin', $is_platformAdmin); |
870 | 871 | Session::write('is_allowedCreateCourse', $is_allowedCreateCourse); |
871 | -} else { // continue with the previous values |
|
872 | +} else { |
|
873 | +// continue with the previous values |
|
872 | 874 | $_user = $_SESSION['_user']; |
873 | 875 | $is_platformAdmin = isset($_SESSION['is_platformAdmin']) ? $_SESSION['is_platformAdmin'] : false; |
874 | 876 | $is_allowedCreateCourse = isset($_SESSION['is_allowedCreateCourse']) ? $_SESSION['is_allowedCreateCourse'] : false; |
@@ -1033,7 +1035,8 @@ discard block |
||
1033 | 1035 | } |
1034 | 1036 | } |
1035 | 1037 | |
1036 | - if (empty($_SESSION['_course']) or empty($_SESSION['_cid'])) { //no previous values... |
|
1038 | + if (empty($_SESSION['_course']) or empty($_SESSION['_cid'])) { |
|
1039 | +//no previous values... |
|
1037 | 1040 | $_cid = -1; // Set default values |
1038 | 1041 | $_course = -1; |
1039 | 1042 | } else { |
@@ -1061,7 +1064,8 @@ discard block |
||
1061 | 1064 | $sql = "SELECT * FROM $group_table |
1062 | 1065 | WHERE c_id = ".$_course['real_id']." AND id = '$gidReq'"; |
1063 | 1066 | $result = Database::query($sql); |
1064 | - if (Database::num_rows($result) > 0) { // This group has recorded status related to this course |
|
1067 | + if (Database::num_rows($result) > 0) { |
|
1068 | +// This group has recorded status related to this course |
|
1065 | 1069 | $gpData = Database::fetch_array($result); |
1066 | 1070 | $_gid = $gpData ['id']; |
1067 | 1071 | Session::write('_gid', $_gid); |
@@ -1185,7 +1189,8 @@ discard block |
||
1185 | 1189 | $result = Database::query($sql); |
1186 | 1190 | |
1187 | 1191 | $cuData = null; |
1188 | - if (Database::num_rows($result) > 0) { // this user have a recorded state for this course |
|
1192 | + if (Database::num_rows($result) > 0) { |
|
1193 | +// this user have a recorded state for this course |
|
1189 | 1194 | $cuData = Database::fetch_array($result, 'ASSOC'); |
1190 | 1195 | |
1191 | 1196 | $is_courseAdmin = (bool) ($cuData['status'] == 1); |
@@ -1342,7 +1347,8 @@ discard block |
||
1342 | 1347 | } |
1343 | 1348 | } |
1344 | 1349 | } |
1345 | - } else { // keys missing => not anymore in the course - user relation |
|
1350 | + } else { |
|
1351 | +// keys missing => not anymore in the course - user relation |
|
1346 | 1352 | // course |
1347 | 1353 | $is_courseMember = false; |
1348 | 1354 | $is_courseAdmin = false; |
@@ -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) |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * This function is used with $extraField->addElements() |
78 | 78 | * @param array $params array for the insertion into the *_field_values table |
79 | 79 | * @param bool $showQuery |
80 | - * @return mixed false on empty params, void otherwise |
|
80 | + * @return false|null false on empty params, void otherwise |
|
81 | 81 | * @assert (array()) === false |
82 | 82 | */ |
83 | 83 | public function saveFieldValues($params, $showQuery = false) |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | * @param int $item_id Item ID (It could be a session_id, course_id or user_id) |
530 | 530 | * @param int $field_id Field ID (the ID from the *_field table) |
531 | 531 | * @param bool $transform Whether to transform the result to a human readable strings |
532 | - * @return mixed A structured array with the field_id and field_value, or false on error |
|
532 | + * @return string A structured array with the field_id and field_value, or false on error |
|
533 | 533 | * @assert (-1,-1) === false |
534 | 534 | */ |
535 | 535 | public function get_values_by_handler_and_field_id($item_id, $field_id, $transform = false) |