@@ -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> |
@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | $interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs')); |
36 | 36 | |
37 | 37 | $add_type = 'multiple'; |
38 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { |
|
38 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
39 | 39 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
40 | 40 | } |
41 | 41 | |
42 | 42 | $access_url_id = 1; |
43 | -if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') { |
|
43 | +if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') { |
|
44 | 44 | $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']); |
45 | 45 | } |
46 | 46 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | if ($form_sent == 1) { |
94 | - if ($access_url_id==0) { |
|
94 | + if ($access_url_id == 0) { |
|
95 | 95 | header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL')); |
96 | 96 | } elseif (is_array($course_list)) { |
97 | 97 | UrlManager::update_urls_rel_course($course_list, $access_url_id); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | Display::display_header($tool_name); |
104 | 104 | |
105 | 105 | echo '<div class="actions">'; |
106 | -echo Display::url( Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'),''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_courses_to_url.php'); |
|
106 | +echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_courses_to_url.php'); |
|
107 | 107 | echo '</div>'; |
108 | 108 | |
109 | 109 | api_display_tool_title($tool_name); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $no_course_list = $course_list = array(); |
115 | 115 | $ajax_search = $add_type == 'unique' ? true : false; |
116 | 116 | |
117 | -if($ajax_search) { |
|
117 | +if ($ajax_search) { |
|
118 | 118 | $courses = UrlManager::get_url_rel_course_data($access_url_id); |
119 | 119 | foreach ($courses as $course) { |
120 | 120 | $course_list[$course['c_id']] = $course; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); |
132 | - $sql="SELECT id, code, title |
|
132 | + $sql = "SELECT id, code, title |
|
133 | 133 | FROM $tbl_course u |
134 | 134 | ORDER BY title, code"; |
135 | 135 | $result = Database::query($sql); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
145 | -if($add_type == 'multiple') { |
|
145 | +if ($add_type == 'multiple') { |
|
146 | 146 | $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
147 | 147 | $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
148 | 148 | } else { |
@@ -155,23 +155,23 @@ discard block |
||
155 | 155 | <?php echo $link_add_type_unique ?> | <?php echo $link_add_type_multiple ?> |
156 | 156 | </div> |
157 | 157 | <br /><br /> |
158 | - <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?> > |
|
158 | + <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?> > |
|
159 | 159 | <?php echo get_lang('SelectUrl').' : '; ?> |
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=''; |
|
163 | + $url_selected = ''; |
|
164 | 164 | foreach ($url_list as $url_obj) { |
165 | 165 | $checked = ''; |
166 | 166 | if (!empty($access_url_id)) { |
167 | - if ($url_obj[0]==$access_url_id) { |
|
167 | + if ($url_obj[0] == $access_url_id) { |
|
168 | 168 | $checked = 'selected=true'; |
169 | - $url_selected=$url_obj[1]; |
|
169 | + $url_selected = $url_obj[1]; |
|
170 | 170 | } |
171 | 171 | } |
172 | - if ($url_obj['active']==1) { |
|
172 | + if ($url_obj['active'] == 1) { |
|
173 | 173 | ?> |
174 | - <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option> |
|
174 | + <option <?php echo $checked; ?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?></option> |
|
175 | 175 | <?php |
176 | 176 | } |
177 | 177 | } |
@@ -181,7 +181,7 @@ discard block |
||
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)) { |
|
184 | + if (!empty($errorMsg)) { |
|
185 | 185 | Display::display_normal_message($errorMsg); //main API |
186 | 186 | } |
187 | 187 | ?> |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | <td align="center"> |
200 | 200 | <div id="content_source"> |
201 | 201 | <?php |
202 | - if($ajax_search) { |
|
202 | + if ($ajax_search) { |
|
203 | 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> |
@@ -208,7 +208,7 @@ discard block |
||
208 | 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) { |
|
211 | + foreach ($no_course_list as $no_course) { |
|
212 | 212 | ?> |
213 | 213 | <option value="<?php echo $no_course['id']; ?>"><?php echo $no_course['title'].' ('.$no_course['code'].')'; ?></option> |
214 | 214 | <?php |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | </td> |
224 | 224 | <td width="10%" valign="middle" align="center"> |
225 | 225 | <?php |
226 | - if($ajax_search) { |
|
226 | + if ($ajax_search) { |
|
227 | 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> |
@@ -246,7 +246,7 @@ discard block |
||
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) { |
|
249 | + foreach ($course_list as $course) { |
|
250 | 250 | $courseInfo = api_get_course_info_by_id($course['id']); |
251 | 251 | ?> |
252 | 252 | <option value="<?php echo $course['id']; ?>"><?php echo $course['title'].' ('.$courseInfo['code'].')'; ?></option> |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | <td colspan="3" align="center"> |
262 | 262 | <br /> |
263 | 263 | <?php |
264 | - if(isset($_GET['add'])) |
|
264 | + if (isset($_GET['add'])) |
|
265 | 265 | echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
266 | 266 | else |
267 | 267 | echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
@@ -108,8 +108,9 @@ discard block |
||
108 | 108 | |
109 | 109 | api_display_tool_title($tool_name); |
110 | 110 | |
111 | -if (isset($_GET['action']) && $_GET['action'] == 'show_message') |
|
111 | +if (isset($_GET['action']) && $_GET['action'] == 'show_message') { |
|
112 | 112 | Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
113 | +} |
|
113 | 114 | |
114 | 115 | $no_course_list = $course_list = array(); |
115 | 116 | $ajax_search = $add_type == 'unique' ? true : false; |
@@ -261,10 +262,11 @@ discard block |
||
261 | 262 | <td colspan="3" align="center"> |
262 | 263 | <br /> |
263 | 264 | <?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>'; |
|
265 | + if(isset($_GET['add'])) { |
|
266 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
|
267 | + } else { |
|
268 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
|
269 | + } |
|
268 | 270 | ?> |
269 | 271 | </td> |
270 | 272 | </tr> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | api_protect_admin_script(true); |
17 | 17 | |
18 | 18 | // setting breadcrumbs |
19 | -$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
19 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
20 | 20 | |
21 | 21 | $form = new FormValidator('archive_cleanup_form', 'post', '', '', array(), FormValidator::LAYOUT_BOX); |
22 | 22 | $form->addButtonSend(get_lang('ArchiveDirCleanupProceedButton')); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | if (isset($_GET['msg']) && isset($_GET['type'])) { |
52 | 52 | if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed'))) |
53 | - switch($_GET['type']) { |
|
53 | + switch ($_GET['type']) { |
|
54 | 54 | case 'error': |
55 | 55 | $message = Display::return_message(get_lang($_GET['msg']), 'error'); |
56 | 56 | break; |
@@ -49,10 +49,11 @@ |
||
49 | 49 | Display::display_warning_message(get_lang('ArchiveDirCleanupDescr')); |
50 | 50 | |
51 | 51 | if (isset($_GET['msg']) && isset($_GET['type'])) { |
52 | - if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed'))) |
|
53 | - switch($_GET['type']) { |
|
52 | + if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed'))) { |
|
53 | + switch($_GET['type']) { |
|
54 | 54 | case 'error': |
55 | 55 | $message = Display::return_message(get_lang($_GET['msg']), 'error'); |
56 | + } |
|
56 | 57 | break; |
57 | 58 | case 'confirmation': |
58 | 59 | $message = Display::return_message(get_lang($_GET['msg']), 'confirm'); |
@@ -24,39 +24,39 @@ |
||
24 | 24 | $message = null; |
25 | 25 | |
26 | 26 | if ($form->validate()) { |
27 | - $archive_path = api_get_path(SYS_ARCHIVE_PATH); |
|
28 | - $htaccess = @file_get_contents($archive_path.'.htaccess'); |
|
29 | - $result = rmdirr($archive_path, true, true); |
|
27 | + $archive_path = api_get_path(SYS_ARCHIVE_PATH); |
|
28 | + $htaccess = @file_get_contents($archive_path.'.htaccess'); |
|
29 | + $result = rmdirr($archive_path, true, true); |
|
30 | 30 | |
31 | - \Chamilo\CoreBundle\Composer\ScriptHandler::dumpCssFiles(); |
|
31 | + \Chamilo\CoreBundle\Composer\ScriptHandler::dumpCssFiles(); |
|
32 | 32 | |
33 | - if (!empty($htaccess)) { |
|
34 | - @file_put_contents($archive_path.'/.htaccess', $htaccess); |
|
35 | - } |
|
36 | - if ($result) { |
|
37 | - $message = 'ArchiveDirCleanupSucceeded'; |
|
38 | - $type = 'confirmation'; |
|
39 | - } else { |
|
40 | - $message = 'ArchiveDirCleanupFailed'; |
|
41 | - $type = 'error'; |
|
42 | - } |
|
33 | + if (!empty($htaccess)) { |
|
34 | + @file_put_contents($archive_path.'/.htaccess', $htaccess); |
|
35 | + } |
|
36 | + if ($result) { |
|
37 | + $message = 'ArchiveDirCleanupSucceeded'; |
|
38 | + $type = 'confirmation'; |
|
39 | + } else { |
|
40 | + $message = 'ArchiveDirCleanupFailed'; |
|
41 | + $type = 'error'; |
|
42 | + } |
|
43 | 43 | |
44 | - header('Location: '.api_get_self().'?msg='.$message.'&type='.$type); |
|
45 | - exit; |
|
44 | + header('Location: '.api_get_self().'?msg='.$message.'&type='.$type); |
|
45 | + exit; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | Display::display_header(get_lang('ArchiveDirCleanup')); |
49 | 49 | Display::display_warning_message(get_lang('ArchiveDirCleanupDescr')); |
50 | 50 | |
51 | 51 | if (isset($_GET['msg']) && isset($_GET['type'])) { |
52 | - if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed'))) |
|
53 | - switch($_GET['type']) { |
|
54 | - case 'error': |
|
55 | - $message = Display::return_message(get_lang($_GET['msg']), 'error'); |
|
56 | - break; |
|
57 | - case 'confirmation': |
|
58 | - $message = Display::return_message(get_lang($_GET['msg']), 'confirm'); |
|
59 | - } |
|
52 | + if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed'))) |
|
53 | + switch($_GET['type']) { |
|
54 | + case 'error': |
|
55 | + $message = Display::return_message(get_lang($_GET['msg']), 'error'); |
|
56 | + break; |
|
57 | + case 'confirmation': |
|
58 | + $message = Display::return_message(get_lang($_GET['msg']), 'confirm'); |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | if (!empty($message)) { |
@@ -12,13 +12,13 @@ |
||
12 | 12 | */ |
13 | 13 | function validate_data($courses) |
14 | 14 | { |
15 | - $errors = array (); |
|
16 | - $coursecodes = array (); |
|
15 | + $errors = array(); |
|
16 | + $coursecodes = array(); |
|
17 | 17 | foreach ($courses as $index => $course) { |
18 | - $course['line'] = $index +1; |
|
18 | + $course['line'] = $index + 1; |
|
19 | 19 | |
20 | 20 | // 1. Check whether mandatory fields are set. |
21 | - $mandatory_fields = array ('Code', 'Title', 'CourseCategory'); |
|
21 | + $mandatory_fields = array('Code', 'Title', 'CourseCategory'); |
|
22 | 22 | foreach ($mandatory_fields as $field) { |
23 | 23 | if (!isset($course[$field]) || strlen($course[$field]) == 0) { |
24 | 24 | $course['error'] = get_lang($field.'Mandatory'); |
@@ -151,7 +151,7 @@ |
||
151 | 151 | /** |
152 | 152 | * Read the CSV-file |
153 | 153 | * @param string $file Path to the CSV-file |
154 | - * @return array All course-information read from the file |
|
154 | + * @return Ddeboer\DataImport\Reader\CsvReader All course-information read from the file |
|
155 | 155 | */ |
156 | 156 | function parse_csv_data($file) |
157 | 157 | { |
@@ -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 | } |
@@ -287,7 +287,10 @@ discard block |
||
287 | 287 | <td width="40%" align="center"> |
288 | 288 | <select name="UserList[]" multiple="multiple" size="20" style="width:300px;"> |
289 | 289 | <?php foreach ($db_users as $user) { ?> |
290 | - <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) echo 'selected="selected"'; ?>> |
|
290 | + <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) { |
|
291 | + echo 'selected="selected"'; |
|
292 | +} |
|
293 | +?>> |
|
291 | 294 | <?php |
292 | 295 | $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; |
293 | 296 | if ($showOfficialCode) { |
@@ -308,7 +311,10 @@ discard block |
||
308 | 311 | <td width="40%" align="center"> |
309 | 312 | <select name="CourseList[]" multiple="multiple" size="20" style="width:300px;"> |
310 | 313 | <?php foreach ($db_courses as $course) { ?> |
311 | - <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>> |
|
314 | + <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) { |
|
315 | + echo 'selected="selected"'; |
|
316 | +} |
|
317 | +?>> |
|
312 | 318 | <?php echo '('.$course['visual_code'].') '.$course['title']; ?> |
313 | 319 | </option> |
314 | 320 | <?php } ?> |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | /* Header */ |
32 | 32 | $tool_name = get_lang('AddUsersToACourse'); |
33 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
33 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
34 | 34 | |
35 | 35 | $htmlHeadXtra[] = '<script> |
36 | 36 | function validate_filter() { |
@@ -142,12 +142,12 @@ discard block |
||
142 | 142 | if (isset($_POST[$varname]) && $_POST[$varname] != '0') { |
143 | 143 | $use_extra_fields = true; |
144 | 144 | if ($fieldtype == ExtraField::FIELD_TYPE_TAG) { |
145 | - $extra_field_result[]= UserManager::get_extra_user_data_by_tags( |
|
145 | + $extra_field_result[] = UserManager::get_extra_user_data_by_tags( |
|
146 | 146 | intval($_POST['field_id']), |
147 | 147 | $_POST[$varname] |
148 | 148 | ); |
149 | 149 | } else { |
150 | - $extra_field_result[]= UserManager::get_extra_user_data_by_value( |
|
150 | + $extra_field_result[] = UserManager::get_extra_user_data_by_value( |
|
151 | 151 | $new_field['variable'], |
152 | 152 | $_POST[$varname] |
153 | 153 | ); |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | $final_result = array(); |
164 | 164 | if (count($extra_field_result) > 1) { |
165 | 165 | for ($i = 0; $i < count($extra_field_result) - 1; $i++) { |
166 | - if (is_array($extra_field_result[$i+1])) { |
|
167 | - $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i+1]); |
|
166 | + if (is_array($extra_field_result[$i + 1])) { |
|
167 | + $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i + 1]); |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | } else { |
@@ -172,14 +172,14 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | if (api_is_multiple_url_enabled()) { |
175 | - if (is_array($final_result) && count($final_result)>0) { |
|
176 | - $where_filter = " AND u.user_id IN ('".implode("','",$final_result)."') "; |
|
175 | + if (is_array($final_result) && count($final_result) > 0) { |
|
176 | + $where_filter = " AND u.user_id IN ('".implode("','", $final_result)."') "; |
|
177 | 177 | } else { |
178 | 178 | //no results |
179 | 179 | $where_filter = " AND u.user_id = -1"; |
180 | 180 | } |
181 | 181 | } else { |
182 | - if (is_array($final_result) && count($final_result)>0) { |
|
182 | + if (is_array($final_result) && count($final_result) > 0) { |
|
183 | 183 | $where_filter = " AND user_id IN ('".implode("','", $final_result)."') "; |
184 | 184 | } else { |
185 | 185 | //no results |
@@ -200,10 +200,10 @@ discard block |
||
200 | 200 | $sql = "SELECT user_id, lastname, firstname, username, official_code |
201 | 201 | FROM $tbl_user |
202 | 202 | WHERE user_id<>2 AND ".$target_name." LIKE '".$first_letter_user."%' $where_filter |
203 | - ORDER BY ". (count($users) > 0 ? "(user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy; |
|
203 | + ORDER BY ".(count($users) > 0 ? "(user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy; |
|
204 | 204 | |
205 | 205 | if (api_is_multiple_url_enabled()) { |
206 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
206 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
207 | 207 | $access_url_id = api_get_current_access_url_id(); |
208 | 208 | if ($access_url_id != -1) { |
209 | 209 | $sql = "SELECT u.user_id,lastname,firstname,username, official_code |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | access_url_id = $access_url_id AND |
216 | 216 | (".$target_name." LIKE '".$first_letter_user."%' ) |
217 | 217 | $where_filter |
218 | - ORDER BY ". (count($users) > 0 ? "(u.user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy; |
|
218 | + ORDER BY ".(count($users) > 0 ? "(u.user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy; |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 | |
@@ -258,8 +258,8 @@ discard block |
||
258 | 258 | $fieldtype = $new_field['type']; |
259 | 259 | echo ' <select name="'.$varname.'">'; |
260 | 260 | echo '<option value="0">--'.get_lang('Select').'--</option>'; |
261 | - foreach ($new_field['data'] as $option) { |
|
262 | - $checked=''; |
|
261 | + foreach ($new_field['data'] as $option) { |
|
262 | + $checked = ''; |
|
263 | 263 | if ($fieldtype == ExtraField::FIELD_TYPE_TAG) { |
264 | 264 | if (isset($_POST[$varname])) { |
265 | 265 | if ($_POST[$varname] == $option['tag']) { |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | <td width="40%" align="center"> |
318 | 318 | <select name="UserList[]" multiple="multiple" size="20" style="width:300px;"> |
319 | 319 | <?php foreach ($db_users as $user) { ?> |
320 | - <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) echo 'selected="selected"'; ?>> |
|
320 | + <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>> |
|
321 | 321 | <?php |
322 | 322 | $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; |
323 | 323 | if ($showOfficialCode) { |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | <td width="40%" align="center"> |
339 | 339 | <select name="CourseList[]" multiple="multiple" size="20" style="width:300px;"> |
340 | 340 | <?php foreach ($db_courses as $course) { ?> |
341 | - <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>> |
|
341 | + <option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) echo 'selected="selected"'; ?>> |
|
342 | 342 | <?php echo '('.$course['visual_code'].') '.$course['title']; ?> |
343 | 343 | </option> |
344 | 344 | <?php } ?> |
@@ -295,7 +295,7 @@ |
||
295 | 295 | if (isset($_GET['export'])) { |
296 | 296 | $dataToExport = $timeReport->prepareDataToExport($withFilter); |
297 | 297 | |
298 | - $fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time(); |
|
298 | + $fileName = get_lang('TeacherTimeReport').' '.api_get_local_time(); |
|
299 | 299 | |
300 | 300 | switch ($_GET['export']) { |
301 | 301 | case 'pdf': |
@@ -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 |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | // setting breadcrumbs |
26 | 26 | |
27 | 27 | $tool_name = get_lang('SkillsAndGradebooks'); |
28 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
28 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
29 | 29 | if ($action == 'add_skill') { |
30 | - $interbreadcrumb[]=array('url' => 'skills_gradebook.php','name' => get_lang('SkillsAndGradebooks')); |
|
30 | + $interbreadcrumb[] = array('url' => 'skills_gradebook.php', 'name' => get_lang('SkillsAndGradebooks')); |
|
31 | 31 | $tool_name = get_lang('Add'); |
32 | 32 | } |
33 | 33 | |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | |
47 | 47 | //Column config |
48 | 48 | $column_model = array( |
49 | - array('name'=>'name', 'index'=>'name', 'width'=>'150', 'align'=>'left'), |
|
50 | - array('name'=>'certificate', 'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'), |
|
51 | - array('name'=>'skills', 'index'=>'skills', 'width'=>'300', 'align'=>'left', 'sortable'=>'false'), |
|
52 | - array('name'=>'actions', 'index'=>'actions', 'width'=>'30', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false') |
|
49 | + array('name'=>'name', 'index'=>'name', 'width'=>'150', 'align'=>'left'), |
|
50 | + array('name'=>'certificate', 'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'), |
|
51 | + array('name'=>'skills', 'index'=>'skills', 'width'=>'300', 'align'=>'left', 'sortable'=>'false'), |
|
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'; |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
61 | 61 | //certificates |
62 | 62 | if (rowObject[4] == 1) { |
63 | - return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'),'',ICON_SIZE_SMALL).'</a>'.'\'; |
|
63 | + return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'), '', ICON_SIZE_SMALL).'</a>'.'\'; |
|
64 | 64 | } else { |
65 | - return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'),'',ICON_SIZE_SMALL).''.'\'; |
|
65 | + return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'), '', ICON_SIZE_SMALL).''.'\'; |
|
66 | 66 | } |
67 | 67 | }'; |
68 | 68 | ?> |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | $(function() { |
71 | 71 | <?php |
72 | 72 | // grid definition see the $career->display() function |
73 | - echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links,true); |
|
73 | + echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links, true); |
|
74 | 74 | ?> |
75 | 75 | }); |
76 | 76 | </script> |
77 | 77 | <?php |
78 | 78 | $gradebook = new Gradebook(); |
79 | 79 | |
80 | -switch($action) { |
|
80 | +switch ($action) { |
|
81 | 81 | case 'display': |
82 | 82 | $gradebook->display(); |
83 | 83 | break; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null; |
86 | 86 | $gradebook_info = $gradebook->get($id); |
87 | 87 | $url = api_get_self().'?action='.$action.'&id='.$id; |
88 | - $form = $gradebook->show_skill_form($id, $url, $gradebook_info['name']); |
|
88 | + $form = $gradebook->show_skill_form($id, $url, $gradebook_info['name']); |
|
89 | 89 | if ($form->validate()) { |
90 | 90 | $values = $form->exportValues(); |
91 | 91 | $res = $gradebook->update_skills_to_gradebook($values['id'], $values['skill']); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | function send() { |
63 | 63 | if (document.formulaire.access_url_id.value!=0) { |
64 | 64 | document.formulaire.form_sent.value=0; |
65 | - document.formulaire.add_type.value=\'' . $add_type . '\'; |
|
65 | + document.formulaire.add_type.value=\'' . $add_type.'\'; |
|
66 | 66 | document.formulaire.submit(); |
67 | 67 | } |
68 | 68 | } |
@@ -92,23 +92,23 @@ discard block |
||
92 | 92 | } |
93 | 93 | if ($form_sent == 1) { |
94 | 94 | if ($access_url_id == 0) { |
95 | - header('Location: access_url_edit_users_to_url.php?action=show_message&message=' . get_lang('SelectURL')); |
|
95 | + header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL')); |
|
96 | 96 | exit; |
97 | 97 | } elseif (is_array($UserList)) { |
98 | 98 | $result = UrlManager::update_urls_rel_user($UserList, $access_url_id); |
99 | 99 | $url_info = UrlManager::get_url_data_from_id($access_url_id); |
100 | 100 | if (!empty($result)) { |
101 | - $message .= 'URL: ' . $url_info['url'] . '<br />'; |
|
101 | + $message .= 'URL: '.$url_info['url'].'<br />'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if (!empty($result['users_added'])) { |
105 | - $message .= '<h4>' . get_lang('UsersAdded') . ':</h4>'; |
|
105 | + $message .= '<h4>'.get_lang('UsersAdded').':</h4>'; |
|
106 | 106 | $i = 1; |
107 | 107 | $user_added_list = array(); |
108 | 108 | foreach ($result['users_added'] as $user) { |
109 | 109 | $user_info = api_get_user_info($user); |
110 | 110 | if (!empty($user_info)) { |
111 | - $user_added_list[] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']); |
|
111 | + $user_added_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']); |
|
112 | 112 | $i++; |
113 | 113 | } |
114 | 114 | } |
@@ -118,13 +118,13 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | if (!empty($result['users_deleted'])) { |
121 | - $message .= '<br /><h4>' . get_lang('UsersDeleted') . ': </h4>'; |
|
121 | + $message .= '<br /><h4>'.get_lang('UsersDeleted').': </h4>'; |
|
122 | 122 | $user_deleted_list = array(); |
123 | 123 | $i = 1; |
124 | 124 | foreach ($result['users_deleted'] as $user) { |
125 | 125 | $user_info = api_get_user_info($user); |
126 | 126 | if (!empty($user_info)) { |
127 | - $user_deleted_list [] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname']); |
|
127 | + $user_deleted_list [] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']); |
|
128 | 128 | $i++; |
129 | 129 | } |
130 | 130 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | echo '<div class="actions">'; |
146 | -echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH) . 'admin/access_url_add_users_to_url.php'); |
|
146 | +echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_users_to_url.php'); |
|
147 | 147 | echo '</div>'; |
148 | 148 | |
149 | 149 | api_display_tool_title($tool_name); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | |
173 | 173 | $sql = "SELECT u.user_id, lastname, firstname, username |
174 | - FROM $tbl_user u WHERE status <> " . ANONYMOUS . " " . |
|
174 | + FROM $tbl_user u WHERE status <> ".ANONYMOUS." ". |
|
175 | 175 | $order_clause; |
176 | 176 | $result = Database::query($sql); |
177 | 177 | $Users = Database::store_result($result); |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | if ($add_type == 'multiple') { |
187 | - $link_add_type_unique = '<a href="' . api_get_self() . '?add_type=unique&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeUnique') . '</a>'; |
|
187 | + $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
188 | 188 | $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
189 | 189 | } else { |
190 | 190 | $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
191 | - $link_add_type_multiple = '<a href="' . api_get_self() . '?add_type=multiple&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeMultiple') . '</a>'; |
|
191 | + $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
192 | 192 | } |
193 | 193 | $url_list = UrlManager::get_url_data(); |
194 | 194 | ?> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) { |
201 | 201 | echo ' onsubmit="valide();"'; |
202 | 202 | } ?> > |
203 | - <?php echo get_lang('SelectUrl') . ' : '; ?> |
|
203 | + <?php echo get_lang('SelectUrl').' : '; ?> |
|
204 | 204 | <select name="access_url_id" onchange="javascript:send();"> |
205 | 205 | <option value="0"> <?php echo get_lang('SelectUrl') ?></option> |
206 | 206 | <?php |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | <td> |
237 | 237 | <h3> |
238 | 238 | <?php |
239 | - $total_users = count($nosessionUsersList) + count($sessionUsersList); |
|
239 | + $total_users = count($nosessionUsersList) + count($sessionUsersList); |
|
240 | 240 | echo get_lang('TotalAvailableUsers').' '.$total_users; |
241 | 241 | ?> |
242 | 242 | </h3> |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | <td align="center"><b><?php echo get_lang('UserListInPlatform') ?> : <?php echo count($nosessionUsersList); ?></b> |
247 | 247 | </td> |
248 | 248 | <td></td> |
249 | - <td align="center"><b><?php echo get_lang('UserListIn') . ' ' . $url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td> |
|
249 | + <td align="center"><b><?php echo get_lang('UserListIn').' '.$url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td> |
|
250 | 250 | </tr> |
251 | 251 | <tr> |
252 | 252 | <td align="center"> |
@@ -306,9 +306,9 @@ discard block |
||
306 | 306 | <br /> |
307 | 307 | <?php |
308 | 308 | if (isset($_GET['add'])) { |
309 | - echo '<button class="save" type="button" onclick="valide()" >' . get_lang('AddUsersToURL') . '</button>'; |
|
309 | + echo '<button class="save" type="button" onclick="valide()" >'.get_lang('AddUsersToURL').'</button>'; |
|
310 | 310 | } else { |
311 | - echo '<button class="save" type="button" onclick="valide()" >' . get_lang('EditUsersToURL') . '</button>'; |
|
311 | + echo '<button class="save" type="button" onclick="valide()" >'.get_lang('EditUsersToURL').'</button>'; |
|
312 | 312 | } |
313 | 313 | ?> |
314 | 314 | </td> |
@@ -261,7 +261,7 @@ |
||
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"> |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | require_once '../inc/global.inc.php'; |
11 | 11 | |
12 | 12 | $xajax = new xajax(); |
13 | -$xajax->registerFunction ('search_sessions'); |
|
13 | +$xajax->registerFunction('search_sessions'); |
|
14 | 14 | |
15 | 15 | // setting the section (for the tabs) |
16 | 16 | $this_section = SECTION_PLATFORM_ADMIN; |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | api_protect_admin_script(true); |
20 | 20 | |
21 | 21 | // setting breadcrumbs |
22 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
23 | -$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions')); |
|
22 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
23 | +$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions')); |
|
24 | 24 | |
25 | 25 | // Setting the name of the tool |
26 | 26 | $tool_name = get_lang('SubscribeSessionsToPromotions'); |
27 | 27 | $add_type = 'multiple'; |
28 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){ |
|
28 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
29 | 29 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
30 | 30 | } |
31 | 31 | |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | |
68 | 68 | $form_sent = 0; |
69 | 69 | $errorMsg = ''; |
70 | -$users =$sessions=array(); |
|
70 | +$users = $sessions = array(); |
|
71 | 71 | $promotion = new Promotion(); |
72 | 72 | $id = intval($_GET['id']); |
73 | 73 | if (isset($_POST['form_sent']) && $_POST['form_sent']) { |
74 | 74 | $form_sent = $_POST['form_sent']; |
75 | 75 | $session_in_promotion_posted = $_POST['session_in_promotion_name']; |
76 | 76 | if (!is_array($session_in_promotion_posted)) { |
77 | - $session_in_promotion_posted=array(); |
|
77 | + $session_in_promotion_posted = array(); |
|
78 | 78 | } |
79 | 79 | if ($form_sent == 1) { |
80 | 80 | // Added a parameter to send emails when registering a user |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | $promotion_data = $promotion->get($id); |
88 | 88 | $session_list = SessionManager::get_sessions_list(array(), array('name')); |
89 | -$session_not_in_promotion = $session_in_promotion= array(); |
|
89 | +$session_not_in_promotion = $session_in_promotion = array(); |
|
90 | 90 | |
91 | 91 | if (!empty($session_list)) { |
92 | 92 | foreach ($session_list as $session) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | } |
124 | 124 | $return .= '</select>'; |
125 | - $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return)); |
|
125 | + $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return)); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return $xajax_response; |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | echo '<div class="actions">'; |
143 | -echo '<a href="promotions.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
143 | +echo '<a href="promotions.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
144 | 144 | echo '</div>'; |
145 | 145 | ?> |
146 | 146 | |
147 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
147 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
148 | 148 | <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>'; |
149 | 149 | |
150 | -if ($add_type=='multiple') { |
|
150 | +if ($add_type == 'multiple') { |
|
151 | 151 | if (is_array($extra_field_list)) { |
152 | 152 | if (is_array($new_field_list) && count($new_field_list) > 0) { |
153 | 153 | echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | echo ' <select name="'.$varname.'">'; |
158 | 158 | echo '<option value="0">--'.get_lang('Select').'--</option>'; |
159 | 159 | foreach ($new_field['data'] as $option) { |
160 | - $checked=''; |
|
160 | + $checked = ''; |
|
161 | 161 | if (isset($_POST[$varname])) { |
162 | - if ($_POST[$varname]==$option[1]) { |
|
162 | + if ($_POST[$varname] == $option[1]) { |
|
163 | 163 | $checked = 'selected="true"'; |
164 | 164 | } |
165 | 165 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | <td align="center"><b><?php echo get_lang('SessionsInPromotion') ?> :</b></td> |
190 | 190 | </tr> |
191 | 191 | |
192 | -<?php if ($add_type=='multiple') { ?> |
|
192 | +<?php if ($add_type == 'multiple') { ?> |
|
193 | 193 | <tr> |
194 | 194 | <td align="center"> |
195 | 195 | <?php echo get_lang('FirstLetterSessions'); ?> : |
@@ -207,7 +207,7 @@ 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> |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } else { |
216 | 216 | ?> |
217 | 217 | <div id="ajax_list_multiple"> |
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); ?> |
|
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 | 221 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | 'session_in_promotion_name[]', |
251 | 251 | $session_in_promotion, |
252 | 252 | '', |
253 | - array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_in_promotion','size'=>'15px'), |
|
253 | + array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_in_promotion', 'size'=>'15px'), |
|
254 | 254 | false |
255 | 255 | ); |
256 | 256 | unset($sessionUsersList); |
@@ -144,7 +144,10 @@ |
||
144 | 144 | echo '</div>'; |
145 | 145 | ?> |
146 | 146 | |
147 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
147 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) { |
|
148 | + echo '&add=true' ; |
|
149 | +} |
|
150 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
148 | 151 | <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>'; |
149 | 152 | |
150 | 153 | if ($add_type=='multiple') { |
@@ -29,18 +29,18 @@ |
||
29 | 29 | |
30 | 30 | $interbreadcrumb = array( |
31 | 31 | array( |
32 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php', |
|
32 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/index.php', |
|
33 | 33 | 'name' => get_lang('Administration') |
34 | 34 | ), |
35 | 35 | array( |
36 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php', |
|
36 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php', |
|
37 | 37 | 'name' => get_lang('Badges') |
38 | 38 | ) |
39 | 39 | ); |
40 | 40 | |
41 | 41 | $toolbar = Display::toolbarButton( |
42 | 42 | get_lang('ManageSkills'), |
43 | - api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php', |
|
43 | + api_get_path(WEB_CODE_PATH).'admin/skill_list.php', |
|
44 | 44 | 'list', |
45 | 45 | 'primary', |
46 | 46 | ['title' => get_lang('ManageSkills')] |