@@ -10,67 +10,67 @@ discard block |
||
10 | 10 | // protect a course script |
11 | 11 | api_protect_course_script(true); |
12 | 12 | if (empty($id)) { |
13 | - $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : ''; |
|
14 | - if (empty($id)) { |
|
15 | - // If the ID was not provided, find the first matching description item given the item type |
|
16 | - $course_description = new CourseDescription(); |
|
17 | - $description = $course_description->get_data_by_description_type($description_type); |
|
18 | - if (count($description) > 0) { |
|
19 | - $id = $description['id']; |
|
20 | - } |
|
21 | - // If no corresponding description is found, edit a new one |
|
22 | - unset($course_description); |
|
23 | - } |
|
13 | + $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : ''; |
|
14 | + if (empty($id)) { |
|
15 | + // If the ID was not provided, find the first matching description item given the item type |
|
16 | + $course_description = new CourseDescription(); |
|
17 | + $description = $course_description->get_data_by_description_type($description_type); |
|
18 | + if (count($description) > 0) { |
|
19 | + $id = $description['id']; |
|
20 | + } |
|
21 | + // If no corresponding description is found, edit a new one |
|
22 | + unset($course_description); |
|
23 | + } |
|
24 | 24 | } |
25 | 25 | $original_id = $id; |
26 | 26 | |
27 | 27 | if (empty($error)) { |
28 | - $token = Security::get_token(); |
|
28 | + $token = Security::get_token(); |
|
29 | 29 | } |
30 | 30 | // display categories |
31 | 31 | $categories = array(); |
32 | 32 | foreach ($default_description_titles as $id => $title) { |
33 | - $categories[$id] = $title; |
|
33 | + $categories[$id] = $title; |
|
34 | 34 | } |
35 | 35 | $categories[ADD_BLOCK] = get_lang('NewBloc'); |
36 | 36 | |
37 | 37 | $i=1; |
38 | 38 | echo '<div class="actions" style="margin-bottom:30px">'; |
39 | 39 | echo '<a href="index.php?'.api_get_cidreq().'">'. |
40 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM). |
|
41 | - '</a>'; |
|
40 | + Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM). |
|
41 | + '</a>'; |
|
42 | 42 | |
43 | 43 | ksort($categories); |
44 | 44 | foreach ($categories as $id => $title) { |
45 | - if ($i==ADD_BLOCK) { |
|
46 | - echo '<a href="index.php?'.api_get_cidreq().'&action=add">'. |
|
47 | - Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>'; |
|
48 | - break; |
|
49 | - } else { |
|
50 | - echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'. |
|
51 | - Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>'; |
|
52 | - $i++; |
|
53 | - } |
|
45 | + if ($i==ADD_BLOCK) { |
|
46 | + echo '<a href="index.php?'.api_get_cidreq().'&action=add">'. |
|
47 | + Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>'; |
|
48 | + break; |
|
49 | + } else { |
|
50 | + echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'. |
|
51 | + Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>'; |
|
52 | + $i++; |
|
53 | + } |
|
54 | 54 | } |
55 | 55 | echo '</div>'; |
56 | 56 | |
57 | 57 | // error messages |
58 | 58 | if (isset($error) && intval($error) == 1) { |
59 | - Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false); |
|
59 | + Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // default header title form |
63 | 63 | $description_type = intval($description_type); |
64 | 64 | $header = $default_description_titles[$description_type]; |
65 | 65 | if ($description_type >= ADD_BLOCK) { |
66 | - $header = $default_description_titles[ADD_BLOCK]; |
|
66 | + $header = $default_description_titles[ADD_BLOCK]; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // display form |
70 | 70 | $form = new FormValidator( |
71 | - 'course_description', |
|
72 | - 'POST', |
|
73 | - 'index.php?action=edit&id='.$original_id.'&description_type='.$description_type.'&'.api_get_cidreq() |
|
71 | + 'course_description', |
|
72 | + 'POST', |
|
73 | + 'index.php?action=edit&id='.$original_id.'&description_type='.$description_type.'&'.api_get_cidreq() |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | $form->addElement('header','',$header); |
@@ -80,15 +80,15 @@ discard block |
||
80 | 80 | $form->addText('title', get_lang('Title'), true, array('size'=>'50')); |
81 | 81 | $form->applyFilter('title','html_filter'); |
82 | 82 | $form->addHtmlEditor( |
83 | - 'contentDescription', |
|
84 | - get_lang('Content'), |
|
85 | - true, |
|
86 | - false, |
|
87 | - array( |
|
88 | - 'ToolbarSet' => 'TrainingDescription', |
|
89 | - 'Width' => '100%', |
|
90 | - 'Height' => '200', |
|
91 | - ) |
|
83 | + 'contentDescription', |
|
84 | + get_lang('Content'), |
|
85 | + true, |
|
86 | + false, |
|
87 | + array( |
|
88 | + 'ToolbarSet' => 'TrainingDescription', |
|
89 | + 'Width' => '100%', |
|
90 | + 'Height' => '200', |
|
91 | + ) |
|
92 | 92 | ); |
93 | 93 | $form->addButtonCreate(get_lang('Save')); |
94 | 94 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | $form->setDefaults($default); |
105 | 105 | |
106 | 106 | if (isset ($question[$description_type])) { |
107 | - $message = '<strong>'.get_lang('QuestionPlan').'</strong><br />'; |
|
108 | - $message .= $question[$description_type]; |
|
109 | - Display::display_normal_message($message, false); |
|
107 | + $message = '<strong>'.get_lang('QuestionPlan').'</strong><br />'; |
|
108 | + $message .= $question[$description_type]; |
|
109 | + Display::display_normal_message($message, false); |
|
110 | 110 | } |
111 | 111 | $form->display(); |
@@ -34,21 +34,21 @@ discard block |
||
34 | 34 | } |
35 | 35 | $categories[ADD_BLOCK] = get_lang('NewBloc'); |
36 | 36 | |
37 | -$i=1; |
|
37 | +$i = 1; |
|
38 | 38 | echo '<div class="actions" style="margin-bottom:30px">'; |
39 | 39 | echo '<a href="index.php?'.api_get_cidreq().'">'. |
40 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM). |
|
40 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ToolCourseDescription'), '', ICON_SIZE_MEDIUM). |
|
41 | 41 | '</a>'; |
42 | 42 | |
43 | 43 | ksort($categories); |
44 | 44 | foreach ($categories as $id => $title) { |
45 | - if ($i==ADD_BLOCK) { |
|
45 | + if ($i == ADD_BLOCK) { |
|
46 | 46 | echo '<a href="index.php?'.api_get_cidreq().'&action=add">'. |
47 | - Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>'; |
|
47 | + Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>'; |
|
48 | 48 | break; |
49 | 49 | } else { |
50 | 50 | echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'. |
51 | - Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>'; |
|
51 | + Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>'; |
|
52 | 52 | $i++; |
53 | 53 | } |
54 | 54 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | // error messages |
58 | 58 | if (isset($error) && intval($error) == 1) { |
59 | - Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false); |
|
59 | + Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // default header title form |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | if (isset($_GET['id_session'])) { |
157 | 157 | $session_id = intval($_GET['id_session']); |
158 | 158 | } |
159 | - $course_description_data = $course_description->get_data_by_id( |
|
159 | + $course_description_data = $course_description->get_data_by_id( |
|
160 | 160 | $id, |
161 | 161 | null, |
162 | 162 | $session_id |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $data['description_title'] = $course_description_data['description_title']; |
166 | 166 | $data['description_content'] = $course_description_data['description_content']; |
167 | 167 | $data['progress'] = $course_description_data['progress']; |
168 | - $data['descriptions'] = $course_description->get_data_by_description_type( |
|
168 | + $data['descriptions'] = $course_description->get_data_by_description_type( |
|
169 | 169 | $description_type, |
170 | 170 | null, |
171 | 171 | $session_id |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | $session_category = ''; |
61 | 61 | |
62 | 62 | if (Database::num_rows($rs)>0) { |
63 | - $rows_session_category = Database::store_result($rs); |
|
64 | - $rows_session_category = $rows_session_category[0]; |
|
65 | - $session_category = $rows_session_category['name']; |
|
63 | + $rows_session_category = Database::store_result($rs); |
|
64 | + $rows_session_category = $rows_session_category[0]; |
|
65 | + $session_category = $rows_session_category['name']; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
@@ -147,22 +147,22 @@ discard block |
||
147 | 147 | <td><?php echo get_lang('Date'); ?> :</td> |
148 | 148 | <td> |
149 | 149 | <?php |
150 | - if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) { |
|
151 | - echo get_lang('NoTimeLimits'); |
|
150 | + if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) { |
|
151 | + echo get_lang('NoTimeLimits'); |
|
152 | 152 | } |
153 | - else { |
|
153 | + else { |
|
154 | 154 | if ($session['access_start_date'] != '00-00-0000') { |
155 | - //$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits')); |
|
155 | + //$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits')); |
|
156 | 156 | $session['access_start_date'] = get_lang('From').' '.$session['access_start_date']; |
157 | 157 | } else { |
158 | - $session['access_start_date'] = ''; |
|
158 | + $session['access_start_date'] = ''; |
|
159 | 159 | } |
160 | 160 | if ($session['access_end_date'] == '00-00-0000') { |
161 | 161 | $session['access_end_date'] =''; |
162 | 162 | } else { |
163 | - $session['access_end_date'] = get_lang('Until').' '.$session['access_end_date']; |
|
163 | + $session['access_end_date'] = get_lang('Until').' '.$session['access_end_date']; |
|
164 | 164 | } |
165 | - echo $session['access_start_date'].' '.$session['access_end_date']; |
|
165 | + echo $session['access_start_date'].' '.$session['access_end_date']; |
|
166 | 166 | } |
167 | 167 | ?> |
168 | 168 | </td> |
@@ -221,22 +221,22 @@ discard block |
||
221 | 221 | </tr> |
222 | 222 | <?php |
223 | 223 | if ($session['nbr_courses'] == 0) { |
224 | - echo '<tr> |
|
224 | + echo '<tr> |
|
225 | 225 | <td colspan="4">'.get_lang('NoCoursesForThisSession').'</td> |
226 | 226 | </tr>'; |
227 | 227 | } else { |
228 | - // select the courses |
|
229 | - $sql = "SELECT c.id, code,title,visual_code, nbr_users |
|
228 | + // select the courses |
|
229 | + $sql = "SELECT c.id, code,title,visual_code, nbr_users |
|
230 | 230 | FROM $tbl_course c,$tbl_session_rel_course sc |
231 | 231 | WHERE c.id = sc.c_id |
232 | 232 | AND session_id='$id_session' |
233 | 233 | ORDER BY title"; |
234 | - $result=Database::query($sql); |
|
235 | - $courses=Database::store_result($result); |
|
236 | - foreach ($courses as $course) { |
|
237 | - //select the number of users |
|
234 | + $result=Database::query($sql); |
|
235 | + $courses=Database::store_result($result); |
|
236 | + foreach ($courses as $course) { |
|
237 | + //select the number of users |
|
238 | 238 | |
239 | - $sql = "SELECT count(*) FROM $tbl_session_rel_user sru, $tbl_session_rel_course_rel_user srcru |
|
239 | + $sql = "SELECT count(*) FROM $tbl_session_rel_user sru, $tbl_session_rel_course_rel_user srcru |
|
240 | 240 | WHERE |
241 | 241 | srcru.user_id = sru.user_id AND |
242 | 242 | srcru.session_id = sru.session_id AND |
@@ -244,49 +244,49 @@ discard block |
||
244 | 244 | sru.relation_type<>".SESSION_RELATION_TYPE_RRHH." AND |
245 | 245 | srcru.session_id = '".intval($id_session)."'"; |
246 | 246 | |
247 | - $rs = Database::query($sql); |
|
248 | - $course['nbr_users'] = Database::result($rs,0,0); |
|
247 | + $rs = Database::query($sql); |
|
248 | + $course['nbr_users'] = Database::result($rs,0,0); |
|
249 | 249 | |
250 | - // Get coachs of the courses in session |
|
250 | + // Get coachs of the courses in session |
|
251 | 251 | |
252 | - $sql = "SELECT user.lastname,user.firstname,user.username |
|
252 | + $sql = "SELECT user.lastname,user.firstname,user.username |
|
253 | 253 | FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user |
254 | 254 | WHERE |
255 | 255 | session_rcru.user_id = user.user_id AND |
256 | 256 | session_rcru.session_id = '".intval($id_session)."' AND |
257 | 257 | session_rcru.c_id ='".Database::escape_string($course['id'])."' AND |
258 | 258 | session_rcru.status=2"; |
259 | - $rs = Database::query($sql); |
|
259 | + $rs = Database::query($sql); |
|
260 | 260 | |
261 | - $coachs = array(); |
|
262 | - if (Database::num_rows($rs) > 0) { |
|
263 | - while ($info_coach = Database::fetch_array($rs)) { |
|
261 | + $coachs = array(); |
|
262 | + if (Database::num_rows($rs) > 0) { |
|
263 | + while ($info_coach = Database::fetch_array($rs)) { |
|
264 | 264 | $coachs[] = api_get_person_name( |
265 | 265 | $info_coach['firstname'], |
266 | 266 | $info_coach['lastname'] |
267 | 267 | ).' ('.$info_coach['username'].')'; |
268 | - } |
|
269 | - } else { |
|
270 | - $coach = get_lang('None'); |
|
271 | - } |
|
272 | - |
|
273 | - if (count($coachs) > 0) { |
|
274 | - $coach = implode('<br />',$coachs); |
|
275 | - } else { |
|
276 | - $coach = get_lang('None'); |
|
277 | - } |
|
278 | - |
|
279 | - $orig_param = '&origin=resume_session'; |
|
280 | - //hide_course_breadcrumb the parameter has been added to hide the |
|
268 | + } |
|
269 | + } else { |
|
270 | + $coach = get_lang('None'); |
|
271 | + } |
|
272 | + |
|
273 | + if (count($coachs) > 0) { |
|
274 | + $coach = implode('<br />',$coachs); |
|
275 | + } else { |
|
276 | + $coach = get_lang('None'); |
|
277 | + } |
|
278 | + |
|
279 | + $orig_param = '&origin=resume_session'; |
|
280 | + //hide_course_breadcrumb the parameter has been added to hide the |
|
281 | 281 | // name of the course, that appeared in the default $interbreadcrumb |
282 | - echo ' |
|
282 | + echo ' |
|
283 | 283 | <tr> |
284 | 284 | <td>'.Display::url($course['title'].' ('.$course['visual_code'].')', api_get_path(WEB_COURSE_PATH).$course['code'].'/?id_session='.$id_session),'</td> |
285 | 285 | <td>'.$coach.'</td> |
286 | 286 | <td>'.$course['nbr_users'].'</td> |
287 | 287 | |
288 | 288 | </tr>'; |
289 | - } |
|
289 | + } |
|
290 | 290 | } |
291 | 291 | ?> |
292 | 292 | </table> |
@@ -307,11 +307,11 @@ discard block |
||
307 | 307 | <?php |
308 | 308 | |
309 | 309 | if ($session['nbr_users']==0) { |
310 | - echo '<tr> |
|
310 | + echo '<tr> |
|
311 | 311 | <td colspan="2">'.get_lang('NoUsersForThisSession').'</td> |
312 | 312 | </tr>'; |
313 | 313 | } else { |
314 | - $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname'; |
|
314 | + $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname'; |
|
315 | 315 | |
316 | 316 | if ($multiple_url_is_on) { |
317 | 317 | $sql = "SELECT u.user_id, lastname, firstname, username, access_url_id |
@@ -329,11 +329,11 @@ discard block |
||
329 | 329 | AND su.session_id = ".$id_session.$order_clause; |
330 | 330 | } |
331 | 331 | |
332 | - $result = Database::query($sql); |
|
333 | - $users = Database::store_result($result); |
|
332 | + $result = Database::query($sql); |
|
333 | + $users = Database::store_result($result); |
|
334 | 334 | // change breadcrumb in destination page |
335 | - $orig_param = '&origin=resume_session&id_session='.$id_session; |
|
336 | - foreach ($users as $user) { |
|
335 | + $orig_param = '&origin=resume_session&id_session='.$id_session; |
|
336 | + foreach ($users as $user) { |
|
337 | 337 | $user_link = ''; |
338 | 338 | if (!empty($user['user_id'])) { |
339 | 339 | $user_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_information.php?user_id='.intval($user['user_id']).'">'. |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | } |
351 | 351 | } |
352 | 352 | |
353 | - echo '<tr> |
|
353 | + echo '<tr> |
|
354 | 354 | <td width="90%"> |
355 | 355 | '.$user_link.' |
356 | 356 | </td> |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | '.$link_to_add_user_in_url.' |
362 | 362 | </td> |
363 | 363 | </tr>'; |
364 | - } |
|
364 | + } |
|
365 | 365 | } |
366 | 366 | ?> |
367 | 367 | </table> |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | // setting the section (for the tabs) |
13 | 13 | $this_section = SECTION_PLATFORM_ADMIN; |
14 | -$id_session = (int)$_GET['id_session']; |
|
14 | +$id_session = (int) $_GET['id_session']; |
|
15 | 15 | SessionManager::protect_teacher_session_edit($id_session); |
16 | 16 | |
17 | 17 | $tool_name = get_lang('SessionOverview'); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $rs = Database::query($sql); |
60 | 60 | $session_category = ''; |
61 | 61 | |
62 | - if (Database::num_rows($rs)>0) { |
|
62 | + if (Database::num_rows($rs) > 0) { |
|
63 | 63 | $rows_session_category = Database::store_result($rs); |
64 | 64 | $rows_session_category = $rows_session_category[0]; |
65 | 65 | $session_category = $rows_session_category['name']; |
@@ -83,25 +83,25 @@ discard block |
||
83 | 83 | break; |
84 | 84 | case 'delete': |
85 | 85 | $idChecked = $_GET['idChecked']; |
86 | - if(is_array($idChecked)) { |
|
86 | + if (is_array($idChecked)) { |
|
87 | 87 | $my_temp = array(); |
88 | - foreach ($idChecked as $id){ |
|
88 | + foreach ($idChecked as $id) { |
|
89 | 89 | $courseInfo = api_get_course_info($id); |
90 | - $my_temp[]= $courseInfo['real_id'];// forcing the escape_string |
|
90 | + $my_temp[] = $courseInfo['real_id']; // forcing the escape_string |
|
91 | 91 | } |
92 | 92 | $idChecked = $my_temp; |
93 | 93 | $idChecked = "'".implode("','", $idChecked)."'"; |
94 | 94 | |
95 | 95 | $result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
96 | - $nbr_affected_rows=Database::affected_rows($result); |
|
96 | + $nbr_affected_rows = Database::affected_rows($result); |
|
97 | 97 | |
98 | 98 | Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
99 | 99 | Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'"); |
100 | 100 | } |
101 | 101 | |
102 | - if (!empty($_GET['class'])){ |
|
102 | + if (!empty($_GET['class'])) { |
|
103 | 103 | $result = Database::query("DELETE FROM $tbl_session_rel_class WHERE session_id='$id_session' AND class_id=".intval($_GET['class'])); |
104 | - $nbr_affected_rows=Database::affected_rows($result); |
|
104 | + $nbr_affected_rows = Database::affected_rows($result); |
|
105 | 105 | Database::query("UPDATE $tbl_session SET nbr_classes=nbr_classes-$nbr_affected_rows WHERE id='$id_session'"); |
106 | 106 | } |
107 | 107 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | Database::query("UPDATE $tbl_session SET nbr_users=nbr_users-$nbr_affected_rows WHERE id='$id_session'"); |
112 | 112 | |
113 | 113 | $result = Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id ='$id_session' AND user_id=".intval($_GET['user'])); |
114 | - $nbr_affected_rows=Database::affected_rows($result); |
|
114 | + $nbr_affected_rows = Database::affected_rows($result); |
|
115 | 115 | |
116 | 116 | Database::query("UPDATE $tbl_session_rel_course SET nbr_users=nbr_users-$nbr_affected_rows WHERE session_id ='$id_session'"); |
117 | 117 | } |
@@ -137,28 +137,28 @@ discard block |
||
137 | 137 | <td><?php echo get_lang('GeneralCoach'); ?> :</td> |
138 | 138 | <td><?php echo api_get_person_name($session['firstname'], $session['lastname']).' ('.$session['username'].')' ?></td> |
139 | 139 | </tr> |
140 | - <?php if(!empty($session_category)) { ?> |
|
140 | + <?php if (!empty($session_category)) { ?> |
|
141 | 141 | <tr> |
142 | 142 | <td><?php echo get_lang('SessionCategory') ?></td> |
143 | - <td><?php echo $session_category; ?></td> |
|
143 | + <td><?php echo $session_category; ?></td> |
|
144 | 144 | </tr> |
145 | 145 | <?php } ?> |
146 | 146 | <tr> |
147 | 147 | <td><?php echo get_lang('Date'); ?> :</td> |
148 | 148 | <td> |
149 | 149 | <?php |
150 | - if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) { |
|
150 | + if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date'] == '00-00-0000') { |
|
151 | 151 | echo get_lang('NoTimeLimits'); |
152 | 152 | } |
153 | 153 | else { |
154 | 154 | if ($session['access_start_date'] != '00-00-0000') { |
155 | 155 | //$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits')); |
156 | - $session['access_start_date'] = get_lang('From').' '.$session['access_start_date']; |
|
156 | + $session['access_start_date'] = get_lang('From').' '.$session['access_start_date']; |
|
157 | 157 | } else { |
158 | 158 | $session['access_start_date'] = ''; |
159 | 159 | } |
160 | 160 | if ($session['access_end_date'] == '00-00-0000') { |
161 | - $session['access_end_date'] =''; |
|
161 | + $session['access_end_date'] = ''; |
|
162 | 162 | } else { |
163 | 163 | $session['access_end_date'] = get_lang('Until').' '.$session['access_end_date']; |
164 | 164 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | <?php echo api_ucfirst(get_lang('SessionVisibility')) ?> : |
190 | 190 | </td> |
191 | 191 | <td> |
192 | - <?php if ($session['visibility']==1) echo get_lang('ReadOnly'); elseif($session['visibility']==2) echo get_lang('Visible');elseif($session['visibility']==3) echo api_ucfirst(get_lang('Invisible')) ?> |
|
192 | + <?php if ($session['visibility'] == 1) echo get_lang('ReadOnly'); elseif ($session['visibility'] == 2) echo get_lang('Visible'); elseif ($session['visibility'] == 3) echo api_ucfirst(get_lang('Invisible')) ?> |
|
193 | 193 | </td> |
194 | 194 | </tr> |
195 | 195 | <?php |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | echo '</td>'; |
202 | 202 | echo '<td>'; |
203 | 203 | $url_list = UrlManager::get_access_url_from_session($id_session); |
204 | - foreach($url_list as $url_data) { |
|
204 | + foreach ($url_list as $url_data) { |
|
205 | 205 | echo $url_data['url'].'<br />'; |
206 | 206 | } |
207 | 207 | echo '</td></tr>'; |
@@ -231,8 +231,8 @@ discard block |
||
231 | 231 | WHERE c.id = sc.c_id |
232 | 232 | AND session_id='$id_session' |
233 | 233 | ORDER BY title"; |
234 | - $result=Database::query($sql); |
|
235 | - $courses=Database::store_result($result); |
|
234 | + $result = Database::query($sql); |
|
235 | + $courses = Database::store_result($result); |
|
236 | 236 | foreach ($courses as $course) { |
237 | 237 | //select the number of users |
238 | 238 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | srcru.session_id = '".intval($id_session)."'"; |
246 | 246 | |
247 | 247 | $rs = Database::query($sql); |
248 | - $course['nbr_users'] = Database::result($rs,0,0); |
|
248 | + $course['nbr_users'] = Database::result($rs, 0, 0); |
|
249 | 249 | |
250 | 250 | // Get coachs of the courses in session |
251 | 251 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } |
272 | 272 | |
273 | 273 | if (count($coachs) > 0) { |
274 | - $coach = implode('<br />',$coachs); |
|
274 | + $coach = implode('<br />', $coachs); |
|
275 | 275 | } else { |
276 | 276 | $coach = get_lang('None'); |
277 | 277 | } |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | // name of the course, that appeared in the default $interbreadcrumb |
282 | 282 | echo ' |
283 | 283 | <tr> |
284 | - <td>'.Display::url($course['title'].' ('.$course['visual_code'].')', api_get_path(WEB_COURSE_PATH).$course['code'].'/?id_session='.$id_session),'</td> |
|
284 | + <td>'.Display::url($course['title'].' ('.$course['visual_code'].')', api_get_path(WEB_COURSE_PATH).$course['code'].'/?id_session='.$id_session), '</td> |
|
285 | 285 | <td>'.$coach.'</td> |
286 | 286 | <td>'.$course['nbr_users'].'</td> |
287 | 287 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | </tr> |
307 | 307 | <?php |
308 | 308 | |
309 | - if ($session['nbr_users']==0) { |
|
309 | + if ($session['nbr_users'] == 0) { |
|
310 | 310 | echo '<tr> |
311 | 311 | <td colspan="2">'.get_lang('NoUsersForThisSession').'</td> |
312 | 312 | </tr>'; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $user_link = ''; |
338 | 338 | if (!empty($user['user_id'])) { |
339 | 339 | $user_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_information.php?user_id='.intval($user['user_id']).'">'. |
340 | - api_htmlentities(api_get_person_name($user['firstname'], $user['lastname']),ENT_QUOTES,$charset).' ('.$user['username'].')</a>'; |
|
340 | + api_htmlentities(api_get_person_name($user['firstname'], $user['lastname']), ENT_QUOTES, $charset).' ('.$user['username'].')</a>'; |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | $link_to_add_user_in_url = ''; |
@@ -149,8 +149,7 @@ discard block |
||
149 | 149 | <?php |
150 | 150 | if ($session['access_start_date'] == '00-00-0000' && $session['access_end_date']== '00-00-0000' ) { |
151 | 151 | echo get_lang('NoTimeLimits'); |
152 | - } |
|
153 | - else { |
|
152 | + } else { |
|
154 | 153 | if ($session['access_start_date'] != '00-00-0000') { |
155 | 154 | //$session['date_start'] = Display::tag('i', get_lang('NoTimeLimits')); |
156 | 155 | $session['access_start_date'] = get_lang('From').' '.$session['access_start_date']; |
@@ -189,12 +188,18 @@ discard block |
||
189 | 188 | <?php echo api_ucfirst(get_lang('SessionVisibility')) ?> : |
190 | 189 | </td> |
191 | 190 | <td> |
192 | - <?php if ($session['visibility']==1) echo get_lang('ReadOnly'); elseif($session['visibility']==2) echo get_lang('Visible');elseif($session['visibility']==3) echo api_ucfirst(get_lang('Invisible')) ?> |
|
191 | + <?php if ($session['visibility']==1) { |
|
192 | + echo get_lang('ReadOnly'); |
|
193 | +} elseif($session['visibility']==2) { |
|
194 | + echo get_lang('Visible'); |
|
195 | +} elseif($session['visibility']==3) { |
|
196 | + echo api_ucfirst(get_lang('Invisible')) ?> |
|
193 | 197 | </td> |
194 | 198 | </tr> |
195 | 199 | <?php |
196 | 200 | |
197 | 201 | $multiple_url_is_on = api_get_multiple_access_url(); |
202 | +} |
|
198 | 203 | if ($multiple_url_is_on) { |
199 | 204 | echo '<tr><td>'; |
200 | 205 | echo 'URL'; |
@@ -477,7 +477,10 @@ discard block |
||
477 | 477 | <div class="actions"> |
478 | 478 | <?php echo $link_add_type_unique ?> | <?php echo $link_add_type_multiple ?> | <?php echo $link_add_group; ?> |
479 | 479 | </div> |
480 | - <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
480 | + <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($_GET['add'])) { |
|
481 | + echo '&add=true' ; |
|
482 | +} |
|
483 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
481 | 484 | <?php echo '<legend>'.$tool_name.' ('.$session_info['name'].') </legend>'; ?> |
482 | 485 | <?php |
483 | 486 | if ($add_type == 'multiple') { |
@@ -545,7 +548,10 @@ discard block |
||
545 | 548 | <?php |
546 | 549 | foreach ($nosessionUsersList as $uid => $enreg) { |
547 | 550 | ?> |
548 | - <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option> |
|
551 | + <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) { |
|
552 | + echo 'selected="selected"'; |
|
553 | +} |
|
554 | +?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option> |
|
549 | 555 | <?php |
550 | 556 | } |
551 | 557 | ?> |
@@ -49,29 +49,29 @@ discard block |
||
49 | 49 | $extra_field_list = UserManager::get_extra_fields(); |
50 | 50 | $new_field_list = array(); |
51 | 51 | if (is_array($extra_field_list)) { |
52 | - foreach ($extra_field_list as $extra_field) { |
|
53 | - //if is enabled to filter and is a "<select>" field type |
|
54 | - if ($extra_field[8]==1 && $extra_field[2]==4 ) { |
|
52 | + foreach ($extra_field_list as $extra_field) { |
|
53 | + //if is enabled to filter and is a "<select>" field type |
|
54 | + if ($extra_field[8]==1 && $extra_field[2]==4 ) { |
|
55 | 55 | $new_field_list[] = array( |
56 | 56 | 'name' => $extra_field[3], |
57 | 57 | 'variable' => $extra_field[1], |
58 | 58 | 'data' => $extra_field[9], |
59 | 59 | ); |
60 | - } |
|
61 | - } |
|
60 | + } |
|
61 | + } |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | function search_users($needle, $type) |
65 | 65 | { |
66 | - global $id_session; |
|
66 | + global $id_session; |
|
67 | 67 | |
68 | 68 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
69 | 69 | $tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
70 | 70 | |
71 | - $xajax_response = new xajaxResponse(); |
|
72 | - $return = ''; |
|
71 | + $xajax_response = new xajaxResponse(); |
|
72 | + $return = ''; |
|
73 | 73 | |
74 | - if (!empty($needle) && !empty($type)) { |
|
74 | + if (!empty($needle) && !empty($type)) { |
|
75 | 75 | |
76 | 76 | //normal behaviour |
77 | 77 | if ($type == 'any_session' && $needle == 'false') { |
@@ -79,32 +79,32 @@ discard block |
||
79 | 79 | $needle = ''; |
80 | 80 | } |
81 | 81 | |
82 | - // xajax send utf8 datas... datas in db can be non-utf8 datas |
|
83 | - $charset = api_get_system_encoding(); |
|
84 | - $needle = Database::escape_string($needle); |
|
85 | - $needle = api_convert_encoding($needle, $charset, 'utf-8'); |
|
82 | + // xajax send utf8 datas... datas in db can be non-utf8 datas |
|
83 | + $charset = api_get_system_encoding(); |
|
84 | + $needle = Database::escape_string($needle); |
|
85 | + $needle = api_convert_encoding($needle, $charset, 'utf-8'); |
|
86 | 86 | |
87 | - $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; |
|
88 | - $cond_user_id = ''; |
|
87 | + $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; |
|
88 | + $cond_user_id = ''; |
|
89 | 89 | |
90 | 90 | //Only for single & multiple |
91 | 91 | if (in_array($type, array('single','multiple'))) { |
92 | - if (!empty($id_session)) { |
|
93 | - $id_session = intval($id_session); |
|
94 | - // check id_user from session_rel_user table |
|
95 | - $sql = 'SELECT user_id FROM '.$tbl_session_rel_user.' |
|
92 | + if (!empty($id_session)) { |
|
93 | + $id_session = intval($id_session); |
|
94 | + // check id_user from session_rel_user table |
|
95 | + $sql = 'SELECT user_id FROM '.$tbl_session_rel_user.' |
|
96 | 96 | WHERE session_id ="'.$id_session.'" AND relation_type<>'.SESSION_RELATION_TYPE_RRHH.' '; |
97 | - $res = Database::query($sql); |
|
98 | - $user_ids = array(); |
|
99 | - if (Database::num_rows($res) > 0) { |
|
100 | - while ($row = Database::fetch_row($res)) { |
|
101 | - $user_ids[] = (int)$row[0]; |
|
102 | - } |
|
103 | - } |
|
104 | - if (count($user_ids) > 0) { |
|
105 | - $cond_user_id = ' AND user.user_id NOT IN('.implode(",",$user_ids).')'; |
|
106 | - } |
|
107 | - } |
|
97 | + $res = Database::query($sql); |
|
98 | + $user_ids = array(); |
|
99 | + if (Database::num_rows($res) > 0) { |
|
100 | + while ($row = Database::fetch_row($res)) { |
|
101 | + $user_ids[] = (int)$row[0]; |
|
102 | + } |
|
103 | + } |
|
104 | + if (count($user_ids) > 0) { |
|
105 | + $cond_user_id = ' AND user.user_id NOT IN('.implode(",",$user_ids).')'; |
|
106 | + } |
|
107 | + } |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | switch ($type) { |
@@ -136,11 +136,11 @@ discard block |
||
136 | 136 | user.status <> 6 '.$cond_user_id. |
137 | 137 | $order_clause; |
138 | 138 | break; |
139 | - } |
|
140 | - if (api_is_multiple_url_enabled()) { |
|
141 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
142 | - $access_url_id = api_get_current_access_url_id(); |
|
143 | - if ($access_url_id != -1) { |
|
139 | + } |
|
140 | + if (api_is_multiple_url_enabled()) { |
|
141 | + $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
142 | + $access_url_id = api_get_current_access_url_id(); |
|
143 | + if ($access_url_id != -1) { |
|
144 | 144 | switch ($type) { |
145 | 145 | case 'single': |
146 | 146 | $sql = 'SELECT user.user_id, username, lastname, firstname |
@@ -178,36 +178,36 @@ discard block |
||
178 | 178 | user.status<>6 '.$cond_user_id. |
179 | 179 | $order_clause; |
180 | 180 | break; |
181 | - } |
|
182 | - } |
|
183 | - } |
|
181 | + } |
|
182 | + } |
|
183 | + } |
|
184 | 184 | |
185 | - $rs = Database::query($sql); |
|
185 | + $rs = Database::query($sql); |
|
186 | 186 | $i=0; |
187 | - if ($type == 'single') { |
|
188 | - while ($user = Database::fetch_array($rs)) { |
|
189 | - $i++; |
|
190 | - if ($i<=10) { |
|
191 | - $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
|
192 | - $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_session(\''.$user['user_id'].'\',\''.$person_name.' ('.$user['username'].')'.'\')">'.$person_name.' ('.$user['username'].')</a><br />'; |
|
193 | - } else { |
|
194 | - $return .= '...<br />'; |
|
195 | - } |
|
196 | - } |
|
197 | - |
|
198 | - $xajax_response -> addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return)); |
|
199 | - } else { |
|
200 | - $return .= '<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">'; |
|
201 | - while ($user = Database :: fetch_array($rs)) { |
|
202 | - $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
|
203 | - $return .= '<option value="'.$user['user_id'].'">'.$person_name.' ('.$user['username'].')</option>'; |
|
204 | - } |
|
205 | - $return .= '</select>'; |
|
206 | - $xajax_response -> addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return)); |
|
207 | - } |
|
208 | - } |
|
187 | + if ($type == 'single') { |
|
188 | + while ($user = Database::fetch_array($rs)) { |
|
189 | + $i++; |
|
190 | + if ($i<=10) { |
|
191 | + $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
|
192 | + $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_session(\''.$user['user_id'].'\',\''.$person_name.' ('.$user['username'].')'.'\')">'.$person_name.' ('.$user['username'].')</a><br />'; |
|
193 | + } else { |
|
194 | + $return .= '...<br />'; |
|
195 | + } |
|
196 | + } |
|
197 | + |
|
198 | + $xajax_response -> addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return)); |
|
199 | + } else { |
|
200 | + $return .= '<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">'; |
|
201 | + while ($user = Database :: fetch_array($rs)) { |
|
202 | + $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
|
203 | + $return .= '<option value="'.$user['user_id'].'">'.$person_name.' ('.$user['username'].')</option>'; |
|
204 | + } |
|
205 | + $return .= '</select>'; |
|
206 | + $xajax_response -> addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return)); |
|
207 | + } |
|
208 | + } |
|
209 | 209 | |
210 | - return $xajax_response; |
|
210 | + return $xajax_response; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $xajax -> processRequests(); |
@@ -347,8 +347,8 @@ discard block |
||
347 | 347 | |
348 | 348 | if ($use_extra_fields) { |
349 | 349 | $final_result = array(); |
350 | - if (count($extra_field_result)>1) { |
|
351 | - for($i=0;$i<count($extra_field_result)-1;$i++) { |
|
350 | + if (count($extra_field_result)>1) { |
|
351 | + for($i=0;$i<count($extra_field_result)-1;$i++) { |
|
352 | 352 | if (is_array($extra_field_result[$i+1])) { |
353 | 353 | $final_result = array_intersect( |
354 | 354 | $extra_field_result[$i], |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | 'un' => $user['username'] |
427 | 427 | ); |
428 | 428 | unset($users[$uid]); |
429 | - } |
|
429 | + } |
|
430 | 430 | } |
431 | 431 | unset($users); //clean to free memory |
432 | 432 | |
@@ -471,13 +471,13 @@ discard block |
||
471 | 471 | } |
472 | 472 | |
473 | 473 | if ($add_type === 'multiple') { |
474 | - $link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=unique">'.Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>'; |
|
475 | - $link_add_type_multiple = Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'); |
|
474 | + $link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=unique">'.Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>'; |
|
475 | + $link_add_type_multiple = Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'); |
|
476 | 476 | } else { |
477 | - $link_add_type_unique = Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'); |
|
478 | - $link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>'; |
|
477 | + $link_add_type_unique = Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'); |
|
478 | + $link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>'; |
|
479 | 479 | } |
480 | - $link_add_group = '<a href="usergroups.php">'. |
|
480 | + $link_add_group = '<a href="usergroups.php">'. |
|
481 | 481 | Display::return_icon('multiple.gif', get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups').'</a>'; |
482 | 482 | ?> |
483 | 483 | <div class="actions"> |
@@ -487,30 +487,30 @@ discard block |
||
487 | 487 | <?php echo '<legend>'.$tool_name.' ('.$session_info['name'].') </legend>'; ?> |
488 | 488 | <?php |
489 | 489 | if ($add_type === 'multiple') { |
490 | - if (is_array($extra_field_list)) { |
|
491 | - if (is_array($new_field_list) && count($new_field_list)>0 ) { |
|
492 | - echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
|
493 | - foreach ($new_field_list as $new_field) { |
|
494 | - echo $new_field['name']; |
|
495 | - $varname = 'field_'.$new_field['variable']; |
|
496 | - echo ' <select name="'.$varname.'">'; |
|
497 | - echo '<option value="0">--'.get_lang('Select').'--</option>'; |
|
498 | - foreach ($new_field['data'] as $option) { |
|
499 | - $checked=''; |
|
500 | - if (isset($_POST[$varname])) { |
|
501 | - if ($_POST[$varname] == $option[1]) { |
|
502 | - $checked = 'selected="true"'; |
|
503 | - } |
|
504 | - } |
|
505 | - echo '<option value="'.$option[1].'" '.$checked.'>'.$option[1].'</option>'; |
|
506 | - } |
|
507 | - echo '</select>'; |
|
508 | - echo ' '; |
|
509 | - } |
|
510 | - echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />'; |
|
511 | - echo '<br /><br />'; |
|
512 | - } |
|
513 | - } |
|
490 | + if (is_array($extra_field_list)) { |
|
491 | + if (is_array($new_field_list) && count($new_field_list)>0 ) { |
|
492 | + echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
|
493 | + foreach ($new_field_list as $new_field) { |
|
494 | + echo $new_field['name']; |
|
495 | + $varname = 'field_'.$new_field['variable']; |
|
496 | + echo ' <select name="'.$varname.'">'; |
|
497 | + echo '<option value="0">--'.get_lang('Select').'--</option>'; |
|
498 | + foreach ($new_field['data'] as $option) { |
|
499 | + $checked=''; |
|
500 | + if (isset($_POST[$varname])) { |
|
501 | + if ($_POST[$varname] == $option[1]) { |
|
502 | + $checked = 'selected="true"'; |
|
503 | + } |
|
504 | + } |
|
505 | + echo '<option value="'.$option[1].'" '.$checked.'>'.$option[1].'</option>'; |
|
506 | + } |
|
507 | + echo '</select>'; |
|
508 | + echo ' '; |
|
509 | + } |
|
510 | + echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />'; |
|
511 | + echo '<br /><br />'; |
|
512 | + } |
|
513 | + } |
|
514 | 514 | } |
515 | 515 | ?> |
516 | 516 | <input type="hidden" name="form_sent" value="1" /> |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | <div id="content_source"> |
534 | 534 | <?php |
535 | 535 | if (!($add_type == 'multiple')) { |
536 | - ?> |
|
536 | + ?> |
|
537 | 537 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
538 | 538 | <div id="ajax_list_users_single"></div> |
539 | 539 | <?php |
@@ -542,12 +542,12 @@ discard block |
||
542 | 542 | <div id="ajax_list_users_multiple"> |
543 | 543 | <select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" class="span5"> |
544 | 544 | <?php |
545 | - foreach ($nosessionUsersList as $uid => $enreg) { |
|
546 | - ?> |
|
545 | + foreach ($nosessionUsersList as $uid => $enreg) { |
|
546 | + ?> |
|
547 | 547 | <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option> |
548 | 548 | <?php |
549 | - } |
|
550 | - ?> |
|
549 | + } |
|
550 | + ?> |
|
551 | 551 | </select> |
552 | 552 | </div> |
553 | 553 | <input type="checkbox" onchange="checked_in_no_session(this.checked);" name="user_with_any_session" id="user_with_any_session_id"> |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | <?php |
556 | 556 | } |
557 | 557 | unset($nosessionUsersList); |
558 | - ?> |
|
558 | + ?> |
|
559 | 559 | </div> |
560 | 560 | </div> |
561 | 561 | |
@@ -582,13 +582,13 @@ discard block |
||
582 | 582 | <br /> |
583 | 583 | <br /> |
584 | 584 | <?php |
585 | - if (isset($_GET['add'])) { |
|
586 | - echo '<button class="btn btn-primary" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>'; |
|
585 | + if (isset($_GET['add'])) { |
|
586 | + echo '<button class="btn btn-primary" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>'; |
|
587 | 587 | } else { |
588 | 588 | //@todo see that the call to "valide()" doesn't duplicate the onsubmit of the form (necessary to avoid delete on "enter" key pressed) |
589 | - echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeUsersToSession').'</button>'; |
|
589 | + echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeUsersToSession').'</button>'; |
|
590 | 590 | } |
591 | - ?> |
|
591 | + ?> |
|
592 | 592 | </div> |
593 | 593 | <div class="span5"> |
594 | 594 | <div class="multiple_select_header"> |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | |
23 | 23 | // setting breadcrumbs |
24 | 24 | if (api_is_platform_admin()) { |
25 | - $interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
26 | - $interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
27 | - $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session,"name" => get_lang('SessionOverview')); |
|
25 | + $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
26 | + $interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
27 | + $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session, "name" => get_lang('SessionOverview')); |
|
28 | 28 | } |
29 | 29 | $allowTutors = api_get_setting('allow_tutors_to_assign_students_to_session'); |
30 | 30 | $extra_field_list = []; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $tool_name = get_lang('SubscribeUsersToSession'); |
40 | 40 | $add_type = 'unique'; |
41 | 41 | |
42 | - if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { |
|
42 | + if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
43 | 43 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
44 | 44 | } |
45 | 45 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if (is_array($extra_field_list)) { |
52 | 52 | foreach ($extra_field_list as $extra_field) { |
53 | 53 | //if is enabled to filter and is a "<select>" field type |
54 | - if ($extra_field[8]==1 && $extra_field[2]==4 ) { |
|
54 | + if ($extra_field[8] == 1 && $extra_field[2] == 4) { |
|
55 | 55 | $new_field_list[] = array( |
56 | 56 | 'name' => $extra_field[3], |
57 | 57 | 'variable' => $extra_field[1], |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | if (!empty($needle) && !empty($type)) { |
75 | 75 | |
76 | 76 | //normal behaviour |
77 | - if ($type == 'any_session' && $needle == 'false') { |
|
77 | + if ($type == 'any_session' && $needle == 'false') { |
|
78 | 78 | $type = 'multiple'; |
79 | 79 | $needle = ''; |
80 | 80 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $cond_user_id = ''; |
89 | 89 | |
90 | 90 | //Only for single & multiple |
91 | - if (in_array($type, array('single','multiple'))) { |
|
91 | + if (in_array($type, array('single', 'multiple'))) { |
|
92 | 92 | if (!empty($id_session)) { |
93 | 93 | $id_session = intval($id_session); |
94 | 94 | // check id_user from session_rel_user table |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | $user_ids = array(); |
99 | 99 | if (Database::num_rows($res) > 0) { |
100 | 100 | while ($row = Database::fetch_row($res)) { |
101 | - $user_ids[] = (int)$row[0]; |
|
101 | + $user_ids[] = (int) $row[0]; |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | if (count($user_ids) > 0) { |
105 | - $cond_user_id = ' AND user.user_id NOT IN('.implode(",",$user_ids).')'; |
|
105 | + $cond_user_id = ' AND user.user_id NOT IN('.implode(",", $user_ids).')'; |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | break; |
139 | 139 | } |
140 | 140 | if (api_is_multiple_url_enabled()) { |
141 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
141 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
142 | 142 | $access_url_id = api_get_current_access_url_id(); |
143 | 143 | if ($access_url_id != -1) { |
144 | 144 | switch ($type) { |
@@ -183,11 +183,11 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | $rs = Database::query($sql); |
186 | - $i=0; |
|
186 | + $i = 0; |
|
187 | 187 | if ($type == 'single') { |
188 | 188 | while ($user = Database::fetch_array($rs)) { |
189 | 189 | $i++; |
190 | - if ($i<=10) { |
|
190 | + if ($i <= 10) { |
|
191 | 191 | $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
192 | 192 | $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_session(\''.$user['user_id'].'\',\''.$person_name.' ('.$user['username'].')'.'\')">'.$person_name.' ('.$user['username'].')</a><br />'; |
193 | 193 | } else { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | } |
197 | 197 | |
198 | - $xajax_response -> addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return)); |
|
198 | + $xajax_response -> addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return)); |
|
199 | 199 | } else { |
200 | 200 | $return .= '<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">'; |
201 | 201 | while ($user = Database :: fetch_array($rs)) { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $return .= '<option value="'.$user['user_id'].'">'.$person_name.' ('.$user['username'].')</option>'; |
204 | 204 | } |
205 | 205 | $return .= '</select>'; |
206 | - $xajax_response -> addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return)); |
|
206 | + $xajax_response -> addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return)); |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | </script>'; |
261 | 261 | |
262 | 262 | $form_sent = 0; |
263 | - $firstLetterUser = $firstLetterSession=''; |
|
263 | + $firstLetterUser = $firstLetterSession = ''; |
|
264 | 264 | $UserList = $SessionList = array(); |
265 | 265 | $sessions = array(); |
266 | 266 | $noPHP_SELF = true; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $UserList = $_POST['sessionUsersList']; |
273 | 273 | |
274 | 274 | if (!is_array($UserList)) { |
275 | - $UserList=array(); |
|
275 | + $UserList = array(); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | if ($form_sent == 1) { |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | WHERE u.status <> ".DRH." AND u.status<>6 $order_clause"; |
303 | 303 | |
304 | 304 | if (api_is_multiple_url_enabled()) { |
305 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
305 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
306 | 306 | $access_url_id = api_get_current_access_url_id(); |
307 | 307 | if ($access_url_id != -1) { |
308 | 308 | $sql = "SELECT u.user_id, lastname, firstname, username, session_id |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $result = Database::query($sql); |
322 | 322 | $users = Database::store_result($result); |
323 | 323 | foreach ($users as $user) { |
324 | - $sessionUsersList[$user['user_id']] = $user ; |
|
324 | + $sessionUsersList[$user['user_id']] = $user; |
|
325 | 325 | } |
326 | 326 | unset($users); //clean to free memory |
327 | 327 | } else { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | foreach ($new_field_list as $new_field) { |
334 | 334 | $varname = 'field_'.$new_field['variable']; |
335 | 335 | if (UserManager::is_extra_field_available($new_field['variable'])) { |
336 | - if (isset($_POST[$varname]) && $_POST[$varname]!='0') { |
|
336 | + if (isset($_POST[$varname]) && $_POST[$varname] != '0') { |
|
337 | 337 | $use_extra_fields = true; |
338 | 338 | $extra_field_result[] = UserManager::get_extra_user_data_by_value( |
339 | 339 | $new_field['variable'], |
@@ -347,9 +347,9 @@ discard block |
||
347 | 347 | |
348 | 348 | if ($use_extra_fields) { |
349 | 349 | $final_result = array(); |
350 | - if (count($extra_field_result)>1) { |
|
351 | - for($i=0;$i<count($extra_field_result)-1;$i++) { |
|
352 | - if (is_array($extra_field_result[$i+1])) { |
|
350 | + if (count($extra_field_result) > 1) { |
|
351 | + for ($i = 0; $i < count($extra_field_result) - 1; $i++) { |
|
352 | + if (is_array($extra_field_result[$i + 1])) { |
|
353 | 353 | $final_result = array_intersect( |
354 | 354 | $extra_field_result[$i], |
355 | 355 | $extra_field_result[$i + 1] |
@@ -360,17 +360,17 @@ discard block |
||
360 | 360 | $final_result = $extra_field_result[0]; |
361 | 361 | } |
362 | 362 | |
363 | - $where_filter =''; |
|
363 | + $where_filter = ''; |
|
364 | 364 | if (api_is_multiple_url_enabled()) { |
365 | - if (is_array($final_result) && count($final_result)>0) { |
|
366 | - $where_filter = " AND u.user_id IN ('".implode("','",$final_result)."') "; |
|
365 | + if (is_array($final_result) && count($final_result) > 0) { |
|
366 | + $where_filter = " AND u.user_id IN ('".implode("','", $final_result)."') "; |
|
367 | 367 | } else { |
368 | 368 | //no results |
369 | 369 | $where_filter = " AND u.user_id = -1"; |
370 | 370 | } |
371 | 371 | } else { |
372 | - if (is_array($final_result) && count($final_result)>0) { |
|
373 | - $where_filter = " WHERE u.user_id IN ('".implode("','",$final_result)."') "; |
|
372 | + if (is_array($final_result) && count($final_result) > 0) { |
|
373 | + $where_filter = " WHERE u.user_id IN ('".implode("','", $final_result)."') "; |
|
374 | 374 | } else { |
375 | 375 | //no results |
376 | 376 | $where_filter = " WHERE u.user_id = -1"; |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $order_clause"; |
400 | 400 | } |
401 | 401 | if (api_is_multiple_url_enabled()) { |
402 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
402 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
403 | 403 | $access_url_id = api_get_current_access_url_id(); |
404 | 404 | if ($access_url_id != -1) { |
405 | 405 | $sql = "SELECT u.user_id, lastname, firstname, username, session_id |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | |
418 | 418 | $result = Database::query($sql); |
419 | - $users = Database::store_result($result,'ASSOC'); |
|
419 | + $users = Database::store_result($result, 'ASSOC'); |
|
420 | 420 | |
421 | 421 | foreach ($users as $uid => $user) { |
422 | 422 | if ($user['session_id'] != $id_session) { |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | WHERE u.status <> ".DRH." AND u.status<>6 $order_clause"; |
442 | 442 | |
443 | 443 | if (api_is_multiple_url_enabled()) { |
444 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
444 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
445 | 445 | $access_url_id = api_get_current_access_url_id(); |
446 | 446 | if ($access_url_id != -1) { |
447 | 447 | $sql = "SELECT u.user_id, lastname, firstname, username, session_id |
@@ -457,11 +457,11 @@ discard block |
||
457 | 457 | } |
458 | 458 | } |
459 | 459 | $result = Database::query($sql); |
460 | - $users = Database::store_result($result,'ASSOC'); |
|
460 | + $users = Database::store_result($result, 'ASSOC'); |
|
461 | 461 | foreach ($users as $uid => $user) { |
462 | 462 | if ($user['session_id'] == $id_session) { |
463 | 463 | $sessionUsersList[$user['user_id']] = $user; |
464 | - if (array_key_exists($user['user_id'],$nosessionUsersList)) { |
|
464 | + if (array_key_exists($user['user_id'], $nosessionUsersList)) { |
|
465 | 465 | unset($nosessionUsersList[$user['user_id']]); |
466 | 466 | } |
467 | 467 | } |
@@ -483,20 +483,20 @@ discard block |
||
483 | 483 | <div class="actions"> |
484 | 484 | <?php echo $link_add_type_unique ?> | <?php echo $link_add_type_multiple ?> | <?php echo $link_add_group; ?> |
485 | 485 | </div> |
486 | - <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
487 | - <?php echo '<legend>'.$tool_name.' (' . $session->getName() . ') </legend>'; ?> |
|
486 | + <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
487 | + <?php echo '<legend>'.$tool_name.' ('.$session->getName().') </legend>'; ?> |
|
488 | 488 | <?php |
489 | 489 | if ($add_type === 'multiple') { |
490 | 490 | if (is_array($extra_field_list)) { |
491 | - if (is_array($new_field_list) && count($new_field_list)>0 ) { |
|
491 | + if (is_array($new_field_list) && count($new_field_list) > 0) { |
|
492 | 492 | echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
493 | 493 | foreach ($new_field_list as $new_field) { |
494 | 494 | echo $new_field['name']; |
495 | 495 | $varname = 'field_'.$new_field['variable']; |
496 | 496 | echo ' <select name="'.$varname.'">'; |
497 | 497 | echo '<option value="0">--'.get_lang('Select').'--</option>'; |
498 | - foreach ($new_field['data'] as $option) { |
|
499 | - $checked=''; |
|
498 | + foreach ($new_field['data'] as $option) { |
|
499 | + $checked = ''; |
|
500 | 500 | if (isset($_POST[$varname])) { |
501 | 501 | if ($_POST[$varname] == $option[1]) { |
502 | 502 | $checked = 'selected="true"'; |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | <?php |
545 | 545 | foreach ($nosessionUsersList as $uid => $enreg) { |
546 | 546 | ?> |
547 | - <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option> |
|
547 | + <option value="<?php echo $uid; ?>" <?php if (in_array($uid, $UserList)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option> |
|
548 | 548 | <?php |
549 | 549 | } |
550 | 550 | ?> |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | </div> |
597 | 597 | <select id="destination_users" name="sessionUsersList[]" multiple="multiple" size="15" class="span5"> |
598 | 598 | <?php |
599 | - foreach($sessionUsersList as $enreg) { |
|
599 | + foreach ($sessionUsersList as $enreg) { |
|
600 | 600 | ?> |
601 | 601 | <option value="<?php echo $enreg['user_id']; ?>"><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option> |
602 | 602 | <?php |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | array('name'=>'access_end_date', 'index'=>'access_end_date', 'width'=>'40', 'align'=>'left', 'search' => 'true'), |
66 | 66 | array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'80', 'align'=>'left', 'search' => 'false'), |
67 | 67 | array('name'=>'status', 'index'=>'session_active','width'=>'40', 'align'=>'left', 'search' => 'true', 'stype'=>'select', |
68 | - //for the bottom bar |
|
68 | + //for the bottom bar |
|
69 | 69 | 'searchoptions' => array( |
70 | 70 | 'defaultValue' => '1', |
71 | 71 | 'value' => '1:'.get_lang('Active').';0:'.get_lang('Inactive') |
72 | 72 | ), |
73 | - //for the top bar |
|
74 | - 'editoptions' => array('value' => ':'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive'))), |
|
73 | + //for the top bar |
|
74 | + 'editoptions' => array('value' => ':'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive'))), |
|
75 | 75 | array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
76 | 76 | array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false') |
77 | 77 | ); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | //With this function we can add actions to the jgrid (edit, delete, etc) |
87 | 87 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
88 | 88 | return \' <a href="add_users_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('user_subscribe_session.png',get_lang('SubscribeUsersToSession'),'',ICON_SIZE_SMALL).'</a>'. |
89 | - '\'; |
|
89 | + '\'; |
|
90 | 90 | }'; |
91 | 91 | ?> |
92 | 92 | <script> |
@@ -56,15 +56,15 @@ discard block |
||
56 | 56 | ); |
57 | 57 | |
58 | 58 | //Column config |
59 | - $column_model = array( |
|
60 | - array('name'=>'name', 'index'=>'name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"), |
|
61 | - array('name'=>'nbr_courses', 'index'=>'nbr_courses', 'width'=>'30', 'align'=>'left', 'search' => 'true'), |
|
62 | - array('name'=>'nbr_users', 'index'=>'nbr_users', 'width'=>'30', 'align'=>'left', 'search' => 'true'), |
|
63 | - array('name'=>'category_name', 'index'=>'category_name', 'width'=>'70', 'align'=>'left', 'search' => 'true'), |
|
64 | - array('name'=>'access_start_date', 'index'=>'access_start_date', 'width'=>'40', 'align'=>'left', 'search' => 'true'), |
|
65 | - array('name'=>'access_end_date', 'index'=>'access_end_date', 'width'=>'40', 'align'=>'left', 'search' => 'true'), |
|
66 | - array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'80', 'align'=>'left', 'search' => 'false'), |
|
67 | - array('name'=>'status', 'index'=>'session_active','width'=>'40', 'align'=>'left', 'search' => 'true', 'stype'=>'select', |
|
59 | + $column_model = array( |
|
60 | + array('name'=>'name', 'index'=>'name', 'width'=>'160', 'align'=>'left', 'search' => 'true', 'wrap_cell' => "true"), |
|
61 | + array('name'=>'nbr_courses', 'index'=>'nbr_courses', 'width'=>'30', 'align'=>'left', 'search' => 'true'), |
|
62 | + array('name'=>'nbr_users', 'index'=>'nbr_users', 'width'=>'30', 'align'=>'left', 'search' => 'true'), |
|
63 | + array('name'=>'category_name', 'index'=>'category_name', 'width'=>'70', 'align'=>'left', 'search' => 'true'), |
|
64 | + array('name'=>'access_start_date', 'index'=>'access_start_date', 'width'=>'40', 'align'=>'left', 'search' => 'true'), |
|
65 | + array('name'=>'access_end_date', 'index'=>'access_end_date', 'width'=>'40', 'align'=>'left', 'search' => 'true'), |
|
66 | + array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'80', 'align'=>'left', 'search' => 'false'), |
|
67 | + array('name'=>'status', 'index'=>'session_active', 'width'=>'40', 'align'=>'left', 'search' => 'true', 'stype'=>'select', |
|
68 | 68 | //for the bottom bar |
69 | 69 | 'searchoptions' => array( |
70 | 70 | 'defaultValue' => '1', |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | ), |
73 | 73 | //for the top bar |
74 | 74 | 'editoptions' => array('value' => ':'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive'))), |
75 | - array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
76 | - array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false') |
|
75 | + array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), |
|
76 | + array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false', 'search' => 'false') |
|
77 | 77 | ); |
78 | 78 | //Autowidth |
79 | 79 | $extra_params['autowidth'] = 'true'; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | //With this function we can add actions to the jgrid (edit, delete, etc) |
87 | 87 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
88 | - return \' <a href="add_users_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('user_subscribe_session.png',get_lang('SubscribeUsersToSession'),'',ICON_SIZE_SMALL).'</a>'. |
|
88 | + return \' <a href="add_users_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('user_subscribe_session.png', get_lang('SubscribeUsersToSession'), '', ICON_SIZE_SMALL).'</a>'. |
|
89 | 89 | '\'; |
90 | 90 | }'; |
91 | 91 | ?> |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $(function() { |
108 | 108 | <?php |
109 | - echo Display::grid_js('sessions', $url,$columns,$column_model,$extra_params, array(), $action_links,true); |
|
109 | + echo Display::grid_js('sessions', $url, $columns, $column_model, $extra_params, array(), $action_links, true); |
|
110 | 110 | ?> |
111 | 111 | |
112 | 112 | setSearchSelect("status"); |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | <?php if (api_is_platform_admin()) {?> |
149 | 149 | <div class="actions"> |
150 | 150 | <?php |
151 | - echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_add.php">'.Display::return_icon('new_session.png',get_lang('AddSession'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
152 | - echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/add_many_session_to_category.php">'.Display::return_icon('session_to_category.png',get_lang('AddSessionsInCategories'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
153 | - echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_category_list.php">'.Display::return_icon('folder.png',get_lang('ListSessionCategory'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
151 | + echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_add.php">'.Display::return_icon('new_session.png', get_lang('AddSession'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
152 | + echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/add_many_session_to_category.php">'.Display::return_icon('session_to_category.png', get_lang('AddSessionsInCategories'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
153 | + echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_category_list.php">'.Display::return_icon('folder.png', get_lang('ListSessionCategory'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
154 | 154 | echo '</div>'; |
155 | 155 | } |
156 | 156 | } else { |
@@ -146,7 +146,7 @@ |
||
146 | 146 | $(function() { |
147 | 147 | <?php |
148 | 148 | // grid definition see the $usergroup>display() function |
149 | - echo Display::grid_js('usergroups', $url, $columns, $columnModel, $extraParams, array(), '', true); |
|
149 | + echo Display::grid_js('usergroups', $url, $columns, $columnModel, $extraParams, array(), '', true); |
|
150 | 150 | ?> |
151 | 151 | }); |
152 | 152 | </script> |
@@ -12,9 +12,9 @@ |
||
12 | 12 | |
13 | 13 | $this_section = SECTION_COURSES; |
14 | 14 | |
15 | -$interbreadcrumb[]= array ('url' =>'classes.php','name' => get_lang('Classes')); |
|
15 | +$interbreadcrumb[] = array('url' =>'classes.php', 'name' => get_lang('Classes')); |
|
16 | 16 | if (isset($_GET['id'])) { |
17 | - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Groups')); |
|
17 | + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Groups')); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | Display :: display_header($tool_name, 'Classes'); |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | |
16 | 16 | $tool_name = get_lang('ImportUsersToACourse'); |
17 | 17 | |
18 | -$interbreadcrumb[] = array ("url" => "user.php", "name" => get_lang("Users")); |
|
19 | -$interbreadcrumb[] = array ("url" => "#", "name" => get_lang("ImportUsersToACourse")); |
|
18 | +$interbreadcrumb[] = array("url" => "user.php", "name" => get_lang("Users")); |
|
19 | +$interbreadcrumb[] = array("url" => "#", "name" => get_lang("ImportUsersToACourse")); |
|
20 | 20 | |
21 | 21 | $form = new FormValidator('user_import', 'post', 'user_import.php'); |
22 | 22 | $form->addElement('header', $tool_name); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if (isset($_FILES['import_file']['size']) && $_FILES['import_file']['size'] !== 0) { |
43 | 43 | $unsubscribe_users = isset($_POST['unsubscribe_users']) ? true : false; |
44 | 44 | //@todo : csvToArray deprecated |
45 | - $users = Import::csvToArray($_FILES['import_file']['tmp_name']); |
|
45 | + $users = Import::csvToArray($_FILES['import_file']['tmp_name']); |
|
46 | 46 | $invalid_users = array(); |
47 | 47 | $clean_users = array(); |
48 | 48 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $user_ids = array(); |
80 | 80 | foreach ($current_user_list as $user) { |
81 | 81 | if (!CourseManager::is_course_teacher($user['user_id'], $course_code)) { |
82 | - $user_ids[]= $user['user_id']; |
|
82 | + $user_ids[] = $user['user_id']; |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | CourseManager::unsubscribe_user($user_ids, $course_code, $session_id); |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | if (empty($session_id)) { |
93 | 93 | //just to make sure |
94 | 94 | if (CourseManager :: is_user_subscribed_in_course($userId, $course_code)) { |
95 | - $user_to_show[]= $userInfo['complete_name']; |
|
95 | + $user_to_show[] = $userInfo['complete_name']; |
|
96 | 96 | } |
97 | 97 | } else { |
98 | 98 | //just to make sure |
99 | 99 | if (CourseManager::is_user_subscribed_in_course($userId, $course_code, true, $session_id)) { |
100 | - $user_to_show[]= $userInfo['complete_name']; |
|
100 | + $user_to_show[] = $userInfo['complete_name']; |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $message = get_lang('CheckUsersWithId'); |
106 | 106 | $type = 'warning'; |
107 | 107 | foreach ($invalid_users as $invalid_user) { |
108 | - $user_to_show[]= $invalid_user; |
|
108 | + $user_to_show[] = $invalid_user; |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | Display::display_warning_message($message.': <br />'.$userMessage, false); |
131 | 131 | } |
132 | 132 | } else { |
133 | - $empty_line_msg = ($empty_line == 0) ? get_lang('ErrorsWhenImportingFile'): get_lang('ErrorsWhenImportingFile').': '.get_lang('EmptyHeaderLine'); |
|
133 | + $empty_line_msg = ($empty_line == 0) ? get_lang('ErrorsWhenImportingFile') : get_lang('ErrorsWhenImportingFile').': '.get_lang('EmptyHeaderLine'); |
|
134 | 134 | Display::display_error_message($empty_line_msg); |
135 | 135 | } |
136 | 136 | } |
@@ -65,6 +65,9 @@ |
||
65 | 65 | |
66 | 66 | /* FUNCTIONS */ |
67 | 67 | |
68 | +/** |
|
69 | + * @param string $name |
|
70 | + */ |
|
68 | 71 | function make_select_session_list($name, $sessions, $attr = array()) |
69 | 72 | { |
70 | 73 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | function display_form() |
87 | 87 | { |
88 | - $html = ''; |
|
88 | + $html = ''; |
|
89 | 89 | $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC')); |
90 | 90 | |
91 | 91 | // Link back to the documents overview |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | //destination |
111 | 111 | $html .= '<div class="form-group">'; |
112 | - $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>'; |
|
112 | + $html .= '<label class="col-sm-2 control-label">'.get_lang('DestinationCoursesFromSession').': </label>'; |
|
113 | 113 | $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">'; |
114 | 114 | $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">'; |
115 | 115 | $html .= '<option value = "0">'.get_lang('ThereIsNotStillASession').'</option></select ></div>'; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $html .= '<button class="btn btn-success" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><em class="fa fa-files-o"></em> '.get_lang('CopyCourse').'</button>'; |
132 | 132 | |
133 | 133 | // Add Security token |
134 | - $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">'; |
|
134 | + $html .= '<input type="hidden" value="'.Security::get_token().'" name="sec_token">'; |
|
135 | 135 | $html .= '</div></div>'; |
136 | 136 | $html .= '</form>'; |
137 | 137 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | /* HTML head extra */ |
229 | 229 | |
230 | -$htmlHeadXtra[] = $xajax->getJavascript( api_get_path(WEB_LIBRARY_PATH).'xajax/'); |
|
230 | +$htmlHeadXtra[] = $xajax->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax/'); |
|
231 | 231 | $htmlHeadXtra[] = '<script> |
232 | 232 | function checkSelected(id_select,id_radio,id_title,id_destination) { |
233 | 233 | var num=0; |