@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | if ($user_id != $_user['user_id'] && UserManager :: delete_user($_GET['user_id'])) |
| 52 | 52 | { |
| 53 | 53 | Display :: display_normal_message(get_lang('UserDeleted')); |
| 54 | - } |
|
| 55 | - else |
|
| 54 | + } else |
|
| 56 | 55 | { |
| 57 | 56 | Display :: display_error_message(get_lang('CannotDeleteUser')); |
| 58 | 57 | } |
@@ -88,8 +87,7 @@ discard block |
||
| 88 | 87 | { |
| 89 | 88 | $message .= '- '.$login.'<br />'; |
| 90 | 89 | } |
| 91 | - } |
|
| 92 | - else |
|
| 90 | + } else |
|
| 93 | 91 | { |
| 94 | 92 | $message=get_lang('NoUserAdded'); |
| 95 | 93 | } |
@@ -100,13 +98,11 @@ discard block |
||
| 100 | 98 | Display :: display_header($tool_name); |
| 101 | 99 | } |
| 102 | 100 | Security::clear_token(); |
| 103 | - } |
|
| 104 | - else |
|
| 101 | + } else |
|
| 105 | 102 | { |
| 106 | 103 | Display::display_header($tool_name); |
| 107 | 104 | } |
| 108 | -} |
|
| 109 | -else |
|
| 105 | +} else |
|
| 110 | 106 | { |
| 111 | 107 | Display::display_header($tool_name); |
| 112 | 108 | } |
@@ -133,8 +129,7 @@ discard block |
||
| 133 | 129 | if($number_of_selected_users == $number_of_deleted_users) |
| 134 | 130 | { |
| 135 | 131 | Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
| 136 | - } |
|
| 137 | - else |
|
| 132 | + } else |
|
| 138 | 133 | { |
| 139 | 134 | Display :: display_error_message(get_lang('SomeUsersNotDeleted')); |
| 140 | 135 | } |
@@ -150,13 +145,13 @@ discard block |
||
| 150 | 145 | $UserList[] = ldap_add_user($user_id); |
| 151 | 146 | } |
| 152 | 147 | } |
| 153 | - if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
| 154 | - addUserToSession($UserList, $_GET['id_session']); |
|
| 148 | + if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) { |
|
| 149 | + addUserToSession($UserList, $_GET['id_session']); |
|
| 150 | + } |
|
| 155 | 151 | if(count($UserList)>0) |
| 156 | 152 | { |
| 157 | 153 | Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
| 158 | - } |
|
| 159 | - else |
|
| 154 | + } else |
|
| 160 | 155 | { |
| 161 | 156 | Display :: display_normal_message(get_lang('NoUserAdded')); |
| 162 | 157 | } |
@@ -173,14 +168,14 @@ discard block |
||
| 173 | 168 | { |
| 174 | 169 | $form->addText('keyword_firstname', get_lang('FirstName'), false); |
| 175 | 170 | $form->addText('keyword_lastname', get_lang('LastName'), false); |
| 176 | -} |
|
| 177 | -else |
|
| 171 | +} else |
|
| 178 | 172 | { |
| 179 | 173 | $form->addText('keyword_lastname',get_lang('LastName'),false); |
| 180 | 174 | $form->addText('keyword_firstname',get_lang('FirstName'),false); |
| 181 | 175 | } |
| 182 | -if (isset($_GET['id_session'])) |
|
| 176 | +if (isset($_GET['id_session'])) { |
|
| 183 | 177 | $form->addElement('hidden','id_session',$_GET['id_session']); |
| 178 | +} |
|
| 184 | 179 | |
| 185 | 180 | $type = array(); |
| 186 | 181 | $type["all"] = get_lang('All'); |
@@ -201,8 +196,9 @@ discard block |
||
| 201 | 196 | $parameters['keyword_firstname'] = @$_GET['keyword_firstname'] ?: null; |
| 202 | 197 | $parameters['keyword_lastname'] = @$_GET['keyword_lastname'] ?: null; |
| 203 | 198 | $parameters['keyword_email'] = @$_GET['keyword_email'] ?: null; |
| 204 | -if (isset($_GET['id_session'])) |
|
| 199 | +if (isset($_GET['id_session'])) { |
|
| 205 | 200 | $parameters['id_session'] = $_GET['id_session']; |
| 201 | +} |
|
| 206 | 202 | // Create a sortable table with user-data |
| 207 | 203 | |
| 208 | 204 | $parameters['sec_token'] = Security::get_token(); |
@@ -214,8 +210,7 @@ discard block |
||
| 214 | 210 | { |
| 215 | 211 | $table->set_header(2, get_lang('FirstName')); |
| 216 | 212 | $table->set_header(3, get_lang('LastName')); |
| 217 | -} |
|
| 218 | -else |
|
| 213 | +} else |
|
| 219 | 214 | { |
| 220 | 215 | $table->set_header(2, get_lang('LastName')); |
| 221 | 216 | $table->set_header(3, get_lang('FirstName')); |
@@ -240,10 +240,11 @@ |
||
| 240 | 240 | <td colspan="3" align="center"> |
| 241 | 241 | <br /> |
| 242 | 242 | <?php |
| 243 | - if(isset($_GET['add'])) |
|
| 244 | - echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>'; |
|
| 245 | - else |
|
| 246 | - echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>'; |
|
| 243 | + if(isset($_GET['add'])) { |
|
| 244 | + echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>'; |
|
| 245 | + } else { |
|
| 246 | + echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>'; |
|
| 247 | + } |
|
| 247 | 248 | ?> |
| 248 | 249 | </td> |
| 249 | 250 | </tr> |
@@ -345,7 +345,10 @@ discard block |
||
| 345 | 345 | $searchForm->display(); |
| 346 | 346 | echo '</div>'; |
| 347 | 347 | ?> |
| 348 | -<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;"> |
|
| 348 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) { |
|
| 349 | + echo '&add=true' ; |
|
| 350 | +} |
|
| 351 | +?>" style="margin:0px;"> |
|
| 349 | 352 | <?php |
| 350 | 353 | echo '<legend>'.$tool_name.': '.$data['name'].'</legend>'; |
| 351 | 354 | |
@@ -420,7 +423,10 @@ discard block |
||
| 420 | 423 | ?> |
| 421 | 424 | <br /> |
| 422 | 425 | <label class="control-label"> |
| 423 | - <input type="checkbox" <?php if ($user_with_any_group) echo 'checked="checked"';?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id"> |
|
| 426 | + <input type="checkbox" <?php if ($user_with_any_group) { |
|
| 427 | + echo 'checked="checked"'; |
|
| 428 | +} |
|
| 429 | +?> onchange="checked_in_no_group(this.checked);" name="user_with_any_group" id="user_with_any_group_id"> |
|
| 424 | 430 | <?php echo get_lang('UsersRegisteredInAnyGroup'); ?> |
| 425 | 431 | </label> |
| 426 | 432 | </div> |
@@ -43,7 +43,9 @@ |
||
| 43 | 43 | //remove last slash if present |
| 44 | 44 | //$doc_url = ($doc_url{strlen($doc_url)-1}=='/')?substr($doc_url,0,strlen($doc_url)-1):$doc_url; |
| 45 | 45 | //mod_rewrite can change /some/path/ to /some/path// in some cases, so clean them all off (René) |
| 46 | - while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul); |
|
| 46 | + while ($doc_url{$dul = strlen($doc_url)-1}=='/') { |
|
| 47 | + $doc_url = substr($doc_url,0,$dul); |
|
| 48 | + } |
|
| 47 | 49 | //create the path |
| 48 | 50 | $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path |
| 49 | 51 | //redirect |
@@ -1132,7 +1132,7 @@ |
||
| 1132 | 1132 | $questions[$row['sort']]['survey_group_sec1'] = $row['survey_group_sec1']; |
| 1133 | 1133 | $questions[$row['sort']]['survey_group_sec2'] = $row['survey_group_sec2']; |
| 1134 | 1134 | $questions[$row['sort']]['survey_group_pri'] = $row['survey_group_pri']; |
| 1135 | - } else { |
|
| 1135 | + } else { |
|
| 1136 | 1136 | // If the type is a page break we are finished loading the questions for this page |
| 1137 | 1137 | break; |
| 1138 | 1138 | } |
@@ -1247,7 +1247,7 @@ discard block |
||
| 1247 | 1247 | '".Database::escape_string($_course['id'])."')"; |
| 1248 | 1248 | Database::query($sql); |
| 1249 | 1249 | $shared_question_id = Database::insert_id(); |
| 1250 | - } else { |
|
| 1250 | + } else { |
|
| 1251 | 1251 | // Updating an existing question |
| 1252 | 1252 | // adding the question to the survey_question table |
| 1253 | 1253 | $sql = "UPDATE $tbl_survey_question SET |
@@ -2776,14 +2776,12 @@ discard block |
||
| 2776 | 2776 | echo $answers_of_user[$question_id][$option_id]['value']; |
| 2777 | 2777 | echo "</td>"; |
| 2778 | 2778 | } |
| 2779 | - } |
|
| 2780 | - else { |
|
| 2779 | + } else { |
|
| 2781 | 2780 | echo '<td align="center">'; |
| 2782 | 2781 | if (!empty($answers_of_user[$question_id][$option_id])) { |
| 2783 | 2782 | if ($answers_of_user[$question_id][$option_id]['value'] != 0) { |
| 2784 | 2783 | echo $answers_of_user[$question_id][$option_id]['value']; |
| 2785 | - } |
|
| 2786 | - else { |
|
| 2784 | + } else { |
|
| 2787 | 2785 | echo 'v'; |
| 2788 | 2786 | } |
| 2789 | 2787 | } |
@@ -124,7 +124,9 @@ |
||
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | -if (!empty($survey_data['survey_version'])) echo '<b>'.get_lang('Version').': '.$survey_data['survey_version'].'</b>'; |
|
| 127 | +if (!empty($survey_data['survey_version'])) { |
|
| 128 | + echo '<b>'.get_lang('Version').': '.$survey_data['survey_version'].'</b>'; |
|
| 129 | +} |
|
| 128 | 130 | |
| 129 | 131 | // We exit here is the first or last question is a pagebreak (which causes errors) |
| 130 | 132 | SurveyUtil::check_first_last_question($_GET['survey_id']); |
@@ -186,7 +186,10 @@ |
||
| 186 | 186 | <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:320px;"> <?php |
| 187 | 187 | foreach($nosessionCourses as $enreg) { |
| 188 | 188 | ?> |
| 189 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option> |
|
| 189 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) { |
|
| 190 | + echo 'selected="selected"'; |
|
| 191 | +} |
|
| 192 | +?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option> |
|
| 190 | 193 | <?php |
| 191 | 194 | } |
| 192 | 195 | ?> </select></div> <?php |
@@ -166,13 +166,19 @@ |
||
| 166 | 166 | |
| 167 | 167 | <select name="id_coach[]" class="form-control" multiple> |
| 168 | 168 | <option value="0">----- <?php echo get_lang("Choose") ?> -----</option> |
| 169 | - <option value="0" <?php if(count($arr_infos) == 0) echo 'selected="selected"'; ?>> |
|
| 169 | + <option value="0" <?php if(count($arr_infos) == 0) { |
|
| 170 | + echo 'selected="selected"'; |
|
| 171 | +} |
|
| 172 | +?>> |
|
| 170 | 173 | <?php echo get_lang('None') ?> |
| 171 | 174 | </option> |
| 172 | 175 | <?php |
| 173 | 176 | foreach ($coaches as $enreg) { |
| 174 | 177 | ?> |
| 175 | - <option value="<?php echo $enreg['user_id']; ?>" <?php if(((is_array($arr_infos) && in_array($enreg['user_id'], $arr_infos)))) echo 'selected="selected"'; ?>> |
|
| 178 | + <option value="<?php echo $enreg['user_id']; ?>" <?php if(((is_array($arr_infos) && in_array($enreg['user_id'], $arr_infos)))) { |
|
| 179 | + echo 'selected="selected"'; |
|
| 180 | +} |
|
| 181 | +?>> |
|
| 176 | 182 | <?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?> |
| 177 | 183 | </option> |
| 178 | 184 | <?php |