@@ -38,7 +38,7 @@ |
||
38 | 38 | $options = array( |
39 | 39 | '--' => '--' |
40 | 40 | ); |
41 | - for ($i=1; $i <= $questionData['maximum_score']; $i++) { |
|
41 | + for ($i = 1; $i <= $questionData['maximum_score']; $i++) { |
|
42 | 42 | $options[$i] = $i; |
43 | 43 | } |
44 | 44 |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | if (api_is_allowed_to_edit()) { |
76 | 76 | SurveyManager::copy_survey($_GET['survey_id']); |
77 | 77 | $message = get_lang('SurveyCopied'); |
78 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?' . api_get_cidreq()); |
|
78 | + header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq()); |
|
79 | 79 | exit; |
80 | 80 | } |
81 | 81 | } |
@@ -162,10 +162,10 @@ discard block |
||
162 | 162 | if (!api_is_course_coach() || $extend_rights_for_coachs == 'true') { |
163 | 163 | // Action links |
164 | 164 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&action=add">'. |
165 | - Display::return_icon('new_survey.png', get_lang('CreateNewSurvey'),'',ICON_SIZE_MEDIUM).'</a> '; |
|
165 | + Display::return_icon('new_survey.png', get_lang('CreateNewSurvey'), '', ICON_SIZE_MEDIUM).'</a> '; |
|
166 | 166 | } |
167 | 167 | echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&search=advanced">'. |
168 | - Display::return_icon('search.png', get_lang('Search'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
168 | + Display::return_icon('search.png', get_lang('Search'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
169 | 169 | echo '</div>'; |
170 | 170 | |
171 | 171 | // Load main content |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | |
51 | 51 | $result = Database::query($sql); |
52 | 52 | if (!list($session_name,$course_title) = Database::fetch_row($result)) { |
53 | - header('Location: session_course_list.php?id_session='.$id_session); |
|
54 | - exit(); |
|
53 | + header('Location: session_course_list.php?id_session='.$id_session); |
|
54 | + exit(); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | switch ($action) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous');?></a> |
123 | 123 | <?php |
124 | 124 | } else { |
125 | - echo get_lang('Previous'); |
|
125 | + echo get_lang('Previous'); |
|
126 | 126 | } |
127 | 127 | ?> |
128 | 128 | | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next');?></a> |
133 | 133 | <?php |
134 | 134 | } else { |
135 | - echo get_lang('Next'); |
|
135 | + echo get_lang('Next'); |
|
136 | 136 | } |
137 | 137 | ?> |
138 | 138 | </div> |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | $i=0; |
155 | 155 | foreach ($users as $key => $enreg) { |
156 | 156 | |
157 | - if ($key == $limit) { |
|
158 | - break; |
|
159 | - } |
|
157 | + if ($key == $limit) { |
|
158 | + break; |
|
159 | + } |
|
160 | 160 | ?> |
161 | 161 | <tr class="<?php echo $i?'row_odd':'row_even'; ?>"> |
162 | 162 | <td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $id_session = intval($_GET['id_session']); |
19 | 19 | SessionManager::protectSession($id_session); |
20 | 20 | |
21 | -if (empty($id_session )) { |
|
21 | +if (empty($id_session)) { |
|
22 | 22 | api_not_allowed(); |
23 | 23 | } |
24 | 24 | |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | |
29 | 29 | $page = isset($_GET['page']) ? intval($_GET['page']) : null; |
30 | 30 | $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; |
31 | -$default_sort = api_sort_by_first_name() ? 'firstname':'lastname'; |
|
32 | -$sort = isset($_GET['sort']) && in_array($_GET['sort'], array('lastname','firstname','username')) ? $_GET['sort'] : $default_sort; |
|
31 | +$default_sort = api_sort_by_first_name() ? 'firstname' : 'lastname'; |
|
32 | +$sort = isset($_GET['sort']) && in_array($_GET['sort'], array('lastname', 'firstname', 'username')) ? $_GET['sort'] : $default_sort; |
|
33 | 33 | $idChecked = isset($_GET['idChecked']) && is_array($_GET['idChecked']) ? $_GET['idChecked'] : (isset($_POST['idChecked']) && is_array($_POST['idChecked']) ? $_POST['idChecked'] : null); |
34 | -$direction = isset($_GET['direction']) && in_array($_GET['direction'], array('desc','asc')) ? $_GET['direction'] : 'desc'; |
|
34 | +$direction = isset($_GET['direction']) && in_array($_GET['direction'], array('desc', 'asc')) ? $_GET['direction'] : 'desc'; |
|
35 | 35 | |
36 | 36 | if (is_array($idChecked)) { |
37 | 37 | $my_temp = array(); |
38 | 38 | foreach ($idChecked as $id) { |
39 | 39 | // forcing the intval |
40 | - $my_temp[]= intval($id); |
|
40 | + $my_temp[] = intval($id); |
|
41 | 41 | } |
42 | 42 | $idChecked = $my_temp; |
43 | 43 | } |
@@ -49,14 +49,14 @@ discard block |
||
49 | 49 | WHERE src.session_id='$id_session' AND src.c_id='$courseId' "; |
50 | 50 | |
51 | 51 | $result = Database::query($sql); |
52 | -if (!list($session_name,$course_title) = Database::fetch_row($result)) { |
|
52 | +if (!list($session_name, $course_title) = Database::fetch_row($result)) { |
|
53 | 53 | header('Location: session_course_list.php?id_session='.$id_session); |
54 | 54 | exit(); |
55 | 55 | } |
56 | 56 | |
57 | 57 | switch ($action) { |
58 | 58 | case 'delete': |
59 | - if (is_array($idChecked) && count($idChecked)>0) { |
|
59 | + if (is_array($idChecked) && count($idChecked) > 0) { |
|
60 | 60 | array_map('intval', $idChecked); |
61 | 61 | $idChecked = implode(',', $idChecked); |
62 | 62 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | ON (s.session_id = scru.session_id AND s.user_id = scru.user_id AND scru.c_id = '".$courseId."' ) |
92 | 92 | WHERE s.session_id='$id_session' |
93 | 93 | ORDER BY $sort $direction |
94 | - LIMIT $from,".($limit+1); |
|
94 | + LIMIT $from,".($limit + 1); |
|
95 | 95 | |
96 | 96 | if ($direction == 'desc') { |
97 | 97 | $direction = 'asc'; |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | $tool_name = get_lang('Session').': '.$session_name.' - '.get_lang('Course').': '.$course_title; |
108 | 108 | |
109 | 109 | //$interbreadcrumb[] = array("url" => "index.php","name" => get_lang('PlatformAdmin')); |
110 | -$interbreadcrumb[] = array("url" => "session_list.php","name" => get_lang('SessionList')); |
|
111 | -$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session,"name" => get_lang('SessionOverview')); |
|
110 | +$interbreadcrumb[] = array("url" => "session_list.php", "name" => get_lang('SessionList')); |
|
111 | +$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session, "name" => get_lang('SessionOverview')); |
|
112 | 112 | |
113 | 113 | Display::display_header($tool_name); |
114 | 114 | |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | <form method="post" action="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>" onsubmit="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;"> |
118 | 118 | <div align="right"> |
119 | 119 | <?php |
120 | -if($page) { |
|
120 | +if ($page) { |
|
121 | 121 | ?> |
122 | -<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous');?></a> |
|
122 | +<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page - 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a> |
|
123 | 123 | <?php |
124 | 124 | } else { |
125 | 125 | echo get_lang('Previous'); |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | ?> |
128 | 128 | | |
129 | 129 | <?php |
130 | -if($nbr_results > $limit) { |
|
130 | +if ($nbr_results > $limit) { |
|
131 | 131 | ?> |
132 | -<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next');?></a> |
|
132 | +<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page + 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a> |
|
133 | 133 | <?php |
134 | 134 | } else { |
135 | 135 | echo get_lang('Next'); |
@@ -141,39 +141,39 @@ discard block |
||
141 | 141 | <tr> |
142 | 142 | <th> </th> |
143 | 143 | <?php if ($is_western_name_order) { ?> |
144 | - <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName');?></a></th> |
|
145 | - <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName');?></a></th> |
|
144 | + <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName'); ?></a></th> |
|
145 | + <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName'); ?></a></th> |
|
146 | 146 | <?php } else { ?> |
147 | - <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName');?></a></th> |
|
148 | - <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName');?></a></th> |
|
147 | + <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=lastname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('LastName'); ?></a></th> |
|
148 | + <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=firstname&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('FirstName'); ?></a></th> |
|
149 | 149 | <?php } ?> |
150 | - <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=username&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('Login');?></a></th> |
|
151 | - <th><?php echo get_lang('Actions');?></th> |
|
150 | + <th><a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=username&direction=<?php echo urlencode($direction); ?>"><?php echo get_lang('Login'); ?></a></th> |
|
151 | + <th><?php echo get_lang('Actions'); ?></th> |
|
152 | 152 | </tr> |
153 | 153 | <?php |
154 | -$i=0; |
|
154 | +$i = 0; |
|
155 | 155 | foreach ($users as $key => $enreg) { |
156 | 156 | |
157 | 157 | if ($key == $limit) { |
158 | 158 | break; |
159 | 159 | } |
160 | 160 | ?> |
161 | - <tr class="<?php echo $i?'row_odd':'row_even'; ?>"> |
|
161 | + <tr class="<?php echo $i ? 'row_odd' : 'row_even'; ?>"> |
|
162 | 162 | <td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td> |
163 | 163 | <?php if ($is_western_name_order) { ?> |
164 | - <td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td> |
|
165 | - <td><?php echo api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td> |
|
164 | + <td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td> |
|
165 | + <td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td> |
|
166 | 166 | <?php } else { ?> |
167 | - <td><?php echo api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td> |
|
168 | - <td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td> |
|
167 | + <td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td> |
|
168 | + <td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td> |
|
169 | 169 | <?php } ?> |
170 | - <td><?php echo api_htmlentities($enreg['username'],ENT_QUOTES,$charset); ?></td> |
|
170 | + <td><?php echo api_htmlentities($enreg['username'], ENT_QUOTES, $charset); ?></td> |
|
171 | 171 | <td> |
172 | 172 | <?php if ($enreg['is_subscribed']) { ?> |
173 | 173 | <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>&action=delete&idChecked[]=<?php echo $enreg['user_id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;"> |
174 | 174 | <?php Display::display_icon('delete.png', get_lang('Delete')); ?> |
175 | 175 | </a> |
176 | - <?php } else { ?> |
|
176 | + <?php } else { ?> |
|
177 | 177 | <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>&action=add&idChecked[]=<?php echo $enreg['user_id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;"> |
178 | 178 | <?php Display::display_icon('add.png', get_lang('Add'), array(), ICON_SIZE_SMALL); ?> |
179 | 179 | </a> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | </td> |
183 | 183 | </tr> |
184 | 184 | <?php |
185 | - $i=$i ? 0 : 1; |
|
185 | + $i = $i ? 0 : 1; |
|
186 | 186 | } |
187 | 187 | unset($users); |
188 | 188 | ?> |
@@ -190,9 +190,9 @@ discard block |
||
190 | 190 | <br /> |
191 | 191 | <div align="left"> |
192 | 192 | <?php |
193 | - if($page) { |
|
193 | + if ($page) { |
|
194 | 194 | ?> |
195 | - <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a> |
|
195 | + <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page - 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous'); ?></a> |
|
196 | 196 | <?php |
197 | 197 | } else { |
198 | 198 | echo get_lang('Previous'); |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | ?> |
201 | 201 | | |
202 | 202 | <?php |
203 | - if($nbr_results > $limit) { |
|
203 | + if ($nbr_results > $limit) { |
|
204 | 204 | ?> |
205 | - <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a> |
|
205 | + <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page + 1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next'); ?></a> |
|
206 | 206 | <?php |
207 | 207 | } else { |
208 | 208 | echo get_lang('Next'); |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | </div> |
212 | 212 | <br /> |
213 | 213 | <select name="action"> |
214 | -<option value="delete"><?php echo get_lang('UnsubscribeSelectedUsersFromSession');?></option> |
|
215 | -<option value="add"><?php echo get_lang('AddUsers');?></option> |
|
214 | +<option value="delete"><?php echo get_lang('UnsubscribeSelectedUsersFromSession'); ?></option> |
|
215 | +<option value="add"><?php echo get_lang('AddUsers'); ?></option> |
|
216 | 216 | </select> |
217 | 217 | <button class="save" type="submit"> <?php echo get_lang('Ok'); ?></button> |
218 | 218 | </form> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | SessionManager::protectSession($id_session); |
17 | 17 | |
18 | 18 | // setting breadcrumbs |
19 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
19 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
20 | 20 | $interbreadcrumb[] = array( |
21 | 21 | 'url' => 'resume_session.php?id_session='.$id_session, |
22 | 22 | 'name' => get_lang('SessionOverview'), |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | FROM '.Database :: get_main_table(TABLE_MAIN_SESSION).' |
44 | 44 | WHERE id='.$id_session; |
45 | 45 | $rs = Database::query($sql); |
46 | - if (Database::result($rs,0,0)!=$_user['user_id']) { |
|
46 | + if (Database::result($rs, 0, 0) != $_user['user_id']) { |
|
47 | 47 | api_not_allowed(true); |
48 | 48 | } |
49 | 49 | } |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | |
89 | 89 | foreach ($CourseList as $enreg_course) { |
90 | 90 | $exists = false; |
91 | - foreach($existingCourses as $existingCourse) { |
|
91 | + foreach ($existingCourses as $existingCourse) { |
|
92 | 92 | if ($enreg_course == $existingCourse['id']) { |
93 | - $exists=true; |
|
93 | + $exists = true; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | foreach ($existingCourses as $existingCourse) { |
113 | - if (!in_array($existingCourse['id'], $CourseList)){ |
|
113 | + if (!in_array($existingCourse['id'], $CourseList)) { |
|
114 | 114 | $existingCourse = Database::escape_string($existingCourse['id']); |
115 | 115 | $sql = "INSERT IGNORE INTO $tbl_session_rel_course_rel_user (session_id,c_id,user_id) |
116 | 116 | VALUES ('$id_session','$existingCourse','$id_user')"; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | WHERE srcru.user_id = $id_user AND session_id = $id_session"; |
147 | 147 | |
148 | 148 | //all |
149 | -$sql_all="SELECT course.id, code, title, visual_code, src.session_id |
|
149 | +$sql_all = "SELECT course.id, code, title, visual_code, src.session_id |
|
150 | 150 | FROM $tbl_course course |
151 | 151 | INNER JOIN $tbl_session_rel_course as src |
152 | 152 | ON course.id = src.c_id AND session_id = $id_session"; |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | |
164 | 164 | foreach ($CoursesAll as $course) { |
165 | 165 | if (in_array($course['id'], $course_temp)) { |
166 | - $nosessionCourses[$course['id']] = $course ; |
|
166 | + $nosessionCourses[$course['id']] = $course; |
|
167 | 167 | } else { |
168 | - $sessionCourses[$course['id']] = $course ; |
|
168 | + $sessionCourses[$course['id']] = $course; |
|
169 | 169 | } |
170 | 170 | } |
171 | 171 | unset($Courses); |
@@ -184,9 +184,9 @@ discard block |
||
184 | 184 | <td width="45%" align="center"> |
185 | 185 | <div id="ajax_list_courses_multiple"> |
186 | 186 | <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:320px;"> <?php |
187 | - foreach($nosessionCourses as $enreg) { |
|
187 | + foreach ($nosessionCourses as $enreg) { |
|
188 | 188 | ?> |
189 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option> |
|
189 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')', ENT_QUOTES).'"'; if (in_array($enreg['code'], $CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option> |
|
190 | 190 | <?php |
191 | 191 | } |
192 | 192 | ?> </select></div> <?php |
@@ -211,9 +211,9 @@ discard block |
||
211 | 211 | <td width="45%" align="center"> |
212 | 212 | <select id='destination' name="SessionCoursesList[]" multiple="multiple" size="20" style="width:320px;"> |
213 | 213 | <?php |
214 | - foreach($sessionCourses as $enreg) { |
|
214 | + foreach ($sessionCourses as $enreg) { |
|
215 | 215 | ?> |
216 | - <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES); ?>"><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option> |
|
216 | + <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')', ENT_QUOTES); ?>"><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option> |
|
217 | 217 | <?php |
218 | 218 | } |
219 | 219 | unset($sessionCourses); |
@@ -186,7 +186,10 @@ |
||
186 | 186 | <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:320px;"> <?php |
187 | 187 | foreach($nosessionCourses as $enreg) { |
188 | 188 | ?> |
189 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option> |
|
189 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) { |
|
190 | + echo 'selected="selected"'; |
|
191 | +} |
|
192 | +?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option> |
|
190 | 193 | <?php |
191 | 194 | } |
192 | 195 | ?> </select></div> <?php |
@@ -30,26 +30,26 @@ discard block |
||
30 | 30 | $result = Database::query("SELECT name FROM $tbl_session WHERE id='$id_session'"); |
31 | 31 | |
32 | 32 | if (!list($session_name)=Database::fetch_row($result)) { |
33 | - header('Location: session_list.php'); |
|
34 | - exit; |
|
33 | + header('Location: session_list.php'); |
|
34 | + exit; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | if ($action == 'delete') { |
38 | - $idChecked = $_REQUEST['idChecked']; |
|
39 | - if (is_array($idChecked) && count($idChecked)>0) { |
|
40 | - $my_temp = array(); |
|
41 | - foreach ($idChecked as $id){ |
|
42 | - $my_temp[]= Database::escape_string($id);// forcing the escape_string |
|
43 | - } |
|
44 | - $idChecked = $my_temp; |
|
45 | - $idChecked="'".implode("','", $idChecked)."'"; |
|
46 | - $result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
|
47 | - $nbr_affected_rows=Database::affected_rows($result); |
|
48 | - Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
|
49 | - Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'"); |
|
50 | - } |
|
51 | - header('Location: '.api_get_self().'?id_session='.$id_session.'&sort='.$sort); |
|
52 | - exit(); |
|
38 | + $idChecked = $_REQUEST['idChecked']; |
|
39 | + if (is_array($idChecked) && count($idChecked)>0) { |
|
40 | + $my_temp = array(); |
|
41 | + foreach ($idChecked as $id){ |
|
42 | + $my_temp[]= Database::escape_string($id);// forcing the escape_string |
|
43 | + } |
|
44 | + $idChecked = $my_temp; |
|
45 | + $idChecked="'".implode("','", $idChecked)."'"; |
|
46 | + $result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
|
47 | + $nbr_affected_rows=Database::affected_rows($result); |
|
48 | + Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
|
49 | + Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'"); |
|
50 | + } |
|
51 | + header('Location: '.api_get_self().'?id_session='.$id_session.'&sort='.$sort); |
|
52 | + exit(); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $limit = 20; |
@@ -82,17 +82,17 @@ discard block |
||
82 | 82 | $tableCourses = array(); |
83 | 83 | |
84 | 84 | foreach ($Courses as $key=>$enreg) { |
85 | - $course = array(); |
|
86 | - $course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">'; |
|
87 | - $course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset); |
|
88 | - $course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>'; |
|
89 | - $course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'. |
|
90 | - Display::return_icon('course_home.gif', get_lang('Course')).'</a> |
|
85 | + $course = array(); |
|
86 | + $course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">'; |
|
87 | + $course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset); |
|
88 | + $course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>'; |
|
89 | + $course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'. |
|
90 | + Display::return_icon('course_home.gif', get_lang('Course')).'</a> |
|
91 | 91 | <a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'. |
92 | - Display::return_icon('edit.png', get_lang('Edit')).'</a> |
|
92 | + Display::return_icon('edit.png', get_lang('Edit')).'</a> |
|
93 | 93 | <a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'. |
94 | - Display::return_icon('delete.png', get_lang('Delete')).'</a>'; |
|
95 | - $tableCourses[] = $course; |
|
94 | + Display::return_icon('delete.png', get_lang('Delete')).'</a>'; |
|
95 | + $tableCourses[] = $course; |
|
96 | 96 | } |
97 | 97 | echo '<form method="post" action="'.api_get_self().'">'; |
98 | 98 | Display :: display_sortable_table($tableHeader, $tableCourses, array (), array ()); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | require_once __DIR__.'/../inc/global.inc.php'; |
9 | 9 | |
10 | 10 | // setting the section (for the tabs) |
11 | -$this_section=SECTION_PLATFORM_ADMIN; |
|
11 | +$this_section = SECTION_PLATFORM_ADMIN; |
|
12 | 12 | |
13 | 13 | $id_session = intval($_GET['id_session']); |
14 | 14 | SessionManager::protectSession($id_session); |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | // Database Table Definitions |
17 | 17 | $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
18 | 18 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
19 | -$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
20 | -$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
19 | +$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
20 | +$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
21 | 21 | |
22 | 22 | if (empty($id_session)) { |
23 | 23 | api_not_allowed(); |
@@ -25,26 +25,26 @@ discard block |
||
25 | 25 | |
26 | 26 | $page = intval($_GET['page']); |
27 | 27 | $action = $_REQUEST['action']; |
28 | -$sort = in_array($_GET['sort'],array('title','nbr_users'))?$_GET['sort']:'title'; |
|
28 | +$sort = in_array($_GET['sort'], array('title', 'nbr_users')) ? $_GET['sort'] : 'title'; |
|
29 | 29 | |
30 | 30 | $result = Database::query("SELECT name FROM $tbl_session WHERE id='$id_session'"); |
31 | 31 | |
32 | -if (!list($session_name)=Database::fetch_row($result)) { |
|
32 | +if (!list($session_name) = Database::fetch_row($result)) { |
|
33 | 33 | header('Location: session_list.php'); |
34 | 34 | exit; |
35 | 35 | } |
36 | 36 | |
37 | 37 | if ($action == 'delete') { |
38 | 38 | $idChecked = $_REQUEST['idChecked']; |
39 | - if (is_array($idChecked) && count($idChecked)>0) { |
|
39 | + if (is_array($idChecked) && count($idChecked) > 0) { |
|
40 | 40 | $my_temp = array(); |
41 | - foreach ($idChecked as $id){ |
|
42 | - $my_temp[]= Database::escape_string($id);// forcing the escape_string |
|
41 | + foreach ($idChecked as $id) { |
|
42 | + $my_temp[] = Database::escape_string($id); // forcing the escape_string |
|
43 | 43 | } |
44 | 44 | $idChecked = $my_temp; |
45 | - $idChecked="'".implode("','", $idChecked)."'"; |
|
45 | + $idChecked = "'".implode("','", $idChecked)."'"; |
|
46 | 46 | $result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
47 | - $nbr_affected_rows=Database::affected_rows($result); |
|
47 | + $nbr_affected_rows = Database::affected_rows($result); |
|
48 | 48 | Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
49 | 49 | Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'"); |
50 | 50 | } |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | FROM $tbl_session_rel_course, $tbl_course c |
60 | 60 | WHERE c_id = c.id AND session_id='$id_session' |
61 | 61 | ORDER BY $sort |
62 | - LIMIT $from,".($limit+1); |
|
63 | -$result=Database::query($sql); |
|
64 | -$Courses=Database::store_result($result); |
|
65 | -$tool_name = api_htmlentities($session_name,ENT_QUOTES,$charset).' : '.get_lang('CourseListInSession'); |
|
62 | + LIMIT $from,".($limit + 1); |
|
63 | +$result = Database::query($sql); |
|
64 | +$Courses = Database::store_result($result); |
|
65 | +$tool_name = api_htmlentities($session_name, ENT_QUOTES, $charset).' : '.get_lang('CourseListInSession'); |
|
66 | 66 | |
67 | 67 | //$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
68 | -$interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList')); |
|
69 | -$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']),"name" => get_lang('SessionOverview')); |
|
68 | +$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList')); |
|
69 | +$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']), "name" => get_lang('SessionOverview')); |
|
70 | 70 | |
71 | 71 | Display::display_header($tool_name); |
72 | 72 | echo Display::page_header($tool_name); |
@@ -84,18 +84,18 @@ discard block |
||
84 | 84 | foreach ($Courses as $key=>$enreg) { |
85 | 85 | $course = array(); |
86 | 86 | $course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">'; |
87 | - $course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset); |
|
87 | + $course[] = api_htmlentities($enreg['title'], ENT_QUOTES, $charset); |
|
88 | 88 | $course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>'; |
89 | 89 | $course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'. |
90 | 90 | Display::return_icon('course_home.gif', get_lang('Course')).'</a> |
91 | 91 | <a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'. |
92 | 92 | Display::return_icon('edit.png', get_lang('Edit')).'</a> |
93 | - <a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'. |
|
93 | + <a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset)).'\')) return false;">'. |
|
94 | 94 | Display::return_icon('delete.png', get_lang('Delete')).'</a>'; |
95 | 95 | $tableCourses[] = $course; |
96 | 96 | } |
97 | 97 | echo '<form method="post" action="'.api_get_self().'">'; |
98 | -Display :: display_sortable_table($tableHeader, $tableCourses, array (), array ()); |
|
98 | +Display :: display_sortable_table($tableHeader, $tableCourses, array(), array()); |
|
99 | 99 | echo '<select name="action"> |
100 | 100 | <option value="delete">'.get_lang('UnsubscribeCoursesFromSession').'</option> |
101 | 101 | </select> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $tool_name = get_lang('ImportSessionDrhList'); |
17 | 17 | |
18 | 18 | //$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
19 | -$interbreadcrumb[]=array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
19 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
20 | 20 | |
21 | 21 | set_time_limit(0); |
22 | 22 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | echo '<div class="actions">'; |
29 | 29 | echo '<a href="../session/session_list.php">'. |
30 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
30 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
31 | 31 | echo '</div>'; |
32 | 32 | |
33 | 33 | if (!empty($error_message)) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $sessionRepository = Database::getManager()->getRepository('ChamiloCoreBundle:Session'); |
156 | 156 | $courses = $sessionRepository->getCoursesOrderedByPosition($session); |
157 | 157 | |
158 | - foreach ($courses as $course) { |
|
158 | + foreach ($courses as $course) { |
|
159 | 159 | //select the number of users |
160 | 160 | $sql = "SELECT count(*) |
161 | 161 | FROM $tbl_session_rel_user sru, |
@@ -167,37 +167,37 @@ discard block |
||
167 | 167 | sru.relation_type <> ".SESSION_RELATION_TYPE_RRHH." AND |
168 | 168 | srcru.session_id = '".intval($sessionId)."'"; |
169 | 169 | |
170 | - $rs = Database::query($sql); |
|
170 | + $rs = Database::query($sql); |
|
171 | 171 | $numberOfUsers = Database::result($rs, 0, 0); |
172 | 172 | |
173 | - // Get coachs of the courses in session |
|
173 | + // Get coachs of the courses in session |
|
174 | 174 | |
175 | - $sql = "SELECT user.lastname, user.firstname, user.username |
|
175 | + $sql = "SELECT user.lastname, user.firstname, user.username |
|
176 | 176 | FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user |
177 | 177 | WHERE |
178 | 178 | session_rcru.user_id = user.user_id AND |
179 | 179 | session_rcru.session_id = '".intval($sessionId)."' AND |
180 | 180 | session_rcru.c_id ='".intval($course->getId())."' AND |
181 | 181 | session_rcru.status=2"; |
182 | - $rs = Database::query($sql); |
|
182 | + $rs = Database::query($sql); |
|
183 | 183 | |
184 | - $coachs = array(); |
|
185 | - if (Database::num_rows($rs) > 0) { |
|
186 | - while($info_coach = Database::fetch_array($rs)) { |
|
184 | + $coachs = array(); |
|
185 | + if (Database::num_rows($rs) > 0) { |
|
186 | + while($info_coach = Database::fetch_array($rs)) { |
|
187 | 187 | $coachs[] = api_get_person_name( |
188 | 188 | $info_coach['firstname'], |
189 | 189 | $info_coach['lastname'] |
190 | 190 | ).' ('.$info_coach['username'].')'; |
191 | - } |
|
192 | - } else { |
|
193 | - $coach = get_lang('None'); |
|
194 | - } |
|
191 | + } |
|
192 | + } else { |
|
193 | + $coach = get_lang('None'); |
|
194 | + } |
|
195 | 195 | |
196 | - if (count($coachs) > 0) { |
|
197 | - $coach = implode('<br />',$coachs); |
|
198 | - } else { |
|
199 | - $coach = get_lang('None'); |
|
200 | - } |
|
196 | + if (count($coachs) > 0) { |
|
197 | + $coach = implode('<br />',$coachs); |
|
198 | + } else { |
|
199 | + $coach = get_lang('None'); |
|
200 | + } |
|
201 | 201 | |
202 | 202 | $orderButtons = null; |
203 | 203 | |
@@ -233,8 +233,8 @@ discard block |
||
233 | 233 | |
234 | 234 | $courseUrl = api_get_course_url($course->getCode(), $sessionId); |
235 | 235 | |
236 | - // hide_course_breadcrumb the parameter has been added to hide the name |
|
237 | - // of the course, that appeared in the default $interbreadcrumb |
|
236 | + // hide_course_breadcrumb the parameter has been added to hide the name |
|
237 | + // of the course, that appeared in the default $interbreadcrumb |
|
238 | 238 | $courseItem .= ' |
239 | 239 | <tr> |
240 | 240 | <td class="title">'.Display::url( |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | </td> |
261 | 261 | </tr>'; |
262 | 262 | $count++; |
263 | - } |
|
263 | + } |
|
264 | 264 | $courseListToShow .= $courseItem; |
265 | 265 | } |
266 | 266 | $courseListToShow .= '</table><br />'; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $tool_name = get_lang('SessionOverview'); |
30 | 30 | |
31 | 31 | //$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
32 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
32 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
33 | 33 | |
34 | 34 | $orig_param = '&origin=resume_session'; |
35 | 35 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | $coachs = array(); |
185 | 185 | if (Database::num_rows($rs) > 0) { |
186 | - while($info_coach = Database::fetch_array($rs)) { |
|
186 | + while ($info_coach = Database::fetch_array($rs)) { |
|
187 | 187 | $coachs[] = api_get_person_name( |
188 | 188 | $info_coach['firstname'], |
189 | 189 | $info_coach['lastname'] |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | if (count($coachs) > 0) { |
197 | - $coach = implode('<br />',$coachs); |
|
197 | + $coach = implode('<br />', $coachs); |
|
198 | 198 | } else { |
199 | 199 | $coach = get_lang('None'); |
200 | 200 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $downIcon = 'down.png'; |
218 | 218 | $downUrl = api_get_self().'?id_session='.$sessionId.'&course_id='.$course->getId().'&action=move_down'; |
219 | 219 | |
220 | - if ($count +1 == count($courses)) { |
|
220 | + if ($count + 1 == count($courses)) { |
|
221 | 221 | $downIcon = 'down_na.png'; |
222 | 222 | $downUrl = '#'; |
223 | 223 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | <td>'.$coach.'</td> |
245 | 245 | <td>'.$numberOfUsers.'</td> |
246 | 246 | <td> |
247 | - <a href="'. $courseUrl . '">'. |
|
247 | + <a href="'. $courseUrl.'">'. |
|
248 | 248 | Display::return_icon('course_home.gif', get_lang('Course')).'</a> |
249 | 249 | '.$orderButtons.' |
250 | 250 | <a href="session_course_user_list.php?id_session='.$sessionId.'&course_code='.$course->getCode().'">'. |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | array('onclick' => "javascript:if(!confirm('".get_lang('ConfirmYourChoice')."')) return false;") |
310 | 310 | ); |
311 | 311 | |
312 | - $addUserToUrlLink= ''; |
|
312 | + $addUserToUrlLink = ''; |
|
313 | 313 | if ($multiple_url_is_on) { |
314 | 314 | if ($user['access_url_id'] != $url_id) { |
315 | 315 | $userLink .= ' '.Display::return_icon( |
@@ -98,9 +98,10 @@ discard block |
||
98 | 98 | $cond_user_id = ''; |
99 | 99 | |
100 | 100 | // Only for single & multiple |
101 | - if (in_array($type, array('single','multiple'))) |
|
102 | - if (!empty($id_session)) { |
|
101 | + if (in_array($type, array('single','multiple'))) { |
|
102 | + if (!empty($id_session)) { |
|
103 | 103 | $id_session = intval($id_session); |
104 | + } |
|
104 | 105 | // check id_user from session_rel_user table |
105 | 106 | $sql = 'SELECT user_id FROM '.$tbl_session_rel_user.' |
106 | 107 | WHERE session_id = "'.$id_session.'" AND relation_type<>'.SESSION_RELATION_TYPE_RRHH.' '; |
@@ -558,7 +559,10 @@ discard block |
||
558 | 559 | echo $newLinks; |
559 | 560 | ?> |
560 | 561 | </div> |
561 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($addProcess)) echo '&add=true' ; ?>" <?php if ($ajax_search) { echo ' onsubmit="valide();"';}?>> |
|
562 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($addProcess)) { |
|
563 | + echo '&add=true' ; |
|
564 | +} |
|
565 | +?>" <?php if ($ajax_search) { echo ' onsubmit="valide();"';}?>> |
|
562 | 566 | <?php echo '<legend>'.$tool_name.' ('.$session_info['name'].') </legend>'; ?> |
563 | 567 | <?php |
564 | 568 | if ($add_type=='multiple') { |
@@ -613,7 +617,10 @@ discard block |
||
613 | 617 | <?php |
614 | 618 | foreach ($nosessionUsersList as $uid => $enreg) { |
615 | 619 | ?> |
616 | - <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>> |
|
620 | + <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) { |
|
621 | + echo 'selected="selected"'; |
|
622 | +} |
|
623 | +?>> |
|
617 | 624 | <?php |
618 | 625 | $personName = api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].') '.$enreg['official_code']; |
619 | 626 | if ($showOfficialCode) { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $add_type = 'unique'; |
39 | 39 | |
40 | 40 | if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
41 | - $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
41 | + $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null; |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | |
427 | 427 | if ($use_extra_fields) { |
428 | 428 | $final_result = array(); |
429 | - if (count($extra_field_result)>1) { |
|
430 | - for($i=0;$i<count($extra_field_result)-1;$i++) { |
|
429 | + if (count($extra_field_result)>1) { |
|
430 | + for($i=0;$i<count($extra_field_result)-1;$i++) { |
|
431 | 431 | if (is_array($extra_field_result[$i+1])) { |
432 | 432 | $final_result = array_intersect($extra_field_result[$i],$extra_field_result[$i+1]); |
433 | 433 | } |
@@ -547,12 +547,12 @@ discard block |
||
547 | 547 | } |
548 | 548 | |
549 | 549 | if ($add_type == 'multiple') { |
550 | - $link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$addProcess.'&add_type=unique">'. |
|
550 | + $link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$addProcess.'&add_type=unique">'. |
|
551 | 551 | Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>'; |
552 | - $link_add_type_multiple = Display::url(Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'), ''); |
|
552 | + $link_add_type_multiple = Display::url(Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'), ''); |
|
553 | 553 | } else { |
554 | - $link_add_type_unique = Display::url(Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'), ''); |
|
555 | - $link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$addProcess.'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>'; |
|
554 | + $link_add_type_unique = Display::url(Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'), ''); |
|
555 | + $link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$addProcess.'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>'; |
|
556 | 556 | } |
557 | 557 | $link_add_group = Display::url( |
558 | 558 | Display::return_icon('multiple.gif',get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups'), |
@@ -580,17 +580,17 @@ discard block |
||
580 | 580 | <?php echo '<legend>'.$tool_name.' ('.$session_info['name'].') </legend>'; ?> |
581 | 581 | <?php |
582 | 582 | if ($add_type=='multiple') { |
583 | - if (is_array($extra_field_list)) { |
|
584 | - if (is_array($new_field_list) && count($new_field_list)>0 ) { |
|
585 | - echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
|
586 | - foreach ($new_field_list as $new_field) { |
|
587 | - echo $new_field['name']; |
|
588 | - $varname = 'field_'.$new_field['variable']; |
|
583 | + if (is_array($extra_field_list)) { |
|
584 | + if (is_array($new_field_list) && count($new_field_list)>0 ) { |
|
585 | + echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
|
586 | + foreach ($new_field_list as $new_field) { |
|
587 | + echo $new_field['name']; |
|
588 | + $varname = 'field_'.$new_field['variable']; |
|
589 | 589 | $fieldtype = $new_field['type']; |
590 | - echo ' <select name="'.$varname.'">'; |
|
591 | - echo '<option value="0">--'.get_lang('Select').'--</option>'; |
|
592 | - foreach ($new_field['data'] as $option) { |
|
593 | - $checked=''; |
|
590 | + echo ' <select name="'.$varname.'">'; |
|
591 | + echo '<option value="0">--'.get_lang('Select').'--</option>'; |
|
592 | + foreach ($new_field['data'] as $option) { |
|
593 | + $checked=''; |
|
594 | 594 | if ($fieldtype == ExtraField::FIELD_TYPE_TAG) { |
595 | 595 | if (isset($_POST[$varname])) { |
596 | 596 | if ($_POST[$varname] == $option['tag']) { |
@@ -611,11 +611,11 @@ discard block |
||
611 | 611 | $extraHidden = $fieldtype == ExtraField::FIELD_TYPE_TAG ? '<input type="hidden" name="field_id" value="'.$option['field_id'].'" />' : ''; |
612 | 612 | echo $extraHidden; |
613 | 613 | echo ' '; |
614 | - } |
|
615 | - echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />'; |
|
616 | - echo '<br /><br />'; |
|
617 | - } |
|
618 | - } |
|
614 | + } |
|
615 | + echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />'; |
|
616 | + echo '<br /><br />'; |
|
617 | + } |
|
618 | + } |
|
619 | 619 | } |
620 | 620 | ?> |
621 | 621 | <input type="hidden" name="form_sent" value="1" /> |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | |
624 | 624 | <?php |
625 | 625 | if (!empty($errorMsg)) { |
626 | - Display::display_normal_message($errorMsg); //main API |
|
626 | + Display::display_normal_message($errorMsg); //main API |
|
627 | 627 | } |
628 | 628 | ?> |
629 | 629 | <div id="multiple-add-session" class="row"> |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | <label><?php echo get_lang('UserListInPlatform') ?> </label> |
633 | 633 | <?php |
634 | 634 | if (!($add_type=='multiple')) { |
635 | - ?> |
|
635 | + ?> |
|
636 | 636 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" class="form-control" /> |
637 | 637 | <div id="ajax_list_users_single" class="select-list-ajax"></div> |
638 | 638 | <?php |
@@ -641,21 +641,21 @@ discard block |
||
641 | 641 | <div id="ajax_list_users_multiple"> |
642 | 642 | <select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" class="form-control"> |
643 | 643 | <?php |
644 | - foreach ($nosessionUsersList as $uid => $enreg) { |
|
645 | - ?> |
|
644 | + foreach ($nosessionUsersList as $uid => $enreg) { |
|
645 | + ?> |
|
646 | 646 | <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>> |
647 | 647 | <?php |
648 | - $personName = api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].') '.$enreg['official_code']; |
|
649 | - if ($showOfficialCode) { |
|
650 | - $officialCode = !empty($enreg['official_code']) ? $enreg['official_code'].' - ' : '? - '; |
|
651 | - $personName = $officialCode.api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; |
|
652 | - } |
|
653 | - echo $personName; |
|
654 | - ?> |
|
648 | + $personName = api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].') '.$enreg['official_code']; |
|
649 | + if ($showOfficialCode) { |
|
650 | + $officialCode = !empty($enreg['official_code']) ? $enreg['official_code'].' - ' : '? - '; |
|
651 | + $personName = $officialCode.api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; |
|
652 | + } |
|
653 | + echo $personName; |
|
654 | + ?> |
|
655 | 655 | </option> |
656 | 656 | <?php |
657 | - } |
|
658 | - ?> |
|
657 | + } |
|
658 | + ?> |
|
659 | 659 | </select> |
660 | 660 | </div> |
661 | 661 | <input type="checkbox" onchange="checked_in_no_session(this.checked);" name="user_with_any_session" id="user_with_any_session_id"> |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | <?php |
664 | 664 | } |
665 | 665 | unset($nosessionUsersList); |
666 | - ?> |
|
666 | + ?> |
|
667 | 667 | </div> |
668 | 668 | </div> |
669 | 669 | |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | <?php |
708 | 708 | } |
709 | 709 | if (!empty($addProcess)) { |
710 | - echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>'; |
|
710 | + echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>'; |
|
711 | 711 | } else { |
712 | 712 | echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('SubscribeUsersToSession').'</button>'; |
713 | 713 | } |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | if (api_is_session_admin() && |
103 | 103 | api_get_setting('prevent_session_admins_to_manage_all_users') === 'true' |
104 | 104 | ) { |
105 | - $order_clause = " AND user.creator_id = " . api_get_user_id() . $order_clause; |
|
105 | + $order_clause = " AND user.creator_id = ".api_get_user_id().$order_clause; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | $cond_user_id = ''; |
109 | 109 | |
110 | 110 | // Only for single & multiple |
111 | - if (in_array($type, array('single','multiple'))) |
|
111 | + if (in_array($type, array('single', 'multiple'))) |
|
112 | 112 | if (!empty($id_session)) { |
113 | 113 | $id_session = intval($id_session); |
114 | 114 | // check id_user from session_rel_user table |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | $user_ids = array(); |
119 | 119 | if (Database::num_rows($res) > 0) { |
120 | 120 | while ($row = Database::fetch_row($res)) { |
121 | - $user_ids[] = (int)$row[0]; |
|
121 | + $user_ids[] = (int) $row[0]; |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | if (count($user_ids) > 0) { |
125 | - $cond_user_id = ' AND user.id NOT IN('.implode(",",$user_ids).')'; |
|
125 | + $cond_user_id = ' AND user.id NOT IN('.implode(",", $user_ids).')'; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | if (api_is_multiple_url_enabled()) { |
167 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
167 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
168 | 168 | $access_url_id = api_get_current_access_url_id(); |
169 | 169 | if ($access_url_id != -1) { |
170 | 170 | switch ($type) { |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | |
216 | 216 | $rs = Database::query($sql); |
217 | 217 | $i = 0; |
218 | - if ($type=='single') { |
|
218 | + if ($type == 'single') { |
|
219 | 219 | while ($user = Database :: fetch_array($rs)) { |
220 | 220 | $i++; |
221 | - if ($i<=10) { |
|
221 | + if ($i <= 10) { |
|
222 | 222 | $person_name = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') '.$user['official_code']; |
223 | 223 | if ($showOfficialCode) { |
224 | 224 | $officialCode = !empty($user['official_code']) ? $user['official_code'].' - ' : '? - '; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | } |
232 | 232 | } |
233 | 233 | |
234 | - $xajax_response -> addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return)); |
|
234 | + $xajax_response -> addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return)); |
|
235 | 235 | } else { |
236 | 236 | global $nosessionUsersList; |
237 | 237 | $return .= '<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">'; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $return .= '<option value="'.$user['id'].'">'.$person_name.' </option>'; |
245 | 245 | } |
246 | 246 | $return .= '</select>'; |
247 | - $xajax_response -> addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return)); |
|
247 | + $xajax_response -> addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return)); |
|
248 | 248 | } |
249 | 249 | } |
250 | 250 | return $xajax_response; |
@@ -355,10 +355,10 @@ discard block |
||
355 | 355 | $order_clause"; |
356 | 356 | |
357 | 357 | if (api_is_multiple_url_enabled()) { |
358 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
358 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
359 | 359 | $access_url_id = api_get_current_access_url_id(); |
360 | 360 | if ($access_url_id != -1) { |
361 | - $sql="SELECT u.id, lastname, firstname, username, session_id, official_code |
|
361 | + $sql = "SELECT u.id, lastname, firstname, username, session_id, official_code |
|
362 | 362 | FROM $tbl_user u |
363 | 363 | INNER JOIN $tbl_session_rel_user |
364 | 364 | ON $tbl_session_rel_user.user_id = u.id AND |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | $result = Database::query($sql); |
373 | 373 | $users = Database::store_result($result); |
374 | 374 | foreach ($users as $user) { |
375 | - $sessionUsersList[$user['id']] = $user ; |
|
375 | + $sessionUsersList[$user['id']] = $user; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | $sessionUserInfo = SessionManager::getTotalUserCoursesInSession($id_session); |
@@ -408,12 +408,12 @@ discard block |
||
408 | 408 | if (isset($_POST[$varname]) && $_POST[$varname] != '0') { |
409 | 409 | $use_extra_fields = true; |
410 | 410 | if ($fieldtype == ExtraField::FIELD_TYPE_TAG) { |
411 | - $extra_field_result[]= UserManager::get_extra_user_data_by_tags( |
|
411 | + $extra_field_result[] = UserManager::get_extra_user_data_by_tags( |
|
412 | 412 | intval($_POST['field_id']), |
413 | 413 | $_POST[$varname] |
414 | 414 | ); |
415 | 415 | } else { |
416 | - $extra_field_result[]= UserManager::get_extra_user_data_by_value( |
|
416 | + $extra_field_result[] = UserManager::get_extra_user_data_by_value( |
|
417 | 417 | $new_field['variable'], |
418 | 418 | $_POST[$varname] |
419 | 419 | ); |
@@ -426,10 +426,10 @@ discard block |
||
426 | 426 | |
427 | 427 | if ($use_extra_fields) { |
428 | 428 | $final_result = array(); |
429 | - if (count($extra_field_result)>1) { |
|
430 | - for($i=0;$i<count($extra_field_result)-1;$i++) { |
|
431 | - if (is_array($extra_field_result[$i+1])) { |
|
432 | - $final_result = array_intersect($extra_field_result[$i],$extra_field_result[$i+1]); |
|
429 | + if (count($extra_field_result) > 1) { |
|
430 | + for ($i = 0; $i < count($extra_field_result) - 1; $i++) { |
|
431 | + if (is_array($extra_field_result[$i + 1])) { |
|
432 | + $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i + 1]); |
|
433 | 433 | } |
434 | 434 | } |
435 | 435 | } else { |
@@ -437,14 +437,14 @@ discard block |
||
437 | 437 | } |
438 | 438 | |
439 | 439 | if (api_is_multiple_url_enabled()) { |
440 | - if (is_array($final_result) && count($final_result)>0) { |
|
441 | - $where_filter = " AND u.id IN ('".implode("','",$final_result)."') "; |
|
440 | + if (is_array($final_result) && count($final_result) > 0) { |
|
441 | + $where_filter = " AND u.id IN ('".implode("','", $final_result)."') "; |
|
442 | 442 | } else { |
443 | 443 | //no results |
444 | 444 | $where_filter = " AND u.id = -1"; |
445 | 445 | } |
446 | 446 | } else { |
447 | - if (is_array($final_result) && count($final_result)>0) { |
|
447 | + if (is_array($final_result) && count($final_result) > 0) { |
|
448 | 448 | $where_filter = " WHERE u.id IN ('".implode("','", $final_result)."') "; |
449 | 449 | } else { |
450 | 450 | //no results |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | } |
454 | 454 | } |
455 | 455 | if (api_is_session_admin() && api_get_setting('prevent_session_admins_to_manage_all_users') === 'true') { |
456 | - $order_clause = " AND u.creator_id = " . api_get_user_id() . $order_clause; |
|
456 | + $order_clause = " AND u.creator_id = ".api_get_user_id().$order_clause; |
|
457 | 457 | } |
458 | 458 | if ($use_extra_fields) { |
459 | 459 | $sql = "SELECT u.id, lastname, firstname, username, session_id, official_code |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | $order_clause"; |
476 | 476 | } |
477 | 477 | if (api_is_multiple_url_enabled()) { |
478 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
478 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
479 | 479 | $access_url_id = api_get_current_access_url_id(); |
480 | 480 | if ($access_url_id != -1) { |
481 | 481 | $sql = "SELECT u.id, lastname, firstname, username, session_id, official_code |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | 'ln' => $user['lastname'], |
502 | 502 | 'un' => $user['username'], |
503 | 503 | 'official_code' => $user['official_code'] |
504 | - ) ; |
|
504 | + ); |
|
505 | 505 | unset($users[$uid]); |
506 | 506 | } |
507 | 507 | } |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | WHERE u.status<>".DRH." AND u.status<>6 $order_clause"; |
518 | 518 | |
519 | 519 | if (api_is_multiple_url_enabled()) { |
520 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
520 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
521 | 521 | $access_url_id = api_get_current_access_url_id(); |
522 | 522 | if ($access_url_id != -1) { |
523 | 523 | $sql = "SELECT u.id, lastname, firstname, username, session_id, official_code |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | $link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$addProcess.'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>'; |
556 | 556 | } |
557 | 557 | $link_add_group = Display::url( |
558 | - Display::return_icon('multiple.gif',get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups'), |
|
558 | + Display::return_icon('multiple.gif', get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups'), |
|
559 | 559 | api_get_path(WEB_CODE_PATH).'admin/usergroups.php' |
560 | 560 | ); |
561 | 561 | |
@@ -576,12 +576,12 @@ discard block |
||
576 | 576 | echo $newLinks; |
577 | 577 | ?> |
578 | 578 | </div> |
579 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($addProcess)) echo '&add=true' ; ?>" <?php if ($ajax_search) { echo ' onsubmit="valide();"';}?>> |
|
579 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if (!empty($addProcess)) echo '&add=true'; ?>" <?php if ($ajax_search) { echo ' onsubmit="valide();"'; }?>> |
|
580 | 580 | <?php echo '<legend>'.$tool_name.' ('.$session_info['name'].') </legend>'; ?> |
581 | 581 | <?php |
582 | -if ($add_type=='multiple') { |
|
582 | +if ($add_type == 'multiple') { |
|
583 | 583 | if (is_array($extra_field_list)) { |
584 | - if (is_array($new_field_list) && count($new_field_list)>0 ) { |
|
584 | + if (is_array($new_field_list) && count($new_field_list) > 0) { |
|
585 | 585 | echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
586 | 586 | foreach ($new_field_list as $new_field) { |
587 | 587 | echo $new_field['name']; |
@@ -589,8 +589,8 @@ discard block |
||
589 | 589 | $fieldtype = $new_field['type']; |
590 | 590 | echo ' <select name="'.$varname.'">'; |
591 | 591 | echo '<option value="0">--'.get_lang('Select').'--</option>'; |
592 | - foreach ($new_field['data'] as $option) { |
|
593 | - $checked=''; |
|
592 | + foreach ($new_field['data'] as $option) { |
|
593 | + $checked = ''; |
|
594 | 594 | if ($fieldtype == ExtraField::FIELD_TYPE_TAG) { |
595 | 595 | if (isset($_POST[$varname])) { |
596 | 596 | if ($_POST[$varname] == $option['tag']) { |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | <div class="form-group"> |
632 | 632 | <label><?php echo get_lang('UserListInPlatform') ?> </label> |
633 | 633 | <?php |
634 | - if (!($add_type=='multiple')) { |
|
634 | + if (!($add_type == 'multiple')) { |
|
635 | 635 | ?> |
636 | 636 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" class="form-control" /> |
637 | 637 | <div id="ajax_list_users_single" class="select-list-ajax"></div> |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | <?php |
644 | 644 | foreach ($nosessionUsersList as $uid => $enreg) { |
645 | 645 | ?> |
646 | - <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>> |
|
646 | + <option value="<?php echo $uid; ?>" <?php if (in_array($uid, $UserList)) echo 'selected="selected"'; ?>> |
|
647 | 647 | <?php |
648 | 648 | $personName = api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].') '.$enreg['official_code']; |
649 | 649 | if ($showOfficialCode) { |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | </div> |
669 | 669 | |
670 | 670 | <div class="col-md-4"> |
671 | - <?php if ($add_type=='multiple') { ?> |
|
671 | + <?php if ($add_type == 'multiple') { ?> |
|
672 | 672 | <?php echo get_lang('FirstLetterUser'); ?> : |
673 | 673 | |
674 | 674 | <select id="first_letter_user" name="firstLetterUser" onchange = "change_select(this.value);" > |
@@ -70,13 +70,13 @@ |
||
70 | 70 | <tr> |
71 | 71 | <td align="center"> |
72 | 72 | <?php |
73 | - echo Display::select( |
|
74 | - 'sessions[]', |
|
75 | - $sessionList, |
|
76 | - '', |
|
77 | - array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'sessions', 'size'=>'15px'), |
|
78 | - false |
|
79 | - ); |
|
73 | + echo Display::select( |
|
74 | + 'sessions[]', |
|
75 | + $sessionList, |
|
76 | + '', |
|
77 | + array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'sessions', 'size'=>'15px'), |
|
78 | + false |
|
79 | + ); |
|
80 | 80 | ?> |
81 | 81 | </td> |
82 | 82 | <td align="center"> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | // setting breadcrumbs |
16 | 16 | //$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
17 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
17 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
18 | 18 | |
19 | 19 | // Setting the name of the tool |
20 | 20 | $tool_name = get_lang('EnrollTrainersFromExistingSessions'); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 'sessions[]', |
75 | 75 | $sessionList, |
76 | 76 | '', |
77 | - array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'sessions', 'size'=>'15px'), |
|
77 | + array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'sessions', 'size'=>'15px'), |
|
78 | 78 | false |
79 | 79 | ); |
80 | 80 | ?> |