@@ -372,13 +372,13 @@ discard block |
||
372 | 372 | $firstname = $userInfo['firstname']; |
373 | 373 | $lastname = $userInfo['lastname']; |
374 | 374 | |
375 | - if (api_is_western_name_order()) { |
|
376 | - $message = sprintf(get_lang('AttemptingToLoginAs'),$firstname, $lastname, $userId); |
|
377 | - } else { |
|
378 | - $message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId); |
|
379 | - } |
|
375 | + if (api_is_western_name_order()) { |
|
376 | + $message = sprintf(get_lang('AttemptingToLoginAs'),$firstname, $lastname, $userId); |
|
377 | + } else { |
|
378 | + $message = sprintf(get_lang('AttemptingToLoginAs'), $lastname, $firstname, $userId); |
|
379 | + } |
|
380 | 380 | |
381 | - if ($userId) { |
|
381 | + if ($userId) { |
|
382 | 382 | |
383 | 383 | // Logout the current user |
384 | 384 | LoginDelete(api_get_user_id()); |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | }*/ |
454 | 454 | |
455 | 455 | if (!in_array($direction, array('ASC','DESC'))) { |
456 | - $direction = 'ASC'; |
|
456 | + $direction = 'ASC'; |
|
457 | 457 | } |
458 | 458 | $column = intval($column); |
459 | 459 | $from = intval($from); |
@@ -464,23 +464,23 @@ discard block |
||
464 | 464 | $sql .= " WHERE u.creator_id = ".api_get_user_id(); |
465 | 465 | } |
466 | 466 | |
467 | - $sql .= " ORDER BY col$column $direction "; |
|
468 | - $sql .= " LIMIT $from,$number_of_items"; |
|
467 | + $sql .= " ORDER BY col$column $direction "; |
|
468 | + $sql .= " LIMIT $from,$number_of_items"; |
|
469 | 469 | |
470 | - $res = Database::query($sql); |
|
470 | + $res = Database::query($sql); |
|
471 | 471 | |
472 | - $users = array (); |
|
472 | + $users = array (); |
|
473 | 473 | $t = time(); |
474 | - while ($user = Database::fetch_row($res)) { |
|
475 | - $userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL); |
|
476 | - $photo = '<img src="'.$userPicture.'" width="22" height="22" alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" />'; |
|
474 | + while ($user = Database::fetch_row($res)) { |
|
475 | + $userPicture = UserManager::getUserPicture($user[0], USER_IMAGE_SIZE_SMALL); |
|
476 | + $photo = '<img src="'.$userPicture.'" width="22" height="22" alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" />'; |
|
477 | 477 | |
478 | 478 | if ($user[7] == 1 && !empty($user[10])) { |
479 | 479 | // check expiration date |
480 | 480 | $expiration_time = convert_sql_date($user[10]); |
481 | 481 | // if expiration date is passed, store a special value for active field |
482 | 482 | if ($expiration_time < $t) { |
483 | - $user[7] = '-1'; |
|
483 | + $user[7] = '-1'; |
|
484 | 484 | } |
485 | 485 | } |
486 | 486 | |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | */ |
511 | 511 | function email_filter($email) |
512 | 512 | { |
513 | - return Display :: encrypted_mailto_link($email, $email); |
|
513 | + return Display :: encrypted_mailto_link($email, $email); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | /** |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | */ |
521 | 521 | function user_filter($name, $params, $row) |
522 | 522 | { |
523 | - return '<a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$row[0].'">'.$name.'</a>'; |
|
523 | + return '<a href="'.api_get_path(WEB_PATH).'whoisonline.php?origin=user_list&id='.$row[0].'">'.$name.'</a>'; |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | /** |
@@ -532,23 +532,23 @@ discard block |
||
532 | 532 | */ |
533 | 533 | function modify_filter($user_id, $url_params, $row) |
534 | 534 | { |
535 | - global $charset, $_admins_list; |
|
535 | + global $charset, $_admins_list; |
|
536 | 536 | $is_admin = in_array($user_id, $_admins_list); |
537 | 537 | $statusname = api_get_status_langvars(); |
538 | 538 | $user_is_anonymous = false; |
539 | 539 | $current_user_status_label = $row['7']; |
540 | 540 | |
541 | - if ($current_user_status_label == $statusname[ANONYMOUS]) { |
|
542 | - $user_is_anonymous = true; |
|
543 | - } |
|
544 | - $result = ''; |
|
545 | - if (!$user_is_anonymous) { |
|
541 | + if ($current_user_status_label == $statusname[ANONYMOUS]) { |
|
542 | + $user_is_anonymous = true; |
|
543 | + } |
|
544 | + $result = ''; |
|
545 | + if (!$user_is_anonymous) { |
|
546 | 546 | $icon = Display::return_icon( |
547 | 547 | 'course.png', |
548 | 548 | get_lang('Courses'), |
549 | 549 | array('onmouseout' => 'clear_course_list (\'div_'.$user_id.'\')') |
550 | 550 | ); |
551 | - $result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')" > |
|
551 | + $result .= '<a href="javascript:void(0)" onclick="load_course_list(\'div_'.$user_id.'\','.$user_id.')" > |
|
552 | 552 | '.$icon.' |
553 | 553 | <div class="blackboard_hide" id="div_'.$user_id.'"> </div> |
554 | 554 | </a>'; |
@@ -558,14 +558,14 @@ discard block |
||
558 | 558 | get_lang('Sessions'), |
559 | 559 | array('onmouseout' => 'clear_session_list (\'div_s_'.$user_id.'\')') |
560 | 560 | ); |
561 | - $result .= '<a href="javascript:void(0)" onclick="load_session_list(\'div_s_'.$user_id.'\','.$user_id.')" > |
|
561 | + $result .= '<a href="javascript:void(0)" onclick="load_session_list(\'div_s_'.$user_id.'\','.$user_id.')" > |
|
562 | 562 | '.$icon.' |
563 | 563 | <div class="blackboard_hide" id="div_s_'.$user_id.'"> </div> |
564 | 564 | </a>'; |
565 | - } else { |
|
566 | - $result .= Display::return_icon('course_na.png',get_lang('Courses')).' '; |
|
567 | - $result .= Display::return_icon('course_na.png',get_lang('Sessions')).' '; |
|
568 | - } |
|
565 | + } else { |
|
566 | + $result .= Display::return_icon('course_na.png',get_lang('Courses')).' '; |
|
567 | + $result .= Display::return_icon('course_na.png',get_lang('Sessions')).' '; |
|
568 | + } |
|
569 | 569 | |
570 | 570 | if (api_is_platform_admin()) { |
571 | 571 | if (!$user_is_anonymous) { |
@@ -614,18 +614,18 @@ discard block |
||
614 | 614 | ); |
615 | 615 | } |
616 | 616 | |
617 | - if ($is_admin) { |
|
617 | + if ($is_admin) { |
|
618 | 618 | $result .= Display::return_icon( |
619 | 619 | 'admin_star.png', |
620 | 620 | get_lang('IsAdministrator'), |
621 | 621 | array('width' => ICON_SIZE_SMALL, 'heigth' => ICON_SIZE_SMALL) |
622 | 622 | ); |
623 | - } else { |
|
624 | - $result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator')); |
|
625 | - } |
|
623 | + } else { |
|
624 | + $result .= Display::return_icon('admin_star_na.png', get_lang('IsNotAdministrator')); |
|
625 | + } |
|
626 | 626 | |
627 | - // actions for assigning sessions, courses or users |
|
628 | - if (!api_is_session_admin()) { |
|
627 | + // actions for assigning sessions, courses or users |
|
628 | + if (!api_is_session_admin()) { |
|
629 | 629 | if ($current_user_status_label == $statusname[SESSIONADMIN]) { |
630 | 630 | $result .= Display::url( |
631 | 631 | Display::return_icon('view_more_stats.gif', get_lang('AssignSessions')), |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | ); |
656 | 656 | } |
657 | 657 | } |
658 | - } |
|
658 | + } |
|
659 | 659 | |
660 | 660 | if (api_is_platform_admin()) { |
661 | 661 | $result .= ' <a data-title="'.get_lang('FreeBusyCalendar').'" href="'.api_get_path(WEB_AJAX_PATH).'agenda.ajax.php?a=get_user_agenda&user_id='.$user_id.'&modal_size=lg" class="agenda_opener ajax">'. |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | } |
675 | 675 | } |
676 | 676 | |
677 | - return $result; |
|
677 | + return $result; |
|
678 | 678 | } |
679 | 679 | |
680 | 680 | /** |
@@ -706,16 +706,16 @@ discard block |
||
706 | 706 | if ($action === 'edit') { |
707 | 707 | $result = Display::return_icon($image.'.png', get_lang('AccountExpired'), array(), 16); |
708 | 708 | } elseif ($row['0'] <> $_user['user_id']) { |
709 | - // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore. |
|
709 | + // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore. |
|
710 | 710 | $result = Display::return_icon( |
711 | 711 | $image.'.png', |
712 | 712 | get_lang(ucfirst($action)), |
713 | 713 | array('onclick' => 'active_user(this);', 'id' => 'img_'.$row['0']), |
714 | 714 | 16 |
715 | 715 | ); |
716 | - } |
|
716 | + } |
|
717 | 717 | |
718 | - return $result; |
|
718 | + return $result; |
|
719 | 719 | } |
720 | 720 | |
721 | 721 | /** |
@@ -728,8 +728,8 @@ discard block |
||
728 | 728 | * @author Patrick Cool <[email protected]>, Ghent University, Belgium |
729 | 729 | */ |
730 | 730 | function status_filter($status) { |
731 | - $statusname = api_get_status_langvars(); |
|
732 | - return $statusname[$status]; |
|
731 | + $statusname = api_get_status_langvars(); |
|
732 | + return $statusname[$status]; |
|
733 | 733 | } |
734 | 734 | |
735 | 735 | if (isset($_GET['keyword']) || isset($_GET['keyword_firstname'])) { |
@@ -745,8 +745,8 @@ discard block |
||
745 | 745 | |
746 | 746 | if (!empty($action)) { |
747 | 747 | $check = Security::check_token('get'); |
748 | - if ($check) { |
|
749 | - switch ($action) { |
|
748 | + if ($check) { |
|
749 | + switch ($action) { |
|
750 | 750 | case 'add_user_to_my_url': |
751 | 751 | $user_id = $_REQUEST["user_id"]; |
752 | 752 | $result = UrlManager::add_user_to_url($user_id, $current_access_url_id); |
@@ -756,45 +756,45 @@ discard block |
||
756 | 756 | $message = Display::return_message($message, 'confirmation'); |
757 | 757 | } |
758 | 758 | break; |
759 | - case 'delete_user': |
|
760 | - if (api_is_platform_admin()) { |
|
759 | + case 'delete_user': |
|
760 | + if (api_is_platform_admin()) { |
|
761 | 761 | $user_to_delete = $_GET['user_id']; |
762 | 762 | $current_user_id = api_get_user_id(); |
763 | 763 | |
764 | - if ($deleteUserAvailable && api_global_admin_can_edit_admin($_GET['user_id'])) { |
|
765 | - if ($user_to_delete != $current_user_id && UserManager :: delete_user($_GET['user_id'])) { |
|
766 | - $message = Display :: return_message(get_lang('UserDeleted'), 'confirmation'); |
|
767 | - } else { |
|
768 | - $message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error'); |
|
769 | - } |
|
770 | - } else { |
|
771 | - $message = Display :: return_message(get_lang('CannotDeleteUser'),'error'); |
|
772 | - } |
|
773 | - } |
|
774 | - break; |
|
764 | + if ($deleteUserAvailable && api_global_admin_can_edit_admin($_GET['user_id'])) { |
|
765 | + if ($user_to_delete != $current_user_id && UserManager :: delete_user($_GET['user_id'])) { |
|
766 | + $message = Display :: return_message(get_lang('UserDeleted'), 'confirmation'); |
|
767 | + } else { |
|
768 | + $message = Display :: return_message(get_lang('CannotDeleteUserBecauseOwnsCourse'), 'error'); |
|
769 | + } |
|
770 | + } else { |
|
771 | + $message = Display :: return_message(get_lang('CannotDeleteUser'),'error'); |
|
772 | + } |
|
773 | + } |
|
774 | + break; |
|
775 | 775 | case 'delete': |
776 | - if (api_is_platform_admin()) { |
|
777 | - $number_of_selected_users = count($_POST['id']); |
|
778 | - $number_of_deleted_users = 0; |
|
779 | - if (is_array($_POST['id'])) { |
|
780 | - foreach ($_POST['id'] as $index => $user_id) { |
|
781 | - if ($user_id != $_user['user_id']) { |
|
782 | - if (UserManager::delete_user($user_id)) { |
|
783 | - $number_of_deleted_users++; |
|
784 | - } |
|
785 | - } |
|
786 | - } |
|
787 | - } |
|
788 | - if ($number_of_selected_users == $number_of_deleted_users) { |
|
776 | + if (api_is_platform_admin()) { |
|
777 | + $number_of_selected_users = count($_POST['id']); |
|
778 | + $number_of_deleted_users = 0; |
|
779 | + if (is_array($_POST['id'])) { |
|
780 | + foreach ($_POST['id'] as $index => $user_id) { |
|
781 | + if ($user_id != $_user['user_id']) { |
|
782 | + if (UserManager::delete_user($user_id)) { |
|
783 | + $number_of_deleted_users++; |
|
784 | + } |
|
785 | + } |
|
786 | + } |
|
787 | + } |
|
788 | + if ($number_of_selected_users == $number_of_deleted_users) { |
|
789 | 789 | $message = Display :: return_message(get_lang('SelectedUsersDeleted'), 'confirmation'); |
790 | - } else { |
|
790 | + } else { |
|
791 | 791 | $message = Display :: return_message(get_lang('SomeUsersNotDeleted'), 'error'); |
792 | - } |
|
793 | - } |
|
794 | - break; |
|
795 | - } |
|
796 | - Security::clear_token(); |
|
797 | - } |
|
792 | + } |
|
793 | + } |
|
794 | + break; |
|
795 | + } |
|
796 | + Security::clear_token(); |
|
797 | + } |
|
798 | 798 | } |
799 | 799 | |
800 | 800 | // Create a search-box |
@@ -811,15 +811,15 @@ discard block |
||
811 | 811 | $actionsCenter = ''; |
812 | 812 | $actionsRight = ''; |
813 | 813 | if (api_is_platform_admin()) { |
814 | - $actionsRight .= '<a class="pull-right" href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'. |
|
815 | - Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
814 | + $actionsRight .= '<a class="pull-right" href="'.api_get_path(WEB_CODE_PATH).'admin/user_add.php">'. |
|
815 | + Display::return_icon('new_user.png',get_lang('AddUsers'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
816 | 816 | } |
817 | 817 | |
818 | 818 | $actionsLeft .= $form->returnForm(); |
819 | 819 | $actionsCenter .= $searchAdvanced; |
820 | 820 | |
821 | 821 | if (isset($_GET['keyword'])) { |
822 | - $parameters = array('keyword' => Security::remove_XSS($_GET['keyword'])); |
|
822 | + $parameters = array('keyword' => Security::remove_XSS($_GET['keyword'])); |
|
823 | 823 | } elseif (isset ($_GET['keyword_firstname'])) { |
824 | 824 | $parameters['keyword_firstname'] = Security::remove_XSS($_GET['keyword_firstname']); |
825 | 825 | $parameters['keyword_lastname'] = Security::remove_XSS($_GET['keyword_lastname']); |
@@ -893,11 +893,11 @@ discard block |
||
893 | 893 | $table->set_header(2, get_lang('OfficialCode')); |
894 | 894 | |
895 | 895 | if (api_is_western_name_order()) { |
896 | - $table->set_header(3, get_lang('FirstName')); |
|
897 | - $table->set_header(4, get_lang('LastName')); |
|
896 | + $table->set_header(3, get_lang('FirstName')); |
|
897 | + $table->set_header(4, get_lang('LastName')); |
|
898 | 898 | } else { |
899 | - $table->set_header(3, get_lang('LastName')); |
|
900 | - $table->set_header(4, get_lang('FirstName')); |
|
899 | + $table->set_header(3, get_lang('LastName')); |
|
900 | + $table->set_header(4, get_lang('FirstName')); |
|
901 | 901 | } |
902 | 902 | $table->set_header(5, get_lang('LoginName')); |
903 | 903 | $table->set_header(6, get_lang('Email')); |
@@ -433,7 +433,7 @@ |
||
433 | 433 | $form->addElement( |
434 | 434 | 'checkbox', |
435 | 435 | 'confirmation', |
436 | - null, |
|
436 | + null, |
|
437 | 437 | $plugin->get_lang('RequestConfirmation') |
438 | 438 | ); |
439 | 439 | } |
@@ -77,20 +77,20 @@ discard block |
||
77 | 77 | |
78 | 78 | function show_compose_reply_to_message($message_id, $receiver_id) |
79 | 79 | { |
80 | - $table_message = Database::get_main_table(TABLE_MESSAGE); |
|
81 | - $query = "SELECT user_sender_id |
|
80 | + $table_message = Database::get_main_table(TABLE_MESSAGE); |
|
81 | + $query = "SELECT user_sender_id |
|
82 | 82 | FROM $table_message |
83 | 83 | WHERE user_receiver_id = ".intval($receiver_id)." AND id='".intval($message_id)."';"; |
84 | - $result = Database::query($query); |
|
85 | - $row = Database::fetch_array($result,'ASSOC'); |
|
86 | - if (!isset($row['user_sender_id'])) { |
|
87 | - $html = get_lang('InvalidMessageId'); |
|
84 | + $result = Database::query($query); |
|
85 | + $row = Database::fetch_array($result,'ASSOC'); |
|
86 | + if (!isset($row['user_sender_id'])) { |
|
87 | + $html = get_lang('InvalidMessageId'); |
|
88 | 88 | |
89 | - return $html; |
|
90 | - } |
|
91 | - $userInfo = api_get_user_info($row['user_sender_id']); |
|
92 | - $default['users'] = array($row['user_sender_id']); |
|
93 | - $html = manage_form($default, null, $userInfo['complete_name']); |
|
89 | + return $html; |
|
90 | + } |
|
91 | + $userInfo = api_get_user_info($row['user_sender_id']); |
|
92 | + $default['users'] = array($row['user_sender_id']); |
|
93 | + $html = manage_form($default, null, $userInfo['complete_name']); |
|
94 | 94 | |
95 | 95 | return $html; |
96 | 96 | } |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | function show_compose_to_user ($receiver_id) |
99 | 99 | { |
100 | 100 | $userInfo = api_get_user_info($receiver_id); |
101 | - $html = get_lang('To').': <strong>'.$userInfo['complete_name'].'</strong>'; |
|
102 | - $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle')); |
|
103 | - $default['users'] = array($receiver_id); |
|
104 | - $html .= manage_form($default); |
|
101 | + $html = get_lang('To').': <strong>'.$userInfo['complete_name'].'</strong>'; |
|
102 | + $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle')); |
|
103 | + $default['users'] = array($receiver_id); |
|
104 | + $html .= manage_form($default); |
|
105 | 105 | |
106 | 106 | return $html; |
107 | 107 | } |
@@ -273,13 +273,13 @@ discard block |
||
273 | 273 | |
274 | 274 | /* MAIN SECTION */ |
275 | 275 | if ($socialToolIsActive) { |
276 | - $this_section = SECTION_SOCIAL; |
|
276 | + $this_section = SECTION_SOCIAL; |
|
277 | 277 | $interbreadcrumb[] = array( |
278 | 278 | 'url' => api_get_path(WEB_PATH).'main/social/home.php', |
279 | 279 | 'name' => get_lang('SocialNetwork') |
280 | 280 | ); |
281 | 281 | } else { |
282 | - $this_section = SECTION_MYPROFILE; |
|
282 | + $this_section = SECTION_MYPROFILE; |
|
283 | 283 | $interbreadcrumb[] = array( |
284 | 284 | 'url' => api_get_path(WEB_PATH).'main/auth/profile.php', |
285 | 285 | 'name' => get_lang('Profile') |
@@ -289,30 +289,30 @@ discard block |
||
289 | 289 | $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null; |
290 | 290 | $social_right_content = null; |
291 | 291 | if ($group_id != 0) { |
292 | - $social_right_content .= '<div class=actions>'; |
|
293 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'. |
|
294 | - Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
295 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'. |
|
296 | - Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
297 | - $social_right_content .= '</div>'; |
|
292 | + $social_right_content .= '<div class=actions>'; |
|
293 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'. |
|
294 | + Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
295 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'. |
|
296 | + Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
297 | + $social_right_content .= '</div>'; |
|
298 | 298 | } else { |
299 | - if ($socialToolIsActive) { |
|
300 | - } else { |
|
301 | - $social_right_content .= '<div class=actions>'; |
|
302 | - if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') { |
|
303 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
299 | + if ($socialToolIsActive) { |
|
300 | + } else { |
|
301 | + $social_right_content .= '<div class=actions>'; |
|
302 | + if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') { |
|
303 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
304 | 304 | Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
305 | - } |
|
306 | - if (api_get_setting('allow_message_tool') === 'true') { |
|
307 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
305 | + } |
|
306 | + if (api_get_setting('allow_message_tool') === 'true') { |
|
307 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
308 | 308 | Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
309 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
|
309 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
|
310 | 310 | Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
311 | 311 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
312 | 312 | Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
313 | - } |
|
314 | - $social_right_content .= '</div>'; |
|
315 | - } |
|
313 | + } |
|
314 | + $social_right_content .= '</div>'; |
|
315 | + } |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | // LEFT COLUMN |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | $interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('MySpace')); |
19 | 19 | $id_session = ''; |
20 | 20 | if (isset($_GET['id_session']) && $_GET['id_session'] != '') { |
21 | - $id_session = intval($_GET['id_session']); |
|
22 | - $interbreadcrumb[] = array ('url' => 'session.php', 'name' => get_lang('Sessions')); |
|
23 | - $interbreadcrumb[] = array ('url' => 'course.php?id_session='.$id_session.'', 'name' => get_lang('Course')); |
|
21 | + $id_session = intval($_GET['id_session']); |
|
22 | + $interbreadcrumb[] = array ('url' => 'session.php', 'name' => get_lang('Sessions')); |
|
23 | + $interbreadcrumb[] = array ('url' => 'course.php?id_session='.$id_session.'', 'name' => get_lang('Course')); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | // Set this option to true to enforce strict purification for usenames. |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | Display :: display_header($tool_name); |
90 | 90 | |
91 | 91 | if ($_FILES['import_file']['size'] == 0 && $_POST) { |
92 | - Display::display_error_message(get_lang('ThisFieldIsRequired')); |
|
92 | + Display::display_error_message(get_lang('ThisFieldIsRequired')); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | if (count($errors) != 0) { |
@@ -97,7 +97,7 @@ |
||
97 | 97 | // Theme calls |
98 | 98 | $show_learn_path = true; |
99 | 99 | if (isset($_SESSION['oLP']) && is_object($_SESSION['oLP'])) { |
100 | - $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
100 | + $lp_theme_css = $_SESSION['oLP']->get_theme(); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if ($mode == 'fullpage') { |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | const VISIBLE_STUDENT = 2; |
11 | 11 | const VISIBLE_TEACHER = 3; |
12 | 12 | |
13 | - /** |
|
14 | - * Displays all announcements |
|
15 | - * @param int $visible VISIBLE_GUEST, VISIBLE_STUDENT or VISIBLE_TEACHER |
|
16 | - * @param int $id The identifier of the announcement to display |
|
17 | - */ |
|
18 | - public static function display_announcements($visible, $id = -1) |
|
13 | + /** |
|
14 | + * Displays all announcements |
|
15 | + * @param int $visible VISIBLE_GUEST, VISIBLE_STUDENT or VISIBLE_TEACHER |
|
16 | + * @param int $id The identifier of the announcement to display |
|
17 | + */ |
|
18 | + public static function display_announcements($visible, $id = -1) |
|
19 | 19 | { |
20 | 20 | $user_selected_language = api_get_interface_language(); |
21 | 21 | $db_table = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS); |
@@ -423,10 +423,10 @@ discard block |
||
423 | 423 | } |
424 | 424 | |
425 | 425 | /** |
426 | - * Makes the announcement id visible only for groups in groups_array |
|
427 | - * @param int $announcement_id |
|
428 | - * @param array $group_array array of group id |
|
429 | - **/ |
|
426 | + * Makes the announcement id visible only for groups in groups_array |
|
427 | + * @param int $announcement_id |
|
428 | + * @param array $group_array array of group id |
|
429 | + **/ |
|
430 | 430 | public static function announcement_for_groups($announcement_id, $group_array) |
431 | 431 | { |
432 | 432 | $tbl_announcement_group = Database:: get_main_table( |
@@ -459,10 +459,10 @@ discard block |
||
459 | 459 | } |
460 | 460 | |
461 | 461 | /** |
462 | - * Gets the groups of this announce |
|
463 | - * @param int announcement id |
|
464 | - * @return array array of group id |
|
465 | - **/ |
|
462 | + * Gets the groups of this announce |
|
463 | + * @param int announcement id |
|
464 | + * @return array array of group id |
|
465 | + **/ |
|
466 | 466 | public static function get_announcement_groups($announcement_id) |
467 | 467 | { |
468 | 468 | $tbl_announcement_group = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS_GROUPS); |
@@ -482,15 +482,15 @@ discard block |
||
482 | 482 | return $groups; |
483 | 483 | } |
484 | 484 | |
485 | - /** |
|
486 | - * Updates an announcement to the database |
|
487 | - * @param integer $id : id of the announcement |
|
488 | - * @param string $title : title of the announcement |
|
489 | - * @param string $content : content of the announcement |
|
490 | - * @param array $date_start: start date of announcement (0 => day ; 1 => month ; 2 => year ; 3 => hour ; 4 => minute) |
|
491 | - * @param array $date_end : end date of announcement (0 => day ; 1 => month ; 2 => year ; 3 => hour ; 4 => minute) |
|
492 | - * @return bool True on success, false on failure |
|
493 | - */ |
|
485 | + /** |
|
486 | + * Updates an announcement to the database |
|
487 | + * @param integer $id : id of the announcement |
|
488 | + * @param string $title : title of the announcement |
|
489 | + * @param string $content : content of the announcement |
|
490 | + * @param array $date_start: start date of announcement (0 => day ; 1 => month ; 2 => year ; 3 => hour ; 4 => minute) |
|
491 | + * @param array $date_end : end date of announcement (0 => day ; 1 => month ; 2 => year ; 3 => hour ; 4 => minute) |
|
492 | + * @return bool True on success, false on failure |
|
493 | + */ |
|
494 | 494 | public static function update_announcement( |
495 | 495 | $id, |
496 | 496 | $title, |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | $sendEmailTest = false |
506 | 506 | ) { |
507 | 507 | $em = Database::getManager(); |
508 | - $announcement = $em->find('ChamiloCoreBundle:SysAnnouncement', $id); |
|
508 | + $announcement = $em->find('ChamiloCoreBundle:SysAnnouncement', $id); |
|
509 | 509 | |
510 | 510 | if (!$announcement) { |
511 | 511 | return false; |
@@ -529,28 +529,28 @@ discard block |
||
529 | 529 | return false; |
530 | 530 | } |
531 | 531 | |
532 | - if (($date_end_to_compare[1] || |
|
532 | + if (($date_end_to_compare[1] || |
|
533 | 533 | $date_end_to_compare[2] || |
534 | 534 | $date_end_to_compare[0]) && |
535 | 535 | !checkdate($date_end_to_compare[1], $date_end_to_compare[2], $date_end_to_compare[0]) |
536 | 536 | ) { |
537 | - Display :: display_normal_message(get_lang('InvalidEndDate')); |
|
537 | + Display :: display_normal_message(get_lang('InvalidEndDate')); |
|
538 | 538 | |
539 | - return false; |
|
540 | - } |
|
539 | + return false; |
|
540 | + } |
|
541 | 541 | |
542 | - if (strlen(trim($title)) == 0) { |
|
543 | - Display::display_normal_message(get_lang('InvalidTitle')); |
|
542 | + if (strlen(trim($title)) == 0) { |
|
543 | + Display::display_normal_message(get_lang('InvalidTitle')); |
|
544 | 544 | |
545 | - return false; |
|
546 | - } |
|
545 | + return false; |
|
546 | + } |
|
547 | 547 | |
548 | 548 | $start = api_get_utc_datetime($date_start); |
549 | 549 | $end = api_get_utc_datetime($date_end); |
550 | 550 | |
551 | - //Fixing urls that are sent by email |
|
552 | - //$content = str_replace('src=\"/home/', 'src=\"'.api_get_path(WEB_PATH).'home/', $content); |
|
553 | - //$content = str_replace('file=/home/', 'file='.api_get_path(WEB_PATH).'home/', $content); |
|
551 | + //Fixing urls that are sent by email |
|
552 | + //$content = str_replace('src=\"/home/', 'src=\"'.api_get_path(WEB_PATH).'home/', $content); |
|
553 | + //$content = str_replace('file=/home/', 'file='.api_get_path(WEB_PATH).'home/', $content); |
|
554 | 554 | $content = str_replace('src=\"'.api_get_path(REL_HOME_PATH), 'src=\"'.api_get_path(WEB_PATH).api_get_path(REL_HOME_PATH), $content); |
555 | 555 | $content = str_replace('file='.api_get_path(REL_HOME_PATH), 'file='.api_get_path(WEB_PATH).api_get_path(REL_HOME_PATH), $content); |
556 | 556 | |
@@ -592,81 +592,81 @@ discard block |
||
592 | 592 | $em->merge($announcement); |
593 | 593 | $em->flush(); |
594 | 594 | |
595 | - return true; |
|
596 | - } |
|
595 | + return true; |
|
596 | + } |
|
597 | 597 | |
598 | - /** |
|
599 | - * Deletes an announcement |
|
600 | - * @param int $id The identifier of the announcement that should be |
|
601 | - * @return bool True on success, false on failure |
|
602 | - */ |
|
603 | - public static function delete_announcement($id) |
|
598 | + /** |
|
599 | + * Deletes an announcement |
|
600 | + * @param int $id The identifier of the announcement that should be |
|
601 | + * @return bool True on success, false on failure |
|
602 | + */ |
|
603 | + public static function delete_announcement($id) |
|
604 | 604 | { |
605 | - $db_table = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS); |
|
606 | - $id = intval($id); |
|
607 | - $sql = "DELETE FROM ".$db_table." WHERE id =".$id; |
|
608 | - $res = Database::query($sql); |
|
605 | + $db_table = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS); |
|
606 | + $id = intval($id); |
|
607 | + $sql = "DELETE FROM ".$db_table." WHERE id =".$id; |
|
608 | + $res = Database::query($sql); |
|
609 | 609 | if ($res === false) { |
610 | - return false; |
|
611 | - } |
|
612 | - return true; |
|
613 | - } |
|
614 | - |
|
615 | - /** |
|
616 | - * Gets an announcement |
|
617 | - * @param int $id The identifier of the announcement that should be |
|
618 | - * @return object Object of class StdClass or the required class, containing the query result row |
|
619 | - */ |
|
620 | - public static function get_announcement($id) |
|
610 | + return false; |
|
611 | + } |
|
612 | + return true; |
|
613 | + } |
|
614 | + |
|
615 | + /** |
|
616 | + * Gets an announcement |
|
617 | + * @param int $id The identifier of the announcement that should be |
|
618 | + * @return object Object of class StdClass or the required class, containing the query result row |
|
619 | + */ |
|
620 | + public static function get_announcement($id) |
|
621 | 621 | { |
622 | - $db_table = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS); |
|
623 | - $id = intval($id); |
|
624 | - $sql = "SELECT * FROM ".$db_table." WHERE id = ".$id; |
|
625 | - $announcement = Database::fetch_object(Database::query($sql)); |
|
626 | - |
|
627 | - return $announcement; |
|
628 | - } |
|
629 | - |
|
630 | - /** |
|
631 | - * Change the visibility of an announcement |
|
632 | - * @param int $announcement_id |
|
633 | - * @param int $user For who should the visibility be changed |
|
622 | + $db_table = Database :: get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS); |
|
623 | + $id = intval($id); |
|
624 | + $sql = "SELECT * FROM ".$db_table." WHERE id = ".$id; |
|
625 | + $announcement = Database::fetch_object(Database::query($sql)); |
|
626 | + |
|
627 | + return $announcement; |
|
628 | + } |
|
629 | + |
|
630 | + /** |
|
631 | + * Change the visibility of an announcement |
|
632 | + * @param int $announcement_id |
|
633 | + * @param int $user For who should the visibility be changed |
|
634 | 634 | * (possible values are VISIBLE_TEACHER, VISIBLE_STUDENT, VISIBLE_GUEST) |
635 | - * @return bool True on success, false on failure |
|
636 | - */ |
|
637 | - public static function set_visibility($announcement_id, $user, $visible) |
|
635 | + * @return bool True on success, false on failure |
|
636 | + */ |
|
637 | + public static function set_visibility($announcement_id, $user, $visible) |
|
638 | 638 | { |
639 | - $db_table = Database::get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS); |
|
640 | - $visible = intval($visible); |
|
641 | - $announcement_id = intval($announcement_id); |
|
639 | + $db_table = Database::get_main_table(TABLE_MAIN_SYSTEM_ANNOUNCEMENTS); |
|
640 | + $visible = intval($visible); |
|
641 | + $announcement_id = intval($announcement_id); |
|
642 | 642 | |
643 | 643 | if (!in_array($user, array(self::VISIBLE_GUEST, self::VISIBLE_STUDENT, self::VISIBLE_TEACHER))) { |
644 | 644 | return false; |
645 | 645 | } |
646 | 646 | |
647 | - $field = ($user == self::VISIBLE_TEACHER ? 'visible_teacher' : ($user == self::VISIBLE_STUDENT ? 'visible_student' : 'visible_guest')); |
|
647 | + $field = ($user == self::VISIBLE_TEACHER ? 'visible_teacher' : ($user == self::VISIBLE_STUDENT ? 'visible_student' : 'visible_guest')); |
|
648 | 648 | |
649 | - $sql = "UPDATE ".$db_table." SET ".$field." = '".$visible."' |
|
649 | + $sql = "UPDATE ".$db_table." SET ".$field." = '".$visible."' |
|
650 | 650 | WHERE id='".$announcement_id."'"; |
651 | - $res = Database::query($sql); |
|
652 | - |
|
653 | - if ($res === false) { |
|
654 | - return false; |
|
655 | - } |
|
656 | - |
|
657 | - return true; |
|
658 | - } |
|
659 | - |
|
660 | - /** |
|
661 | - * Send a system announcement by e-mail to all teachers/students depending on parameters |
|
662 | - * @param string $title |
|
663 | - * @param string $content |
|
664 | - * @param int $teacher Whether to send to all teachers (1) or not (0) |
|
665 | - * @param int $student Whether to send to all students (1) or not (0) |
|
666 | - * @param string $language Language (optional, considered for all languages if left empty) |
|
651 | + $res = Database::query($sql); |
|
652 | + |
|
653 | + if ($res === false) { |
|
654 | + return false; |
|
655 | + } |
|
656 | + |
|
657 | + return true; |
|
658 | + } |
|
659 | + |
|
660 | + /** |
|
661 | + * Send a system announcement by e-mail to all teachers/students depending on parameters |
|
662 | + * @param string $title |
|
663 | + * @param string $content |
|
664 | + * @param int $teacher Whether to send to all teachers (1) or not (0) |
|
665 | + * @param int $student Whether to send to all students (1) or not (0) |
|
666 | + * @param string $language Language (optional, considered for all languages if left empty) |
|
667 | 667 | * @param bool $sendEmailTest |
668 | 668 | * @return bool True if the message was sent or there was no destination matching. False on database or e-mail sending error. |
669 | - */ |
|
669 | + */ |
|
670 | 670 | public static function send_system_announcement_by_email( |
671 | 671 | $title, |
672 | 672 | $content, |
@@ -692,26 +692,26 @@ discard block |
||
692 | 692 | } |
693 | 693 | |
694 | 694 | if ($teacher <> 0 && $student == 0) { |
695 | - $sql = "SELECT DISTINCT u.user_id FROM $user_table u $url_condition |
|
695 | + $sql = "SELECT DISTINCT u.user_id FROM $user_table u $url_condition |
|
696 | 696 | WHERE status = '1' "; |
697 | - } |
|
697 | + } |
|
698 | 698 | |
699 | - if ($teacher == 0 && $student <> 0) { |
|
700 | - $sql = "SELECT DISTINCT u.user_id FROM $user_table u $url_condition |
|
699 | + if ($teacher == 0 && $student <> 0) { |
|
700 | + $sql = "SELECT DISTINCT u.user_id FROM $user_table u $url_condition |
|
701 | 701 | WHERE status = '5' "; |
702 | - } |
|
702 | + } |
|
703 | 703 | |
704 | - if ($teacher<> 0 && $student <> 0) { |
|
705 | - $sql = "SELECT DISTINCT u.user_id FROM $user_table u $url_condition |
|
704 | + if ($teacher<> 0 && $student <> 0) { |
|
705 | + $sql = "SELECT DISTINCT u.user_id FROM $user_table u $url_condition |
|
706 | 706 | WHERE 1 = 1 "; |
707 | - } |
|
707 | + } |
|
708 | 708 | |
709 | - if (!empty($language)) { |
|
710 | - //special condition because language was already treated for SQL insert before |
|
711 | - $sql .= " AND language = '".Database::escape_string($language)."' "; |
|
712 | - } |
|
709 | + if (!empty($language)) { |
|
710 | + //special condition because language was already treated for SQL insert before |
|
711 | + $sql .= " AND language = '".Database::escape_string($language)."' "; |
|
712 | + } |
|
713 | 713 | |
714 | - if (api_is_multiple_url_enabled()) { |
|
714 | + if (api_is_multiple_url_enabled()) { |
|
715 | 715 | $sql .= " AND access_url_id = '".$current_access_url_id."' "; |
716 | 716 | } |
717 | 717 | |
@@ -721,28 +721,28 @@ discard block |
||
721 | 721 | // Expiration date |
722 | 722 | $sql .= " AND (expiration_date = '' OR expiration_date IS NULL OR expiration_date > '$now') "; |
723 | 723 | |
724 | - if ((empty($teacher) || $teacher == '0') && (empty($student) || $student == '0')) { |
|
724 | + if ((empty($teacher) || $teacher == '0') && (empty($student) || $student == '0')) { |
|
725 | 725 | |
726 | - return true; |
|
727 | - } |
|
726 | + return true; |
|
727 | + } |
|
728 | 728 | |
729 | - $result = Database::query($sql); |
|
730 | - if ($result === false) { |
|
729 | + $result = Database::query($sql); |
|
730 | + if ($result === false) { |
|
731 | 731 | |
732 | - return false; |
|
733 | - } |
|
732 | + return false; |
|
733 | + } |
|
734 | 734 | |
735 | 735 | $message_sent = false; |
736 | 736 | |
737 | - while ($row = Database::fetch_array($result,'ASSOC')) { |
|
737 | + while ($row = Database::fetch_array($result,'ASSOC')) { |
|
738 | 738 | MessageManager::send_message_simple($row['user_id'], $title, $content); |
739 | 739 | $message_sent = true; |
740 | - } |
|
740 | + } |
|
741 | 741 | |
742 | - return $message_sent; //true if at least one e-mail was sent |
|
743 | - } |
|
742 | + return $message_sent; //true if at least one e-mail was sent |
|
743 | + } |
|
744 | 744 | |
745 | - /** |
|
745 | + /** |
|
746 | 746 | * Displays announcements as an slideshow |
747 | 747 | * @param int $visible VISIBLE_GUEST, VISIBLE_STUDENT or VISIBLE_TEACHER |
748 | 748 | * @param int $id The identifier of the announcement to display |
@@ -36,20 +36,20 @@ discard block |
||
36 | 36 | |
37 | 37 | // setting the name of the tool |
38 | 38 | if (UserManager::is_admin($user_id)) { |
39 | - $tool_name= get_lang('AssignCoursesToPlatformAdministrator'); |
|
39 | + $tool_name= get_lang('AssignCoursesToPlatformAdministrator'); |
|
40 | 40 | } else if ($user_info['status'] == SESSIONADMIN) { |
41 | - $tool_name= get_lang('AssignCoursesToSessionsAdministrator'); |
|
41 | + $tool_name= get_lang('AssignCoursesToSessionsAdministrator'); |
|
42 | 42 | } else { |
43 | - $tool_name= get_lang('AssignCoursesToHumanResourcesManager'); |
|
43 | + $tool_name= get_lang('AssignCoursesToHumanResourcesManager'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $add_type = 'multiple'; |
47 | 47 | if(isset($_GET['add_type']) && $_GET['add_type']!='') { |
48 | - $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
48 | + $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if (!api_is_platform_admin()) { |
52 | - api_not_allowed(true); |
|
52 | + api_not_allowed(true); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | function search_courses($needle, $type) |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $return = ''; |
61 | 61 | if (!empty($needle) && !empty($type)) { |
62 | 62 | // xajax send utf8 datas... datas in db can be non-utf8 datas |
63 | - $needle = Database::escape_string($needle); |
|
63 | + $needle = Database::escape_string($needle); |
|
64 | 64 | |
65 | 65 | $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id); |
66 | 66 | $assigned_courses_code = array_keys($assigned_courses_to_hrm); |
@@ -88,16 +88,16 @@ discard block |
||
88 | 88 | $without_assigned_courses "; |
89 | 89 | } |
90 | 90 | |
91 | - $rs = Database::query($sql); |
|
91 | + $rs = Database::query($sql); |
|
92 | 92 | |
93 | - $return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >'; |
|
94 | - while ($course = Database :: fetch_array($rs)) { |
|
95 | - $return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>'; |
|
96 | - } |
|
97 | - $return .= '</select>'; |
|
98 | - $xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return)); |
|
99 | - } |
|
100 | - return $xajax_response; |
|
93 | + $return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >'; |
|
94 | + while ($course = Database :: fetch_array($rs)) { |
|
95 | + $return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>'; |
|
96 | + } |
|
97 | + $return .= '</select>'; |
|
98 | + $xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return)); |
|
99 | + } |
|
100 | + return $xajax_response; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | $xajax->processRequests(); |
@@ -187,23 +187,23 @@ discard block |
||
187 | 187 | $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id); |
188 | 188 | $assigned_courses_code = array_keys($assigned_courses_to_hrm); |
189 | 189 | foreach ($assigned_courses_code as &$value) { |
190 | - $value = "'".$value."'"; |
|
190 | + $value = "'".$value."'"; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | $without_assigned_courses = ''; |
194 | 194 | if (count($assigned_courses_code) > 0) { |
195 | - $without_assigned_courses = " AND c.code NOT IN(".implode(',', $assigned_courses_code).")"; |
|
195 | + $without_assigned_courses = " AND c.code NOT IN(".implode(',', $assigned_courses_code).")"; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | $needle = '%'; |
199 | 199 | $firstLetter = null; |
200 | 200 | if (isset($_POST['firstLetterCourse'])) { |
201 | - $firstLetter = $_POST['firstLetterCourse']; |
|
202 | - $needle = Database::escape_string($firstLetter.'%'); |
|
201 | + $firstLetter = $_POST['firstLetterCourse']; |
|
202 | + $needle = Database::escape_string($firstLetter.'%'); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | if (api_is_multiple_url_enabled()) { |
206 | - $sql = " SELECT c.code, c.title |
|
206 | + $sql = " SELECT c.code, c.title |
|
207 | 207 | FROM $tbl_course c |
208 | 208 | LEFT JOIN $tbl_course_rel_access_url a |
209 | 209 | ON (a.c_id = c.id) |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | ORDER BY c.title"; |
214 | 214 | |
215 | 215 | } else { |
216 | - $sql= " SELECT c.code, c.title |
|
216 | + $sql= " SELECT c.code, c.title |
|
217 | 217 | FROM $tbl_course c |
218 | 218 | WHERE c.code LIKE '$needle' $without_assigned_courses |
219 | 219 | ORDER BY c.title"; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | <input type="hidden" name="formSent" value="1" /> |
228 | 228 | <?php |
229 | 229 | if(!empty($msg)) { |
230 | - Display::display_normal_message($msg); //main API |
|
230 | + Display::display_normal_message($msg); //main API |
|
231 | 231 | } |
232 | 232 | ?> |
233 | 233 | |
@@ -272,13 +272,13 @@ discard block |
||
272 | 272 | </div> |
273 | 273 | <div class="col-md-4"> |
274 | 274 | <h5><?php |
275 | - if (UserManager::is_admin($user_id)) { |
|
276 | - echo get_lang('AssignedCoursesListToPlatformAdministrator'); |
|
277 | - } else if ($user_info['status'] == SESSIONADMIN) { |
|
278 | - echo get_lang('AssignedCoursesListToSessionsAdministrator'); |
|
279 | - } else { |
|
280 | - echo get_lang('AssignedCoursesListToHumanResourcesManager'); |
|
281 | - } |
|
275 | + if (UserManager::is_admin($user_id)) { |
|
276 | + echo get_lang('AssignedCoursesListToPlatformAdministrator'); |
|
277 | + } else if ($user_info['status'] == SESSIONADMIN) { |
|
278 | + echo get_lang('AssignedCoursesListToSessionsAdministrator'); |
|
279 | + } else { |
|
280 | + echo get_lang('AssignedCoursesListToHumanResourcesManager'); |
|
281 | + } |
|
282 | 282 | ?>: </h5> |
283 | 283 | |
284 | 284 | <select id='destination' name="CoursesList[]" multiple="multiple" size="20" style="width:320px;"> |
@@ -114,8 +114,8 @@ |
||
114 | 114 | //With this function we can add actions to the jgrid (edit, delete, etc) |
115 | 115 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
116 | 116 | return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. |
117 | - ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
118 | - '\'; |
|
117 | + ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
118 | + '\'; |
|
119 | 119 | }'; |
120 | 120 | ?> |
121 | 121 | <script> |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $oskill = new Skill(); |
71 | 71 | $skill_id = $oskill->add($skill); |
72 | 72 | $parents[$saved_id] = $skill_id; |
73 | - } |
|
73 | + } |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | */ |
82 | 82 | function parse_csv_data($file) |
83 | 83 | { |
84 | - $skills = Import :: csvToArray($file); |
|
85 | - foreach ($skills as $index => $skill) { |
|
86 | - $skills[$index] = $skill; |
|
87 | - } |
|
84 | + $skills = Import :: csvToArray($file); |
|
85 | + foreach ($skills as $index => $skill) { |
|
86 | + $skills[$index] = $skill; |
|
87 | + } |
|
88 | 88 | |
89 | - return $skills; |
|
89 | + return $skills; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | function element_start($parser, $data) |
96 | 96 | { |
97 | - $data = api_utf8_decode($data); |
|
97 | + $data = api_utf8_decode($data); |
|
98 | 98 | global $skill; |
99 | 99 | global $current_tag; |
100 | 100 | switch ($data) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | function element_end($parser, $data) |
113 | 113 | { |
114 | - $data = api_utf8_decode($data); |
|
114 | + $data = api_utf8_decode($data); |
|
115 | 115 | global $skill; |
116 | 116 | global $skills; |
117 | 117 | global $current_value; |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | */ |
131 | 131 | function character_data($parser, $data) |
132 | 132 | { |
133 | - $data = trim(api_utf8_decode($data)); |
|
134 | - global $current_value; |
|
135 | - $current_value = $data; |
|
133 | + $data = trim(api_utf8_decode($data)); |
|
134 | + global $current_value; |
|
135 | + $current_value = $data; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | xml_parse($parser, api_utf8_encode_xml(file_get_contents($file))); |
155 | 155 | xml_parser_free($parser); |
156 | 156 | |
157 | - return $skills; |
|
157 | + return $skills; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | $this_section = SECTION_PLATFORM_ADMIN; |