@@ -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')] |
@@ -505,8 +505,14 @@ |
||
505 | 505 | <p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p> |
506 | 506 | <blockquote> |
507 | 507 | <pre> |
508 | -<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) echo implode(';', $list).';'; ?></span>Courses;ClassId; |
|
509 | -<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) echo implode(';', $list_reponse).';'; ?></span>xxx1|xxx2|xxx3;1;<br /> |
|
508 | +<b>LastName</b>;<b>FirstName</b>;<b>Email</b>;UserName;Password;AuthSource;OfficialCode;PhoneNumber;Status;ExpiryDate;<span style="color:red;"><?php if (count($list) > 0) { |
|
509 | + echo implode(';', $list).';'; |
|
510 | +} |
|
511 | +?></span>Courses;ClassId; |
|
512 | +<b>xxx</b>;<b>xxx</b>;<b>xxx</b>;xxx;xxx;<?php echo implode('/', $defined_auth_sources); ?>;xxx;xxx;user/teacher/drh;0000-00-00 00:00:00;<span style="color:red;"><?php if (count($list_reponse) > 0) { |
|
513 | + echo implode(';', $list_reponse).';'; |
|
514 | +} |
|
515 | +?></span>xxx1|xxx2|xxx3;1;<br /> |
|
510 | 516 | </pre> |
511 | 517 | </blockquote> |
512 | 518 | <p><?php echo get_lang('XMLMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p> |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | // We are sure that the extra field exists. |
216 | 216 | foreach ($extra_fields as $extras) { |
217 | 217 | if (isset($user[$extras[1]])) { |
218 | - $key = $extras[1]; |
|
219 | - $value = $user[$extras[1]]; |
|
218 | + $key = $extras[1]; |
|
219 | + $value = $user[$extras[1]]; |
|
220 | 220 | UserManager::update_extra_field_value($user_id, $key, $value); |
221 | 221 | } |
222 | 222 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | global $current_tag; |
253 | 253 | switch ($data) { |
254 | 254 | case 'Contact': |
255 | - $user = array (); |
|
255 | + $user = array(); |
|
256 | 256 | break; |
257 | 257 | default: |
258 | 258 | $current_tag = $data; |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | $allowed_file_mimetype = array('csv', 'xml'); |
346 | 346 | $error_kind_file = false; |
347 | 347 | |
348 | - $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] :null; |
|
348 | + $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] : null; |
|
349 | 349 | |
350 | 350 | $uploadInfo = pathinfo($_FILES['import_file']['name']); |
351 | 351 | $ext_import_file = $uploadInfo['extension']; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | if (strcmp($file_type, 'csv') === 0 && |
355 | 355 | $ext_import_file == $allowed_file_mimetype[0] |
356 | 356 | ) { |
357 | - $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
357 | + $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
358 | 358 | $errors = validate_data($users, $checkUniqueEmail); |
359 | 359 | $error_kind_file = false; |
360 | 360 | } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) { |
@@ -227,7 +227,7 @@ |
||
227 | 227 | /** |
228 | 228 | * Read the CSV-file |
229 | 229 | * @param string $file Path to the CSV-file |
230 | - * @return array All userinformation read from the file |
|
230 | + * @return Ddeboer\DataImport\Reader\CsvReader All userinformation read from the file |
|
231 | 231 | */ |
232 | 232 | function parse_csv_data($file) |
233 | 233 | { |
@@ -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 } |
@@ -244,8 +244,7 @@ |
||
244 | 244 | </button> |
245 | 245 | </div> |
246 | 246 | <?php |
247 | - } |
|
248 | - else |
|
247 | + } else |
|
249 | 248 | { |
250 | 249 | ?> |
251 | 250 | <div class="separate-action"> |
@@ -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 | /* |
@@ -51,8 +51,7 @@ discard block |
||
51 | 51 | if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id'])) |
52 | 52 | { |
53 | 53 | Display :: display_normal_message(get_lang('UserDeleted')); |
54 | - } |
|
55 | - else |
|
54 | + } else |
|
56 | 55 | { |
57 | 56 | Display :: display_error_message(get_lang('CannotDeleteUser')); |
58 | 57 | } |
@@ -88,8 +87,7 @@ discard block |
||
88 | 87 | { |
89 | 88 | $message .= '- '.$login.'<br />'; |
90 | 89 | } |
91 | - } |
|
92 | - else |
|
90 | + } else |
|
93 | 91 | { |
94 | 92 | $message=get_lang('NoUserAdded'); |
95 | 93 | } |
@@ -100,13 +98,11 @@ discard block |
||
100 | 98 | Display :: display_header($tool_name); |
101 | 99 | } |
102 | 100 | Security::clear_token(); |
103 | - } |
|
104 | - else |
|
101 | + } else |
|
105 | 102 | { |
106 | 103 | Display::display_header($tool_name); |
107 | 104 | } |
108 | -} |
|
109 | -else |
|
105 | +} else |
|
110 | 106 | { |
111 | 107 | Display::display_header($tool_name); |
112 | 108 | } |
@@ -133,8 +129,7 @@ discard block |
||
133 | 129 | if($number_of_selected_users == $number_of_deleted_users) |
134 | 130 | { |
135 | 131 | Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
136 | - } |
|
137 | - else |
|
132 | + } else |
|
138 | 133 | { |
139 | 134 | Display :: display_error_message(get_lang('SomeUsersNotDeleted')); |
140 | 135 | } |
@@ -150,13 +145,13 @@ discard block |
||
150 | 145 | $UserList[] = ldap_add_user($user_id); |
151 | 146 | } |
152 | 147 | } |
153 | - if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
154 | - addUserToSession($UserList, $_GET['id_session']); |
|
148 | + if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) { |
|
149 | + addUserToSession($UserList, $_GET['id_session']); |
|
150 | + } |
|
155 | 151 | if(count($UserList)>0) |
156 | 152 | { |
157 | 153 | Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
158 | - } |
|
159 | - else |
|
154 | + } else |
|
160 | 155 | { |
161 | 156 | Display :: display_normal_message(get_lang('NoUserAdded')); |
162 | 157 | } |
@@ -173,14 +168,14 @@ discard block |
||
173 | 168 | { |
174 | 169 | $form->addText('keyword_firstname', get_lang('FirstName'), false); |
175 | 170 | $form->addText('keyword_lastname', get_lang('LastName'), false); |
176 | -} |
|
177 | -else |
|
171 | +} else |
|
178 | 172 | { |
179 | 173 | $form->addText('keyword_lastname',get_lang('LastName'),false); |
180 | 174 | $form->addText('keyword_firstname',get_lang('FirstName'),false); |
181 | 175 | } |
182 | -if (isset($_GET['id_session'])) |
|
176 | +if (isset($_GET['id_session'])) { |
|
183 | 177 | $form->addElement('hidden','id_session',$_GET['id_session']); |
178 | +} |
|
184 | 179 | |
185 | 180 | $type = array(); |
186 | 181 | $type["all"] = get_lang('All'); |
@@ -201,8 +196,9 @@ discard block |
||
201 | 196 | $parameters['keyword_firstname'] = @$_GET['keyword_firstname'] ?: null; |
202 | 197 | $parameters['keyword_lastname'] = @$_GET['keyword_lastname'] ?: null; |
203 | 198 | $parameters['keyword_email'] = @$_GET['keyword_email'] ?: null; |
204 | -if (isset($_GET['id_session'])) |
|
199 | +if (isset($_GET['id_session'])) { |
|
205 | 200 | $parameters['id_session'] = $_GET['id_session']; |
201 | +} |
|
206 | 202 | // Create a sortable table with user-data |
207 | 203 | |
208 | 204 | $parameters['sec_token'] = Security::get_token(); |
@@ -214,8 +210,7 @@ discard block |
||
214 | 210 | { |
215 | 211 | $table->set_header(2, get_lang('FirstName')); |
216 | 212 | $table->set_header(3, get_lang('LastName')); |
217 | -} |
|
218 | -else |
|
213 | +} else |
|
219 | 214 | { |
220 | 215 | $table->set_header(2, get_lang('LastName')); |
221 | 216 | $table->set_header(3, get_lang('FirstName')); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | // Login as ... |
21 | 21 | if ($action == "login_as" && !empty ($login_as_user_id)) |
22 | 22 | { |
23 | - login_user($login_as_user_id); |
|
23 | + login_user($login_as_user_id); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | //if we already have a session id and a user... |
@@ -37,150 +37,150 @@ discard block |
||
37 | 37 | |
38 | 38 | if (isset ($_GET['action'])) |
39 | 39 | { |
40 | - $check = Security::check_token('get'); |
|
41 | - if($check) |
|
42 | - { |
|
43 | - switch ($_GET['action']) |
|
44 | - { |
|
45 | - case 'show_message' : |
|
46 | - Display :: display_header($tool_name); |
|
47 | - Display :: display_normal_message($_GET['message']); |
|
48 | - break; |
|
49 | - case 'delete_user' : |
|
50 | - Display :: display_header($tool_name); |
|
51 | - if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id'])) |
|
52 | - { |
|
53 | - Display :: display_normal_message(get_lang('UserDeleted')); |
|
54 | - } |
|
55 | - else |
|
56 | - { |
|
57 | - Display :: display_error_message(get_lang('CannotDeleteUser')); |
|
58 | - } |
|
59 | - break; |
|
60 | - case 'lock' : |
|
61 | - Display :: display_header($tool_name); |
|
62 | - $message=lock_unlock_user('lock',$_GET['user_id']); |
|
63 | - Display :: display_normal_message($message); |
|
64 | - break; |
|
65 | - case 'unlock'; |
|
66 | - Display :: display_header($tool_name); |
|
67 | - $message=lock_unlock_user('unlock',$_GET['user_id']); |
|
68 | - Display :: display_normal_message($message); |
|
69 | - break; |
|
70 | - case 'add_user'; |
|
71 | - $id=$_GET['id']; |
|
72 | - $UserList=array(); |
|
73 | - $userid_match_login = array(); |
|
74 | - foreach ($id as $user_id) { |
|
75 | - $tmp = ldap_add_user($user_id); |
|
76 | - $UserList[]= $tmp; |
|
77 | - $userid_match_login[$tmp] = $user_id; |
|
78 | - } |
|
79 | - if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) { |
|
80 | - ldap_add_user_to_session($UserList, $_GET['id_session']); |
|
81 | - header('Location: resume_session.php?id_session='.$_GET['id_session']); |
|
82 | - } else { |
|
83 | - Display :: display_header($tool_name); |
|
84 | - if(count($userid_match_login)>0) |
|
85 | - { |
|
86 | - $message=get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | - foreach($userid_match_login as $user_id => $login) |
|
88 | - { |
|
89 | - $message .= '- '.$login.'<br />'; |
|
90 | - } |
|
91 | - } |
|
92 | - else |
|
93 | - { |
|
94 | - $message=get_lang('NoUserAdded'); |
|
95 | - } |
|
96 | - Display :: display_normal_message($message,false); |
|
97 | - } |
|
98 | - break; |
|
99 | - default : |
|
100 | - Display :: display_header($tool_name); |
|
101 | - } |
|
102 | - Security::clear_token(); |
|
103 | - } |
|
104 | - else |
|
105 | - { |
|
106 | - Display::display_header($tool_name); |
|
107 | - } |
|
40 | + $check = Security::check_token('get'); |
|
41 | + if($check) |
|
42 | + { |
|
43 | + switch ($_GET['action']) |
|
44 | + { |
|
45 | + case 'show_message' : |
|
46 | + Display :: display_header($tool_name); |
|
47 | + Display :: display_normal_message($_GET['message']); |
|
48 | + break; |
|
49 | + case 'delete_user' : |
|
50 | + Display :: display_header($tool_name); |
|
51 | + if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id'])) |
|
52 | + { |
|
53 | + Display :: display_normal_message(get_lang('UserDeleted')); |
|
54 | + } |
|
55 | + else |
|
56 | + { |
|
57 | + Display :: display_error_message(get_lang('CannotDeleteUser')); |
|
58 | + } |
|
59 | + break; |
|
60 | + case 'lock' : |
|
61 | + Display :: display_header($tool_name); |
|
62 | + $message=lock_unlock_user('lock',$_GET['user_id']); |
|
63 | + Display :: display_normal_message($message); |
|
64 | + break; |
|
65 | + case 'unlock'; |
|
66 | + Display :: display_header($tool_name); |
|
67 | + $message=lock_unlock_user('unlock',$_GET['user_id']); |
|
68 | + Display :: display_normal_message($message); |
|
69 | + break; |
|
70 | + case 'add_user'; |
|
71 | + $id=$_GET['id']; |
|
72 | + $UserList=array(); |
|
73 | + $userid_match_login = array(); |
|
74 | + foreach ($id as $user_id) { |
|
75 | + $tmp = ldap_add_user($user_id); |
|
76 | + $UserList[]= $tmp; |
|
77 | + $userid_match_login[$tmp] = $user_id; |
|
78 | + } |
|
79 | + if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) { |
|
80 | + ldap_add_user_to_session($UserList, $_GET['id_session']); |
|
81 | + header('Location: resume_session.php?id_session='.$_GET['id_session']); |
|
82 | + } else { |
|
83 | + Display :: display_header($tool_name); |
|
84 | + if(count($userid_match_login)>0) |
|
85 | + { |
|
86 | + $message=get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | + foreach($userid_match_login as $user_id => $login) |
|
88 | + { |
|
89 | + $message .= '- '.$login.'<br />'; |
|
90 | + } |
|
91 | + } |
|
92 | + else |
|
93 | + { |
|
94 | + $message=get_lang('NoUserAdded'); |
|
95 | + } |
|
96 | + Display :: display_normal_message($message,false); |
|
97 | + } |
|
98 | + break; |
|
99 | + default : |
|
100 | + Display :: display_header($tool_name); |
|
101 | + } |
|
102 | + Security::clear_token(); |
|
103 | + } |
|
104 | + else |
|
105 | + { |
|
106 | + Display::display_header($tool_name); |
|
107 | + } |
|
108 | 108 | } |
109 | 109 | else |
110 | 110 | { |
111 | - Display::display_header($tool_name); |
|
111 | + Display::display_header($tool_name); |
|
112 | 112 | } |
113 | 113 | if (isset ($_POST['action'])) |
114 | 114 | { |
115 | - $check = Security::check_token('get'); |
|
116 | - if($check) |
|
117 | - { |
|
118 | - switch ($_POST['action']) |
|
119 | - { |
|
120 | - case 'delete' : |
|
121 | - $number_of_selected_users = count($_POST['id']); |
|
122 | - $number_of_deleted_users = 0; |
|
123 | - foreach ($_POST['id'] as $index => $user_id) |
|
124 | - { |
|
125 | - if($user_id != $_user['user_id']) |
|
126 | - { |
|
127 | - if(UserManager :: delete_user($user_id)) |
|
128 | - { |
|
129 | - $number_of_deleted_users++; |
|
130 | - } |
|
131 | - } |
|
132 | - } |
|
133 | - if($number_of_selected_users == $number_of_deleted_users) |
|
134 | - { |
|
135 | - Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
|
136 | - } |
|
137 | - else |
|
138 | - { |
|
139 | - Display :: display_error_message(get_lang('SomeUsersNotDeleted')); |
|
140 | - } |
|
141 | - break; |
|
142 | - case 'add_user' : |
|
143 | - $number_of_selected_users = count($_POST['id']); |
|
144 | - $number_of_added_users = 0; |
|
145 | - $UserList=array(); |
|
146 | - foreach ($_POST['id'] as $index => $user_id) |
|
147 | - { |
|
148 | - if($user_id != $_user['user_id']) |
|
149 | - { |
|
150 | - $UserList[] = ldap_add_user($user_id); |
|
151 | - } |
|
152 | - } |
|
153 | - if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
154 | - addUserToSession($UserList, $_GET['id_session']); |
|
155 | - if(count($UserList)>0) |
|
156 | - { |
|
157 | - Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
|
158 | - } |
|
159 | - else |
|
160 | - { |
|
161 | - Display :: display_normal_message(get_lang('NoUserAdded')); |
|
162 | - } |
|
163 | - break; |
|
115 | + $check = Security::check_token('get'); |
|
116 | + if($check) |
|
117 | + { |
|
118 | + switch ($_POST['action']) |
|
119 | + { |
|
120 | + case 'delete' : |
|
121 | + $number_of_selected_users = count($_POST['id']); |
|
122 | + $number_of_deleted_users = 0; |
|
123 | + foreach ($_POST['id'] as $index => $user_id) |
|
124 | + { |
|
125 | + if($user_id != $_user['user_id']) |
|
126 | + { |
|
127 | + if(UserManager :: delete_user($user_id)) |
|
128 | + { |
|
129 | + $number_of_deleted_users++; |
|
130 | + } |
|
131 | + } |
|
132 | + } |
|
133 | + if($number_of_selected_users == $number_of_deleted_users) |
|
134 | + { |
|
135 | + Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
|
136 | + } |
|
137 | + else |
|
138 | + { |
|
139 | + Display :: display_error_message(get_lang('SomeUsersNotDeleted')); |
|
140 | + } |
|
141 | + break; |
|
142 | + case 'add_user' : |
|
143 | + $number_of_selected_users = count($_POST['id']); |
|
144 | + $number_of_added_users = 0; |
|
145 | + $UserList=array(); |
|
146 | + foreach ($_POST['id'] as $index => $user_id) |
|
147 | + { |
|
148 | + if($user_id != $_user['user_id']) |
|
149 | + { |
|
150 | + $UserList[] = ldap_add_user($user_id); |
|
151 | + } |
|
152 | + } |
|
153 | + if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
154 | + addUserToSession($UserList, $_GET['id_session']); |
|
155 | + if(count($UserList)>0) |
|
156 | + { |
|
157 | + Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
|
158 | + } |
|
159 | + else |
|
160 | + { |
|
161 | + Display :: display_normal_message(get_lang('NoUserAdded')); |
|
162 | + } |
|
163 | + break; |
|
164 | 164 | |
165 | - } |
|
166 | - Security::clear_token(); |
|
167 | - } |
|
165 | + } |
|
166 | + Security::clear_token(); |
|
167 | + } |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | $form = new FormValidator('advanced_search','get'); |
171 | 171 | $form->addText('keyword_username',get_lang('LoginName'),false); |
172 | 172 | if (api_is_western_name_order()) |
173 | 173 | { |
174 | - $form->addText('keyword_firstname', get_lang('FirstName'), false); |
|
175 | - $form->addText('keyword_lastname', get_lang('LastName'), false); |
|
174 | + $form->addText('keyword_firstname', get_lang('FirstName'), false); |
|
175 | + $form->addText('keyword_lastname', get_lang('LastName'), false); |
|
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'); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $parameters['keyword_lastname'] = @$_GET['keyword_lastname'] ?: null; |
203 | 203 | $parameters['keyword_email'] = @$_GET['keyword_email'] ?: null; |
204 | 204 | if (isset($_GET['id_session'])) |
205 | - $parameters['id_session'] = $_GET['id_session']; |
|
205 | + $parameters['id_session'] = $_GET['id_session']; |
|
206 | 206 | // Create a sortable table with user-data |
207 | 207 | |
208 | 208 | $parameters['sec_token'] = Security::get_token(); |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | $table->set_header(1, get_lang('LoginName')); |
213 | 213 | if (api_is_western_name_order()) |
214 | 214 | { |
215 | - $table->set_header(2, get_lang('FirstName')); |
|
216 | - $table->set_header(3, get_lang('LastName')); |
|
215 | + $table->set_header(2, get_lang('FirstName')); |
|
216 | + $table->set_header(3, get_lang('LastName')); |
|
217 | 217 | } |
218 | 218 | else |
219 | 219 | { |
220 | - $table->set_header(2, get_lang('LastName')); |
|
221 | - $table->set_header(3, get_lang('FirstName')); |
|
220 | + $table->set_header(2, get_lang('LastName')); |
|
221 | + $table->set_header(3, get_lang('FirstName')); |
|
222 | 222 | } |
223 | 223 | $table->set_header(4, get_lang('Email')); |
224 | 224 | $table->set_header(5, get_lang('Actions')); |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | $output = array(); |
31 | 31 | if (!empty($_GET['fill'])) { |
32 | 32 | switch ($_GET['fill']) { |
33 | - case 'users': |
|
34 | - require api_get_path(SYS_TEST_PATH).'datafiller/fill_users.php'; |
|
33 | + case 'users': |
|
34 | + require api_get_path(SYS_TEST_PATH).'datafiller/fill_users.php'; |
|
35 | 35 | $output = fill_users(); |
36 | 36 | break; |
37 | 37 | case 'courses': |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | $result .= '<table>'; |
54 | 54 | foreach ($output as $line) { |
55 | 55 | $result .= '<tr>'; |
56 | - $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>'; |
|
57 | - $result .= '</tr>'; |
|
56 | + $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>'; |
|
57 | + $result .= '</tr>'; |
|
58 | 58 | } |
59 | 59 | $result .= '</table>'; |
60 | 60 | $result .= '</div>'; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $nameTools = get_lang('PlatformAdmin'); |
23 | 23 | |
24 | 24 | // setting breadcrumbs |
25 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => $nameTools); |
|
25 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => $nameTools); |
|
26 | 26 | |
27 | 27 | // setting the name of the tool |
28 | 28 | $nameTools = get_lang('DataFiller'); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | Display::display_header($nameTools); |
48 | 48 | |
49 | 49 | $result = ''; |
50 | -if (count($output)>0) { |
|
50 | +if (count($output) > 0) { |
|
51 | 51 | $result = '<div class="filler-report">'."\n"; |
52 | 52 | $result .= '<h3>'.$output[0]['title'].'</h3>'."\n"; |
53 | 53 | $result .= '<table>'; |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | } |
59 | 59 | $result .= '</table>'; |
60 | 60 | $result .= '</div>'; |
61 | - Display::display_normal_message($result,false); |
|
61 | + Display::display_normal_message($result, false); |
|
62 | 62 | } |
63 | 63 | ?> |
64 | 64 | <div id="datafiller" class="actions"> |
65 | - <h4><?php echo Display::return_icon('bug.png',get_lang('DataFiller'),null,ICON_SIZE_MEDIUM).' '.get_lang('DataFiller')?></h4> |
|
66 | - <div class="description"><?php echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls');?></div> |
|
65 | + <h4><?php echo Display::return_icon('bug.png', get_lang('DataFiller'), null, ICON_SIZE_MEDIUM).' '.get_lang('DataFiller')?></h4> |
|
66 | + <div class="description"><?php echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls'); ?></div> |
|
67 | 67 | <ul class="fillers"> |
68 | - <li><a href="filler.php?fill=users"><?php echo Display::return_icon('user.png',get_lang('FillUsers'),null,ICON_SIZE_SMALL).' '.get_lang('FillUsers');?></a></li> |
|
69 | - <li><a href="filler.php?fill=courses"><?php echo Display::return_icon('new-course.png',get_lang('FillCourses'),null,ICON_SIZE_SMALL).' '.get_lang('FillCourses');?></a></li> |
|
68 | + <li><a href="filler.php?fill=users"><?php echo Display::return_icon('user.png', get_lang('FillUsers'), null, ICON_SIZE_SMALL).' '.get_lang('FillUsers'); ?></a></li> |
|
69 | + <li><a href="filler.php?fill=courses"><?php echo Display::return_icon('new-course.png', get_lang('FillCourses'), null, ICON_SIZE_SMALL).' '.get_lang('FillCourses'); ?></a></li> |
|
70 | 70 | </ul> |
71 | 71 | </div> |
72 | 72 | <?php |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | if ($add_type == 'multiple') { |
127 | - $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
128 | - $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
|
127 | + $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
128 | + $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
|
129 | 129 | } else { |
130 | - $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
|
131 | - $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
130 | + $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
|
131 | + $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | $url_list = UrlManager::get_url_data(); |
@@ -192,34 +192,34 @@ discard block |
||
192 | 192 | <?php } else { ?> |
193 | 193 | <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;"> |
194 | 194 | <?php |
195 | - foreach ($noUserGroupList as $noItem) { |
|
196 | - ?> |
|
195 | + foreach ($noUserGroupList as $noItem) { |
|
196 | + ?> |
|
197 | 197 | <option value="<?php echo $noItem['id']; ?>"> |
198 | 198 | <?php echo $noItem['name']; ?> |
199 | 199 | </option> |
200 | 200 | <?php |
201 | - } |
|
202 | - ?> |
|
201 | + } |
|
202 | + ?> |
|
203 | 203 | </select> |
204 | 204 | <?php |
205 | - } |
|
206 | - ?> |
|
205 | + } |
|
206 | + ?> |
|
207 | 207 | </div> |
208 | 208 | </td> |
209 | 209 | <td width="10%" valign="middle" align="center"> |
210 | 210 | <?php |
211 | - if ($ajax_search) { |
|
212 | - ?> |
|
211 | + if ($ajax_search) { |
|
212 | + ?> |
|
213 | 213 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" ></button> |
214 | 214 | <?php |
215 | - } else { |
|
216 | - ?> |
|
215 | + } else { |
|
216 | + ?> |
|
217 | 217 | <button class="arrowr" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" ></button> |
218 | 218 | <br /><br /> |
219 | 219 | <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" ></button> |
220 | 220 | <?php |
221 | - } |
|
222 | - ?> |
|
221 | + } |
|
222 | + ?> |
|
223 | 223 | <br /><br /><br /><br /><br /><br /> |
224 | 224 | </td> |
225 | 225 | <td align="center"> |
@@ -240,11 +240,11 @@ discard block |
||
240 | 240 | <td colspan="3" align="center"> |
241 | 241 | <br /> |
242 | 242 | <?php |
243 | - if(isset($_GET['add'])) |
|
244 | - echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>'; |
|
245 | - else |
|
246 | - echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>'; |
|
247 | - ?> |
|
243 | + if(isset($_GET['add'])) |
|
244 | + echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>'; |
|
245 | + else |
|
246 | + echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>'; |
|
247 | + ?> |
|
248 | 248 | </td> |
249 | 249 | </tr> |
250 | 250 | </table> |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | // Setting breadcrumbs |
26 | 26 | $tool_name = get_lang('EditUserGroupToURL'); |
27 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
28 | -$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
|
27 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
28 | +$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
|
29 | 29 | |
30 | 30 | $add_type = 'multiple'; |
31 | 31 | if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
@@ -72,10 +72,10 @@ discard block |
||
72 | 72 | } |
73 | 73 | </script>'; |
74 | 74 | |
75 | -$form_sent=0; |
|
76 | -$errorMsg=''; |
|
77 | -$UserList=$SessionList = array(); |
|
78 | -$users=$sessions = array(); |
|
75 | +$form_sent = 0; |
|
76 | +$errorMsg = ''; |
|
77 | +$UserList = $SessionList = array(); |
|
78 | +$users = $sessions = array(); |
|
79 | 79 | |
80 | 80 | if (isset($_POST['form_sent']) && $_POST['form_sent']) { |
81 | 81 | $form_sent = $_POST['form_sent']; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | foreach ($userGroups as $item) { |
119 | 119 | if ($item['access_url_id'] == $access_url_id) { |
120 | - $userGroupList[$item['id']] = $item ; |
|
120 | + $userGroupList[$item['id']] = $item; |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | $noUserGroupList = getCourseCategoryNotInList(array_keys($userGroupList)); |
@@ -153,11 +153,11 @@ discard block |
||
153 | 153 | if (!empty($access_url_id)) { |
154 | 154 | if ($url_obj[0] == $access_url_id) { |
155 | 155 | $checked = 'selected=true'; |
156 | - $url_selected=$url_obj[1]; |
|
156 | + $url_selected = $url_obj[1]; |
|
157 | 157 | } |
158 | 158 | } |
159 | - if ($url_obj['active']==1) { ?> |
|
160 | - <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?> |
|
159 | + if ($url_obj['active'] == 1) { ?> |
|
160 | + <option <?php echo $checked; ?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?> |
|
161 | 161 | </option> |
162 | 162 | <?php |
163 | 163 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | <td align="center"><b><?php echo get_lang('CourseCategoryInPlatform') ?> :</b> |
181 | 181 | </td> |
182 | 182 | <td></td> |
183 | - <td align="center"><b><?php printf(get_lang('CourseCategoryListInX'),$url_selected); ?></b></td> |
|
183 | + <td align="center"><b><?php printf(get_lang('CourseCategoryListInX'), $url_selected); ?></b></td> |
|
184 | 184 | </tr> |
185 | 185 | |
186 | 186 | <tr> |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | <td align="center"> |
226 | 226 | <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;"> |
227 | 227 | <?php |
228 | -foreach($userGroupList as $item) { |
|
228 | +foreach ($userGroupList as $item) { |
|
229 | 229 | ?> |
230 | 230 | <option value="<?php echo $item['id']; ?>"> |
231 | 231 | <?php echo $item['name']; ?> |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | <td colspan="3" align="center"> |
241 | 241 | <br /> |
242 | 242 | <?php |
243 | - if(isset($_GET['add'])) |
|
243 | + if (isset($_GET['add'])) |
|
244 | 244 | echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>'; |
245 | 245 | else |
246 | 246 | echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>'; |
@@ -240,10 +240,11 @@ |
||
240 | 240 | <td colspan="3" align="center"> |
241 | 241 | <br /> |
242 | 242 | <?php |
243 | - if(isset($_GET['add'])) |
|
244 | - echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>'; |
|
245 | - else |
|
246 | - echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>'; |
|
243 | + if(isset($_GET['add'])) { |
|
244 | + echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>'; |
|
245 | + } else { |
|
246 | + echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>'; |
|
247 | + } |
|
247 | 248 | ?> |
248 | 249 | </td> |
249 | 250 | </tr> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | // Setting the section (for the tabs). |
16 | 16 | $this_section = SECTION_PLATFORM_ADMIN; |
17 | -$_SESSION['this_section']=$this_section; |
|
17 | +$_SESSION['this_section'] = $this_section; |
|
18 | 18 | |
19 | 19 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
20 | 20 | $action_todo = false; |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | if (!empty($action)) { |
38 | - $interbreadcrumb[] = array ("url" => "system_announcements.php", "name" => get_lang('SystemAnnouncements')); |
|
38 | + $interbreadcrumb[] = array("url" => "system_announcements.php", "name" => get_lang('SystemAnnouncements')); |
|
39 | 39 | if ($action == 'add') { |
40 | - $interbreadcrumb[] = array ("url" => '#', "name" => get_lang('AddAnnouncement')); |
|
40 | + $interbreadcrumb[] = array("url" => '#', "name" => get_lang('AddAnnouncement')); |
|
41 | 41 | } |
42 | 42 | if ($action == 'edit') { |
43 | - $interbreadcrumb[] = array ("url" => '#', "name" => get_lang('Edit')); |
|
43 | + $interbreadcrumb[] = array("url" => '#', "name" => get_lang('Edit')); |
|
44 | 44 | } |
45 | 45 | } else { |
46 | 46 | $tool_name = get_lang('SystemAnnouncements'); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | // Actions |
69 | -switch($action) { |
|
69 | +switch ($action) { |
|
70 | 70 | case 'make_visible': |
71 | 71 | case 'make_invisible': |
72 | 72 | $status = false; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | Display :: display_confirmation_message(get_lang('AnnouncementDeleted')); |
82 | 82 | break; |
83 | 83 | case 'delete_selected': |
84 | - foreach($_POST['id'] as $index => $id) { |
|
84 | + foreach ($_POST['id'] as $index => $id) { |
|
85 | 85 | SystemAnnouncementManager :: delete_announcement($id); |
86 | 86 | } |
87 | 87 | Display :: display_confirmation_message(get_lang('AnnouncementDeleted')); |
@@ -137,11 +137,11 @@ discard block |
||
137 | 137 | $language_list = api_get_languages(); |
138 | 138 | $language_list_with_keys = array(); |
139 | 139 | $language_list_with_keys['all'] = get_lang('All'); |
140 | - for ($i=0; $i<count($language_list['name']) ; $i++) { |
|
140 | + for ($i = 0; $i < count($language_list['name']); $i++) { |
|
141 | 141 | $language_list_with_keys[$language_list['folder'][$i]] = $language_list['name'][$i]; |
142 | 142 | } |
143 | 143 | |
144 | - $form->addElement('select', 'lang',get_lang('Language'), $language_list_with_keys); |
|
144 | + $form->addElement('select', 'lang', get_lang('Language'), $language_list_with_keys); |
|
145 | 145 | $form->addHtmlEditor( |
146 | 146 | 'content', |
147 | 147 | get_lang('Content'), |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | |
158 | 158 | $group = array(); |
159 | 159 | |
160 | - $group[]= $form->createElement('checkbox', 'visible_teacher', null, get_lang('Teacher')); |
|
161 | - $group[]= $form->createElement('checkbox', 'visible_student', null, get_lang('Student')); |
|
162 | - $group[]= $form->createElement('checkbox', 'visible_guest', null, get_lang('Guest')); |
|
160 | + $group[] = $form->createElement('checkbox', 'visible_teacher', null, get_lang('Teacher')); |
|
161 | + $group[] = $form->createElement('checkbox', 'visible_student', null, get_lang('Student')); |
|
162 | + $group[] = $form->createElement('checkbox', 'visible_guest', null, get_lang('Guest')); |
|
163 | 163 | |
164 | 164 | $form->addGroup($group, null, get_lang('Visible'), ''); |
165 | 165 | |
@@ -182,15 +182,15 @@ discard block |
||
182 | 182 | |
183 | 183 | $form->addElement('checkbox', 'send_mail', null, get_lang('SendMail')); |
184 | 184 | |
185 | - if (isset($_REQUEST['action']) && $_REQUEST['action']=='add') { |
|
185 | + if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') { |
|
186 | 186 | $form->addElement('checkbox', 'add_to_calendar', null, get_lang('AddToCalendar')); |
187 | - $text=get_lang('AddNews'); |
|
188 | - $class='add'; |
|
187 | + $text = get_lang('AddNews'); |
|
188 | + $class = 'add'; |
|
189 | 189 | $form->addElement('hidden', 'action', 'add'); |
190 | 190 | |
191 | 191 | } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') { |
192 | - $text=get_lang('EditNews'); |
|
193 | - $class='save'; |
|
192 | + $text = get_lang('EditNews'); |
|
193 | + $class = 'save'; |
|
194 | 194 | $form->addElement('hidden', 'action', 'edit'); |
195 | 195 | } |
196 | 196 | $form->addElement('checkbox', 'send_email_test', null, get_lang('SendOnlyAnEmailToMySelfToTest')); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | if ($show_announcement_list) { |
282 | 282 | $announcements = SystemAnnouncementManager :: get_all_announcements(); |
283 | - $announcement_data = array (); |
|
283 | + $announcement_data = array(); |
|
284 | 284 | foreach ($announcements as $index => $announcement) { |
285 | 285 | $row = array(); |
286 | 286 | $row[] = $announcement->id; |
@@ -288,9 +288,9 @@ discard block |
||
288 | 288 | $row[] = $announcement->title; |
289 | 289 | $row[] = api_convert_and_format_date($announcement->date_start); |
290 | 290 | $row[] = api_convert_and_format_date($announcement->date_end); |
291 | - $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_TEACHER."&action=". ($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
292 | - $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_STUDENT."&action=". ($announcement->visible_student ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
293 | - $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_GUEST."&action=". ($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
291 | + $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_TEACHER."&action=".($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
292 | + $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_STUDENT."&action=".($announcement->visible_student ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
293 | + $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_GUEST."&action=".($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>"; |
|
294 | 294 | |
295 | 295 | $row[] = $announcement->lang; |
296 | 296 | $row[] = "<a href=\"?action=edit&id=".$announcement->id."\">".Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)."</a> <a href=\"?action=delete&id=".$announcement->id."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."')) return false;\">".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL)."</a>"; |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | $table->set_column_filter(3, 'edit_filter'); |
44 | 44 | |
45 | 45 | function edit_filter($id,$url_params,$row) { |
46 | - global $charset; |
|
47 | - $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>'; |
|
48 | - $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>'; |
|
49 | - return $return; |
|
46 | + global $charset; |
|
47 | + $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>'; |
|
48 | + $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>'; |
|
49 | + return $return; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if ($_REQUEST['action'] == 'delete') { |
53 | - delete_specific_field($_REQUEST['field_id']); |
|
54 | - header('Location: specific_fields.php?message='.get_lang('FieldRemoved')); |
|
53 | + delete_specific_field($_REQUEST['field_id']); |
|
54 | + header('Location: specific_fields.php?message='.get_lang('FieldRemoved')); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | // Start output |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | echo Display::display_normal_message(get_lang('SpecificSearchFieldsIntro')); |
62 | 62 | |
63 | 63 | if(!empty($_GET['message'])) { |
64 | - Display::display_confirmation_message($_GET['message']); |
|
64 | + Display::display_confirmation_message($_GET['message']); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | echo '<div class="actions">'; |
@@ -15,36 +15,36 @@ discard block |
||
15 | 15 | api_protect_admin_script(); |
16 | 16 | |
17 | 17 | // Breadcrumb |
18 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
19 | -$interbreadcrumb[] = array ('url' => 'settings.php?category=Search', 'name' => get_lang('PlatformConfigSettings')); |
|
18 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
19 | +$interbreadcrumb[] = array('url' => 'settings.php?category=Search', 'name' => get_lang('PlatformConfigSettings')); |
|
20 | 20 | |
21 | 21 | $libpath = api_get_path(LIBRARY_PATH); |
22 | 22 | |
23 | 23 | include_once $libpath.'specific_fields_manager.lib.php'; |
24 | 24 | |
25 | 25 | // Create an add-field box |
26 | -$form = new FormValidator('add_field','post','','',null,false); |
|
27 | -$renderer =& $form->defaultRenderer(); |
|
26 | +$form = new FormValidator('add_field', 'post', '', '', null, false); |
|
27 | +$renderer = & $form->defaultRenderer(); |
|
28 | 28 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
29 | -$form->addElement('static','search_advanced_link',null,'<a href="specific_fields_add.php">'.Display::return_icon('fieldadd.gif').get_lang('AddSpecificSearchField').'</a>'); |
|
29 | +$form->addElement('static', 'search_advanced_link', null, '<a href="specific_fields_add.php">'.Display::return_icon('fieldadd.gif').get_lang('AddSpecificSearchField').'</a>'); |
|
30 | 30 | |
31 | 31 | // Create a sortable table with specific fields data |
32 | -$column_show = array(1,1,1); |
|
33 | -$column_order = array(3,2,1); |
|
32 | +$column_show = array(1, 1, 1); |
|
33 | +$column_order = array(3, 2, 1); |
|
34 | 34 | $extra_fields = get_specific_field_list(); |
35 | 35 | $number_of_extra_fields = count($extra_fields); |
36 | 36 | |
37 | -$table = new SortableTableFromArrayConfig($extra_fields,2,50,'',$column_show,$column_order); |
|
38 | -$table->set_header(0, ' ', false,null,'width="2%"', 'style="display:none"'); |
|
37 | +$table = new SortableTableFromArrayConfig($extra_fields, 2, 50, '', $column_show, $column_order); |
|
38 | +$table->set_header(0, ' ', false, null, 'width="2%"', 'style="display:none"'); |
|
39 | 39 | $table->set_header(1, get_lang('Code'), TRUE, 'width="10%"'); |
40 | 40 | $table->set_header(2, get_lang('Name')); |
41 | -$table->set_header(3, get_lang('Modify'),false,'width="10%"'); |
|
41 | +$table->set_header(3, get_lang('Modify'), false, 'width="10%"'); |
|
42 | 42 | $table->set_column_filter(3, 'edit_filter'); |
43 | 43 | |
44 | -function edit_filter($id,$url_params,$row) { |
|
44 | +function edit_filter($id, $url_params, $row) { |
|
45 | 45 | global $charset; |
46 | - $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>'; |
|
47 | - $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>'; |
|
46 | + $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>'; |
|
47 | + $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>'; |
|
48 | 48 | return $return; |
49 | 49 | } |
50 | 50 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | Display::display_header(get_lang('SpecificSearchFields')); |
61 | 61 | echo Display::display_normal_message(get_lang('SpecificSearchFieldsIntro')); |
62 | 62 | |
63 | -if(!empty($_GET['message'])) { |
|
63 | +if (!empty($_GET['message'])) { |
|
64 | 64 | Display::display_confirmation_message($_GET['message']); |
65 | 65 | } |
66 | 66 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $skill_profile = new SkillProfile(); |
25 | 25 | $skill_rel_user = new SkillRelUser(); |
26 | 26 | |
27 | -$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php'; |
|
27 | +$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php'; |
|
28 | 28 | |
29 | 29 | $tpl = new Template(get_lang('Skills')); |
30 | 30 | |
@@ -55,16 +55,16 @@ discard block |
||
55 | 55 | $_SESSION['skills'] = $skills; |
56 | 56 | |
57 | 57 | } else { |
58 | - $skills = isset($_SESSION['skills']) ? $_SESSION['skills']: array(); |
|
58 | + $skills = isset($_SESSION['skills']) ? $_SESSION['skills'] : array(); |
|
59 | 59 | } |
60 | 60 | } else { |
61 | - $skills = isset($_SESSION['skills']) ? $_SESSION['skills']: array(); |
|
61 | + $skills = isset($_SESSION['skills']) ? $_SESSION['skills'] : array(); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $user_list = array(); |
65 | 65 | $count_skills = count($skills); |
66 | 66 | |
67 | -$users = $skill_rel_user->get_user_by_skills($skills); |
|
67 | +$users = $skill_rel_user->get_user_by_skills($skills); |
|
68 | 68 | |
69 | 69 | if (!empty($users)) { |
70 | 70 | foreach ($users as $user) { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $user_list[$user['user_id']]['user'] = $user_info; |
73 | 73 | $my_user_skills = $skill_rel_user->get_user_skills($user['user_id']); |
74 | 74 | $user_skills = array(); |
75 | - $found_counts = 0 ; |
|
75 | + $found_counts = 0; |
|
76 | 76 | foreach ($my_user_skills as $my_skill) { |
77 | 77 | $found = false; |
78 | 78 | if (in_array($my_skill['skill_id'], $skills)) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $user_list[$user['user_id']]['total_found_skills'] = $found_counts; |
90 | 90 | } |
91 | 91 | $ordered_user_list = array(); |
92 | - foreach($user_list as $user_id => $user_data) { |
|
92 | + foreach ($user_list as $user_id => $user_data) { |
|
93 | 93 | $ordered_user_list[$user_data['total_found_skills']][] = $user_data; |
94 | 94 | } |
95 | 95 | if (!empty($ordered_user_list)) { |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | |
104 | 104 | if (!empty($skills)) { |
105 | 105 | $counter = 0; |
106 | - foreach($skills as $hidden_skill_id) { |
|
106 | + foreach ($skills as $hidden_skill_id) { |
|
107 | 107 | $form->addElement('hidden', 'hidden_skills[]', $hidden_skill_id); |
108 | 108 | $counter++; |
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
112 | 112 | if (!empty($skills)) { |
113 | - foreach($skills as $my_skill) { |
|
113 | + foreach ($skills as $my_skill) { |
|
114 | 114 | $total_skills_to_search[$my_skill] = $my_skill; |
115 | 115 | } |
116 | 116 | } |