@@ -24,8 +24,9 @@ |
||
24 | 24 | |
25 | 25 | // Actions |
26 | 26 | if (isset ($_GET['action'])) { |
27 | - if ($_GET['action'] == 'show_message') |
|
28 | - Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
27 | + if ($_GET['action'] == 'show_message') { |
|
28 | + Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
29 | + } |
|
29 | 30 | Security::clear_token(); |
30 | 31 | } |
31 | 32 |
@@ -144,7 +144,10 @@ |
||
144 | 144 | echo '</div>'; |
145 | 145 | ?> |
146 | 146 | |
147 | -<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();"';}?>> |
|
147 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) { |
|
148 | + echo '&add=true' ; |
|
149 | +} |
|
150 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
148 | 151 | <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>'; |
149 | 152 | |
150 | 153 | if ($add_type=='multiple') { |
@@ -106,7 +106,9 @@ discard block |
||
106 | 106 | //Check if the user is registered in the session otherwise we will add it |
107 | 107 | $result = SessionManager::get_users_by_session($new_session_id); |
108 | 108 | if (empty($result) || !in_array($user_id, array_keys($result))) { |
109 | - if ($debug) echo 'User added to the session'; |
|
109 | + if ($debug) { |
|
110 | + echo 'User added to the session'; |
|
111 | + } |
|
110 | 112 | //Registering user to the new session |
111 | 113 | SessionManager::suscribe_users_to_session($new_session_id,array($user_id),false); |
112 | 114 | } |
@@ -141,10 +143,11 @@ discard block |
||
141 | 143 | $list[$row['exe_id']]= $row; |
142 | 144 | } |
143 | 145 | |
144 | - if (!empty($list)) |
|
145 | - foreach ($list as $exe_id =>$data) { |
|
146 | + if (!empty($list)) { |
|
147 | + foreach ($list as $exe_id =>$data) { |
|
146 | 148 | if ($update_database) { |
147 | 149 | $sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id"; |
150 | + } |
|
148 | 151 | $res = Database::query($sql); |
149 | 152 | $result_message[$TABLETRACK_EXERCICES]++; |
150 | 153 | } else { |
@@ -168,10 +171,11 @@ discard block |
||
168 | 171 | $list[$row['exe_id']]= $row; |
169 | 172 | } |
170 | 173 | |
171 | - if (!empty($list)) |
|
172 | - foreach ($list as $exe_id =>$data) { |
|
174 | + if (!empty($list)) { |
|
175 | + foreach ($list as $exe_id =>$data) { |
|
173 | 176 | if ($update_database) { |
174 | 177 | $sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id"; |
178 | + } |
|
175 | 179 | $res = Database::query($sql); |
176 | 180 | $result_message[$TABLETRACK_EXERCICES]++; |
177 | 181 | } else { |
@@ -196,13 +200,18 @@ discard block |
||
196 | 200 | $list[$row['course_access_id']] = $row; |
197 | 201 | } |
198 | 202 | |
199 | - if (!empty($list)) |
|
200 | - foreach ($list as $id => $data) { |
|
203 | + if (!empty($list)) { |
|
204 | + foreach ($list as $id => $data) { |
|
201 | 205 | if ($update_database) { |
202 | 206 | $sql = "UPDATE $TBL_TRACK_E_COURSE_ACCESS SET session_id = $new_session_id WHERE course_access_id = $id"; |
203 | - if ($debug) echo $sql; |
|
207 | + } |
|
208 | + if ($debug) { |
|
209 | + echo $sql; |
|
210 | + } |
|
204 | 211 | $res = Database::query($sql); |
205 | - if ($debug) var_dump($res); |
|
212 | + if ($debug) { |
|
213 | + var_dump($res); |
|
214 | + } |
|
206 | 215 | $result_message[$TBL_TRACK_E_COURSE_ACCESS]++; |
207 | 216 | } |
208 | 217 | } |
@@ -217,13 +226,18 @@ discard block |
||
217 | 226 | while($row = Database::fetch_array($res,'ASSOC')) { |
218 | 227 | $list[] = $row['access_id']; |
219 | 228 | } |
220 | - if (!empty($list)) |
|
221 | - foreach ($list as $id) { |
|
229 | + if (!empty($list)) { |
|
230 | + foreach ($list as $id) { |
|
222 | 231 | if ($update_database) { |
223 | 232 | $sql = "UPDATE $TBL_TRACK_E_LAST_ACCESS SET access_session_id = $new_session_id WHERE access_id = $id"; |
224 | - if ($debug) echo $sql; |
|
233 | + } |
|
234 | + if ($debug) { |
|
235 | + echo $sql; |
|
236 | + } |
|
225 | 237 | $res = Database::query($sql); |
226 | - if ($debug) var_dump($res); |
|
238 | + if ($debug) { |
|
239 | + var_dump($res); |
|
240 | + } |
|
227 | 241 | $result_message[$TBL_TRACK_E_LAST_ACCESS]++; |
228 | 242 | } |
229 | 243 | } |
@@ -247,13 +261,18 @@ discard block |
||
247 | 261 | } |
248 | 262 | } |
249 | 263 | |
250 | - if (!empty($list)) |
|
251 | - foreach ($list as $id=>$data) { |
|
264 | + if (!empty($list)) { |
|
265 | + foreach ($list as $id=>$data) { |
|
252 | 266 | if ($update_database) { |
253 | 267 | $sql = "UPDATE $TBL_LP_VIEW SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id "; |
254 | - if ($debug) var_dump($sql); |
|
268 | + } |
|
269 | + if ($debug) { |
|
270 | + var_dump($sql); |
|
271 | + } |
|
255 | 272 | $res = Database::query($sql); |
256 | - if ($debug) var_dump($res); |
|
273 | + if ($debug) { |
|
274 | + var_dump($res); |
|
275 | + } |
|
257 | 276 | $result_message[$TBL_LP_VIEW]++; |
258 | 277 | } else { |
259 | 278 | //Getting all information of that lp_item_id |
@@ -280,10 +299,11 @@ discard block |
||
280 | 299 | $list[$row['id']] = $row; |
281 | 300 | } |
282 | 301 | } |
283 | - if (!empty($list)) |
|
284 | - foreach ($list as $id=>$data) { |
|
302 | + if (!empty($list)) { |
|
303 | + foreach ($list as $id=>$data) { |
|
285 | 304 | //Getting all information of that lp_item_id |
286 | 305 | $score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $new_session_id); |
306 | + } |
|
287 | 307 | $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $new_session_id); |
288 | 308 | $result_message_compare['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress); |
289 | 309 | } |
@@ -299,9 +319,13 @@ discard block |
||
299 | 319 | $id = $row['ref']; |
300 | 320 | if ($update_database) { |
301 | 321 | $sql = "UPDATE $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id "; |
302 | - if ($debug) var_dump($sql); |
|
322 | + if ($debug) { |
|
323 | + var_dump($sql); |
|
324 | + } |
|
303 | 325 | $res_update = Database::query($sql); |
304 | - if ($debug) var_dump($res_update); |
|
326 | + if ($debug) { |
|
327 | + var_dump($res_update); |
|
328 | + } |
|
305 | 329 | $result_message['agenda']++; |
306 | 330 | } |
307 | 331 | } |
@@ -313,22 +337,30 @@ discard block |
||
313 | 337 | //echo '<h1>Student publication</h1>'; |
314 | 338 | |
315 | 339 | $sql = "SELECT ref FROM $TBL_ITEM_PROPERTY WHERE tool = 'work' AND insert_user_id = $user_id AND c_id = $course_id"; |
316 | - if ($debug) echo $sql; |
|
340 | + if ($debug) { |
|
341 | + echo $sql; |
|
342 | + } |
|
317 | 343 | $res = Database::query($sql); |
318 | 344 | while($row = Database::fetch_array($res,'ASSOC')) { |
319 | 345 | $id = $row['ref']; |
320 | 346 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $id AND session_id = $origin_session_id AND c_id = $course_id"; |
321 | - if ($debug) var_dump($sql); |
|
347 | + if ($debug) { |
|
348 | + var_dump($sql); |
|
349 | + } |
|
322 | 350 | $sub_res = Database::query($sql); |
323 | 351 | if (Database::num_rows($sub_res) > 0 ) { |
324 | 352 | $data = Database::fetch_array($sub_res,'ASSOC'); |
325 | - if ($debug) var_dump($data); |
|
353 | + if ($debug) { |
|
354 | + var_dump($data); |
|
355 | + } |
|
326 | 356 | $parent_id = $data['parent_id']; |
327 | 357 | if (isset($data['parent_id']) && !empty($data['parent_id'])) { |
328 | 358 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $parent_id AND c_id = $course_id"; |
329 | 359 | $select_res = Database::query($sql); |
330 | 360 | $parent_data = Database::fetch_array($select_res,'ASSOC'); |
331 | - if ($debug) var_dump($parent_data); |
|
361 | + if ($debug) { |
|
362 | + var_dump($parent_data); |
|
363 | + } |
|
332 | 364 | |
333 | 365 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
334 | 366 | $course_dir = $sys_course_path . $course_info['path']; |
@@ -343,7 +375,9 @@ discard block |
||
343 | 375 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION |
344 | 376 | WHERE description like '%$search_this%' AND url LIKE '%$search_this2%' AND session_id = $new_session_id AND c_id = $course_id |
345 | 377 | ORDER BY id desc LIMIT 1"; |
346 | - if ($debug) echo $sql; |
|
378 | + if ($debug) { |
|
379 | + echo $sql; |
|
380 | + } |
|
347 | 381 | $sub_res = Database::query($sql); |
348 | 382 | $num_rows = Database::num_rows($sub_res); |
349 | 383 | |
@@ -376,12 +410,16 @@ discard block |
||
376 | 410 | date_of_qualification = '0000-00-00 00:00:00', |
377 | 411 | session_id = ".$new_session_id; |
378 | 412 | $rest_insert = Database::query($sql_add_publication); |
379 | - if ($debug) echo ($sql_add_publication); |
|
413 | + if ($debug) { |
|
414 | + echo ($sql_add_publication); |
|
415 | + } |
|
380 | 416 | // add the directory |
381 | 417 | $id = Database::insert_id(); |
382 | 418 | //Folder created |
383 | 419 | api_item_property_update($course_info, 'work', $id, 'DirectoryCreated', api_get_user_id()); |
384 | - if ($debug) var_dump($rest_insert); |
|
420 | + if ($debug) { |
|
421 | + var_dump($rest_insert); |
|
422 | + } |
|
385 | 423 | $new_parent_id = $id; |
386 | 424 | $result_message[$TBL_STUDENT_PUBLICATION.' - new folder created called: '.$created_dir]++; |
387 | 425 | } |
@@ -389,7 +427,9 @@ discard block |
||
389 | 427 | |
390 | 428 | //Creating student_publication_assignment if exists |
391 | 429 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION_ASSIGNMENT WHERE publication_id = $parent_id AND c_id = $course_id"; |
392 | - if ($debug) var_dump($sql); |
|
430 | + if ($debug) { |
|
431 | + var_dump($sql); |
|
432 | + } |
|
393 | 433 | $rest_select = Database::query($sql); |
394 | 434 | if (Database::num_rows($rest_select) > 0 ) { |
395 | 435 | if ($update_database) { |
@@ -401,7 +441,9 @@ discard block |
||
401 | 441 | add_to_calendar = '".$assignment_data['add_to_calendar']."', |
402 | 442 | enable_qualification = '".$assignment_data['enable_qualification']."', |
403 | 443 | publication_id = '".$new_parent_id."'"; |
404 | - if ($debug) echo $sql_add_publication; |
|
444 | + if ($debug) { |
|
445 | + echo $sql_add_publication; |
|
446 | + } |
|
405 | 447 | $rest_select = Database::query($sql_add_publication); |
406 | 448 | $id = Database::insert_id(); |
407 | 449 | |
@@ -409,11 +451,15 @@ discard block |
||
409 | 451 | "has_properties = '".$id."', |
410 | 452 | view_properties = '1' |
411 | 453 | WHERE id = ".$new_parent_id; |
412 | - if ($debug) echo $sql_update; |
|
454 | + if ($debug) { |
|
455 | + echo $sql_update; |
|
456 | + } |
|
413 | 457 | $rest_update = Database::query($sql_update); |
414 | 458 | |
415 | 459 | |
416 | - if ($debug) var_dump($sql_update); |
|
460 | + if ($debug) { |
|
461 | + var_dump($sql_update); |
|
462 | + } |
|
417 | 463 | $result_message[$TBL_STUDENT_PUBLICATION_ASSIGNMENT]++; |
418 | 464 | } |
419 | 465 | } |
@@ -436,9 +482,13 @@ discard block |
||
436 | 482 | parent_id = ".$new_parent_id ." , |
437 | 483 | session_id = ".$new_session_id; |
438 | 484 | |
439 | - if ($debug) echo $sql_add_publication; |
|
485 | + if ($debug) { |
|
486 | + echo $sql_add_publication; |
|
487 | + } |
|
440 | 488 | $rest_insert = Database::query($sql_add_publication); |
441 | - if ($debug) var_dump($rest_insert); |
|
489 | + if ($debug) { |
|
490 | + var_dump($rest_insert); |
|
491 | + } |
|
442 | 492 | $id = Database::insert_id(); |
443 | 493 | api_item_property_update($course_info, 'work', $id, 'DocumentAdded', $user_id); |
444 | 494 | $result_message[$TBL_STUDENT_PUBLICATION]++; |
@@ -452,7 +502,9 @@ discard block |
||
452 | 502 | if ($result) { |
453 | 503 | unlink($full_file_name); |
454 | 504 | $sql = "DELETE FROM $TBL_STUDENT_PUBLICATION WHERE id= ".$data['id']; |
455 | - if ($debug) var_dump($sql); |
|
505 | + if ($debug) { |
|
506 | + var_dump($sql); |
|
507 | + } |
|
456 | 508 | $result_delete = Database::query($sql); |
457 | 509 | api_item_property_update($course_info, 'work', $data['id'], 'DocumentDeleted', api_get_user_id()); |
458 | 510 | } |
@@ -468,22 +520,30 @@ discard block |
||
468 | 520 | //10. Dropbox - not neccesary to move categories (no presence of session_id) |
469 | 521 | |
470 | 522 | $sql = "SELECT id FROM $TBL_DROPBOX_FILE WHERE uploader_id = $user_id AND session_id = $origin_session_id AND c_id = $course_id"; |
471 | - if ($debug) var_dump($sql); |
|
523 | + if ($debug) { |
|
524 | + var_dump($sql); |
|
525 | + } |
|
472 | 526 | $res = Database::query($sql); |
473 | 527 | while($row = Database::fetch_array($res,'ASSOC')) { |
474 | 528 | $id = $row['id']; |
475 | 529 | if ($update_database) { |
476 | 530 | $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id"; |
477 | - if ($debug) var_dump($sql); |
|
531 | + if ($debug) { |
|
532 | + var_dump($sql); |
|
533 | + } |
|
478 | 534 | $res = Database::query($sql); |
479 | - if ($debug) var_dump($res); |
|
535 | + if ($debug) { |
|
536 | + var_dump($res); |
|
537 | + } |
|
480 | 538 | |
481 | 539 | $sql = "UPDATE $TBL_DROPBOX_POST SET session_id = $new_session_id WHERE file_id = $id"; |
482 | - if ($debug) |
|
483 | - var_dump($sql); |
|
540 | + if ($debug) { |
|
541 | + var_dump($sql); |
|
542 | + } |
|
484 | 543 | $res = Database::query($sql); |
485 | - if ($debug) |
|
486 | - var_dump($res); |
|
544 | + if ($debug) { |
|
545 | + var_dump($res); |
|
546 | + } |
|
487 | 547 | $result_message[$TBL_DROPBOX_FILE]++; |
488 | 548 | } |
489 | 549 | } |
@@ -492,23 +552,30 @@ discard block |
||
492 | 552 | |
493 | 553 | $sql = "SELECT notebook_id FROM $TBL_NOTEBOOK |
494 | 554 | WHERE user_id = $user_id AND session_id = $origin_session_id AND course = '$origin_course_code' AND c_id = $course_id"; |
495 | - if ($debug) var_dump($sql); |
|
555 | + if ($debug) { |
|
556 | + var_dump($sql); |
|
557 | + } |
|
496 | 558 | $res = Database::query($sql); |
497 | 559 | while($row = Database::fetch_array($res,'ASSOC')) { |
498 | 560 | $id = $row['notebook_id']; |
499 | 561 | if ($update_database) { |
500 | 562 | $sql = "UPDATE $TBL_NOTEBOOK SET session_id = $new_session_id WHERE c_id = $course_id AND notebook_id = $id"; |
501 | - if ($debug) var_dump($sql); |
|
563 | + if ($debug) { |
|
564 | + var_dump($sql); |
|
565 | + } |
|
502 | 566 | $res = Database::query($sql); |
503 | - if ($debug) var_dump($res); |
|
567 | + if ($debug) { |
|
568 | + var_dump($res); |
|
569 | + } |
|
504 | 570 | } |
505 | 571 | } |
506 | 572 | |
507 | 573 | if ($update_database) { |
508 | 574 | echo '<h2>'.get_lang('StatsMoved').'</h2>'; |
509 | - if (is_array($result_message)) |
|
510 | - foreach ($result_message as $table=>$times) { |
|
575 | + if (is_array($result_message)) { |
|
576 | + foreach ($result_message as $table=>$times) { |
|
511 | 577 | echo 'Table '.$table.' - '.$times.' records updated <br />'; |
578 | + } |
|
512 | 579 | } |
513 | 580 | } else { |
514 | 581 | echo '<h2>'.get_lang('UserInformationOfThisCourse').'</h2>'; |
@@ -625,10 +692,11 @@ discard block |
||
625 | 692 | } |
626 | 693 | $navigation .= ' '; |
627 | 694 | $page ++; |
628 | -if ($page < $nro_pages) |
|
695 | +if ($page < $nro_pages) { |
|
629 | 696 | $navigation .= '<a href="'.api_get_self().'?page='.$page.'">'.get_lang('Next').'</a>'; |
630 | -else |
|
697 | +} else { |
|
631 | 698 | $navigation .= get_lang('Next'); |
699 | +} |
|
632 | 700 | |
633 | 701 | echo $navigation; |
634 | 702 | $user_list = UserManager::get_user_list(array(), array(), $begin, $default); |
@@ -254,10 +254,11 @@ |
||
254 | 254 | <td colspan="3" align="center"> |
255 | 255 | <br /> |
256 | 256 | <?php |
257 | - if(isset($_GET['add'])) |
|
258 | - echo '<button class="save" onclick="valide()" >'.get_lang('AddUserGroupToURL').'</button>'; |
|
259 | - else |
|
260 | - echo '<button class="save" onclick="valide()" >'.get_lang('EditUserGroupToURL').'</button>'; |
|
257 | + if(isset($_GET['add'])) { |
|
258 | + echo '<button class="save" onclick="valide()" >'.get_lang('AddUserGroupToURL').'</button>'; |
|
259 | + } else { |
|
260 | + echo '<button class="save" onclick="valide()" >'.get_lang('EditUserGroupToURL').'</button>'; |
|
261 | + } |
|
261 | 262 | ?> |
262 | 263 | </td> |
263 | 264 | </tr> |
@@ -471,8 +471,9 @@ discard block |
||
471 | 471 | $extraction_path = $cssToUpload.$style_name.'/'; |
472 | 472 | for ($i = 0; $i < $num_files; $i++) { |
473 | 473 | $entry = $zip->getNameIndex($i); |
474 | - if (substr($entry, -1) == '/') |
|
475 | - continue; |
|
474 | + if (substr($entry, -1) == '/') { |
|
475 | + continue; |
|
476 | + } |
|
476 | 477 | |
477 | 478 | $pos_slash = strpos($entry, '/'); |
478 | 479 | $entry_without_first_dir = substr($entry, $pos_slash + 1); |
@@ -1231,17 +1232,21 @@ discard block |
||
1231 | 1232 | $hideme = array('disabled'); |
1232 | 1233 | } elseif ($url_info['active'] == 1) { |
1233 | 1234 | // We show the elements. |
1234 | - if (empty($row['variable'])) |
|
1235 | - $row['variable'] = 0; |
|
1236 | - if (empty($row['subkey'])) |
|
1237 | - $row['subkey'] = 0; |
|
1238 | - if (empty($row['category'])) |
|
1239 | - $row['category'] = 0; |
|
1235 | + if (empty($row['variable'])) { |
|
1236 | + $row['variable'] = 0; |
|
1237 | + } |
|
1238 | + if (empty($row['subkey'])) { |
|
1239 | + $row['subkey'] = 0; |
|
1240 | + } |
|
1241 | + if (empty($row['category'])) { |
|
1242 | + $row['category'] = 0; |
|
1243 | + } |
|
1240 | 1244 | |
1241 | 1245 | if (is_array($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ])) { |
1242 | 1246 | // We are sure that the other site have a selected value. |
1243 | - if ($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ]['selected_value'] != '') |
|
1244 | - $row['selected_value'] = $settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value']; |
|
1247 | + if ($settings_by_access_list[ $row['variable'] ] [ $row['subkey'] ] [ $row['category'] ]['selected_value'] != '') { |
|
1248 | + $row['selected_value'] = $settings_by_access_list[$row['variable']] [$row['subkey']] [$row['category']]['selected_value']; |
|
1249 | + } |
|
1245 | 1250 | } |
1246 | 1251 | // There is no else{} statement because we load the default $row['selected_value'] of the main Chamilo site. |
1247 | 1252 | } |
@@ -119,7 +119,10 @@ discard block |
||
119 | 119 | <td width="40%" align="center"> |
120 | 120 | <select name="course_list[]" multiple="multiple" size="20" style="width:400px;"> |
121 | 121 | <?php foreach ($db_courses as $course) { ?> |
122 | - <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>><?php echo $course['title'].' ('.$course['code'].')'; ?> |
|
122 | + <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) { |
|
123 | + echo 'selected="selected"'; |
|
124 | +} |
|
125 | +?>><?php echo $course['title'].' ('.$course['code'].')'; ?> |
|
123 | 126 | </option> |
124 | 127 | <?php } ?> |
125 | 128 | </select> |
@@ -130,7 +133,10 @@ discard block |
||
130 | 133 | <td width="40%" align="center"> |
131 | 134 | <select name="url_list[]" multiple="multiple" size="20" style="width:300px;"> |
132 | 135 | <?php foreach ($db_urls as $url_obj) { ?> |
133 | - <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?> |
|
136 | + <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) { |
|
137 | + echo 'selected="selected"'; |
|
138 | +} |
|
139 | +?>><?php echo $url_obj['url']; ?> |
|
134 | 140 | </option> |
135 | 141 | <?php } ?> |
136 | 142 | </select> |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | echo '</form>'; |
64 | 64 | echo '</div>'; |
65 | 65 | |
66 | -} |
|
67 | -elseif(!empty($annee) && empty($id_session)) |
|
66 | +} elseif(!empty($annee) && empty($id_session)) |
|
68 | 67 | { |
69 | 68 | Display::display_header($tool_name); |
70 | 69 | echo '<div style="align:center">'; |
@@ -142,8 +141,7 @@ discard block |
||
142 | 141 | echo '<br /><br />'; |
143 | 142 | echo '</div>'; |
144 | 143 | |
145 | -} |
|
146 | -elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes')) |
|
144 | +} elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes')) |
|
147 | 145 | { |
148 | 146 | $id=$_POST['username_form']; |
149 | 147 | $UserList=array(); |
@@ -118,7 +118,10 @@ discard block |
||
118 | 118 | <?php |
119 | 119 | foreach ($db_users as $user) { |
120 | 120 | ?> |
121 | - <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>> |
|
121 | + <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'], $users)) { |
|
122 | + echo 'selected="selected"'; |
|
123 | +} |
|
124 | +?>> |
|
122 | 125 | <?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?> |
123 | 126 | </option> |
124 | 127 | <?php |
@@ -134,7 +137,10 @@ discard block |
||
134 | 137 | <?php |
135 | 138 | foreach ($db_urls as $url_obj) { |
136 | 139 | ?> |
137 | - <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>> |
|
140 | + <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) { |
|
141 | + echo 'selected="selected"'; |
|
142 | +} |
|
143 | +?>> |
|
138 | 144 | <?php echo $url_obj['url']; ?> |
139 | 145 | </option> |
140 | 146 | <?php |
@@ -118,8 +118,7 @@ |
||
118 | 118 | if (isset($included) && ($included)) |
119 | 119 | { |
120 | 120 | $message .= "> $name_session: ".count($UserAdd)." ".get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified').'<br/>'; |
121 | - } |
|
122 | - else |
|
121 | + } else |
|
123 | 122 | { |
124 | 123 | print "> $name_session: ".count($UserAdd).get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified')."\n"; |
125 | 124 | } |