@@ -189,8 +189,8 @@ |
||
189 | 189 | { |
190 | 190 | $code = CourseRequestManager::get_course_request_code($id); |
191 | 191 | $result = '<a href="course_request_edit.php?id='.$id.'&caller=0">'.Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align: middle;')).'</a>'. |
192 | - ' <a href="?accept_course_request='.$id.'">'.Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;'),16).'</a>'. |
|
193 | - ' <a href="?reject_course_request='.$id.'">'.Display::return_icon('error.png', get_lang('RejectThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeRejected'), $code), ENT_QUOTES)).'\')) return false;'),16).'</a>'; |
|
192 | + ' <a href="?accept_course_request='.$id.'">'.Display::return_icon('accept.png', get_lang('AcceptThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ANewCourseWillBeCreated'), $code), ENT_QUOTES)).'\')) return false;'), 16).'</a>'. |
|
193 | + ' <a href="?reject_course_request='.$id.'">'.Display::return_icon('error.png', get_lang('RejectThisCourseRequest'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('ACourseRequestWillBeRejected'), $code), ENT_QUOTES)).'\')) return false;'), 16).'</a>'; |
|
194 | 194 | if (!CourseRequestManager::additional_info_asked($id)) { |
195 | 195 | $result .= ' <a href="?request_info='.$id.'">'.Display::return_icon('request_info.gif', get_lang('AskAdditionalInfo'), array('style' => 'vertical-align: middle;', 'onclick' => 'javascript: if (!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('AdditionalInfoWillBeAsked'), $code), ENT_QUOTES)).'\')) return false;')).'</a>'; |
196 | 196 | } |
@@ -8,43 +8,43 @@ discard block |
||
8 | 8 | */ |
9 | 9 | exit(); //not yet functional, needs to be revised |
10 | 10 | |
11 | -$cidReset=true; |
|
11 | +$cidReset = true; |
|
12 | 12 | |
13 | 13 | require('../inc/global.inc.php'); |
14 | 14 | $libpath = api_get_path(LIBRARY_PATH); |
15 | 15 | require("../auth/ldap/authldap.php"); |
16 | -$annee_base=date('Y'); |
|
16 | +$annee_base = date('Y'); |
|
17 | 17 | // setting the section (for the tabs) |
18 | 18 | $this_section = SECTION_PLATFORM_ADMIN; |
19 | 19 | api_protect_admin_script(); |
20 | 20 | |
21 | 21 | // setting breadcrumbs |
22 | -$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
|
23 | -$interbreadcrumb[]=array('url' => api_get_self(),"name" => get_lang('SessionsList')); |
|
22 | +$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
23 | +$interbreadcrumb[] = array('url' => api_get_self(), "name" => get_lang('SessionsList')); |
|
24 | 24 | |
25 | 25 | // Database Table Definitions |
26 | 26 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
27 | -$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS); |
|
28 | -$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
29 | -$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
30 | -$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
31 | -$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
32 | -$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
33 | -$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS); |
|
34 | -$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER); |
|
27 | +$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS); |
|
28 | +$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
29 | +$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
30 | +$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
31 | +$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
32 | +$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
33 | +$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS); |
|
34 | +$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER); |
|
35 | 35 | |
36 | -$tbl_session_rel_etape = "session_rel_etape"; |
|
36 | +$tbl_session_rel_etape = "session_rel_etape"; |
|
37 | 37 | |
38 | -$id_session=intval($_GET['id_session']); |
|
38 | +$id_session = intval($_GET['id_session']); |
|
39 | 39 | |
40 | -$formSent=0; |
|
41 | -$errorMsg=$firstLetterUser=$firstLetterSession=''; |
|
42 | -$UserList=$SessionList=array(); |
|
43 | -$users=$sessions=array(); |
|
44 | -$noPHP_SELF=true; |
|
40 | +$formSent = 0; |
|
41 | +$errorMsg = $firstLetterUser = $firstLetterSession = ''; |
|
42 | +$UserList = $SessionList = array(); |
|
43 | +$users = $sessions = array(); |
|
44 | +$noPHP_SELF = true; |
|
45 | 45 | |
46 | -$page=intval($_GET['page']); |
|
47 | -$action=$_REQUEST['action']; |
|
46 | +$page = intval($_GET['page']); |
|
47 | +$action = $_REQUEST['action']; |
|
48 | 48 | |
49 | 49 | $tool_name = get_lang('Synchro LDAP : Import Etudiants/Etapes dans session'); |
50 | 50 | Display::display_header($tool_name); |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | </form> |
60 | 60 | |
61 | 61 | <?php |
62 | -if (isset($action) && ($action=="synchro")) { |
|
63 | - $included=true; |
|
62 | +if (isset($action) && ($action == "synchro")) { |
|
63 | + $included = true; |
|
64 | 64 | require('ldap_synchro.php'); |
65 | - Display :: display_normal_message($message,false); |
|
65 | + Display :: display_normal_message($message, false); |
|
66 | 66 | } |
67 | 67 | Display::display_footer(); |
68 | 68 | ?> |
@@ -13,8 +13,8 @@ |
||
13 | 13 | |
14 | 14 | $tool_name = get_lang('Export'); |
15 | 15 | |
16 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
17 | -$interbreadcrumb[] = array ('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
16 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
17 | +$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
18 | 18 | |
19 | 19 | set_time_limit(0); |
20 | 20 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | // Setting breadcrumbs. |
22 | 22 | $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
23 | -$interbreadcrumb[] = array ('url' => 'class_list.php', 'name' => get_lang('Classes')); |
|
23 | +$interbreadcrumb[] = array('url' => 'class_list.php', 'name' => get_lang('Classes')); |
|
24 | 24 | |
25 | 25 | // Setting the name of the tool. |
26 | 26 | $tool_name = get_lang("AddClasses"); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1 |
27 | 27 | ) { |
28 | 28 | $access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
29 | - $sql.= " INNER JOIN $access_url_rel_course_table url_rel_course |
|
29 | + $sql .= " INNER JOIN $access_url_rel_course_table url_rel_course |
|
30 | 30 | ON (c.id = url_rel_course.c_id)"; |
31 | 31 | } |
32 | 32 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | if ((api_is_platform_admin() || api_is_session_admin()) && |
63 | 63 | api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1 |
64 | 64 | ) { |
65 | - $sql.= " AND url_rel_course.access_url_id = ".api_get_current_access_url_id(); |
|
65 | + $sql .= " AND url_rel_course.access_url_id = ".api_get_current_access_url_id(); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $res = Database::query($sql); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1 |
102 | 102 | ) { |
103 | 103 | $access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
104 | - $sql.= " INNER JOIN $access_url_rel_course_table url_rel_course |
|
104 | + $sql .= " INNER JOIN $access_url_rel_course_table url_rel_course |
|
105 | 105 | ON (course.id = url_rel_course.c_id)"; |
106 | 106 | } |
107 | 107 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if ((api_is_platform_admin() || api_is_session_admin()) && |
137 | 137 | api_is_multiple_url_enabled() && api_get_current_access_url_id() != -1 |
138 | 138 | ) { |
139 | - $sql.= " AND url_rel_course.access_url_id=".api_get_current_access_url_id(); |
|
139 | + $sql .= " AND url_rel_course.access_url_id=".api_get_current_access_url_id(); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | $sql .= " ORDER BY col$column $direction "; |
@@ -206,13 +206,13 @@ discard block |
||
206 | 206 | |
207 | 207 | if (isset($_GET['session_id']) && !empty($_GET['session_id'])) { |
208 | 208 | $sessionId = intval($_GET['session_id']); |
209 | - $sql.= " WHERE s.id = ".$sessionId; |
|
209 | + $sql .= " WHERE s.id = ".$sessionId; |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | $sql .= " ORDER BY col$column $direction "; |
213 | 213 | $sql .= " LIMIT $from,$number_of_items"; |
214 | 214 | $res = Database::query($sql); |
215 | - $courses = array (); |
|
215 | + $courses = array(); |
|
216 | 216 | while ($course = Database::fetch_array($res)) { |
217 | 217 | // Place colour icons in front of courses. |
218 | 218 | $show_visual_code = $course['visual_code'] != $course[2] ? Display::label($course['visual_code'], 'info') : null; |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | function get_course_visibility_icon($v) { |
257 | 257 | $style = 'margin-bottom:0;margin-right:5px;'; |
258 | - switch($v) { |
|
258 | + switch ($v) { |
|
259 | 259 | case 0: |
260 | 260 | return Display::return_icon('bullet_red.png', get_lang('CourseVisibilityClosed'), array('style' => $style)); |
261 | 261 | break; |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $form->setDefaults($defaults); |
343 | 343 | $content .= $form->return_form(); |
344 | 344 | } else { |
345 | - $interbreadcrumb[] = array ('url' => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
345 | + $interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
346 | 346 | $tool_name = get_lang('CourseList'); |
347 | 347 | |
348 | 348 | if (isset($_GET['action'])) { |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $form = new FormValidator('search_simple', 'get', '', '', array(), FormValidator::LAYOUT_INLINE); |
370 | 370 | $form->addElement('text', 'keyword', null, array('id' => 'course-search-keyword')); |
371 | 371 | $form->addButtonSearch(get_lang('SearchCourse')); |
372 | - $advanced = '<a class="btn btn-default" href="'. api_get_path(WEB_CODE_PATH).'admin/course_list.php?search=advanced"><em class="fa fa-search"></em> '.get_lang('AdvancedSearch').'</a>'; |
|
372 | + $advanced = '<a class="btn btn-default" href="'.api_get_path(WEB_CODE_PATH).'admin/course_list.php?search=advanced"><em class="fa fa-search"></em> '.get_lang('AdvancedSearch').'</a>'; |
|
373 | 373 | |
374 | 374 | // Create a filter by session |
375 | 375 | $sessionFilter = new FormValidator('course_filter', 'get', '', '', array(), FormValidator::LAYOUT_INLINE); |
@@ -390,9 +390,9 @@ discard block |
||
390 | 390 | $courseListUrl = api_get_self(); |
391 | 391 | $actions .= '<div class="row">'; |
392 | 392 | $actions .= '<div class="col-md-2">'; |
393 | - $actions .= '<a href="course_add.php">'.Display::return_icon('new_course.png', get_lang('AddCourse'),'',ICON_SIZE_MEDIUM).'</a> '; |
|
393 | + $actions .= '<a href="course_add.php">'.Display::return_icon('new_course.png', get_lang('AddCourse'), '', ICON_SIZE_MEDIUM).'</a> '; |
|
394 | 394 | if (api_get_setting('course_validation') == 'true') { |
395 | - $actions .= '<a href="course_request_review.php">'.Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
395 | + $actions .= '<a href="course_request_review.php">'.Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
396 | 396 | } |
397 | 397 | $actions .= '</div>'; |
398 | 398 | $actions .= '<div class="col-md-4">'; |
@@ -430,18 +430,18 @@ discard block |
||
430 | 430 | $table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data', 2, 20, 'ASC', 'course-list'); |
431 | 431 | } |
432 | 432 | |
433 | - $parameters=array(); |
|
433 | + $parameters = array(); |
|
434 | 434 | |
435 | 435 | if (isset ($_GET['keyword'])) { |
436 | - $parameters = array ('keyword' => Security::remove_XSS($_GET['keyword'])); |
|
436 | + $parameters = array('keyword' => Security::remove_XSS($_GET['keyword'])); |
|
437 | 437 | } elseif (isset ($_GET['keyword_code'])) { |
438 | - $parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']); |
|
439 | - $parameters['keyword_title'] = Security::remove_XSS($_GET['keyword_title']); |
|
438 | + $parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']); |
|
439 | + $parameters['keyword_title'] = Security::remove_XSS($_GET['keyword_title']); |
|
440 | 440 | $parameters['keyword_category'] = Security::remove_XSS($_GET['keyword_category']); |
441 | 441 | $parameters['keyword_language'] = Security::remove_XSS($_GET['keyword_language']); |
442 | - $parameters['keyword_visibility'] = Security::remove_XSS($_GET['keyword_visibility']); |
|
443 | - $parameters['keyword_subscribe'] = Security::remove_XSS($_GET['keyword_subscribe']); |
|
444 | - $parameters['keyword_unsubscribe'] = Security::remove_XSS($_GET['keyword_unsubscribe']); |
|
442 | + $parameters['keyword_visibility'] = Security::remove_XSS($_GET['keyword_visibility']); |
|
443 | + $parameters['keyword_subscribe'] = Security::remove_XSS($_GET['keyword_subscribe']); |
|
444 | + $parameters['keyword_unsubscribe'] = Security::remove_XSS($_GET['keyword_unsubscribe']); |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | $table->set_additional_parameters($parameters); |
@@ -59,8 +59,8 @@ |
||
59 | 59 | api_protect_admin_script(); |
60 | 60 | |
61 | 61 | // setting breadcrumbs |
62 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
63 | -$interbreadcrumb[] = array ('url' => 'class_list.php', 'name' => get_lang('Classes')); |
|
62 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
63 | +$interbreadcrumb[] = array('url' => 'class_list.php', 'name' => get_lang('Classes')); |
|
64 | 64 | |
65 | 65 | // Database Table Definitions |
66 | 66 |
@@ -23,14 +23,14 @@ |
||
23 | 23 | |
24 | 24 | $interbreadcrumb = array( |
25 | 25 | array( |
26 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php', |
|
26 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/index.php', |
|
27 | 27 | 'name' => get_lang('Administration') |
28 | 28 | ) |
29 | 29 | ); |
30 | 30 | |
31 | 31 | $toolbar = Display::toolbarButton( |
32 | 32 | get_lang('ManageSkills'), |
33 | - api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php', |
|
33 | + api_get_path(WEB_CODE_PATH).'admin/skill_list.php', |
|
34 | 34 | 'list', |
35 | 35 | 'primary', |
36 | 36 | ['title' => get_lang('ManageSkills')] |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | |
23 | 23 | // setting breadcrumbs |
24 | 24 | $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
25 | -$interbreadcrumb[] = array('url' => 'user_list.php','name' => get_lang('UserList')); |
|
25 | +$interbreadcrumb[] = array('url' => 'user_list.php', 'name' => get_lang('UserList')); |
|
26 | 26 | |
27 | 27 | // Database Table Definitions |
28 | -$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
|
29 | -$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
28 | +$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
|
29 | +$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
30 | 30 | $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
31 | 31 | |
32 | 32 | // Initializing variables |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $add_type = 'multiple'; |
49 | -if (isset($_GET['add_type']) && $_GET['add_type']!='') { |
|
49 | +if (isset($_GET['add_type']) && $_GET['add_type'] != '') { |
|
50 | 50 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
51 | 51 | } |
52 | 52 | |
@@ -71,20 +71,20 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | if (api_is_multiple_url_enabled()) { |
74 | - $sql = " SELECT s.id, s.name FROM $tbl_session s |
|
74 | + $sql = " SELECT s.id, s.name FROM $tbl_session s |
|
75 | 75 | LEFT JOIN $tbl_session_rel_access_url a ON (s.id = a.session_id) |
76 | 76 | WHERE s.name LIKE '$needle%' $without_assigned_sessions AND access_url_id = ".api_get_current_access_url_id().""; |
77 | 77 | } else { |
78 | 78 | $sql = "SELECT s.id, s.name FROM $tbl_session s |
79 | 79 | WHERE s.name LIKE '$needle%' $without_assigned_sessions "; |
80 | 80 | } |
81 | - $rs = Database::query($sql); |
|
81 | + $rs = Database::query($sql); |
|
82 | 82 | $return .= '<select class="form-control" id="origin" name="NoAssignedSessionsList[]" multiple="multiple" size="20">'; |
83 | - while($session = Database :: fetch_array($rs)) { |
|
84 | - $return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'],ENT_QUOTES).'">'.$session['name'].'</option>'; |
|
83 | + while ($session = Database :: fetch_array($rs)) { |
|
84 | + $return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'], ENT_QUOTES).'">'.$session['name'].'</option>'; |
|
85 | 85 | } |
86 | 86 | $return .= '</select>'; |
87 | - $xajax_response->addAssign('ajax_list_sessions_multiple','innerHTML',api_utf8_encode($return)); |
|
87 | + $xajax_response->addAssign('ajax_list_sessions_multiple', 'innerHTML', api_utf8_encode($return)); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return $xajax_response; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | </script>'; |
145 | 145 | |
146 | -$formSent=0; |
|
146 | +$formSent = 0; |
|
147 | 147 | $firstLetterSession = isset($_POST['firstLetterSession']) ? $_POST['firstLetterSession'] : null; |
148 | 148 | $errorMsg = ''; |
149 | 149 | $UserList = array(); |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | // actions |
169 | 169 | |
170 | 170 | if ($user_info['status'] != SESSIONADMIN) { |
171 | - $actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">' . Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM ) . '</a>'; |
|
172 | - $actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">' . Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM) . '</a>'; |
|
171 | + $actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">'.Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM).'</a>'; |
|
172 | + $actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">'.Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM).'</a>'; |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | |
176 | -echo Display::toolbarAction('toolbar-dashboard', array( 0 => $actionsLeft, 1 => '')); |
|
176 | +echo Display::toolbarAction('toolbar-dashboard', array(0 => $actionsLeft, 1 => '')); |
|
177 | 177 | |
178 | 178 | echo Display::page_header(sprintf(get_lang('AssignSessionsToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])), null, 'h3'); |
179 | 179 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | $without_assigned_sessions = ''; |
184 | 184 | if (count($assigned_sessions_id) > 0) { |
185 | - $without_assigned_sessions = " AND s.id NOT IN (".implode(',',$assigned_sessions_id).") "; |
|
185 | + $without_assigned_sessions = " AND s.id NOT IN (".implode(',', $assigned_sessions_id).") "; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | $needle = '%'; |
@@ -203,9 +203,9 @@ discard block |
||
203 | 203 | WHERE s.name LIKE '$needle%' $without_assigned_sessions |
204 | 204 | ORDER BY s.name"; |
205 | 205 | } |
206 | -$result = Database::query($sql); |
|
206 | +$result = Database::query($sql); |
|
207 | 207 | ?> |
208 | - <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if($ajax_search){ echo ' onsubmit="valide();"';}?>> |
|
208 | + <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if ($ajax_search) { echo ' onsubmit="valide();"'; }?>> |
|
209 | 209 | <input type="hidden" name="formSent" value="1" /> |
210 | 210 | |
211 | 211 | <div class="row"> |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | <?php |
218 | 218 | while ($enreg = Database::fetch_array($result)) { |
219 | 219 | ?> |
220 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"';?>> |
|
220 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>> |
|
221 | 221 | <?php echo $enreg['name']; ?> |
222 | 222 | </option> |
223 | 223 | <?php } ?> |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | <div class="col-md-4"> |
228 | 228 | <div class="code-course"> |
229 | 229 | <?php if ($add_type == 'multiple') { ?> |
230 | - <p><?php echo get_lang('FirstLetterSession');?> :</p> |
|
230 | + <p><?php echo get_lang('FirstLetterSession'); ?> :</p> |
|
231 | 231 | <select class="selectpicker form-control" name="firstLetterSession" onchange = "xajax_search_sessions(this.value, 'multiple')"> |
232 | 232 | <option value="%">--</option> |
233 | 233 | <?php echo Display :: get_alphabet_options($firstLetterSession); ?> |
@@ -282,9 +282,9 @@ discard block |
||
282 | 282 | <select id='destination' name="SessionsList[]" multiple="multiple" size="20" style="width:320px;"> |
283 | 283 | <?php |
284 | 284 | if (is_array($assigned_sessions_to_hrm)) { |
285 | - foreach($assigned_sessions_to_hrm as $enreg) { |
|
285 | + foreach ($assigned_sessions_to_hrm as $enreg) { |
|
286 | 286 | ?> |
287 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; ?>> |
|
287 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>> |
|
288 | 288 | <?php echo $enreg['name'] ?> |
289 | 289 | </option> |
290 | 290 | <?php } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | */ |
32 | 32 | |
33 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
33 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
34 | 34 | $tool_name = get_lang('SearchLDAPUsers'); |
35 | 35 | //Display :: display_header($tool_name); //cannot display now as we need to redirect |
36 | 36 | //api_display_tool_title($tool_name); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if (isset ($_GET['action'])) |
39 | 39 | { |
40 | 40 | $check = Security::check_token('get'); |
41 | - if($check) |
|
41 | + if ($check) |
|
42 | 42 | { |
43 | 43 | switch ($_GET['action']) |
44 | 44 | { |
@@ -59,41 +59,41 @@ discard block |
||
59 | 59 | break; |
60 | 60 | case 'lock' : |
61 | 61 | Display :: display_header($tool_name); |
62 | - $message=lock_unlock_user('lock',$_GET['user_id']); |
|
62 | + $message = lock_unlock_user('lock', $_GET['user_id']); |
|
63 | 63 | Display :: display_normal_message($message); |
64 | 64 | break; |
65 | 65 | case 'unlock'; |
66 | 66 | Display :: display_header($tool_name); |
67 | - $message=lock_unlock_user('unlock',$_GET['user_id']); |
|
67 | + $message = lock_unlock_user('unlock', $_GET['user_id']); |
|
68 | 68 | Display :: display_normal_message($message); |
69 | 69 | break; |
70 | 70 | case 'add_user'; |
71 | - $id=$_GET['id']; |
|
72 | - $UserList=array(); |
|
71 | + $id = $_GET['id']; |
|
72 | + $UserList = array(); |
|
73 | 73 | $userid_match_login = array(); |
74 | 74 | foreach ($id as $user_id) { |
75 | 75 | $tmp = ldap_add_user($user_id); |
76 | - $UserList[]= $tmp; |
|
76 | + $UserList[] = $tmp; |
|
77 | 77 | $userid_match_login[$tmp] = $user_id; |
78 | 78 | } |
79 | - if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) { |
|
79 | + if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session'] > 0)) { |
|
80 | 80 | ldap_add_user_to_session($UserList, $_GET['id_session']); |
81 | 81 | header('Location: resume_session.php?id_session='.$_GET['id_session']); |
82 | 82 | } else { |
83 | 83 | Display :: display_header($tool_name); |
84 | - if(count($userid_match_login)>0) |
|
84 | + if (count($userid_match_login) > 0) |
|
85 | 85 | { |
86 | - $message=get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | - foreach($userid_match_login as $user_id => $login) |
|
86 | + $message = get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | + foreach ($userid_match_login as $user_id => $login) |
|
88 | 88 | { |
89 | 89 | $message .= '- '.$login.'<br />'; |
90 | 90 | } |
91 | 91 | } |
92 | 92 | else |
93 | 93 | { |
94 | - $message=get_lang('NoUserAdded'); |
|
94 | + $message = get_lang('NoUserAdded'); |
|
95 | 95 | } |
96 | - Display :: display_normal_message($message,false); |
|
96 | + Display :: display_normal_message($message, false); |
|
97 | 97 | } |
98 | 98 | break; |
99 | 99 | default : |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | if (isset ($_POST['action'])) |
114 | 114 | { |
115 | 115 | $check = Security::check_token('get'); |
116 | - if($check) |
|
116 | + if ($check) |
|
117 | 117 | { |
118 | 118 | switch ($_POST['action']) |
119 | 119 | { |
@@ -122,15 +122,15 @@ discard block |
||
122 | 122 | $number_of_deleted_users = 0; |
123 | 123 | foreach ($_POST['id'] as $index => $user_id) |
124 | 124 | { |
125 | - if($user_id != $_user['user_id']) |
|
125 | + if ($user_id != $_user['user_id']) |
|
126 | 126 | { |
127 | - if(UserManager :: delete_user($user_id)) |
|
127 | + if (UserManager :: delete_user($user_id)) |
|
128 | 128 | { |
129 | 129 | $number_of_deleted_users++; |
130 | 130 | } |
131 | 131 | } |
132 | 132 | } |
133 | - if($number_of_selected_users == $number_of_deleted_users) |
|
133 | + if ($number_of_selected_users == $number_of_deleted_users) |
|
134 | 134 | { |
135 | 135 | Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
136 | 136 | } |
@@ -142,17 +142,17 @@ discard block |
||
142 | 142 | case 'add_user' : |
143 | 143 | $number_of_selected_users = count($_POST['id']); |
144 | 144 | $number_of_added_users = 0; |
145 | - $UserList=array(); |
|
145 | + $UserList = array(); |
|
146 | 146 | foreach ($_POST['id'] as $index => $user_id) |
147 | 147 | { |
148 | - if($user_id != $_user['user_id']) |
|
148 | + if ($user_id != $_user['user_id']) |
|
149 | 149 | { |
150 | 150 | $UserList[] = ldap_add_user($user_id); |
151 | 151 | } |
152 | 152 | } |
153 | - if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
153 | + if (isset($_GET['id_session']) && (trim($_GET['id_session']) != "")) |
|
154 | 154 | addUserToSession($UserList, $_GET['id_session']); |
155 | - if(count($UserList)>0) |
|
155 | + if (count($UserList) > 0) |
|
156 | 156 | { |
157 | 157 | Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
158 | 158 | } |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | } |
168 | 168 | } |
169 | 169 | |
170 | -$form = new FormValidator('advanced_search','get'); |
|
171 | -$form->addText('keyword_username',get_lang('LoginName'),false); |
|
170 | +$form = new FormValidator('advanced_search', 'get'); |
|
171 | +$form->addText('keyword_username', get_lang('LoginName'), false); |
|
172 | 172 | if (api_is_western_name_order()) |
173 | 173 | { |
174 | 174 | $form->addText('keyword_firstname', get_lang('FirstName'), false); |
@@ -176,20 +176,20 @@ discard block |
||
176 | 176 | } |
177 | 177 | else |
178 | 178 | { |
179 | - $form->addText('keyword_lastname',get_lang('LastName'),false); |
|
180 | - $form->addText('keyword_firstname',get_lang('FirstName'),false); |
|
179 | + $form->addText('keyword_lastname', get_lang('LastName'), false); |
|
180 | + $form->addText('keyword_firstname', get_lang('FirstName'), false); |
|
181 | 181 | } |
182 | 182 | if (isset($_GET['id_session'])) |
183 | - $form->addElement('hidden','id_session',$_GET['id_session']); |
|
183 | + $form->addElement('hidden', 'id_session', $_GET['id_session']); |
|
184 | 184 | |
185 | 185 | $type = array(); |
186 | 186 | $type["all"] = get_lang('All'); |
187 | -$type["employee"] = get_lang('Teacher'); |
|
187 | +$type["employee"] = get_lang('Teacher'); |
|
188 | 188 | $type["student"] = get_lang('Student'); |
189 | 189 | |
190 | -$form->addElement('select','keyword_type',get_lang('Status'),$type); |
|
190 | +$form->addElement('select', 'keyword_type', get_lang('Status'), $type); |
|
191 | 191 | // Structure a rajouer ?? |
192 | -$form->addElement('submit','submit',get_lang('Ok')); |
|
192 | +$form->addElement('submit', 'submit', get_lang('Ok')); |
|
193 | 193 | //$defaults['keyword_active'] = 1; |
194 | 194 | //$defaults['keyword_inactive'] = 1; |
195 | 195 | //$form->setDefaults($defaults); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | //$table->set_column_filter(5, 'email_filter'); |
226 | 226 | //$table->set_column_filter(5, 'active_filter'); |
227 | 227 | $table->set_column_filter(5, 'modify_filter'); |
228 | -$table->set_form_actions(array ('add_user' => get_lang('AddLDAPUsers'))); |
|
228 | +$table->set_form_actions(array('add_user' => get_lang('AddLDAPUsers'))); |
|
229 | 229 | $table->display(); |
230 | 230 | |
231 | 231 | /* |