@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | $xajax = new xajax(); |
13 | 13 | $xajax->registerFunction( |
14 | - array('search_courses', 'Accessurleditcoursestourl', 'search_courses') |
|
14 | + array('search_courses', 'Accessurleditcoursestourl', 'search_courses') |
|
15 | 15 | ); |
16 | 16 | |
17 | 17 | // setting the section (for the tabs) |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | // Access restrictions |
21 | 21 | api_protect_global_admin_script(); |
22 | 22 | if (!api_get_multiple_access_url()) { |
23 | - header('Location: index.php'); |
|
24 | - exit; |
|
23 | + header('Location: index.php'); |
|
24 | + exit; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | // Database Table Definitions |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | |
37 | 37 | $add_type = 'multiple'; |
38 | 38 | if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { |
39 | - $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
39 | + $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $access_url_id = 1; |
43 | 43 | if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') { |
44 | - $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']); |
|
44 | + $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $xajax -> processRequests(); |
@@ -83,21 +83,21 @@ discard block |
||
83 | 83 | $users = $sessions = array(); |
84 | 84 | |
85 | 85 | if (isset($_POST['form_sent']) && $_POST['form_sent']) { |
86 | - $form_sent = $_POST['form_sent']; |
|
87 | - $course_list = $_POST['course_list']; |
|
88 | - |
|
89 | - if (!is_array($course_list)) { |
|
90 | - $course_list = array(); |
|
91 | - } |
|
92 | - |
|
93 | - if ($form_sent == 1) { |
|
94 | - if ($access_url_id==0) { |
|
95 | - header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL')); |
|
96 | - } elseif (is_array($course_list)) { |
|
97 | - UrlManager::update_urls_rel_course($course_list, $access_url_id); |
|
98 | - header('Location: access_urls.php?action=show_message&message='.get_lang('CoursesWereEdited')); |
|
99 | - } |
|
100 | - } |
|
86 | + $form_sent = $_POST['form_sent']; |
|
87 | + $course_list = $_POST['course_list']; |
|
88 | + |
|
89 | + if (!is_array($course_list)) { |
|
90 | + $course_list = array(); |
|
91 | + } |
|
92 | + |
|
93 | + if ($form_sent == 1) { |
|
94 | + if ($access_url_id==0) { |
|
95 | + header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL')); |
|
96 | + } elseif (is_array($course_list)) { |
|
97 | + UrlManager::update_urls_rel_course($course_list, $access_url_id); |
|
98 | + header('Location: access_urls.php?action=show_message&message='.get_lang('CoursesWereEdited')); |
|
99 | + } |
|
100 | + } |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | Display::display_header($tool_name); |
@@ -109,45 +109,45 @@ discard block |
||
109 | 109 | api_display_tool_title($tool_name); |
110 | 110 | |
111 | 111 | if (isset($_GET['action']) && $_GET['action'] == 'show_message') |
112 | - Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
112 | + Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
113 | 113 | |
114 | 114 | $no_course_list = $course_list = array(); |
115 | 115 | $ajax_search = $add_type == 'unique' ? true : false; |
116 | 116 | |
117 | 117 | if($ajax_search) { |
118 | - $courses = UrlManager::get_url_rel_course_data($access_url_id); |
|
119 | - foreach ($courses as $course) { |
|
120 | - $course_list[$course['c_id']] = $course; |
|
121 | - } |
|
118 | + $courses = UrlManager::get_url_rel_course_data($access_url_id); |
|
119 | + foreach ($courses as $course) { |
|
120 | + $course_list[$course['c_id']] = $course; |
|
121 | + } |
|
122 | 122 | } else { |
123 | - $courses = UrlManager::get_url_rel_course_data(); |
|
123 | + $courses = UrlManager::get_url_rel_course_data(); |
|
124 | 124 | |
125 | - foreach ($courses as $course) { |
|
126 | - if ($course['access_url_id'] == $access_url_id) { |
|
127 | - $course_list[$course['c_id']] = $course; |
|
128 | - } |
|
129 | - } |
|
125 | + foreach ($courses as $course) { |
|
126 | + if ($course['access_url_id'] == $access_url_id) { |
|
127 | + $course_list[$course['c_id']] = $course; |
|
128 | + } |
|
129 | + } |
|
130 | 130 | |
131 | - $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
|
132 | - $sql="SELECT id, code, title |
|
131 | + $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
|
132 | + $sql="SELECT id, code, title |
|
133 | 133 | FROM $tbl_course u |
134 | 134 | ORDER BY title, code"; |
135 | - $result = Database::query($sql); |
|
136 | - $courses = Database::store_result($result); |
|
137 | - $course_list_leys = array_keys($course_list); |
|
138 | - foreach ($courses as $course) { |
|
139 | - if (!in_array($course['id'], $course_list_leys)) { |
|
140 | - $no_course_list[$course['id']] = $course; |
|
141 | - } |
|
142 | - } |
|
135 | + $result = Database::query($sql); |
|
136 | + $courses = Database::store_result($result); |
|
137 | + $course_list_leys = array_keys($course_list); |
|
138 | + foreach ($courses as $course) { |
|
139 | + if (!in_array($course['id'], $course_list_leys)) { |
|
140 | + $no_course_list[$course['id']] = $course; |
|
141 | + } |
|
142 | + } |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | if($add_type == 'multiple') { |
146 | - $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
147 | - $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
|
146 | + $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
147 | + $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
|
148 | 148 | } else { |
149 | - $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
|
150 | - $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
149 | + $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
|
150 | + $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
151 | 151 | } |
152 | 152 | $url_list = UrlManager::get_url_data(); |
153 | 153 | ?> |
@@ -160,31 +160,31 @@ discard block |
||
160 | 160 | <select name="access_url_id" onchange="javascript:send();"> |
161 | 161 | <option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option> |
162 | 162 | <?php |
163 | - $url_selected=''; |
|
164 | - foreach ($url_list as $url_obj) { |
|
165 | - $checked = ''; |
|
166 | - if (!empty($access_url_id)) { |
|
167 | - if ($url_obj[0]==$access_url_id) { |
|
168 | - $checked = 'selected=true'; |
|
169 | - $url_selected=$url_obj[1]; |
|
170 | - } |
|
171 | - } |
|
172 | - if ($url_obj['active']==1) { |
|
173 | - ?> |
|
163 | + $url_selected=''; |
|
164 | + foreach ($url_list as $url_obj) { |
|
165 | + $checked = ''; |
|
166 | + if (!empty($access_url_id)) { |
|
167 | + if ($url_obj[0]==$access_url_id) { |
|
168 | + $checked = 'selected=true'; |
|
169 | + $url_selected=$url_obj[1]; |
|
170 | + } |
|
171 | + } |
|
172 | + if ($url_obj['active']==1) { |
|
173 | + ?> |
|
174 | 174 | <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option> |
175 | 175 | <?php |
176 | - } |
|
177 | - } |
|
178 | - ?> |
|
176 | + } |
|
177 | + } |
|
178 | + ?> |
|
179 | 179 | </select> |
180 | 180 | <br /><br /> |
181 | 181 | <input type="hidden" name="form_sent" value="1" /> |
182 | 182 | <input type="hidden" name="add_type" value = "<?php echo $add_type ?>" /> |
183 | 183 | <?php |
184 | - if(!empty($errorMsg)) { |
|
185 | - Display::display_normal_message($errorMsg); //main API |
|
186 | - } |
|
187 | - ?> |
|
184 | + if(!empty($errorMsg)) { |
|
185 | + Display::display_normal_message($errorMsg); //main API |
|
186 | + } |
|
187 | + ?> |
|
188 | 188 | <table border="0" cellpadding="5" cellspacing="0" width="100%"> |
189 | 189 | |
190 | 190 | <!-- Users --> |
@@ -199,38 +199,38 @@ discard block |
||
199 | 199 | <td align="center"> |
200 | 200 | <div id="content_source"> |
201 | 201 | <?php |
202 | - if($ajax_search) { |
|
203 | - ?> |
|
202 | + if($ajax_search) { |
|
203 | + ?> |
|
204 | 204 | <input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" /> |
205 | 205 | <div id="ajax_list_courses"></div> |
206 | 206 | <?php |
207 | - } else { |
|
208 | - ?> |
|
207 | + } else { |
|
208 | + ?> |
|
209 | 209 | <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;"> |
210 | 210 | <?php |
211 | - foreach($no_course_list as $no_course) { |
|
212 | - ?> |
|
211 | + foreach($no_course_list as $no_course) { |
|
212 | + ?> |
|
213 | 213 | <option value="<?php echo $no_course['id']; ?>"><?php echo $no_course['title'].' ('.$no_course['code'].')'; ?></option> |
214 | 214 | <?php |
215 | - } |
|
216 | - unset($no_course_list); |
|
217 | - ?> |
|
215 | + } |
|
216 | + unset($no_course_list); |
|
217 | + ?> |
|
218 | 218 | </select> |
219 | 219 | <?php |
220 | - } |
|
221 | - ?> |
|
220 | + } |
|
221 | + ?> |
|
222 | 222 | </div> |
223 | 223 | </td> |
224 | 224 | <td width="10%" valign="middle" align="center"> |
225 | 225 | <?php |
226 | - if($ajax_search) { |
|
227 | - ?> |
|
226 | + if($ajax_search) { |
|
227 | + ?> |
|
228 | 228 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" > |
229 | 229 | <em class="fa fa-arrow-left"></em> |
230 | 230 | </button> |
231 | 231 | <?php |
232 | - } else { |
|
233 | - ?> |
|
232 | + } else { |
|
233 | + ?> |
|
234 | 234 | <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" > |
235 | 235 | <em class="fa fa-arrow-right"></em> |
236 | 236 | </button> |
@@ -239,21 +239,21 @@ discard block |
||
239 | 239 | <em class="fa fa-arrow-left"></em> |
240 | 240 | </button> |
241 | 241 | <?php |
242 | - } |
|
243 | - ?> |
|
242 | + } |
|
243 | + ?> |
|
244 | 244 | <br /><br /><br /><br /><br /><br /> |
245 | 245 | </td> |
246 | 246 | <td align="center"> |
247 | 247 | <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;"> |
248 | 248 | <?php |
249 | - foreach($course_list as $course) { |
|
250 | - $courseInfo = api_get_course_info_by_id($course['id']); |
|
251 | - ?> |
|
249 | + foreach($course_list as $course) { |
|
250 | + $courseInfo = api_get_course_info_by_id($course['id']); |
|
251 | + ?> |
|
252 | 252 | <option value="<?php echo $course['id']; ?>"><?php echo $course['title'].' ('.$courseInfo['code'].')'; ?></option> |
253 | 253 | <?php |
254 | - } |
|
255 | - unset($course_list); |
|
256 | - ?> |
|
254 | + } |
|
255 | + unset($course_list); |
|
256 | + ?> |
|
257 | 257 | |
258 | 258 | </select></td> |
259 | 259 | </tr> |
@@ -261,11 +261,11 @@ discard block |
||
261 | 261 | <td colspan="3" align="center"> |
262 | 262 | <br /> |
263 | 263 | <?php |
264 | - if(isset($_GET['add'])) |
|
265 | - echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
|
266 | - else |
|
267 | - echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
|
268 | - ?> |
|
264 | + if(isset($_GET['add'])) |
|
265 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
|
266 | + else |
|
267 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
|
268 | + ?> |
|
269 | 269 | </td> |
270 | 270 | </tr> |
271 | 271 | </table> |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | <option value="">--</option> |
264 | 264 | <?php |
265 | 265 | echo Display :: get_alphabet_options($first_letter_user); |
266 | - ?> |
|
266 | + ?> |
|
267 | 267 | </select> |
268 | 268 | </td> |
269 | 269 | <td width="20%"> </td> |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | <select name="firstLetterCourse" onchange="javascript:document.formulaire.form_sent.value='2'; document.formulaire.submit();"> |
275 | 275 | <option value="">--</option> |
276 | 276 | <?php |
277 | - echo Display :: get_alphabet_options($first_letter_course); |
|
278 | - ?> |
|
277 | + echo Display :: get_alphabet_options($first_letter_course); |
|
278 | + ?> |
|
279 | 279 | </select> |
280 | 280 | </td> |
281 | 281 | </tr> |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | } |
296 | 296 | |
297 | 297 | echo $userName; |
298 | - ?> |
|
298 | + ?> |
|
299 | 299 | </option> |
300 | 300 | <?php |
301 | 301 | } |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | |
25 | 25 | // Actions |
26 | 26 | if (isset ($_GET['action'])) { |
27 | - if ($_GET['action'] == 'show_message') |
|
28 | - Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
29 | - Security::clear_token(); |
|
27 | + if ($_GET['action'] == 'show_message') |
|
28 | + Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
|
29 | + Security::clear_token(); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | $legal_count = LegalManager::count(); |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | |
53 | 53 | // this 2 "mask" function are here just because the SortableTable |
54 | 54 | function get_legal_data_mask($id, $params=null, $row=null) { |
55 | - return LegalManager::get_legal_data($id, $params, $row); |
|
55 | + return LegalManager::get_legal_data($id, $params, $row); |
|
56 | 56 | } |
57 | 57 | function count_mask() { |
58 | - return LegalManager::count(); |
|
58 | + return LegalManager::count(); |
|
59 | 59 | } |
60 | 60 | Display :: display_footer(); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | array('name'=>'certificate', 'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'), |
51 | 51 | array('name'=>'skills', 'index'=>'skills', 'width'=>'300', 'align'=>'left', 'sortable'=>'false'), |
52 | 52 | array('name'=>'actions', 'index'=>'actions', 'width'=>'30', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false') |
53 | - ); |
|
53 | + ); |
|
54 | 54 | //Autowidth |
55 | 55 | $extra_params['autowidth'] = 'true'; |
56 | 56 | //height auto |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | /** |
4 | - * @package chamilo.admin |
|
5 | - * @author Julio Montoya <[email protected]> |
|
6 | - */ |
|
4 | + * @package chamilo.admin |
|
5 | + * @author Julio Montoya <[email protected]> |
|
6 | + */ |
|
7 | 7 | // resetting the course id |
8 | 8 | $cidReset = true; |
9 | 9 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | ?> |
262 | 262 | <option value="<?php echo $enreg['user_id']; ?>"><?php echo $enreg['username'].' - '.api_get_person_name($enreg['firstname'], $enreg['lastname']); ?></option> |
263 | 263 | <?php |
264 | - } |
|
264 | + } |
|
265 | 265 | unset($nosessionUsersList); |
266 | 266 | ?> |
267 | 267 | </select> |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | <option value = "%">--</option> |
198 | 198 | <?php |
199 | 199 | echo Display :: get_alphabet_options(); |
200 | - ?> |
|
200 | + ?> |
|
201 | 201 | </select> |
202 | 202 | </td> |
203 | 203 | <td align="center"> </td> |
@@ -207,31 +207,31 @@ discard block |
||
207 | 207 | <td align="center"> |
208 | 208 | <div id="content_source"> |
209 | 209 | <?php |
210 | - if (!($add_type=='multiple')) { |
|
210 | + if (!($add_type=='multiple')) { |
|
211 | 211 | ?> |
212 | 212 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
213 | 213 | <div id="ajax_list_users_single"></div> |
214 | 214 | <?php |
215 | - } else { |
|
216 | - ?> |
|
215 | + } else { |
|
216 | + ?> |
|
217 | 217 | <div id="ajax_list_multiple"> |
218 | 218 | <?php echo Display::select('session_not_in_promotion_name',$session_not_in_promotion, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_not_in_promotion','size'=>'15px'),false); ?> |
219 | 219 | </div> |
220 | 220 | <?php |
221 | - } |
|
222 | - ?> |
|
221 | + } |
|
222 | + ?> |
|
223 | 223 | </div> |
224 | 224 | </td> |
225 | 225 | <td width="10%" valign="middle" align="center"> |
226 | 226 | <?php |
227 | - if ($ajax_search) { |
|
228 | - ?> |
|
227 | + if ($ajax_search) { |
|
228 | + ?> |
|
229 | 229 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('session_in_promotion'))" > |
230 | 230 | <em class="fa fa-arrow-left"></em> |
231 | 231 | </button> |
232 | 232 | <?php |
233 | - } else { |
|
234 | - ?> |
|
233 | + } else { |
|
234 | + ?> |
|
235 | 235 | <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))" onclick="moveItem(document.getElementById('session_not_in_promotion'), document.getElementById('session_in_promotion'))"> |
236 | 236 | <em class="fa fa-arrow-right"></em> |
237 | 237 | </button> |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | <em class="fa fa-arrow-left"></em> |
241 | 241 | </button> |
242 | 242 | <?php |
243 | - } |
|
244 | - ?> |
|
243 | + } |
|
244 | + ?> |
|
245 | 245 | <br /><br /><br /><br /><br /><br /> |
246 | 246 | </td> |
247 | 247 | <td align="center"> |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | api_protect_global_admin_script(); |
15 | 15 | |
16 | 16 | if (!api_get_multiple_access_url()) { |
17 | - header('Location: index.php'); |
|
18 | - exit; |
|
17 | + header('Location: index.php'); |
|
18 | + exit; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $interbreadcrumb[] = array ("url" => 'index.php', 'name' => get_lang('PlatformAdmin')); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $check = Security::check_token('get'); |
36 | 36 | if ($check) { |
37 | - $url_id = intval($_GET['url_id']); |
|
37 | + $url_id = intval($_GET['url_id']); |
|
38 | 38 | |
39 | 39 | switch ($_GET['action']) { |
40 | 40 | case 'delete_url': |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | if(!empty($url_string)) { |
88 | - Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false); |
|
88 | + Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // checking the current installation |
92 | 92 | if ($current_access_url_id==-1) { |
93 | - Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH)); |
|
93 | + Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH)); |
|
94 | 94 | } elseif(api_is_platform_admin()) { |
95 | 95 | $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id); |
96 | 96 | if ($quant==0) { |
@@ -36,20 +36,20 @@ discard block |
||
36 | 36 | |
37 | 37 | // setting the name of the tool |
38 | 38 | if (UserManager::is_admin($user_id)) { |
39 | - $tool_name= get_lang('AssignCoursesToPlatformAdministrator'); |
|
39 | + $tool_name= get_lang('AssignCoursesToPlatformAdministrator'); |
|
40 | 40 | } else if ($user_info['status'] == SESSIONADMIN) { |
41 | - $tool_name= get_lang('AssignCoursesToSessionsAdministrator'); |
|
41 | + $tool_name= get_lang('AssignCoursesToSessionsAdministrator'); |
|
42 | 42 | } else { |
43 | - $tool_name= get_lang('AssignCoursesToHumanResourcesManager'); |
|
43 | + $tool_name= get_lang('AssignCoursesToHumanResourcesManager'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $add_type = 'multiple'; |
47 | 47 | if(isset($_GET['add_type']) && $_GET['add_type']!='') { |
48 | - $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
48 | + $add_type = Security::remove_XSS($_REQUEST['add_type']); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if (!api_is_platform_admin()) { |
52 | - api_not_allowed(true); |
|
52 | + api_not_allowed(true); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | function search_courses($needle, $type) |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $return = ''; |
61 | 61 | if (!empty($needle) && !empty($type)) { |
62 | 62 | // xajax send utf8 datas... datas in db can be non-utf8 datas |
63 | - $needle = Database::escape_string($needle); |
|
63 | + $needle = Database::escape_string($needle); |
|
64 | 64 | |
65 | 65 | $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id); |
66 | 66 | $assigned_courses_code = array_keys($assigned_courses_to_hrm); |
@@ -88,16 +88,16 @@ discard block |
||
88 | 88 | $without_assigned_courses "; |
89 | 89 | } |
90 | 90 | |
91 | - $rs = Database::query($sql); |
|
91 | + $rs = Database::query($sql); |
|
92 | 92 | |
93 | - $return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >'; |
|
94 | - while($course = Database :: fetch_array($rs)) { |
|
95 | - $return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>'; |
|
96 | - } |
|
97 | - $return .= '</select>'; |
|
98 | - $xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return)); |
|
99 | - } |
|
100 | - return $xajax_response; |
|
93 | + $return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >'; |
|
94 | + while($course = Database :: fetch_array($rs)) { |
|
95 | + $return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>'; |
|
96 | + } |
|
97 | + $return .= '</select>'; |
|
98 | + $xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return)); |
|
99 | + } |
|
100 | + return $xajax_response; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | $xajax->processRequests(); |
@@ -181,23 +181,23 @@ discard block |
||
181 | 181 | $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id); |
182 | 182 | $assigned_courses_code = array_keys($assigned_courses_to_hrm); |
183 | 183 | foreach ($assigned_courses_code as &$value) { |
184 | - $value = "'".$value."'"; |
|
184 | + $value = "'".$value."'"; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | $without_assigned_courses = ''; |
188 | 188 | if (count($assigned_courses_code) > 0) { |
189 | - $without_assigned_courses = " AND c.code NOT IN(".implode(',',$assigned_courses_code).")"; |
|
189 | + $without_assigned_courses = " AND c.code NOT IN(".implode(',',$assigned_courses_code).")"; |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | $needle = '%'; |
193 | 193 | $firstLetter = null; |
194 | 194 | if (isset($_POST['firstLetterCourse'])) { |
195 | - $firstLetter = $_POST['firstLetterCourse']; |
|
196 | - $needle = Database::escape_string($firstLetter.'%'); |
|
195 | + $firstLetter = $_POST['firstLetterCourse']; |
|
196 | + $needle = Database::escape_string($firstLetter.'%'); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | if (api_is_multiple_url_enabled()) { |
200 | - $sql = " SELECT c.code, c.title |
|
200 | + $sql = " SELECT c.code, c.title |
|
201 | 201 | FROM $tbl_course c |
202 | 202 | LEFT JOIN $tbl_course_rel_access_url a |
203 | 203 | ON (a.c_id = c.id) |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | ORDER BY c.title"; |
208 | 208 | |
209 | 209 | } else { |
210 | - $sql= " SELECT c.code, c.title |
|
210 | + $sql= " SELECT c.code, c.title |
|
211 | 211 | FROM $tbl_course c |
212 | 212 | WHERE c.code LIKE '$needle' $without_assigned_courses |
213 | 213 | ORDER BY c.title"; |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | <input type="hidden" name="formSent" value="1" /> |
222 | 222 | <?php |
223 | 223 | if(!empty($msg)) { |
224 | - Display::display_normal_message($msg); //main API |
|
224 | + Display::display_normal_message($msg); //main API |
|
225 | 225 | } |
226 | 226 | ?> |
227 | 227 | |
@@ -269,13 +269,13 @@ discard block |
||
269 | 269 | </div> |
270 | 270 | <div class="col-md-4"> |
271 | 271 | <h5><?php |
272 | - if (UserManager::is_admin($user_id)) { |
|
273 | - echo get_lang('AssignedCoursesListToPlatformAdministrator'); |
|
274 | - } else if ($user_info['status'] == SESSIONADMIN) { |
|
275 | - echo get_lang('AssignedCoursesListToSessionsAdministrator'); |
|
276 | - } else { |
|
277 | - echo get_lang('AssignedCoursesListToHumanResourcesManager'); |
|
278 | - } |
|
272 | + if (UserManager::is_admin($user_id)) { |
|
273 | + echo get_lang('AssignedCoursesListToPlatformAdministrator'); |
|
274 | + } else if ($user_info['status'] == SESSIONADMIN) { |
|
275 | + echo get_lang('AssignedCoursesListToSessionsAdministrator'); |
|
276 | + } else { |
|
277 | + echo get_lang('AssignedCoursesListToHumanResourcesManager'); |
|
278 | + } |
|
279 | 279 | ?>: </h5> |
280 | 280 | |
281 | 281 | <select id='destination' name="CoursesList[]" multiple="multiple" size="20" style="width:320px;"> |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $userGroupList[$item['id']] = $item; |
122 | 122 | } |
123 | 123 | } else { |
124 | - $userGroups = UrlManager::get_url_rel_usergroup_data(); |
|
124 | + $userGroups = UrlManager::get_url_rel_usergroup_data(); |
|
125 | 125 | |
126 | 126 | foreach ($userGroups as $item) { |
127 | 127 | if ($item['access_url_id'] == $access_url_id) { |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | if ($add_type == 'multiple') { |
135 | - $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
136 | - $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
|
135 | + $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
136 | + $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
|
137 | 137 | } else { |
138 | - $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
|
139 | - $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
138 | + $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
|
139 | + $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | $url_list = UrlManager::get_url_data(); |
@@ -200,30 +200,30 @@ discard block |
||
200 | 200 | <?php } else { ?> |
201 | 201 | <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;"> |
202 | 202 | <?php |
203 | - foreach ($noUserGroupList as $noItem) { |
|
204 | - ?> |
|
203 | + foreach ($noUserGroupList as $noItem) { |
|
204 | + ?> |
|
205 | 205 | <option value="<?php echo $noItem['id']; ?>"> |
206 | 206 | <?php echo $noItem['name']; ?> |
207 | 207 | </option> |
208 | 208 | <?php |
209 | - } |
|
210 | - ?> |
|
209 | + } |
|
210 | + ?> |
|
211 | 211 | </select> |
212 | 212 | <?php |
213 | - } |
|
214 | - ?> |
|
213 | + } |
|
214 | + ?> |
|
215 | 215 | </div> |
216 | 216 | </td> |
217 | 217 | <td width="10%" valign="middle" align="center"> |
218 | 218 | <?php |
219 | - if ($ajax_search) { |
|
220 | - ?> |
|
219 | + if ($ajax_search) { |
|
220 | + ?> |
|
221 | 221 | <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" > |
222 | 222 | <em class="fa fa-arrow-left"></em> |
223 | 223 | </button> |
224 | 224 | <?php |
225 | - } else { |
|
226 | - ?> |
|
225 | + } else { |
|
226 | + ?> |
|
227 | 227 | <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" > |
228 | 228 | <em class="fa fa-arrow-right"></em> |
229 | 229 | </button> |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | <em class="fa fa-arrow-left"></em> |
233 | 233 | </button> |
234 | 234 | <?php |
235 | - } |
|
236 | - ?> |
|
235 | + } |
|
236 | + ?> |
|
237 | 237 | <br /><br /><br /><br /><br /><br /> |
238 | 238 | </td> |
239 | 239 | <td align="center"> |
@@ -254,11 +254,11 @@ discard block |
||
254 | 254 | <td colspan="3" align="center"> |
255 | 255 | <br /> |
256 | 256 | <?php |
257 | - if(isset($_GET['add'])) |
|
258 | - echo '<button class="save" onclick="valide()" >'.get_lang('AddUserGroupToURL').'</button>'; |
|
259 | - else |
|
260 | - echo '<button class="save" onclick="valide()" >'.get_lang('EditUserGroupToURL').'</button>'; |
|
261 | - ?> |
|
257 | + if(isset($_GET['add'])) |
|
258 | + echo '<button class="save" onclick="valide()" >'.get_lang('AddUserGroupToURL').'</button>'; |
|
259 | + else |
|
260 | + echo '<button class="save" onclick="valide()" >'.get_lang('EditUserGroupToURL').'</button>'; |
|
261 | + ?> |
|
262 | 262 | </td> |
263 | 263 | </tr> |
264 | 264 | </table> |