@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | if ($quota_bytes != 0) { |
88 | - $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
88 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $session[] = array(addslashes(get_lang('Teacher').': '.$user_name).' ('.format_file_size($quota_bytes).')', $quota_percentage); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | $session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'), $user_name)), $quota_percentage); |
107 | 107 | |
108 | - } |
|
108 | + } |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | $quota_percentage = round(($total_quota_bytes - $used_quota_bytes) / $total_quota_bytes, 2) * 100; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($is_drh) { |
105 | - $view = 'drh'; |
|
105 | + $view = 'drh'; |
|
106 | 106 | $menu_items[] = Display::url( |
107 | 107 | Display::return_icon('user_na.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), |
108 | 108 | '#' |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | echo "</div><br />"; |
162 | 162 | } |
163 | 163 | } else { |
164 | - echo Display::url( |
|
164 | + echo Display::url( |
|
165 | 165 | Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), |
166 | 166 | api_get_path(WEB_CODE_PATH)."auth/my_progress.php" |
167 | 167 | ); |
@@ -431,11 +431,11 @@ discard block |
||
431 | 431 | |
432 | 432 | // Send the csv file if asked |
433 | 433 | if ($export_csv) { |
434 | - ob_end_clean(); |
|
435 | - Export :: arrayToCsv($csv_content, 'reporting_index'); |
|
436 | - exit; |
|
434 | + ob_end_clean(); |
|
435 | + Export :: arrayToCsv($csv_content, 'reporting_index'); |
|
436 | + exit; |
|
437 | 437 | } |
438 | 438 | |
439 | 439 | if (!$export_csv) { |
440 | - Display::display_footer(); |
|
440 | + Display::display_footer(); |
|
441 | 441 | } |
@@ -29,19 +29,19 @@ |
||
29 | 29 | require_once __DIR__.'/chamilo_pens.php'; |
30 | 30 | |
31 | 31 | class ChamiloPackageHandler extends PENSPackageHandler { |
32 | - public function processPackage($request, $path_to_package) { |
|
33 | - $server = PENSServer::singleton(); |
|
34 | - // Moves the package to archive/pens |
|
35 | - $path_to_archives = api_get_path(SYS_ARCHIVE_PATH).'pens'; |
|
36 | - if (!is_dir($path_to_archives)) { |
|
37 | - mkdir($path_to_archives, 0777, true); |
|
38 | - } |
|
39 | - rename($path_to_package, $path_to_archives.'/'.$request->getFilename()); |
|
40 | - // Insert the request in the database |
|
41 | - $chamilo_pens = new ChamiloPens($request); |
|
42 | - $chamilo_pens->save(); |
|
43 | - $server->sendAlert($request, new PENSResponse(0, 'Package successfully processed')); |
|
44 | - } |
|
32 | + public function processPackage($request, $path_to_package) { |
|
33 | + $server = PENSServer::singleton(); |
|
34 | + // Moves the package to archive/pens |
|
35 | + $path_to_archives = api_get_path(SYS_ARCHIVE_PATH).'pens'; |
|
36 | + if (!is_dir($path_to_archives)) { |
|
37 | + mkdir($path_to_archives, 0777, true); |
|
38 | + } |
|
39 | + rename($path_to_package, $path_to_archives.'/'.$request->getFilename()); |
|
40 | + // Insert the request in the database |
|
41 | + $chamilo_pens = new ChamiloPens($request); |
|
42 | + $chamilo_pens->save(); |
|
43 | + $server->sendAlert($request, new PENSResponse(0, 'Package successfully processed')); |
|
44 | + } |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $handler = new ChamiloPackageHandler(); |
@@ -77,20 +77,20 @@ discard block |
||
77 | 77 | |
78 | 78 | function show_compose_reply_to_message($message_id, $receiver_id) |
79 | 79 | { |
80 | - $table_message = Database::get_main_table(TABLE_MESSAGE); |
|
81 | - $query = "SELECT user_sender_id |
|
80 | + $table_message = Database::get_main_table(TABLE_MESSAGE); |
|
81 | + $query = "SELECT user_sender_id |
|
82 | 82 | FROM $table_message |
83 | 83 | WHERE user_receiver_id = ".intval($receiver_id)." AND id='".intval($message_id)."';"; |
84 | - $result = Database::query($query); |
|
85 | - $row = Database::fetch_array($result, 'ASSOC'); |
|
86 | - if (!isset($row['user_sender_id'])) { |
|
87 | - $html = get_lang('InvalidMessageId'); |
|
84 | + $result = Database::query($query); |
|
85 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
86 | + if (!isset($row['user_sender_id'])) { |
|
87 | + $html = get_lang('InvalidMessageId'); |
|
88 | 88 | |
89 | - return $html; |
|
90 | - } |
|
91 | - $userInfo = api_get_user_info($row['user_sender_id']); |
|
92 | - $default['users'] = array($row['user_sender_id']); |
|
93 | - $html = manage_form($default, null, $userInfo['complete_name']); |
|
89 | + return $html; |
|
90 | + } |
|
91 | + $userInfo = api_get_user_info($row['user_sender_id']); |
|
92 | + $default['users'] = array($row['user_sender_id']); |
|
93 | + $html = manage_form($default, null, $userInfo['complete_name']); |
|
94 | 94 | |
95 | 95 | return $html; |
96 | 96 | } |
@@ -98,10 +98,10 @@ discard block |
||
98 | 98 | function show_compose_to_user($receiver_id) |
99 | 99 | { |
100 | 100 | $userInfo = api_get_user_info($receiver_id); |
101 | - $html = get_lang('To').': <strong>'.$userInfo['complete_name'].'</strong>'; |
|
102 | - $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle')); |
|
103 | - $default['users'] = array($receiver_id); |
|
104 | - $html .= manage_form($default); |
|
101 | + $html = get_lang('To').': <strong>'.$userInfo['complete_name'].'</strong>'; |
|
102 | + $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle')); |
|
103 | + $default['users'] = array($receiver_id); |
|
104 | + $html .= manage_form($default); |
|
105 | 105 | |
106 | 106 | return $html; |
107 | 107 | } |
@@ -273,13 +273,13 @@ discard block |
||
273 | 273 | |
274 | 274 | /* MAIN SECTION */ |
275 | 275 | if ($socialToolIsActive) { |
276 | - $this_section = SECTION_SOCIAL; |
|
276 | + $this_section = SECTION_SOCIAL; |
|
277 | 277 | $interbreadcrumb[] = array( |
278 | 278 | 'url' => api_get_path(WEB_PATH).'main/social/home.php', |
279 | 279 | 'name' => get_lang('SocialNetwork') |
280 | 280 | ); |
281 | 281 | } else { |
282 | - $this_section = SECTION_MYPROFILE; |
|
282 | + $this_section = SECTION_MYPROFILE; |
|
283 | 283 | $interbreadcrumb[] = array( |
284 | 284 | 'url' => api_get_path(WEB_PATH).'main/auth/profile.php', |
285 | 285 | 'name' => get_lang('Profile') |
@@ -289,30 +289,30 @@ discard block |
||
289 | 289 | $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null; |
290 | 290 | $social_right_content = null; |
291 | 291 | if ($group_id != 0) { |
292 | - $social_right_content .= '<div class=actions>'; |
|
293 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'. |
|
294 | - Display::return_icon('back.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
295 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'. |
|
296 | - Display::return_icon('message_new.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
297 | - $social_right_content .= '</div>'; |
|
292 | + $social_right_content .= '<div class=actions>'; |
|
293 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'. |
|
294 | + Display::return_icon('back.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
295 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'. |
|
296 | + Display::return_icon('message_new.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
297 | + $social_right_content .= '</div>'; |
|
298 | 298 | } else { |
299 | - if ($socialToolIsActive) { |
|
300 | - } else { |
|
301 | - $social_right_content .= '<div class=actions>'; |
|
302 | - if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') { |
|
303 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
299 | + if ($socialToolIsActive) { |
|
300 | + } else { |
|
301 | + $social_right_content .= '<div class=actions>'; |
|
302 | + if (api_get_setting('allow_social_tool') === 'true' && api_get_setting('allow_message_tool') === 'true') { |
|
303 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
304 | 304 | Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
305 | - } |
|
306 | - if (api_get_setting('allow_message_tool') === 'true') { |
|
307 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
305 | + } |
|
306 | + if (api_get_setting('allow_message_tool') === 'true') { |
|
307 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
308 | 308 | Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
309 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
|
309 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
|
310 | 310 | Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; |
311 | 311 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
312 | 312 | Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
313 | - } |
|
314 | - $social_right_content .= '</div>'; |
|
315 | - } |
|
313 | + } |
|
314 | + $social_right_content .= '</div>'; |
|
315 | + } |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | // LEFT COLUMN |
@@ -326,9 +326,9 @@ |
||
326 | 326 | } |
327 | 327 | |
328 | 328 | /** |
329 | - * Serialize the course with the best serializer available |
|
330 | - * @return string |
|
331 | - */ |
|
329 | + * Serialize the course with the best serializer available |
|
330 | + * @return string |
|
331 | + */ |
|
332 | 332 | public static function serialize($course) |
333 | 333 | { |
334 | 334 | if (extension_loaded('igbinary')) { |
@@ -51,15 +51,15 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * Displays the title + grid |
53 | 53 | */ |
54 | - public function display() |
|
54 | + public function display() |
|
55 | 55 | { |
56 | - // action links |
|
57 | - echo '<div class="actions" style="margin-bottom:20px">'; |
|
56 | + // action links |
|
57 | + echo '<div class="actions" style="margin-bottom:20px">'; |
|
58 | 58 | echo '<a href="grade_models.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
59 | - echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
60 | - echo '</div>'; |
|
59 | + echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
60 | + echo '</div>'; |
|
61 | 61 | echo Display::grid_html('grade_model'); |
62 | - } |
|
62 | + } |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Returns a Form validator Obj |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public function delete($id) |
256 | 256 | { |
257 | - parent::delete($id); |
|
257 | + parent::delete($id); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
@@ -308,11 +308,11 @@ discard block |
||
308 | 308 | /** |
309 | 309 | * GradeModelComponents constructor. |
310 | 310 | */ |
311 | - public function __construct() |
|
311 | + public function __construct() |
|
312 | 312 | { |
313 | 313 | parent::__construct(); |
314 | 314 | $this->table = Database::get_main_table(TABLE_GRADE_MODEL_COMPONENTS); |
315 | - } |
|
315 | + } |
|
316 | 316 | |
317 | 317 | /** |
318 | 318 | * @param array $params |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | */ |
322 | 322 | public function save($params, $show_query = false) |
323 | 323 | { |
324 | - $id = parent::save($params, $show_query); |
|
324 | + $id = parent::save($params, $show_query); |
|
325 | 325 | |
326 | 326 | return $id; |
327 | 327 | } |
@@ -49,29 +49,29 @@ discard block |
||
49 | 49 | $extra_field_list = UserManager::get_extra_fields(); |
50 | 50 | $new_field_list = array(); |
51 | 51 | if (is_array($extra_field_list)) { |
52 | - foreach ($extra_field_list as $extra_field) { |
|
53 | - //if is enabled to filter and is a "<select>" field type |
|
54 | - if ($extra_field[8] == 1 && $extra_field[2] == 4) { |
|
52 | + foreach ($extra_field_list as $extra_field) { |
|
53 | + //if is enabled to filter and is a "<select>" field type |
|
54 | + if ($extra_field[8] == 1 && $extra_field[2] == 4) { |
|
55 | 55 | $new_field_list[] = array( |
56 | 56 | 'name' => $extra_field[3], |
57 | 57 | 'variable' => $extra_field[1], |
58 | 58 | 'data' => $extra_field[9], |
59 | 59 | ); |
60 | - } |
|
61 | - } |
|
60 | + } |
|
61 | + } |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | function search_users($needle, $type) |
65 | 65 | { |
66 | - global $id_session; |
|
66 | + global $id_session; |
|
67 | 67 | |
68 | 68 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
69 | 69 | $tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
70 | 70 | |
71 | - $xajax_response = new xajaxResponse(); |
|
72 | - $return = ''; |
|
71 | + $xajax_response = new xajaxResponse(); |
|
72 | + $return = ''; |
|
73 | 73 | |
74 | - if (!empty($needle) && !empty($type)) { |
|
74 | + if (!empty($needle) && !empty($type)) { |
|
75 | 75 | |
76 | 76 | //normal behaviour |
77 | 77 | if ($type == 'any_session' && $needle == 'false') { |
@@ -79,32 +79,32 @@ discard block |
||
79 | 79 | $needle = ''; |
80 | 80 | } |
81 | 81 | |
82 | - // xajax send utf8 datas... datas in db can be non-utf8 datas |
|
83 | - $charset = api_get_system_encoding(); |
|
84 | - $needle = Database::escape_string($needle); |
|
85 | - $needle = api_convert_encoding($needle, $charset, 'utf-8'); |
|
82 | + // xajax send utf8 datas... datas in db can be non-utf8 datas |
|
83 | + $charset = api_get_system_encoding(); |
|
84 | + $needle = Database::escape_string($needle); |
|
85 | + $needle = api_convert_encoding($needle, $charset, 'utf-8'); |
|
86 | 86 | |
87 | - $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; |
|
88 | - $cond_user_id = ''; |
|
87 | + $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; |
|
88 | + $cond_user_id = ''; |
|
89 | 89 | |
90 | 90 | //Only for single & multiple |
91 | 91 | if (in_array($type, array('single', 'multiple'))) { |
92 | - if (!empty($id_session)) { |
|
93 | - $id_session = intval($id_session); |
|
94 | - // check id_user from session_rel_user table |
|
95 | - $sql = 'SELECT user_id FROM '.$tbl_session_rel_user.' |
|
92 | + if (!empty($id_session)) { |
|
93 | + $id_session = intval($id_session); |
|
94 | + // check id_user from session_rel_user table |
|
95 | + $sql = 'SELECT user_id FROM '.$tbl_session_rel_user.' |
|
96 | 96 | WHERE session_id ="'.$id_session.'" AND relation_type<>'.SESSION_RELATION_TYPE_RRHH.' '; |
97 | - $res = Database::query($sql); |
|
98 | - $user_ids = array(); |
|
99 | - if (Database::num_rows($res) > 0) { |
|
100 | - while ($row = Database::fetch_row($res)) { |
|
101 | - $user_ids[] = (int) $row[0]; |
|
102 | - } |
|
103 | - } |
|
104 | - if (count($user_ids) > 0) { |
|
105 | - $cond_user_id = ' AND user.user_id NOT IN('.implode(",", $user_ids).')'; |
|
106 | - } |
|
107 | - } |
|
97 | + $res = Database::query($sql); |
|
98 | + $user_ids = array(); |
|
99 | + if (Database::num_rows($res) > 0) { |
|
100 | + while ($row = Database::fetch_row($res)) { |
|
101 | + $user_ids[] = (int) $row[0]; |
|
102 | + } |
|
103 | + } |
|
104 | + if (count($user_ids) > 0) { |
|
105 | + $cond_user_id = ' AND user.user_id NOT IN('.implode(",", $user_ids).')'; |
|
106 | + } |
|
107 | + } |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | switch ($type) { |
@@ -136,11 +136,11 @@ discard block |
||
136 | 136 | user.status <> 6 '.$cond_user_id. |
137 | 137 | $order_clause; |
138 | 138 | break; |
139 | - } |
|
140 | - if (api_is_multiple_url_enabled()) { |
|
141 | - $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
142 | - $access_url_id = api_get_current_access_url_id(); |
|
143 | - if ($access_url_id != -1) { |
|
139 | + } |
|
140 | + if (api_is_multiple_url_enabled()) { |
|
141 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
142 | + $access_url_id = api_get_current_access_url_id(); |
|
143 | + if ($access_url_id != -1) { |
|
144 | 144 | switch ($type) { |
145 | 145 | case 'single': |
146 | 146 | $sql = 'SELECT user.user_id, username, lastname, firstname |
@@ -178,36 +178,36 @@ discard block |
||
178 | 178 | user.status<>6 '.$cond_user_id. |
179 | 179 | $order_clause; |
180 | 180 | break; |
181 | - } |
|
182 | - } |
|
183 | - } |
|
181 | + } |
|
182 | + } |
|
183 | + } |
|
184 | 184 | |
185 | - $rs = Database::query($sql); |
|
185 | + $rs = Database::query($sql); |
|
186 | 186 | $i = 0; |
187 | - if ($type == 'single') { |
|
188 | - while ($user = Database::fetch_array($rs)) { |
|
189 | - $i++; |
|
190 | - if ($i <= 10) { |
|
191 | - $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
|
192 | - $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_session(\''.$user['user_id'].'\',\''.$person_name.' ('.$user['username'].')'.'\')">'.$person_name.' ('.$user['username'].')</a><br />'; |
|
193 | - } else { |
|
194 | - $return .= '...<br />'; |
|
195 | - } |
|
196 | - } |
|
197 | - |
|
198 | - $xajax_response -> addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return)); |
|
199 | - } else { |
|
200 | - $return .= '<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">'; |
|
201 | - while ($user = Database :: fetch_array($rs)) { |
|
202 | - $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
|
203 | - $return .= '<option value="'.$user['user_id'].'">'.$person_name.' ('.$user['username'].')</option>'; |
|
204 | - } |
|
205 | - $return .= '</select>'; |
|
206 | - $xajax_response -> addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return)); |
|
207 | - } |
|
208 | - } |
|
187 | + if ($type == 'single') { |
|
188 | + while ($user = Database::fetch_array($rs)) { |
|
189 | + $i++; |
|
190 | + if ($i <= 10) { |
|
191 | + $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
|
192 | + $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_session(\''.$user['user_id'].'\',\''.$person_name.' ('.$user['username'].')'.'\')">'.$person_name.' ('.$user['username'].')</a><br />'; |
|
193 | + } else { |
|
194 | + $return .= '...<br />'; |
|
195 | + } |
|
196 | + } |
|
209 | 197 | |
210 | - return $xajax_response; |
|
198 | + $xajax_response -> addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return)); |
|
199 | + } else { |
|
200 | + $return .= '<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">'; |
|
201 | + while ($user = Database :: fetch_array($rs)) { |
|
202 | + $person_name = api_get_person_name($user['firstname'], $user['lastname']); |
|
203 | + $return .= '<option value="'.$user['user_id'].'">'.$person_name.' ('.$user['username'].')</option>'; |
|
204 | + } |
|
205 | + $return .= '</select>'; |
|
206 | + $xajax_response -> addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return)); |
|
207 | + } |
|
208 | + } |
|
209 | + |
|
210 | + return $xajax_response; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | $xajax -> processRequests(); |
@@ -347,8 +347,8 @@ discard block |
||
347 | 347 | |
348 | 348 | if ($use_extra_fields) { |
349 | 349 | $final_result = array(); |
350 | - if (count($extra_field_result) > 1) { |
|
351 | - for ($i = 0; $i < count($extra_field_result) - 1; $i++) { |
|
350 | + if (count($extra_field_result) > 1) { |
|
351 | + for ($i = 0; $i < count($extra_field_result) - 1; $i++) { |
|
352 | 352 | if (is_array($extra_field_result[$i + 1])) { |
353 | 353 | $final_result = array_intersect( |
354 | 354 | $extra_field_result[$i], |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | 'un' => $user['username'] |
427 | 427 | ); |
428 | 428 | unset($users[$uid]); |
429 | - } |
|
429 | + } |
|
430 | 430 | } |
431 | 431 | unset($users); //clean to free memory |
432 | 432 | |
@@ -471,13 +471,13 @@ discard block |
||
471 | 471 | } |
472 | 472 | |
473 | 473 | if ($add_type === 'multiple') { |
474 | - $link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=unique">'.Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>'; |
|
475 | - $link_add_type_multiple = Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'); |
|
474 | + $link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=unique">'.Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>'; |
|
475 | + $link_add_type_multiple = Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'); |
|
476 | 476 | } else { |
477 | - $link_add_type_unique = Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'); |
|
478 | - $link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>'; |
|
477 | + $link_add_type_unique = Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'); |
|
478 | + $link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.Security::remove_XSS($_GET['add']).'&add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>'; |
|
479 | 479 | } |
480 | - $link_add_group = '<a href="usergroups.php">'. |
|
480 | + $link_add_group = '<a href="usergroups.php">'. |
|
481 | 481 | Display::return_icon('multiple.gif', get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups').'</a>'; |
482 | 482 | ?> |
483 | 483 | <div class="actions"> |
@@ -487,30 +487,30 @@ discard block |
||
487 | 487 | <?php echo '<legend>'.$tool_name.' ('.$session->getName().') </legend>'; ?> |
488 | 488 | <?php |
489 | 489 | if ($add_type === 'multiple') { |
490 | - if (is_array($extra_field_list)) { |
|
491 | - if (is_array($new_field_list) && count($new_field_list) > 0) { |
|
492 | - echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
|
493 | - foreach ($new_field_list as $new_field) { |
|
494 | - echo $new_field['name']; |
|
495 | - $varname = 'field_'.$new_field['variable']; |
|
496 | - echo ' <select name="'.$varname.'">'; |
|
497 | - echo '<option value="0">--'.get_lang('Select').'--</option>'; |
|
498 | - foreach ($new_field['data'] as $option) { |
|
499 | - $checked = ''; |
|
500 | - if (isset($_POST[$varname])) { |
|
501 | - if ($_POST[$varname] == $option[1]) { |
|
502 | - $checked = 'selected="true"'; |
|
503 | - } |
|
504 | - } |
|
505 | - echo '<option value="'.$option[1].'" '.$checked.'>'.$option[1].'</option>'; |
|
506 | - } |
|
507 | - echo '</select>'; |
|
508 | - echo ' '; |
|
509 | - } |
|
510 | - echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />'; |
|
511 | - echo '<br /><br />'; |
|
512 | - } |
|
513 | - } |
|
490 | + if (is_array($extra_field_list)) { |
|
491 | + if (is_array($new_field_list) && count($new_field_list) > 0) { |
|
492 | + echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
|
493 | + foreach ($new_field_list as $new_field) { |
|
494 | + echo $new_field['name']; |
|
495 | + $varname = 'field_'.$new_field['variable']; |
|
496 | + echo ' <select name="'.$varname.'">'; |
|
497 | + echo '<option value="0">--'.get_lang('Select').'--</option>'; |
|
498 | + foreach ($new_field['data'] as $option) { |
|
499 | + $checked = ''; |
|
500 | + if (isset($_POST[$varname])) { |
|
501 | + if ($_POST[$varname] == $option[1]) { |
|
502 | + $checked = 'selected="true"'; |
|
503 | + } |
|
504 | + } |
|
505 | + echo '<option value="'.$option[1].'" '.$checked.'>'.$option[1].'</option>'; |
|
506 | + } |
|
507 | + echo '</select>'; |
|
508 | + echo ' '; |
|
509 | + } |
|
510 | + echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />'; |
|
511 | + echo '<br /><br />'; |
|
512 | + } |
|
513 | + } |
|
514 | 514 | } |
515 | 515 | ?> |
516 | 516 | <input type="hidden" name="form_sent" value="1" /> |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | <div id="content_source"> |
534 | 534 | <?php |
535 | 535 | if (!($add_type == 'multiple')) { |
536 | - ?> |
|
536 | + ?> |
|
537 | 537 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
538 | 538 | <div id="ajax_list_users_single"></div> |
539 | 539 | <?php |
@@ -542,12 +542,12 @@ discard block |
||
542 | 542 | <div id="ajax_list_users_multiple"> |
543 | 543 | <select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" class="span5"> |
544 | 544 | <?php |
545 | - foreach ($nosessionUsersList as $uid => $enreg) { |
|
546 | - ?> |
|
545 | + foreach ($nosessionUsersList as $uid => $enreg) { |
|
546 | + ?> |
|
547 | 547 | <option value="<?php echo $uid; ?>" <?php if (in_array($uid, $UserList)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option> |
548 | 548 | <?php |
549 | - } |
|
550 | - ?> |
|
549 | + } |
|
550 | + ?> |
|
551 | 551 | </select> |
552 | 552 | </div> |
553 | 553 | <input type="checkbox" onchange="checked_in_no_session(this.checked);" name="user_with_any_session" id="user_with_any_session_id"> |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | <?php |
556 | 556 | } |
557 | 557 | unset($nosessionUsersList); |
558 | - ?> |
|
558 | + ?> |
|
559 | 559 | </div> |
560 | 560 | </div> |
561 | 561 | |
@@ -582,13 +582,13 @@ discard block |
||
582 | 582 | <br /> |
583 | 583 | <br /> |
584 | 584 | <?php |
585 | - if (isset($_GET['add'])) { |
|
586 | - echo '<button class="btn btn-primary" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>'; |
|
585 | + if (isset($_GET['add'])) { |
|
586 | + echo '<button class="btn btn-primary" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>'; |
|
587 | 587 | } else { |
588 | 588 | //@todo see that the call to "valide()" doesn't duplicate the onsubmit of the form (necessary to avoid delete on "enter" key pressed) |
589 | - echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeUsersToSession').'</button>'; |
|
589 | + echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeUsersToSession').'</button>'; |
|
590 | 590 | } |
591 | - ?> |
|
591 | + ?> |
|
592 | 592 | </div> |
593 | 593 | <div class="span5"> |
594 | 594 | <div class="multiple_select_header"> |
@@ -282,16 +282,16 @@ |
||
282 | 282 | Duis bibendum elementum justo. Duis posuere. Fusce nulla odio, posuere eget, condimentum nec, venenatis eu, elit. In hac habitasse platea dictumst. Aenean ac sem in enim imperdiet feugiat. Integer tincidunt lectus at elit. Integer magna lacus, vehicula quis, eleifend eget, suscipit vitae, leo. Nunc porta augue nec enim. Curabitur vehicula volutpat enim. Aliquam consequat. Vestibulum rhoncus tellus vitae erat. Integer est. Quisque fermentum leo nec odio. Suspendisse lobortis sollicitudin augue. Nullam urna mi, suscipit eu, sagittis laoreet, ultrices ac, sem. Aliquam enim tortor, hendrerit non, cursus a, tristique sit amet, sapien. Suspendisse potenti. Aenean semper placerat neque.'; |
283 | 283 | switch ($type) |
284 | 284 | { |
285 | - case 'description': |
|
285 | + case 'description': |
|
286 | 286 | $descriptions = explode(".", $dummy_text); |
287 | 287 | return $descriptions[rand(0, count($descriptions) - 1)]; |
288 | 288 | break; |
289 | - case 'title': |
|
289 | + case 'title': |
|
290 | 290 | $dummy_text = str_replace(array("\n", '.', ',', "\t"), array(' ', '', '', ' '), $dummy_text); |
291 | 291 | $titles = explode(" ", $dummy_text); |
292 | 292 | return trim($titles[rand(0, count($titles) - 1)]); |
293 | 293 | break; |
294 | - case 'text': |
|
294 | + case 'text': |
|
295 | 295 | $texts = explode("\n", $dummy_text); |
296 | 296 | return $texts[rand(0, count($texts) - 1)]; |
297 | 297 | break; |
@@ -556,7 +556,7 @@ |
||
556 | 556 | window.location.href=ui.tab; |
557 | 557 | }); |
558 | 558 | <?php |
559 | - //Displays js code to use a jqgrid |
|
559 | + //Displays js code to use a jqgrid |
|
560 | 560 | echo Display::grid_js( |
561 | 561 | 'courses', |
562 | 562 | '', |