@@ -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'); |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | exit(); |
64 | 64 | } |
65 | 65 | } elseif ($remove_from_class) { |
66 | - if (count($right_user_list) == 0) |
|
67 | - $error_message = get_lang('AtLeastOneUser'); |
|
68 | - else { |
|
66 | + if (count($right_user_list) == 0) { |
|
67 | + $error_message = get_lang('AtLeastOneUser'); |
|
68 | + } else { |
|
69 | 69 | foreach ($right_user_list as $index => $user_id) { |
70 | 70 | ClassManager :: unsubscribe_user($user_id, $class_id); |
71 | 71 | } |
@@ -122,7 +122,10 @@ discard block |
||
122 | 122 | <?php |
123 | 123 | foreach ($left_users as $user) { |
124 | 124 | ?> |
125 | - <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option> |
|
125 | + <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) { |
|
126 | + echo 'selected="selected"'; |
|
127 | +} |
|
128 | +?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option> |
|
126 | 129 | <?php |
127 | 130 | } |
128 | 131 | ?> |
@@ -138,7 +141,10 @@ discard block |
||
138 | 141 | <?php |
139 | 142 | foreach ($right_users as $user) { |
140 | 143 | ?> |
141 | - <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option> |
|
144 | + <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) { |
|
145 | + echo 'selected="selected"'; |
|
146 | +} |
|
147 | +?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option> |
|
142 | 148 | <?php |
143 | 149 | } |
144 | 150 | ?> |
@@ -285,7 +285,10 @@ discard block |
||
285 | 285 | <?php |
286 | 286 | foreach ($db_users as $user) { |
287 | 287 | ?> |
288 | - <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) echo 'selected="selected"'; ?>> |
|
288 | + <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) { |
|
289 | + echo 'selected="selected"'; |
|
290 | +} |
|
291 | +?>> |
|
289 | 292 | <?php |
290 | 293 | $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; |
291 | 294 | if ($showOfficialCode) { |
@@ -312,7 +315,10 @@ discard block |
||
312 | 315 | <?php |
313 | 316 | foreach ($db_courses as $course) { |
314 | 317 | ?> |
315 | - <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>> |
|
318 | + <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) { |
|
319 | + echo 'selected="selected"'; |
|
320 | +} |
|
321 | +?>> |
|
316 | 322 | <?php echo '('.$course['visual_code'].') '.$course['title']; ?> |
317 | 323 | </option> |
318 | 324 | <?php |
@@ -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') { |
@@ -254,10 +254,11 @@ |
||
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>'; |
|
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 | + } |
|
261 | 262 | ?> |
262 | 263 | </td> |
263 | 264 | </tr> |
@@ -119,7 +119,10 @@ discard block |
||
119 | 119 | <td width="40%" align="center"> |
120 | 120 | <select name="course_list[]" multiple="multiple" size="20" style="width:400px;"> |
121 | 121 | <?php foreach ($db_courses as $course) { ?> |
122 | - <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>><?php echo $course['title'].' ('.$course['code'].')'; ?> |
|
122 | + <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) { |
|
123 | + echo 'selected="selected"'; |
|
124 | +} |
|
125 | +?>><?php echo $course['title'].' ('.$course['code'].')'; ?> |
|
123 | 126 | </option> |
124 | 127 | <?php } ?> |
125 | 128 | </select> |
@@ -130,7 +133,10 @@ discard block |
||
130 | 133 | <td width="40%" align="center"> |
131 | 134 | <select name="url_list[]" multiple="multiple" size="20" style="width:300px;"> |
132 | 135 | <?php foreach ($db_urls as $url_obj) { ?> |
133 | - <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?> |
|
136 | + <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) { |
|
137 | + echo 'selected="selected"'; |
|
138 | +} |
|
139 | +?>><?php echo $url_obj['url']; ?> |
|
134 | 140 | </option> |
135 | 141 | <?php } ?> |
136 | 142 | </select> |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | echo '</form>'; |
64 | 64 | echo '</div>'; |
65 | 65 | |
66 | -} |
|
67 | -elseif(!empty($annee) && empty($id_session)) |
|
66 | +} elseif(!empty($annee) && empty($id_session)) |
|
68 | 67 | { |
69 | 68 | Display::display_header($tool_name); |
70 | 69 | echo '<div style="align:center">'; |
@@ -142,8 +141,7 @@ discard block |
||
142 | 141 | echo '<br /><br />'; |
143 | 142 | echo '</div>'; |
144 | 143 | |
145 | -} |
|
146 | -elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes')) |
|
144 | +} elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes')) |
|
147 | 145 | { |
148 | 146 | $id=$_POST['username_form']; |
149 | 147 | $UserList=array(); |
@@ -118,7 +118,10 @@ discard block |
||
118 | 118 | <?php |
119 | 119 | foreach ($db_users as $user) { |
120 | 120 | ?> |
121 | - <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>> |
|
121 | + <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'], $users)) { |
|
122 | + echo 'selected="selected"'; |
|
123 | +} |
|
124 | +?>> |
|
122 | 125 | <?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?> |
123 | 126 | </option> |
124 | 127 | <?php |
@@ -134,7 +137,10 @@ discard block |
||
134 | 137 | <?php |
135 | 138 | foreach ($db_urls as $url_obj) { |
136 | 139 | ?> |
137 | - <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>> |
|
140 | + <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) { |
|
141 | + echo 'selected="selected"'; |
|
142 | +} |
|
143 | +?>> |
|
138 | 144 | <?php echo $url_obj['url']; ?> |
139 | 145 | </option> |
140 | 146 | <?php |
@@ -118,8 +118,7 @@ |
||
118 | 118 | if (isset($included) && ($included)) |
119 | 119 | { |
120 | 120 | $message .= "> $name_session: ".count($UserAdd)." ".get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified').'<br/>'; |
121 | - } |
|
122 | - else |
|
121 | + } else |
|
123 | 122 | { |
124 | 123 | print "> $name_session: ".count($UserAdd).get_lang('Added').' '.get_lang('And').' '.count($UserUpdate).' '.get_lang('Modified')."\n"; |
125 | 124 | } |