@@ -197,12 +197,12 @@ |
||
197 | 197 | if (!empty($rows_session_category)) { |
198 | 198 | foreach($rows_session_category as $category) { |
199 | 199 | if($category['id'] == $categoryId) |
200 | - echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; |
|
201 | - else |
|
202 | - echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; |
|
200 | + echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; |
|
201 | + else |
|
202 | + echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; |
|
203 | 203 | } |
204 | 204 | } |
205 | - ?> |
|
205 | + ?> |
|
206 | 206 | </select> |
207 | 207 | </td> |
208 | 208 | </tr> |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | |
18 | 18 | // setting breadcrumbs |
19 | 19 | //$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
20 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
20 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
21 | 21 | |
22 | 22 | // Database Table Definitions |
23 | -$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
24 | -$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
|
23 | +$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
24 | +$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
|
25 | 25 | $tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY); |
26 | 26 | $tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
27 | -$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
28 | -$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
27 | +$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
28 | +$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
29 | 29 | |
30 | 30 | // setting the name of the tool |
31 | 31 | $tool_name = get_lang('SubscribeSessionsToCategory'); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | if (!api_is_platform_admin() && !api_is_session_admin()) { |
42 | - $sql = 'SELECT session_admin_id FROM ' . Database:: get_main_table(TABLE_MAIN_SESSION) . ' WHERE id=' . $id_session; |
|
42 | + $sql = 'SELECT session_admin_id FROM '.Database:: get_main_table(TABLE_MAIN_SESSION).' WHERE id='.$id_session; |
|
43 | 43 | $rs = Database::query($sql); |
44 | 44 | if (Database::result($rs, 0, 0) != $_user['user_id']) { |
45 | 45 | api_not_allowed(true); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | $sql = "UPDATE $tbl_session SET session_category_id = $categoryId WHERE id in ($session_id) "; |
103 | 103 | Database::query($sql); |
104 | - header('Location: add_many_session_to_category.php?id_category=' . $categoryId . '&msg=ok'); |
|
104 | + header('Location: add_many_session_to_category.php?id_category='.$categoryId.'&msg=ok'); |
|
105 | 105 | exit; |
106 | 106 | } else { |
107 | 107 | header('Location: add_many_session_to_category.php?msg=error'); |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | $rows_category_session = array(); |
130 | 130 | if ((isset($_POST['CategorySessionId']) && $_POST['formSent'] == 0) || isset($_GET['id_category'])) { |
131 | 131 | |
132 | - $where = 'WHERE session_category_id != ' . $categoryId .' OR session_category_id IS NULL'; |
|
133 | - $sql = 'SELECT id, name FROM ' . $tbl_session . ' WHERE session_category_id =' . $categoryId . ' ORDER BY name'; |
|
132 | + $where = 'WHERE session_category_id != '.$categoryId.' OR session_category_id IS NULL'; |
|
133 | + $sql = 'SELECT id, name FROM '.$tbl_session.' WHERE session_category_id ='.$categoryId.' ORDER BY name'; |
|
134 | 134 | $result = Database::query($sql); |
135 | 135 | $rows_category_session = Database::store_result($result); |
136 | 136 | } |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | if (api_get_multiple_access_url()) { |
146 | - $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
146 | + $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
147 | 147 | $access_url_id = api_get_current_access_url_id(); |
148 | 148 | $sql = "SELECT s.id, s.name FROM $tbl_session s INNER JOIN $table_access_url_rel_session u ON s.id = u.session_id $where AND u.access_url_id = $access_url_id ORDER BY name"; |
149 | 149 | } else { |
150 | 150 | $sql = "SELECT id, name FROM $tbl_session $where ORDER BY name"; |
151 | 151 | } |
152 | -$result=Database::query($sql); |
|
152 | +$result = Database::query($sql); |
|
153 | 153 | $rows_session = Database::store_result($result); |
154 | 154 | ?> |
155 | 155 | <form name="formulaire" method="post" |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | if (!empty($_GET['add'])) { |
158 | 158 | echo '&add=true'; |
159 | 159 | } ?>" style="margin:0px;"> |
160 | -<?php echo '<legend>' . $tool_name . '</legend>'; ?> |
|
160 | +<?php echo '<legend>'.$tool_name.'</legend>'; ?> |
|
161 | 161 | <input type="hidden" name="formSent" value="1"/> |
162 | 162 | <?php |
163 | 163 | if (!empty($errorMsg)) { |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | <option value="0" ></option> |
196 | 196 | <?php |
197 | 197 | if (!empty($rows_session_category)) { |
198 | - foreach($rows_session_category as $category) { |
|
199 | - if($category['id'] == $categoryId) |
|
198 | + foreach ($rows_session_category as $category) { |
|
199 | + if ($category['id'] == $categoryId) |
|
200 | 200 | echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; |
201 | 201 | else |
202 | 202 | echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | <td align="center" width="45%"><b><?php echo get_lang('SessionListInCategory') ?> :</b></td> |
213 | 213 | </tr> |
214 | 214 | |
215 | -<?php if($add_type == 'multiple') { ?> |
|
215 | +<?php if ($add_type == 'multiple') { ?> |
|
216 | 216 | <tr> |
217 | 217 | <td> </td></tr> |
218 | 218 | <?php } ?> |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | <div id="ajax_list_courses_multiple"> |
222 | 222 | <select id="origin" name="NoSessionCategoryList[]" multiple="multiple" size="20" style="width:320px;"> |
223 | 223 | <?php |
224 | - foreach($rows_session as $enreg) { |
|
224 | + foreach ($rows_session as $enreg) { |
|
225 | 225 | ?> |
226 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option> |
|
226 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; if (in_array($enreg['id'], $CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option> |
|
227 | 227 | <?php } ?> |
228 | 228 | </select></div> |
229 | 229 | <?php unset($nosessionCourses); ?> |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | <td width="45%" align="center"> |
245 | 245 | <select id='destination' name="SessionCategoryList[]" multiple="multiple" size="20" style="width:320px;"> |
246 | 246 | <?php |
247 | - foreach($rows_category_session as $enreg) { ?> |
|
248 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option> |
|
247 | + foreach ($rows_category_session as $enreg) { ?> |
|
248 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; if (in_array($enreg['id'], $CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option> |
|
249 | 249 | <?php } ?> |
250 | 250 | </select></td> |
251 | 251 | </tr> |
@@ -196,10 +196,11 @@ discard block |
||
196 | 196 | <?php |
197 | 197 | if (!empty($rows_session_category)) { |
198 | 198 | foreach($rows_session_category as $category) { |
199 | - if($category['id'] == $categoryId) |
|
200 | - echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; |
|
201 | - else |
|
202 | - echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; |
|
199 | + if($category['id'] == $categoryId) { |
|
200 | + echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; |
|
201 | + } else { |
|
202 | + echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; |
|
203 | + } |
|
203 | 204 | } |
204 | 205 | } |
205 | 206 | ?> |
@@ -223,7 +224,10 @@ discard block |
||
223 | 224 | <?php |
224 | 225 | foreach($rows_session as $enreg) { |
225 | 226 | ?> |
226 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option> |
|
227 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) { |
|
228 | + echo 'selected="selected"'; |
|
229 | +} |
|
230 | +?>><?php echo $enreg['name']; ?></option> |
|
227 | 231 | <?php } ?> |
228 | 232 | </select></div> |
229 | 233 | <?php unset($nosessionCourses); ?> |
@@ -245,7 +249,10 @@ discard block |
||
245 | 249 | <select id='destination' name="SessionCategoryList[]" multiple="multiple" size="20" style="width:320px;"> |
246 | 250 | <?php |
247 | 251 | foreach($rows_category_session as $enreg) { ?> |
248 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option> |
|
252 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; if(in_array($enreg['id'],$CourseList)) { |
|
253 | + echo 'selected="selected"'; |
|
254 | +} |
|
255 | +?>><?php echo $enreg['name']; ?></option> |
|
249 | 256 | <?php } ?> |
250 | 257 | </select></td> |
251 | 258 | </tr> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | // setting breadcrumbs |
25 | 25 | //$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
26 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
26 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
27 | 27 | $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$sessionId, "name" => get_lang('SessionOverview')); |
28 | 28 | |
29 | 29 | // Database Table Definitions |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
35 | 35 | |
36 | 36 | // setting the name of the tool |
37 | -$tool_name= get_lang('SubscribeCoursesToSession'); |
|
37 | +$tool_name = get_lang('SubscribeCoursesToSession'); |
|
38 | 38 | |
39 | 39 | $add_type = 'multiple'; |
40 | -if (isset($_GET['add_type']) && $_GET['add_type']!=''){ |
|
40 | +if (isset($_GET['add_type']) && $_GET['add_type'] != '') { |
|
41 | 41 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
42 | 42 | } |
43 | 43 | |
@@ -123,18 +123,18 @@ discard block |
||
123 | 123 | $nosessionCourses = $sessionCourses = array(); |
124 | 124 | if ($ajax_search) { |
125 | 125 | |
126 | - $sql="SELECT course.id, code, title, visual_code, session_id |
|
126 | + $sql = "SELECT course.id, code, title, visual_code, session_id |
|
127 | 127 | FROM $tbl_course course |
128 | 128 | INNER JOIN $tbl_session_rel_course session_rel_course |
129 | 129 | ON |
130 | 130 | course.id = session_rel_course.c_id AND |
131 | 131 | session_rel_course.session_id = ".intval($sessionId)." |
132 | - ORDER BY ".(sizeof($courses)?"(code IN(".implode(',', $courses).")) DESC,":"")." title"; |
|
132 | + ORDER BY ".(sizeof($courses) ? "(code IN(".implode(',', $courses).")) DESC," : "")." title"; |
|
133 | 133 | |
134 | 134 | if (api_is_multiple_url_enabled()) { |
135 | 135 | $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
136 | 136 | $access_url_id = api_get_current_access_url_id(); |
137 | - if ($access_url_id != -1){ |
|
137 | + if ($access_url_id != -1) { |
|
138 | 138 | $sql = "SELECT course.id, code, title, visual_code, session_id |
139 | 139 | FROM $tbl_course course |
140 | 140 | INNER JOIN $tbl_session_rel_course session_rel_course |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | INNER JOIN $tbl_course_rel_access_url url_course |
144 | 144 | ON (url_course.c_id = course.id) |
145 | 145 | WHERE access_url_id = $access_url_id |
146 | - ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title"; |
|
146 | + ORDER BY ".(sizeof($courses) ? "(code IN(".implode(',', $courses).")) DESC," : "")." title"; |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $Courses = Database::store_result($result); |
152 | 152 | |
153 | 153 | foreach ($Courses as $course) { |
154 | - $sessionCourses[$course['id']] = $course ; |
|
154 | + $sessionCourses[$course['id']] = $course; |
|
155 | 155 | } |
156 | 156 | } else { |
157 | 157 | $sql = "SELECT course.id, code, title, visual_code, session_id |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | ON |
161 | 161 | course.id = session_rel_course.c_id AND |
162 | 162 | session_rel_course.session_id = ".intval($sessionId)." |
163 | - ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title"; |
|
163 | + ORDER BY ".(sizeof($courses) ? "(code IN(".implode(',', $courses).")) DESC," : "")." title"; |
|
164 | 164 | |
165 | 165 | if (api_is_multiple_url_enabled()) { |
166 | 166 | $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
167 | 167 | $access_url_id = api_get_current_access_url_id(); |
168 | - if ($access_url_id != -1){ |
|
168 | + if ($access_url_id != -1) { |
|
169 | 169 | $sql = "SELECT course.id, code, title, visual_code, session_id |
170 | 170 | FROM $tbl_course course |
171 | 171 | LEFT JOIN $tbl_session_rel_course session_rel_course |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | INNER JOIN $tbl_course_rel_access_url url_course |
176 | 176 | ON (url_course.c_id = course.id) |
177 | 177 | WHERE access_url_id = $access_url_id |
178 | - ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title"; |
|
178 | + ORDER BY ".(sizeof($courses) ? "(code IN(".implode(',', $courses).")) DESC," : "")." title"; |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | $result = Database::query($sql); |
182 | 182 | $Courses = Database::store_result($result); |
183 | 183 | foreach ($Courses as $course) { |
184 | 184 | if ($course['session_id'] == $sessionId) { |
185 | - $sessionCourses[$course['id']] = $course ; |
|
185 | + $sessionCourses[$course['id']] = $course; |
|
186 | 186 | } else { |
187 | - $nosessionCourses[$course['id']] = $course ; |
|
187 | + $nosessionCourses[$course['id']] = $course; |
|
188 | 188 | } |
189 | 189 | } |
190 | 190 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | unset($Courses); |
208 | 208 | ?> |
209 | - <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
209 | + <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
210 | 210 | <legend><?php echo $tool_name.' ('.$session_info['name'].')'; ?></legend> |
211 | 211 | <input type="hidden" name="formSent" value="1" /> |
212 | 212 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | <div id="ajax_list_courses_multiple"> |
230 | 230 | <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" class="form-control"> |
231 | 231 | <?php foreach ($nosessionCourses as $enreg) { ?> |
232 | - <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"'; ?>> |
|
232 | + <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"'; ?>> |
|
233 | 233 | <?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?> |
234 | 234 | </option> |
235 | 235 | <?php } ?> |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | ?> |
242 | 242 | </div> |
243 | 243 | <div class="col-md-4"> |
244 | - <?php if($add_type == 'multiple') { ?> |
|
244 | + <?php if ($add_type == 'multiple') { ?> |
|
245 | 245 | <div class="code-course"> |
246 | 246 | <?php echo get_lang('FirstLetterCourse'); ?> : |
247 | 247 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | <option value="%">--</option> |
250 | 250 | <?php |
251 | 251 | echo Display :: get_alphabet_options(); |
252 | - echo Display :: get_numeric_options(0,9,''); |
|
252 | + echo Display :: get_numeric_options(0, 9, ''); |
|
253 | 253 | ?> |
254 | 254 | </select> |
255 | 255 | </div> |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | <select id='destination' name="SessionCoursesList[]" multiple="multiple" size="20" class="form-control"> |
306 | 306 | |
307 | 307 | <?php |
308 | - foreach($sessionCourses as $enreg) { |
|
308 | + foreach ($sessionCourses as $enreg) { |
|
309 | 309 | ?> |
310 | - <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES); ?>"> |
|
310 | + <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')', ENT_QUOTES); ?>"> |
|
311 | 311 | <?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?> |
312 | 312 | </option> |
313 | 313 | <?php |
@@ -206,7 +206,10 @@ discard block |
||
206 | 206 | |
207 | 207 | unset($Courses); |
208 | 208 | ?> |
209 | - <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
209 | + <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $sessionId; ?><?php if(!empty($_GET['add'])) { |
|
210 | + echo '&add=true' ; |
|
211 | +} |
|
212 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
210 | 213 | <legend><?php echo $tool_name.' ('.$session_info['name'].')'; ?></legend> |
211 | 214 | <input type="hidden" name="formSent" value="1" /> |
212 | 215 | |
@@ -229,7 +232,10 @@ discard block |
||
229 | 232 | <div id="ajax_list_courses_multiple"> |
230 | 233 | <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" class="form-control"> |
231 | 234 | <?php foreach ($nosessionCourses as $enreg) { ?> |
232 | - <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"'; ?>> |
|
235 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) { |
|
236 | + echo 'selected="selected"'; |
|
237 | +} |
|
238 | +?>> |
|
233 | 239 | <?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?> |
234 | 240 | </option> |
235 | 241 | <?php } ?> |
@@ -29,29 +29,29 @@ discard block |
||
29 | 29 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
30 | 30 | |
31 | 31 | if (isset($_POST['formSent']) && $_POST['formSent']) { |
32 | - $formSent = 1; |
|
33 | - $name = $_POST['name']; |
|
34 | - $year_start = $_POST['year_start']; |
|
35 | - $month_start = $_POST['month_start']; |
|
36 | - $day_start = $_POST['day_start']; |
|
37 | - $year_end = $_POST['year_end']; |
|
38 | - $month_end = $_POST['month_end']; |
|
39 | - $day_end = $_POST['day_end']; |
|
40 | - $return = SessionManager::create_category_session( |
|
41 | - $name, |
|
42 | - $year_start, |
|
43 | - $month_start, |
|
44 | - $day_start, |
|
45 | - $year_end, |
|
46 | - $month_end, |
|
47 | - $day_end |
|
48 | - ); |
|
32 | + $formSent = 1; |
|
33 | + $name = $_POST['name']; |
|
34 | + $year_start = $_POST['year_start']; |
|
35 | + $month_start = $_POST['month_start']; |
|
36 | + $day_start = $_POST['day_start']; |
|
37 | + $year_end = $_POST['year_end']; |
|
38 | + $month_end = $_POST['month_end']; |
|
39 | + $day_end = $_POST['day_end']; |
|
40 | + $return = SessionManager::create_category_session( |
|
41 | + $name, |
|
42 | + $year_start, |
|
43 | + $month_start, |
|
44 | + $day_start, |
|
45 | + $year_end, |
|
46 | + $month_end, |
|
47 | + $day_end |
|
48 | + ); |
|
49 | 49 | |
50 | - if ($return == strval(intval($return))) { |
|
51 | - Display::addFlash(Display::return_message(get_lang('SessionCategoryAdded'))); |
|
52 | - header('Location: session_category_list.php'); |
|
53 | - exit(); |
|
54 | - } |
|
50 | + if ($return == strval(intval($return))) { |
|
51 | + Display::addFlash(Display::return_message(get_lang('SessionCategoryAdded'))); |
|
52 | + header('Location: session_category_list.php'); |
|
53 | + exit(); |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | $thisYear = date('Y'); |
57 | 57 | $thisMonth = date('m'); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | //display the header |
62 | 62 | Display::display_header($tool_name); |
63 | 63 | if (!empty($return)) { |
64 | - Display::display_error_message($return,false); |
|
64 | + Display::display_error_message($return,false); |
|
65 | 65 | } |
66 | 66 | ?> |
67 | 67 | <div class="row"> |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | / |
140 | 140 | <select name="year_start"> |
141 | 141 | <?php |
142 | - for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { |
|
143 | - ?> |
|
142 | + for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { |
|
143 | + ?> |
|
144 | 144 | <option value="<?php echo $i; ?>" <?php if((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option> |
145 | 145 | <?php |
146 | - } |
|
147 | - ?> |
|
146 | + } |
|
147 | + ?> |
|
148 | 148 | </select> |
149 | 149 | </div> |
150 | 150 | <div class="col-md-3"></div> |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | |
19 | 19 | api_protect_admin_script(true); |
20 | 20 | |
21 | -$formSent=0; |
|
22 | -$errorMsg=''; |
|
21 | +$formSent = 0; |
|
22 | +$errorMsg = ''; |
|
23 | 23 | //$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
24 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
25 | -$interbreadcrumb[] = array('url' => "session_category_list.php","name" => get_lang('ListSessionCategory')); |
|
24 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
25 | +$interbreadcrumb[] = array('url' => "session_category_list.php", "name" => get_lang('ListSessionCategory')); |
|
26 | 26 | |
27 | 27 | // Database Table Definitions |
28 | 28 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | //display the header |
62 | 62 | Display::display_header($tool_name); |
63 | 63 | if (!empty($return)) { |
64 | - Display::display_error_message($return,false); |
|
64 | + Display::display_error_message($return, false); |
|
65 | 65 | } |
66 | 66 | ?> |
67 | 67 | <div class="row"> |
@@ -72,13 +72,13 @@ discard block |
||
72 | 72 | <div class="form-group"> |
73 | 73 | <label class="col-sm-3 control-label"><?php echo get_lang('SessionCategoryName') ?></label> |
74 | 74 | <div class="col-sm-6"> |
75 | - <input type="text" class="form-control" name="name" placeholder="<?php echo get_lang('Category') ?>" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); ?>"> |
|
75 | + <input type="text" class="form-control" name="name" placeholder="<?php echo get_lang('Category') ?>" size="50" maxlength="50" value="<?php if ($formSent) echo api_htmlentities($name, ENT_QUOTES, $charset); ?>"> |
|
76 | 76 | </div> |
77 | 77 | <div class="col-md-3"></div> |
78 | 78 | </div> |
79 | 79 | <div class="form-group"> |
80 | 80 | <div class="col-sm-offset-3 col-sm-6"> |
81 | - <?php echo get_lang('TheTimeLimitsAreReferential');?> <a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('AddTimeLimit') ?></a> |
|
81 | + <?php echo get_lang('TheTimeLimitsAreReferential'); ?> <a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('AddTimeLimit') ?></a> |
|
82 | 82 | </div> |
83 | 83 | <div class="col-md-3"></div> |
84 | 84 | </div> |
@@ -90,58 +90,58 @@ discard block |
||
90 | 90 | <div class="col-sm-6"> |
91 | 91 | <select name="day_start"> |
92 | 92 | <option value="1">01</option> |
93 | - <option value="2" <?php if((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
94 | - <option value="3" <?php if((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
95 | - <option value="4" <?php if((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
96 | - <option value="5" <?php if((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
97 | - <option value="6" <?php if((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
98 | - <option value="7" <?php if((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
99 | - <option value="8" <?php if((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
100 | - <option value="9" <?php if((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
101 | - <option value="10" <?php if((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
102 | - <option value="11" <?php if((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
103 | - <option value="12" <?php if((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
104 | - <option value="13" <?php if((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) echo 'selected="selected"'; ?> >13</option> |
|
105 | - <option value="14" <?php if((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) echo 'selected="selected"'; ?> >14</option> |
|
106 | - <option value="15" <?php if((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) echo 'selected="selected"'; ?> >15</option> |
|
107 | - <option value="16" <?php if((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) echo 'selected="selected"'; ?> >16</option> |
|
108 | - <option value="17" <?php if((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) echo 'selected="selected"'; ?> >17</option> |
|
109 | - <option value="18" <?php if((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) echo 'selected="selected"'; ?> >18</option> |
|
110 | - <option value="19" <?php if((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) echo 'selected="selected"'; ?> >19</option> |
|
111 | - <option value="20" <?php if((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) echo 'selected="selected"'; ?> >20</option> |
|
112 | - <option value="21" <?php if((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) echo 'selected="selected"'; ?> >21</option> |
|
113 | - <option value="22" <?php if((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) echo 'selected="selected"'; ?> >22</option> |
|
114 | - <option value="23" <?php if((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) echo 'selected="selected"'; ?> >23</option> |
|
115 | - <option value="24" <?php if((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) echo 'selected="selected"'; ?> >24</option> |
|
116 | - <option value="25" <?php if((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) echo 'selected="selected"'; ?> >25</option> |
|
117 | - <option value="26" <?php if((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) echo 'selected="selected"'; ?> >26</option> |
|
118 | - <option value="27" <?php if((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) echo 'selected="selected"'; ?> >27</option> |
|
119 | - <option value="28" <?php if((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) echo 'selected="selected"'; ?> >28</option> |
|
120 | - <option value="29" <?php if((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) echo 'selected="selected"'; ?> >29</option> |
|
121 | - <option value="30" <?php if((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) echo 'selected="selected"'; ?> >30</option> |
|
122 | - <option value="31" <?php if((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) echo 'selected="selected"'; ?> >31</option> |
|
93 | + <option value="2" <?php if ((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
94 | + <option value="3" <?php if ((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
95 | + <option value="4" <?php if ((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
96 | + <option value="5" <?php if ((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
97 | + <option value="6" <?php if ((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
98 | + <option value="7" <?php if ((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
99 | + <option value="8" <?php if ((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
100 | + <option value="9" <?php if ((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
101 | + <option value="10" <?php if ((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
102 | + <option value="11" <?php if ((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
103 | + <option value="12" <?php if ((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
104 | + <option value="13" <?php if ((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) echo 'selected="selected"'; ?> >13</option> |
|
105 | + <option value="14" <?php if ((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) echo 'selected="selected"'; ?> >14</option> |
|
106 | + <option value="15" <?php if ((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) echo 'selected="selected"'; ?> >15</option> |
|
107 | + <option value="16" <?php if ((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) echo 'selected="selected"'; ?> >16</option> |
|
108 | + <option value="17" <?php if ((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) echo 'selected="selected"'; ?> >17</option> |
|
109 | + <option value="18" <?php if ((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) echo 'selected="selected"'; ?> >18</option> |
|
110 | + <option value="19" <?php if ((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) echo 'selected="selected"'; ?> >19</option> |
|
111 | + <option value="20" <?php if ((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) echo 'selected="selected"'; ?> >20</option> |
|
112 | + <option value="21" <?php if ((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) echo 'selected="selected"'; ?> >21</option> |
|
113 | + <option value="22" <?php if ((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) echo 'selected="selected"'; ?> >22</option> |
|
114 | + <option value="23" <?php if ((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) echo 'selected="selected"'; ?> >23</option> |
|
115 | + <option value="24" <?php if ((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) echo 'selected="selected"'; ?> >24</option> |
|
116 | + <option value="25" <?php if ((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) echo 'selected="selected"'; ?> >25</option> |
|
117 | + <option value="26" <?php if ((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) echo 'selected="selected"'; ?> >26</option> |
|
118 | + <option value="27" <?php if ((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) echo 'selected="selected"'; ?> >27</option> |
|
119 | + <option value="28" <?php if ((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) echo 'selected="selected"'; ?> >28</option> |
|
120 | + <option value="29" <?php if ((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) echo 'selected="selected"'; ?> >29</option> |
|
121 | + <option value="30" <?php if ((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) echo 'selected="selected"'; ?> >30</option> |
|
122 | + <option value="31" <?php if ((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) echo 'selected="selected"'; ?> >31</option> |
|
123 | 123 | </select> |
124 | 124 | / |
125 | 125 | <select name="month_start"> |
126 | 126 | <option value="1">01</option> |
127 | - <option value="2" <?php if((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
128 | - <option value="3" <?php if((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
129 | - <option value="4" <?php if((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
130 | - <option value="5" <?php if((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
131 | - <option value="6" <?php if((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
132 | - <option value="7" <?php if((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
133 | - <option value="8" <?php if((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
134 | - <option value="9" <?php if((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
135 | - <option value="10" <?php if((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
136 | - <option value="11" <?php if((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
137 | - <option value="12" <?php if((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
127 | + <option value="2" <?php if ((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
128 | + <option value="3" <?php if ((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
129 | + <option value="4" <?php if ((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
130 | + <option value="5" <?php if ((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
131 | + <option value="6" <?php if ((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
132 | + <option value="7" <?php if ((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
133 | + <option value="8" <?php if ((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
134 | + <option value="9" <?php if ((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
135 | + <option value="10" <?php if ((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
136 | + <option value="11" <?php if ((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
137 | + <option value="12" <?php if ((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
138 | 138 | </select> |
139 | 139 | / |
140 | 140 | <select name="year_start"> |
141 | 141 | <?php |
142 | - for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { |
|
142 | + for ($i = $thisYear - 5; $i <= ($thisYear + 5); $i++) { |
|
143 | 143 | ?> |
144 | - <option value="<?php echo $i; ?>" <?php if((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option> |
|
144 | + <option value="<?php echo $i; ?>" <?php if ((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option> |
|
145 | 145 | <?php |
146 | 146 | } |
147 | 147 | ?> |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | <select name="year_end"> |
207 | 207 | <option value="0">----</option> |
208 | 208 | <?php |
209 | - for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { |
|
209 | + for ($i = $thisYear - 5; $i <= ($thisYear + 5); $i++) { |
|
210 | 210 | ?> |
211 | 211 | <option value="<?php echo $i; ?>"><?php echo $i; ?></option> |
212 | 212 | <?php |
@@ -72,7 +72,10 @@ discard block |
||
72 | 72 | <div class="form-group"> |
73 | 73 | <label class="col-sm-3 control-label"><?php echo get_lang('SessionCategoryName') ?></label> |
74 | 74 | <div class="col-sm-6"> |
75 | - <input type="text" class="form-control" name="name" placeholder="<?php echo get_lang('Category') ?>" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); ?>"> |
|
75 | + <input type="text" class="form-control" name="name" placeholder="<?php echo get_lang('Category') ?>" size="50" maxlength="50" value="<?php if($formSent) { |
|
76 | + echo api_htmlentities($name,ENT_QUOTES,$charset); |
|
77 | +} |
|
78 | +?>"> |
|
76 | 79 | </div> |
77 | 80 | <div class="col-md-3"></div> |
78 | 81 | </div> |
@@ -90,58 +93,184 @@ discard block |
||
90 | 93 | <div class="col-sm-6"> |
91 | 94 | <select name="day_start"> |
92 | 95 | <option value="1">01</option> |
93 | - <option value="2" <?php if((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
94 | - <option value="3" <?php if((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
95 | - <option value="4" <?php if((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
96 | - <option value="5" <?php if((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
97 | - <option value="6" <?php if((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
98 | - <option value="7" <?php if((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
99 | - <option value="8" <?php if((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
100 | - <option value="9" <?php if((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
101 | - <option value="10" <?php if((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
102 | - <option value="11" <?php if((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
103 | - <option value="12" <?php if((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
104 | - <option value="13" <?php if((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) echo 'selected="selected"'; ?> >13</option> |
|
105 | - <option value="14" <?php if((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) echo 'selected="selected"'; ?> >14</option> |
|
106 | - <option value="15" <?php if((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) echo 'selected="selected"'; ?> >15</option> |
|
107 | - <option value="16" <?php if((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) echo 'selected="selected"'; ?> >16</option> |
|
108 | - <option value="17" <?php if((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) echo 'selected="selected"'; ?> >17</option> |
|
109 | - <option value="18" <?php if((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) echo 'selected="selected"'; ?> >18</option> |
|
110 | - <option value="19" <?php if((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) echo 'selected="selected"'; ?> >19</option> |
|
111 | - <option value="20" <?php if((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) echo 'selected="selected"'; ?> >20</option> |
|
112 | - <option value="21" <?php if((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) echo 'selected="selected"'; ?> >21</option> |
|
113 | - <option value="22" <?php if((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) echo 'selected="selected"'; ?> >22</option> |
|
114 | - <option value="23" <?php if((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) echo 'selected="selected"'; ?> >23</option> |
|
115 | - <option value="24" <?php if((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) echo 'selected="selected"'; ?> >24</option> |
|
116 | - <option value="25" <?php if((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) echo 'selected="selected"'; ?> >25</option> |
|
117 | - <option value="26" <?php if((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) echo 'selected="selected"'; ?> >26</option> |
|
118 | - <option value="27" <?php if((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) echo 'selected="selected"'; ?> >27</option> |
|
119 | - <option value="28" <?php if((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) echo 'selected="selected"'; ?> >28</option> |
|
120 | - <option value="29" <?php if((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) echo 'selected="selected"'; ?> >29</option> |
|
121 | - <option value="30" <?php if((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) echo 'selected="selected"'; ?> >30</option> |
|
122 | - <option value="31" <?php if((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) echo 'selected="selected"'; ?> >31</option> |
|
96 | + <option value="2" <?php if((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) { |
|
97 | + echo 'selected="selected"'; |
|
98 | +} |
|
99 | +?> >02</option> |
|
100 | + <option value="3" <?php if((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) { |
|
101 | + echo 'selected="selected"'; |
|
102 | +} |
|
103 | +?> >03</option> |
|
104 | + <option value="4" <?php if((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) { |
|
105 | + echo 'selected="selected"'; |
|
106 | +} |
|
107 | +?> >04</option> |
|
108 | + <option value="5" <?php if((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) { |
|
109 | + echo 'selected="selected"'; |
|
110 | +} |
|
111 | +?> >05</option> |
|
112 | + <option value="6" <?php if((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) { |
|
113 | + echo 'selected="selected"'; |
|
114 | +} |
|
115 | +?> >06</option> |
|
116 | + <option value="7" <?php if((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) { |
|
117 | + echo 'selected="selected"'; |
|
118 | +} |
|
119 | +?> >07</option> |
|
120 | + <option value="8" <?php if((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) { |
|
121 | + echo 'selected="selected"'; |
|
122 | +} |
|
123 | +?> >08</option> |
|
124 | + <option value="9" <?php if((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) { |
|
125 | + echo 'selected="selected"'; |
|
126 | +} |
|
127 | +?> >09</option> |
|
128 | + <option value="10" <?php if((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) { |
|
129 | + echo 'selected="selected"'; |
|
130 | +} |
|
131 | +?> >10</option> |
|
132 | + <option value="11" <?php if((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) { |
|
133 | + echo 'selected="selected"'; |
|
134 | +} |
|
135 | +?> >11</option> |
|
136 | + <option value="12" <?php if((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) { |
|
137 | + echo 'selected="selected"'; |
|
138 | +} |
|
139 | +?> >12</option> |
|
140 | + <option value="13" <?php if((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) { |
|
141 | + echo 'selected="selected"'; |
|
142 | +} |
|
143 | +?> >13</option> |
|
144 | + <option value="14" <?php if((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) { |
|
145 | + echo 'selected="selected"'; |
|
146 | +} |
|
147 | +?> >14</option> |
|
148 | + <option value="15" <?php if((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) { |
|
149 | + echo 'selected="selected"'; |
|
150 | +} |
|
151 | +?> >15</option> |
|
152 | + <option value="16" <?php if((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) { |
|
153 | + echo 'selected="selected"'; |
|
154 | +} |
|
155 | +?> >16</option> |
|
156 | + <option value="17" <?php if((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) { |
|
157 | + echo 'selected="selected"'; |
|
158 | +} |
|
159 | +?> >17</option> |
|
160 | + <option value="18" <?php if((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) { |
|
161 | + echo 'selected="selected"'; |
|
162 | +} |
|
163 | +?> >18</option> |
|
164 | + <option value="19" <?php if((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) { |
|
165 | + echo 'selected="selected"'; |
|
166 | +} |
|
167 | +?> >19</option> |
|
168 | + <option value="20" <?php if((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) { |
|
169 | + echo 'selected="selected"'; |
|
170 | +} |
|
171 | +?> >20</option> |
|
172 | + <option value="21" <?php if((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) { |
|
173 | + echo 'selected="selected"'; |
|
174 | +} |
|
175 | +?> >21</option> |
|
176 | + <option value="22" <?php if((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) { |
|
177 | + echo 'selected="selected"'; |
|
178 | +} |
|
179 | +?> >22</option> |
|
180 | + <option value="23" <?php if((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) { |
|
181 | + echo 'selected="selected"'; |
|
182 | +} |
|
183 | +?> >23</option> |
|
184 | + <option value="24" <?php if((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) { |
|
185 | + echo 'selected="selected"'; |
|
186 | +} |
|
187 | +?> >24</option> |
|
188 | + <option value="25" <?php if((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) { |
|
189 | + echo 'selected="selected"'; |
|
190 | +} |
|
191 | +?> >25</option> |
|
192 | + <option value="26" <?php if((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) { |
|
193 | + echo 'selected="selected"'; |
|
194 | +} |
|
195 | +?> >26</option> |
|
196 | + <option value="27" <?php if((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) { |
|
197 | + echo 'selected="selected"'; |
|
198 | +} |
|
199 | +?> >27</option> |
|
200 | + <option value="28" <?php if((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) { |
|
201 | + echo 'selected="selected"'; |
|
202 | +} |
|
203 | +?> >28</option> |
|
204 | + <option value="29" <?php if((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) { |
|
205 | + echo 'selected="selected"'; |
|
206 | +} |
|
207 | +?> >29</option> |
|
208 | + <option value="30" <?php if((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) { |
|
209 | + echo 'selected="selected"'; |
|
210 | +} |
|
211 | +?> >30</option> |
|
212 | + <option value="31" <?php if((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) { |
|
213 | + echo 'selected="selected"'; |
|
214 | +} |
|
215 | +?> >31</option> |
|
123 | 216 | </select> |
124 | 217 | / |
125 | 218 | <select name="month_start"> |
126 | 219 | <option value="1">01</option> |
127 | - <option value="2" <?php if((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) echo 'selected="selected"'; ?> >02</option> |
|
128 | - <option value="3" <?php if((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) echo 'selected="selected"'; ?> >03</option> |
|
129 | - <option value="4" <?php if((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) echo 'selected="selected"'; ?> >04</option> |
|
130 | - <option value="5" <?php if((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) echo 'selected="selected"'; ?> >05</option> |
|
131 | - <option value="6" <?php if((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) echo 'selected="selected"'; ?> >06</option> |
|
132 | - <option value="7" <?php if((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) echo 'selected="selected"'; ?> >07</option> |
|
133 | - <option value="8" <?php if((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) echo 'selected="selected"'; ?> >08</option> |
|
134 | - <option value="9" <?php if((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) echo 'selected="selected"'; ?> >09</option> |
|
135 | - <option value="10" <?php if((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) echo 'selected="selected"'; ?> >10</option> |
|
136 | - <option value="11" <?php if((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) echo 'selected="selected"'; ?> >11</option> |
|
137 | - <option value="12" <?php if((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) echo 'selected="selected"'; ?> >12</option> |
|
220 | + <option value="2" <?php if((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) { |
|
221 | + echo 'selected="selected"'; |
|
222 | +} |
|
223 | +?> >02</option> |
|
224 | + <option value="3" <?php if((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) { |
|
225 | + echo 'selected="selected"'; |
|
226 | +} |
|
227 | +?> >03</option> |
|
228 | + <option value="4" <?php if((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) { |
|
229 | + echo 'selected="selected"'; |
|
230 | +} |
|
231 | +?> >04</option> |
|
232 | + <option value="5" <?php if((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) { |
|
233 | + echo 'selected="selected"'; |
|
234 | +} |
|
235 | +?> >05</option> |
|
236 | + <option value="6" <?php if((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) { |
|
237 | + echo 'selected="selected"'; |
|
238 | +} |
|
239 | +?> >06</option> |
|
240 | + <option value="7" <?php if((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) { |
|
241 | + echo 'selected="selected"'; |
|
242 | +} |
|
243 | +?> >07</option> |
|
244 | + <option value="8" <?php if((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) { |
|
245 | + echo 'selected="selected"'; |
|
246 | +} |
|
247 | +?> >08</option> |
|
248 | + <option value="9" <?php if((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) { |
|
249 | + echo 'selected="selected"'; |
|
250 | +} |
|
251 | +?> >09</option> |
|
252 | + <option value="10" <?php if((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) { |
|
253 | + echo 'selected="selected"'; |
|
254 | +} |
|
255 | +?> >10</option> |
|
256 | + <option value="11" <?php if((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) { |
|
257 | + echo 'selected="selected"'; |
|
258 | +} |
|
259 | +?> >11</option> |
|
260 | + <option value="12" <?php if((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) { |
|
261 | + echo 'selected="selected"'; |
|
262 | +} |
|
263 | +?> >12</option> |
|
138 | 264 | </select> |
139 | 265 | / |
140 | 266 | <select name="year_start"> |
141 | 267 | <?php |
142 | 268 | for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) { |
143 | 269 | ?> |
144 | - <option value="<?php echo $i; ?>" <?php if((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option> |
|
270 | + <option value="<?php echo $i; ?>" <?php if((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) { |
|
271 | + echo 'selected="selected"'; |
|
272 | +} |
|
273 | +?> ><?php echo $i; ?></option> |
|
145 | 274 | <?php |
146 | 275 | } |
147 | 276 | ?> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id,"name" => get_lang('SessionOverview')); |
42 | 42 | |
43 | 43 | if (isset($_POST['formSent']) && $_POST['formSent']) { |
44 | - $formSent = 1; |
|
44 | + $formSent = 1; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $order_clause = 'ORDER BY '; |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | WHERE status='1'".$order_clause; |
53 | 53 | |
54 | 54 | if (api_is_multiple_url_enabled()) { |
55 | - $table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
56 | - $access_url_id = api_get_current_access_url_id(); |
|
57 | - if ($access_url_id != -1) { |
|
58 | - $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username |
|
55 | + $table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
56 | + $access_url_id = api_get_current_access_url_id(); |
|
57 | + if ($access_url_id != -1) { |
|
58 | + $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username |
|
59 | 59 | FROM $tbl_user u |
60 | 60 | INNER JOIN $table_access_url_rel_user url_rel_user |
61 | 61 | ON (url_rel_user.user_id = u.user_id) |
62 | 62 | WHERE status='1' AND access_url_id = '$access_url_id' $order_clause"; |
63 | - } |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $result = Database::query($sql); |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | ); |
171 | 171 | |
172 | 172 | if ($return == strval(intval($return))) { |
173 | - header('Location: resume_session.php?id_session=' . $return); |
|
174 | - exit(); |
|
175 | - } |
|
173 | + header('Location: resume_session.php?id_session=' . $return); |
|
174 | + exit(); |
|
175 | + } |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | // display the header |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | $tool_name = get_lang('EditSession'); |
38 | 38 | |
39 | 39 | //$interbreadcrumb[] = array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
40 | -$interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList')); |
|
41 | -$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id,"name" => get_lang('SessionOverview')); |
|
40 | +$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList')); |
|
41 | +$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id, "name" => get_lang('SessionOverview')); |
|
42 | 42 | |
43 | 43 | if (isset($_POST['formSent']) && $_POST['formSent']) { |
44 | 44 | $formSent = 1; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | WHERE status='1'".$order_clause; |
53 | 53 | |
54 | 54 | if (api_is_multiple_url_enabled()) { |
55 | - $table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
55 | + $table_access_url_rel_user = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
56 | 56 | $access_url_id = api_get_current_access_url_id(); |
57 | 57 | if ($access_url_id != -1) { |
58 | 58 | $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $thisYear = date('Y'); |
69 | 69 | |
70 | 70 | $coachesOption = array( |
71 | - '' => '----- ' . get_lang('None') . ' -----' |
|
71 | + '' => '----- '.get_lang('None').' -----' |
|
72 | 72 | ); |
73 | 73 | |
74 | 74 | foreach ($coaches as $coach) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | } |
90 | 90 | |
91 | -$formAction = api_get_self() . '?'; |
|
91 | +$formAction = api_get_self().'?'; |
|
92 | 92 | $formAction .= http_build_query(array( |
93 | 93 | 'page' => Security::remove_XSS($_GET['page']), |
94 | 94 | 'id' => $id |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $duration = null; |
140 | 140 | } |
141 | 141 | $description = $params['description']; |
142 | - $showDescription = isset($params['show_description']) ? 1: 0; |
|
142 | + $showDescription = isset($params['show_description']) ? 1 : 0; |
|
143 | 143 | $sendSubscriptionNotification = isset($params['send_subscription_notification']); |
144 | 144 | |
145 | 145 | $extraFields = array(); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | ); |
171 | 171 | |
172 | 172 | if ($return == strval(intval($return))) { |
173 | - header('Location: resume_session.php?id_session=' . $return); |
|
173 | + header('Location: resume_session.php?id_session='.$return); |
|
174 | 174 | exit(); |
175 | 175 | } |
176 | 176 | } |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | set_time_limit(0); |
38 | 38 | |
39 | 39 | if (isset($_POST['formSent'])) { |
40 | - $formSent = $_POST['formSent']; |
|
41 | - $file_type = isset($_POST['file_type']) ? $_POST['file_type'] : 'csv'; |
|
42 | - $session_id = $_POST['session_id']; |
|
43 | - if (empty($session_id)) { |
|
44 | - $sql = "SELECT |
|
40 | + $formSent = $_POST['formSent']; |
|
41 | + $file_type = isset($_POST['file_type']) ? $_POST['file_type'] : 'csv'; |
|
42 | + $session_id = $_POST['session_id']; |
|
43 | + if (empty($session_id)) { |
|
44 | + $sql = "SELECT |
|
45 | 45 | s.id, |
46 | 46 | name, |
47 | 47 | id_coach, |
@@ -55,84 +55,84 @@ discard block |
||
55 | 55 | ON $tbl_user.user_id = s.id_coach |
56 | 56 | ORDER BY id"; |
57 | 57 | |
58 | - if (api_is_multiple_url_enabled()) { |
|
59 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
60 | - $access_url_id = api_get_current_access_url_id(); |
|
61 | - if ($access_url_id != -1){ |
|
62 | - $sql = "SELECT s.id, name,id_coach,username,access_start_date,access_end_date,visibility,session_category_id |
|
58 | + if (api_is_multiple_url_enabled()) { |
|
59 | + $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
60 | + $access_url_id = api_get_current_access_url_id(); |
|
61 | + if ($access_url_id != -1){ |
|
62 | + $sql = "SELECT s.id, name,id_coach,username,access_start_date,access_end_date,visibility,session_category_id |
|
63 | 63 | FROM $tbl_session s |
64 | 64 | INNER JOIN $tbl_session_rel_access_url as session_rel_url |
65 | 65 | ON (s.id= session_rel_url.session_id) |
66 | 66 | INNER JOIN $tbl_user u ON (u.user_id = s.id_coach) |
67 | 67 | WHERE access_url_id = $access_url_id |
68 | 68 | ORDER BY id"; |
69 | - } |
|
70 | - } |
|
69 | + } |
|
70 | + } |
|
71 | 71 | |
72 | - $result = Database::query($sql); |
|
73 | - } else { |
|
74 | - $sql = "SELECT s.id,name,username,access_start_date,access_end_date,visibility,session_category_id |
|
72 | + $result = Database::query($sql); |
|
73 | + } else { |
|
74 | + $sql = "SELECT s.id,name,username,access_start_date,access_end_date,visibility,session_category_id |
|
75 | 75 | FROM $tbl_session s |
76 | 76 | INNER JOIN $tbl_user |
77 | 77 | ON $tbl_user.user_id = s.id_coach |
78 | 78 | WHERE id='$session_id'"; |
79 | - $result = Database::query($sql); |
|
80 | - } |
|
79 | + $result = Database::query($sql); |
|
80 | + } |
|
81 | 81 | |
82 | - if (Database::num_rows($result)) { |
|
82 | + if (Database::num_rows($result)) { |
|
83 | 83 | |
84 | 84 | |
85 | 85 | |
86 | - $sessionListToExport = []; |
|
86 | + $sessionListToExport = []; |
|
87 | 87 | |
88 | - if (in_array($file_type, ['csv', 'xls'])) { |
|
88 | + if (in_array($file_type, ['csv', 'xls'])) { |
|
89 | 89 | |
90 | - $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time(); |
|
90 | + $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time(); |
|
91 | 91 | |
92 | - $cvs = true; |
|
93 | - $sessionListToExport[] = [ |
|
94 | - 'SessionName', |
|
95 | - 'Coach', |
|
96 | - 'DateStart', |
|
97 | - 'DateEnd', |
|
98 | - 'Visibility', |
|
99 | - 'SessionCategory', |
|
100 | - 'Users', |
|
101 | - 'Courses' |
|
102 | - ]; |
|
103 | - } else { |
|
104 | - if (!file_exists($archivePath)) { |
|
105 | - mkdir($archivePath, api_get_permissions_for_new_directories(), true); |
|
106 | - } |
|
92 | + $cvs = true; |
|
93 | + $sessionListToExport[] = [ |
|
94 | + 'SessionName', |
|
95 | + 'Coach', |
|
96 | + 'DateStart', |
|
97 | + 'DateEnd', |
|
98 | + 'Visibility', |
|
99 | + 'SessionCategory', |
|
100 | + 'Users', |
|
101 | + 'Courses' |
|
102 | + ]; |
|
103 | + } else { |
|
104 | + if (!file_exists($archivePath)) { |
|
105 | + mkdir($archivePath, api_get_permissions_for_new_directories(), true); |
|
106 | + } |
|
107 | 107 | |
108 | - if (!file_exists($archivePath.'index.html')) { |
|
109 | - $fp = fopen($archivePath.'index.html', 'w'); |
|
110 | - fputs($fp, '<html><head></head><body></body></html>'); |
|
111 | - fclose($fp); |
|
112 | - } |
|
108 | + if (!file_exists($archivePath.'index.html')) { |
|
109 | + $fp = fopen($archivePath.'index.html', 'w'); |
|
110 | + fputs($fp, '<html><head></head><body></body></html>'); |
|
111 | + fclose($fp); |
|
112 | + } |
|
113 | 113 | |
114 | - $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type; |
|
115 | - while (file_exists($archivePath.$archiveFile)) { |
|
116 | - $archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type; |
|
117 | - } |
|
114 | + $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type; |
|
115 | + while (file_exists($archivePath.$archiveFile)) { |
|
116 | + $archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type; |
|
117 | + } |
|
118 | 118 | |
119 | - $cvs = false; |
|
120 | - $fp = fopen($archivePath.$archiveFile, 'w'); |
|
121 | - fputs($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Sessions>\n"); |
|
122 | - } |
|
119 | + $cvs = false; |
|
120 | + $fp = fopen($archivePath.$archiveFile, 'w'); |
|
121 | + fputs($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Sessions>\n"); |
|
122 | + } |
|
123 | 123 | |
124 | 124 | |
125 | - while ($row = Database::fetch_array($result)) { |
|
126 | - $row['name'] = str_replace(';',',',$row['name']); |
|
127 | - $row['username'] = str_replace(';',',',$row['username']); |
|
128 | - $row['access_start_date'] = str_replace(';',',',$row['access_start_date']); |
|
129 | - $row['access_end_date'] = str_replace(';',',',$row['access_end_date']); |
|
130 | - $row['visibility'] = str_replace(';',',',$row['visibility']); |
|
131 | - $row['session_category'] = str_replace(';',',',$row['session_category_id']); |
|
125 | + while ($row = Database::fetch_array($result)) { |
|
126 | + $row['name'] = str_replace(';',',',$row['name']); |
|
127 | + $row['username'] = str_replace(';',',',$row['username']); |
|
128 | + $row['access_start_date'] = str_replace(';',',',$row['access_start_date']); |
|
129 | + $row['access_end_date'] = str_replace(';',',',$row['access_end_date']); |
|
130 | + $row['visibility'] = str_replace(';',',',$row['visibility']); |
|
131 | + $row['session_category'] = str_replace(';',',',$row['session_category_id']); |
|
132 | 132 | |
133 | 133 | |
134 | - // users |
|
135 | - $sql = "SELECT DISTINCT $tbl_user.username |
|
134 | + // users |
|
135 | + $sql = "SELECT DISTINCT $tbl_user.username |
|
136 | 136 | FROM $tbl_user |
137 | 137 | INNER JOIN $tbl_session_user |
138 | 138 | ON |
@@ -140,33 +140,33 @@ discard block |
||
140 | 140 | $tbl_session_user.relation_type<>".SESSION_RELATION_TYPE_RRHH." AND |
141 | 141 | $tbl_session_user.session_id = '".$row['id']."'"; |
142 | 142 | |
143 | - $rsUsers = Database::query($sql); |
|
144 | - $users = ''; |
|
145 | - while ($rowUsers = Database::fetch_array($rsUsers)){ |
|
146 | - if($cvs){ |
|
147 | - $users .= str_replace(';',',',$rowUsers['username']).'|'; |
|
148 | - } else { |
|
149 | - $users .= "\t\t<User>$rowUsers[username]</User>\n"; |
|
150 | - } |
|
151 | - } |
|
152 | - |
|
153 | - if (!empty($users) && $cvs) { |
|
154 | - $users = api_substr($users, 0, api_strlen($users) - 1); |
|
155 | - } |
|
156 | - |
|
157 | - // Courses |
|
158 | - $sql = "SELECT DISTINCT c.code, sc.id, c_id |
|
143 | + $rsUsers = Database::query($sql); |
|
144 | + $users = ''; |
|
145 | + while ($rowUsers = Database::fetch_array($rsUsers)){ |
|
146 | + if($cvs){ |
|
147 | + $users .= str_replace(';',',',$rowUsers['username']).'|'; |
|
148 | + } else { |
|
149 | + $users .= "\t\t<User>$rowUsers[username]</User>\n"; |
|
150 | + } |
|
151 | + } |
|
152 | + |
|
153 | + if (!empty($users) && $cvs) { |
|
154 | + $users = api_substr($users, 0, api_strlen($users) - 1); |
|
155 | + } |
|
156 | + |
|
157 | + // Courses |
|
158 | + $sql = "SELECT DISTINCT c.code, sc.id, c_id |
|
159 | 159 | FROM $tbl_course c |
160 | 160 | INNER JOIN $tbl_session_course_user sc |
161 | 161 | ON c.id = sc.c_id |
162 | 162 | AND sc.session_id = '".$row['id']."'"; |
163 | 163 | |
164 | - $rsCourses = Database::query($sql); |
|
164 | + $rsCourses = Database::query($sql); |
|
165 | 165 | |
166 | - $courses = ''; |
|
167 | - while ($rowCourses = Database::fetch_array($rsCourses)) { |
|
168 | - // get coachs from a course |
|
169 | - $sql = "SELECT u.username |
|
166 | + $courses = ''; |
|
167 | + while ($rowCourses = Database::fetch_array($rsCourses)) { |
|
168 | + // get coachs from a course |
|
169 | + $sql = "SELECT u.username |
|
170 | 170 | FROM $tbl_session_course_user scu |
171 | 171 | INNER JOIN $tbl_user u |
172 | 172 | ON u.user_id = scu.user_id |
@@ -175,25 +175,25 @@ discard block |
||
175 | 175 | scu.session_id = '".$row['id']."' AND |
176 | 176 | scu.status = 2 "; |
177 | 177 | |
178 | - $rs_coachs = Database::query($sql); |
|
179 | - $coachs = array(); |
|
180 | - while ($row_coachs = Database::fetch_array($rs_coachs)) { |
|
181 | - $coachs[] = $row_coachs['username']; |
|
182 | - } |
|
183 | - |
|
184 | - $coachs = implode(",", $coachs); |
|
185 | - |
|
186 | - if ($cvs) { |
|
187 | - $courses .= str_replace(';',',',$rowCourses['code']); |
|
188 | - $courses .= '['.str_replace(';',',',$coachs).']['; |
|
189 | - } else { |
|
190 | - $courses .= "\t\t<Course>\n"; |
|
191 | - $courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n"; |
|
192 | - $courses .= "\t\t\t<Coach>$coachs</Coach>\n"; |
|
193 | - } |
|
194 | - |
|
195 | - // rel user courses |
|
196 | - $sql = "SELECT DISTINCT u.username |
|
178 | + $rs_coachs = Database::query($sql); |
|
179 | + $coachs = array(); |
|
180 | + while ($row_coachs = Database::fetch_array($rs_coachs)) { |
|
181 | + $coachs[] = $row_coachs['username']; |
|
182 | + } |
|
183 | + |
|
184 | + $coachs = implode(",", $coachs); |
|
185 | + |
|
186 | + if ($cvs) { |
|
187 | + $courses .= str_replace(';',',',$rowCourses['code']); |
|
188 | + $courses .= '['.str_replace(';',',',$coachs).']['; |
|
189 | + } else { |
|
190 | + $courses .= "\t\t<Course>\n"; |
|
191 | + $courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n"; |
|
192 | + $courses .= "\t\t\t<Coach>$coachs</Coach>\n"; |
|
193 | + } |
|
194 | + |
|
195 | + // rel user courses |
|
196 | + $sql = "SELECT DISTINCT u.username |
|
197 | 197 | FROM $tbl_session_course_user scu |
198 | 198 | INNER JOIN $tbl_session_user su |
199 | 199 | ON |
@@ -206,80 +206,80 @@ discard block |
||
206 | 206 | scu.c_id='".$rowCourses['c_id']."' AND |
207 | 207 | scu.session_id='".$row['id']."'"; |
208 | 208 | |
209 | - $rsUsersCourse = Database::query($sql); |
|
210 | - $userscourse = ''; |
|
211 | - while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){ |
|
212 | - if ($cvs) { |
|
213 | - $userscourse .= str_replace(';',',',$rowUsersCourse['username']).','; |
|
214 | - } else { |
|
215 | - $courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n"; |
|
216 | - } |
|
217 | - } |
|
218 | - |
|
219 | - if ($cvs) { |
|
220 | - if (!empty($userscourse)) { |
|
221 | - $userscourse = api_substr( |
|
222 | - $userscourse, |
|
223 | - 0, |
|
224 | - api_strlen($userscourse) - 1 |
|
225 | - ); |
|
226 | - } |
|
227 | - |
|
228 | - $courses .= $userscourse.']|'; |
|
229 | - } else { |
|
230 | - $courses .= "\t\t</Course>\n"; |
|
231 | - } |
|
232 | - } |
|
233 | - |
|
234 | - if (!empty($courses) && $cvs) { |
|
235 | - $courses = api_substr($courses, 0, api_strlen($courses) - 1); |
|
236 | - } |
|
237 | - $add .= $courses; |
|
238 | - |
|
239 | - |
|
240 | - if (in_array($file_type, ['csv', 'xls'])) { |
|
241 | - $sessionListToExport[] = [ |
|
242 | - $row['name'], |
|
243 | - $row['username'], |
|
244 | - $row['access_start_date'], |
|
245 | - $row['access_end_date'], |
|
246 | - $row['visibility'], |
|
247 | - $row['session_category'], |
|
248 | - $users, |
|
249 | - $courses |
|
250 | - ]; |
|
251 | - } else { |
|
252 | - $add = "\t<Session>\n" |
|
253 | - ."\t\t<SessionName>$row[name]</SessionName>\n" |
|
254 | - ."\t\t<Coach>$row[username]</Coach>\n" |
|
255 | - ."\t\t<DateStart>$row[access_start_date]</DateStart>\n" |
|
256 | - ."\t\t<DateEnd>$row[access_end_date]</DateEnd>\n" |
|
257 | - ."\t\t<Visibility>$row[visibility]</Visibility>\n" |
|
258 | - ."\t\t<SessionCategory>$row[session_category]</SessionCategory>\n"; |
|
259 | - } |
|
260 | - |
|
261 | - if (!$cvs) { |
|
262 | - $add .= "\t</Session>\n"; |
|
263 | - fputs($fp, $add); |
|
264 | - } |
|
265 | - } |
|
266 | - |
|
267 | - switch ($file_type) { |
|
268 | - case 'xml': |
|
269 | - fputs($fp, "</Sessions>\n"); |
|
270 | - fclose($fp); |
|
271 | - $errorMsg = get_lang('UserListHasBeenExported').'<br/> |
|
209 | + $rsUsersCourse = Database::query($sql); |
|
210 | + $userscourse = ''; |
|
211 | + while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){ |
|
212 | + if ($cvs) { |
|
213 | + $userscourse .= str_replace(';',',',$rowUsersCourse['username']).','; |
|
214 | + } else { |
|
215 | + $courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n"; |
|
216 | + } |
|
217 | + } |
|
218 | + |
|
219 | + if ($cvs) { |
|
220 | + if (!empty($userscourse)) { |
|
221 | + $userscourse = api_substr( |
|
222 | + $userscourse, |
|
223 | + 0, |
|
224 | + api_strlen($userscourse) - 1 |
|
225 | + ); |
|
226 | + } |
|
227 | + |
|
228 | + $courses .= $userscourse.']|'; |
|
229 | + } else { |
|
230 | + $courses .= "\t\t</Course>\n"; |
|
231 | + } |
|
232 | + } |
|
233 | + |
|
234 | + if (!empty($courses) && $cvs) { |
|
235 | + $courses = api_substr($courses, 0, api_strlen($courses) - 1); |
|
236 | + } |
|
237 | + $add .= $courses; |
|
238 | + |
|
239 | + |
|
240 | + if (in_array($file_type, ['csv', 'xls'])) { |
|
241 | + $sessionListToExport[] = [ |
|
242 | + $row['name'], |
|
243 | + $row['username'], |
|
244 | + $row['access_start_date'], |
|
245 | + $row['access_end_date'], |
|
246 | + $row['visibility'], |
|
247 | + $row['session_category'], |
|
248 | + $users, |
|
249 | + $courses |
|
250 | + ]; |
|
251 | + } else { |
|
252 | + $add = "\t<Session>\n" |
|
253 | + ."\t\t<SessionName>$row[name]</SessionName>\n" |
|
254 | + ."\t\t<Coach>$row[username]</Coach>\n" |
|
255 | + ."\t\t<DateStart>$row[access_start_date]</DateStart>\n" |
|
256 | + ."\t\t<DateEnd>$row[access_end_date]</DateEnd>\n" |
|
257 | + ."\t\t<Visibility>$row[visibility]</Visibility>\n" |
|
258 | + ."\t\t<SessionCategory>$row[session_category]</SessionCategory>\n"; |
|
259 | + } |
|
260 | + |
|
261 | + if (!$cvs) { |
|
262 | + $add .= "\t</Session>\n"; |
|
263 | + fputs($fp, $add); |
|
264 | + } |
|
265 | + } |
|
266 | + |
|
267 | + switch ($file_type) { |
|
268 | + case 'xml': |
|
269 | + fputs($fp, "</Sessions>\n"); |
|
270 | + fclose($fp); |
|
271 | + $errorMsg = get_lang('UserListHasBeenExported').'<br/> |
|
272 | 272 | <a class="btn btn-default" href="'.$archiveURL.$archiveFile.'">'.get_lang('ClickHereToDownloadTheFile').'</a>'; |
273 | - break; |
|
274 | - case 'csv': |
|
275 | - Export::arrayToCsv($sessionListToExport, $archiveFile); |
|
276 | - exit; |
|
277 | - case 'xls': |
|
278 | - Export::arrayToXls($sessionListToExport, $archiveFile); |
|
279 | - exit; |
|
280 | - break; |
|
281 | - } |
|
282 | - } |
|
273 | + break; |
|
274 | + case 'csv': |
|
275 | + Export::arrayToCsv($sessionListToExport, $archiveFile); |
|
276 | + exit; |
|
277 | + case 'xls': |
|
278 | + Export::arrayToXls($sessionListToExport, $archiveFile); |
|
279 | + exit; |
|
280 | + break; |
|
281 | + } |
|
282 | + } |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | // display the header |
@@ -289,26 +289,26 @@ discard block |
||
289 | 289 | $sql = "SELECT id, name FROM $tbl_session ORDER BY name"; |
290 | 290 | |
291 | 291 | if (api_is_multiple_url_enabled()) { |
292 | - $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
293 | - $access_url_id = api_get_current_access_url_id(); |
|
294 | - if ($access_url_id != -1){ |
|
295 | - $sql = "SELECT s.id, name FROM $tbl_session s |
|
292 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
293 | + $access_url_id = api_get_current_access_url_id(); |
|
294 | + if ($access_url_id != -1){ |
|
295 | + $sql = "SELECT s.id, name FROM $tbl_session s |
|
296 | 296 | INNER JOIN $tbl_session_rel_access_url as session_rel_url |
297 | 297 | ON (s.id = session_rel_url.session_id) |
298 | 298 | WHERE access_url_id = $access_url_id |
299 | 299 | ORDER BY name"; |
300 | - } |
|
300 | + } |
|
301 | 301 | } |
302 | 302 | $result = Database::query($sql); |
303 | 303 | $Sessions = Database::store_result($result); |
304 | 304 | |
305 | 305 | echo '<div class="actions">'; |
306 | 306 | echo '<a href="../session/session_list.php">'. |
307 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
307 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
308 | 308 | echo '</div>'; |
309 | 309 | |
310 | 310 | if (!empty($errorMsg)) { |
311 | - Display::display_normal_message($errorMsg, false); //main API |
|
311 | + Display::display_normal_message($errorMsg, false); //main API |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | $form = new FormValidator('session_export', 'post', api_get_self()); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | $tool_name = get_lang('ExportSessionListXMLCSV'); |
34 | 34 | |
35 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
35 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
36 | 36 | |
37 | 37 | set_time_limit(0); |
38 | 38 | |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | ORDER BY id"; |
57 | 57 | |
58 | 58 | if (api_is_multiple_url_enabled()) { |
59 | - $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
59 | + $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
60 | 60 | $access_url_id = api_get_current_access_url_id(); |
61 | - if ($access_url_id != -1){ |
|
61 | + if ($access_url_id != -1) { |
|
62 | 62 | $sql = "SELECT s.id, name,id_coach,username,access_start_date,access_end_date,visibility,session_category_id |
63 | 63 | FROM $tbl_session s |
64 | 64 | INNER JOIN $tbl_session_rel_access_url as session_rel_url |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type; |
115 | 115 | while (file_exists($archivePath.$archiveFile)) { |
116 | - $archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type; |
|
116 | + $archiveFile = 'export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | $cvs = false; |
@@ -123,12 +123,12 @@ discard block |
||
123 | 123 | |
124 | 124 | |
125 | 125 | while ($row = Database::fetch_array($result)) { |
126 | - $row['name'] = str_replace(';',',',$row['name']); |
|
127 | - $row['username'] = str_replace(';',',',$row['username']); |
|
128 | - $row['access_start_date'] = str_replace(';',',',$row['access_start_date']); |
|
129 | - $row['access_end_date'] = str_replace(';',',',$row['access_end_date']); |
|
130 | - $row['visibility'] = str_replace(';',',',$row['visibility']); |
|
131 | - $row['session_category'] = str_replace(';',',',$row['session_category_id']); |
|
126 | + $row['name'] = str_replace(';', ',', $row['name']); |
|
127 | + $row['username'] = str_replace(';', ',', $row['username']); |
|
128 | + $row['access_start_date'] = str_replace(';', ',', $row['access_start_date']); |
|
129 | + $row['access_end_date'] = str_replace(';', ',', $row['access_end_date']); |
|
130 | + $row['visibility'] = str_replace(';', ',', $row['visibility']); |
|
131 | + $row['session_category'] = str_replace(';', ',', $row['session_category_id']); |
|
132 | 132 | |
133 | 133 | |
134 | 134 | // users |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | |
143 | 143 | $rsUsers = Database::query($sql); |
144 | 144 | $users = ''; |
145 | - while ($rowUsers = Database::fetch_array($rsUsers)){ |
|
146 | - if($cvs){ |
|
147 | - $users .= str_replace(';',',',$rowUsers['username']).'|'; |
|
145 | + while ($rowUsers = Database::fetch_array($rsUsers)) { |
|
146 | + if ($cvs) { |
|
147 | + $users .= str_replace(';', ',', $rowUsers['username']).'|'; |
|
148 | 148 | } else { |
149 | 149 | $users .= "\t\t<User>$rowUsers[username]</User>\n"; |
150 | 150 | } |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | $coachs = implode(",", $coachs); |
185 | 185 | |
186 | 186 | if ($cvs) { |
187 | - $courses .= str_replace(';',',',$rowCourses['code']); |
|
188 | - $courses .= '['.str_replace(';',',',$coachs).']['; |
|
187 | + $courses .= str_replace(';', ',', $rowCourses['code']); |
|
188 | + $courses .= '['.str_replace(';', ',', $coachs).']['; |
|
189 | 189 | } else { |
190 | 190 | $courses .= "\t\t<Course>\n"; |
191 | 191 | $courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n"; |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | |
209 | 209 | $rsUsersCourse = Database::query($sql); |
210 | 210 | $userscourse = ''; |
211 | - while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){ |
|
211 | + while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)) { |
|
212 | 212 | if ($cvs) { |
213 | - $userscourse .= str_replace(';',',',$rowUsersCourse['username']).','; |
|
213 | + $userscourse .= str_replace(';', ',', $rowUsersCourse['username']).','; |
|
214 | 214 | } else { |
215 | 215 | $courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n"; |
216 | 216 | } |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | if (api_is_multiple_url_enabled()) { |
292 | 292 | $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
293 | 293 | $access_url_id = api_get_current_access_url_id(); |
294 | - if ($access_url_id != -1){ |
|
294 | + if ($access_url_id != -1) { |
|
295 | 295 | $sql = "SELECT s.id, name FROM $tbl_session s |
296 | 296 | INNER JOIN $tbl_session_rel_access_url as session_rel_url |
297 | 297 | ON (s.id = session_rel_url.session_id) |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | echo '<div class="actions">'; |
306 | 306 | echo '<a href="../session/session_list.php">'. |
307 | - Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
307 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
308 | 308 | echo '</div>'; |
309 | 309 | |
310 | 310 | if (!empty($errorMsg)) { |
@@ -313,8 +313,8 @@ discard block |
||
313 | 313 | |
314 | 314 | $form = new FormValidator('session_export', 'post', api_get_self()); |
315 | 315 | $form->addElement('hidden', 'formSent', 1); |
316 | -$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null); |
|
317 | -$form->addElement('radio', 'file_type', '', 'XLS' , 'xls', null); |
|
316 | +$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV', 'csv', null); |
|
317 | +$form->addElement('radio', 'file_type', '', 'XLS', 'xls', null); |
|
318 | 318 | $form->addElement('radio', 'file_type', null, 'XML', 'xml', null, array('id' => 'file_type_xml')); |
319 | 319 | |
320 | 320 | $options = array(); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | $options[$enreg['id']] = $enreg['name']; |
324 | 324 | } |
325 | 325 | |
326 | -$form->addElement('select', 'session_id', get_lang('WhichSessionToExport'), $options); |
|
326 | +$form->addElement('select', 'session_id', get_lang('WhichSessionToExport'), $options); |
|
327 | 327 | $form->addButtonExport(get_lang('ExportSession')); |
328 | 328 | |
329 | 329 | $defaults = array(); |
@@ -5,8 +5,8 @@ |
||
5 | 5 | */ |
6 | 6 | require_once '../inc/global.inc.php'; |
7 | 7 | if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') { |
8 | - header('Location:inbox.php?f=social'); |
|
8 | + header('Location:inbox.php?f=social'); |
|
9 | 9 | } elseif ( api_get_setting('allow_message_tool')=='true') { |
10 | - header('Location:inbox.php'); |
|
10 | + header('Location:inbox.php'); |
|
11 | 11 | } |
12 | 12 | exit; |
@@ -4,9 +4,9 @@ |
||
4 | 4 | * @package chamilo.messages |
5 | 5 | */ |
6 | 6 | require_once '../inc/global.inc.php'; |
7 | -if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool')=='true') { |
|
7 | +if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
8 | 8 | header('Location:inbox.php?f=social'); |
9 | -} elseif ( api_get_setting('allow_message_tool')=='true') { |
|
9 | +} elseif (api_get_setting('allow_message_tool') == 'true') { |
|
10 | 10 | header('Location:inbox.php'); |
11 | 11 | } |
12 | 12 | exit; |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | $message_uid = ''; |
51 | 51 | $message_type = array('inbox','outbox'); |
52 | 52 | if (in_array($_GET['type'],$message_type)) { |
53 | - if ($_GET['type'] == 'inbox') { |
|
54 | - $message_uid = $row_users['user_receiver_id']; |
|
55 | - } else { |
|
56 | - $message_uid = $row_users['user_sender_id']; |
|
57 | - } |
|
53 | + if ($_GET['type'] == 'inbox') { |
|
54 | + $message_uid = $row_users['user_receiver_id']; |
|
55 | + } else { |
|
56 | + $message_uid = $row_users['user_sender_id']; |
|
57 | + } |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | // allow to the correct user for download this file |
@@ -62,19 +62,19 @@ discard block |
||
62 | 62 | $userGroup = new UserGroup(); |
63 | 63 | |
64 | 64 | if (!empty($row_users['group_id'])) { |
65 | - $users_group = $userGroup->get_all_users_by_group($row_users['group_id']); |
|
66 | - if (!in_array($current_uid,array_keys($users_group))) { |
|
67 | - $not_allowed_to_edit = true; |
|
68 | - } |
|
65 | + $users_group = $userGroup->get_all_users_by_group($row_users['group_id']); |
|
66 | + if (!in_array($current_uid,array_keys($users_group))) { |
|
67 | + $not_allowed_to_edit = true; |
|
68 | + } |
|
69 | 69 | } else { |
70 | - if ($current_uid != $message_uid) { |
|
71 | - $not_allowed_to_edit = true; |
|
72 | - } |
|
70 | + if ($current_uid != $message_uid) { |
|
71 | + $not_allowed_to_edit = true; |
|
72 | + } |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | if ($not_allowed_to_edit) { |
76 | - api_not_allowed(); |
|
77 | - exit; |
|
76 | + api_not_allowed(); |
|
77 | + exit; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | // set the path directory file |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | true |
86 | 86 | ); |
87 | 87 | } else { |
88 | - $path_user_info['dir'] = UserManager::getUserPathById($message_uid, 'system'); |
|
88 | + $path_user_info['dir'] = UserManager::getUserPathById($message_uid, 'system'); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $full_file_name = $path_user_info['dir'].'message_attachments/'.$file_url; |
92 | 92 | |
93 | 93 | if (Security::check_abs_path($full_file_name, $path_user_info['dir'].'message_attachments/')) { |
94 | 94 | // launch event |
95 | - Event::event_download($file_url); |
|
95 | + Event::event_download($file_url); |
|
96 | 96 | DocumentManager::file_send_for_download($full_file_name,TRUE, $title); |
97 | 97 | } |
98 | 98 | exit; |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | |
49 | 49 | // get message user id for inbox/outbox |
50 | 50 | $message_uid = ''; |
51 | -$message_type = array('inbox','outbox'); |
|
52 | -if (in_array($_GET['type'],$message_type)) { |
|
51 | +$message_type = array('inbox', 'outbox'); |
|
52 | +if (in_array($_GET['type'], $message_type)) { |
|
53 | 53 | if ($_GET['type'] == 'inbox') { |
54 | 54 | $message_uid = $row_users['user_receiver_id']; |
55 | 55 | } else { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | if (!empty($row_users['group_id'])) { |
65 | 65 | $users_group = $userGroup->get_all_users_by_group($row_users['group_id']); |
66 | - if (!in_array($current_uid,array_keys($users_group))) { |
|
66 | + if (!in_array($current_uid, array_keys($users_group))) { |
|
67 | 67 | $not_allowed_to_edit = true; |
68 | 68 | } |
69 | 69 | } else { |
@@ -93,6 +93,6 @@ discard block |
||
93 | 93 | if (Security::check_abs_path($full_file_name, $path_user_info['dir'].'message_attachments/')) { |
94 | 94 | // launch event |
95 | 95 | Event::event_download($file_url); |
96 | - DocumentManager::file_send_for_download($full_file_name,TRUE, $title); |
|
96 | + DocumentManager::file_send_for_download($full_file_name, TRUE, $title); |
|
97 | 97 | } |
98 | 98 | exit; |
@@ -9,20 +9,20 @@ discard block |
||
9 | 9 | api_block_anonymous_users(); |
10 | 10 | |
11 | 11 | if (isset($_GET['messages_page_nr'])) { |
12 | - if (api_get_setting('allow_social_tool')=='true' && |
|
12 | + if (api_get_setting('allow_social_tool')=='true' && |
|
13 | 13 | api_get_setting('allow_message_tool')=='true' |
14 | 14 | ) { |
15 | - $social_link = ''; |
|
16 | - if ($_REQUEST['f']=='social') { |
|
17 | - $social_link = '&f=social'; |
|
18 | - } |
|
19 | - header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
|
20 | - exit; |
|
21 | - } |
|
15 | + $social_link = ''; |
|
16 | + if ($_REQUEST['f']=='social') { |
|
17 | + $social_link = '&f=social'; |
|
18 | + } |
|
19 | + header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
|
20 | + exit; |
|
21 | + } |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | if (api_get_setting('allow_message_tool')!='true'){ |
25 | - api_not_allowed(); |
|
25 | + api_not_allowed(); |
|
26 | 26 | } |
27 | 27 | //jquery thickbox already called from main/inc/header.inc.php |
28 | 28 | |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | MAIN CODE |
55 | 55 | */ |
56 | 56 | if (isset($_GET['f']) && $_GET['f']=='social') { |
57 | - $this_section = SECTION_SOCIAL; |
|
58 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
59 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
57 | + $this_section = SECTION_SOCIAL; |
|
58 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
59 | + $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
60 | 60 | } else { |
61 | - $this_section = SECTION_MYPROFILE; |
|
62 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
63 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
61 | + $this_section = SECTION_MYPROFILE; |
|
62 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
63 | + $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $actions = ''; |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | |
84 | 84 | if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0])=='delete') { |
85 | 85 | for ($i = 1; $i <= $count_delete_outbox; $i++) { |
86 | - MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]); |
|
87 | - } |
|
86 | + MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]); |
|
87 | + } |
|
88 | 88 | $message_box=get_lang('SelectedMessagesDeleted'). |
89 | 89 | '  |
90 | 90 | <br><a href="../social/index.php?#remote-tab-3">'. |
@@ -9,11 +9,11 @@ discard block |
||
9 | 9 | api_block_anonymous_users(); |
10 | 10 | |
11 | 11 | if (isset($_GET['messages_page_nr'])) { |
12 | - if (api_get_setting('allow_social_tool')=='true' && |
|
13 | - api_get_setting('allow_message_tool')=='true' |
|
12 | + if (api_get_setting('allow_social_tool') == 'true' && |
|
13 | + api_get_setting('allow_message_tool') == 'true' |
|
14 | 14 | ) { |
15 | 15 | $social_link = ''; |
16 | - if ($_REQUEST['f']=='social') { |
|
16 | + if ($_REQUEST['f'] == 'social') { |
|
17 | 17 | $social_link = '&f=social'; |
18 | 18 | } |
19 | 19 | header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.''); |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | -if (api_get_setting('allow_message_tool')!='true'){ |
|
24 | +if (api_get_setting('allow_message_tool') != 'true') { |
|
25 | 25 | api_not_allowed(); |
26 | 26 | } |
27 | 27 | //jquery thickbox already called from main/inc/header.inc.php |
28 | 28 | |
29 | -$htmlHeadXtra[]='<script language="javascript"> |
|
29 | +$htmlHeadXtra[] = '<script language="javascript"> |
|
30 | 30 | function enviar(miforma) { |
31 | 31 | if(confirm("'.get_lang('SureYouWantToDeleteSelectedMessages', '').'")) |
32 | 32 | miforma.submit(); |
@@ -53,44 +53,44 @@ discard block |
||
53 | 53 | /* |
54 | 54 | MAIN CODE |
55 | 55 | */ |
56 | -if (isset($_GET['f']) && $_GET['f']=='social') { |
|
56 | +if (isset($_GET['f']) && $_GET['f'] == 'social') { |
|
57 | 57 | $this_section = SECTION_SOCIAL; |
58 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
59 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
58 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social')); |
|
59 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox')); |
|
60 | 60 | } else { |
61 | 61 | $this_section = SECTION_MYPROFILE; |
62 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
63 | - $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox')); |
|
62 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile')); |
|
63 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox')); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $actions = ''; |
67 | 67 | if (api_get_setting('extended_profile') == 'true') { |
68 | 68 | if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
69 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
|
69 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
|
70 | 70 | } |
71 | 71 | if (api_get_setting('allow_message_tool') == 'true') { |
72 | 72 | //echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>'; |
73 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
74 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
75 | - $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
73 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
|
74 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; |
|
75 | + $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | |
80 | -$info_delete_outbox =array(); |
|
81 | -$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',',$_GET['form_delete_outbox']) : ''; |
|
80 | +$info_delete_outbox = array(); |
|
81 | +$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',', $_GET['form_delete_outbox']) : ''; |
|
82 | 82 | $count_delete_outbox = count($info_delete_outbox) - 1; |
83 | 83 | |
84 | -if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0])=='delete') { |
|
84 | +if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0]) == 'delete') { |
|
85 | 85 | for ($i = 1; $i <= $count_delete_outbox; $i++) { |
86 | - MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]); |
|
86 | + MessageManager::delete_message_by_user_sender(api_get_user_id(), $info_delete_outbox[$i]); |
|
87 | 87 | } |
88 | - $message_box=get_lang('SelectedMessagesDeleted'). |
|
88 | + $message_box = get_lang('SelectedMessagesDeleted'). |
|
89 | 89 | '  |
90 | 90 | <br><a href="../social/index.php?#remote-tab-3">'. |
91 | 91 | get_lang('BackToOutbox'). |
92 | 92 | '</a>'; |
93 | - Display::display_normal_message(api_xml_http_response_encode($message_box),false); |
|
93 | + Display::display_normal_message(api_xml_http_response_encode($message_box), false); |
|
94 | 94 | exit; |
95 | 95 | } |
96 | 96 | |
@@ -117,23 +117,23 @@ discard block |
||
117 | 117 | } |
118 | 118 | //MAIN CONTENT |
119 | 119 | if ($action == 'delete') { |
120 | - $delete_list_id=array(); |
|
120 | + $delete_list_id = array(); |
|
121 | 121 | if (isset($_POST['out'])) { |
122 | - $delete_list_id=$_POST['out']; |
|
122 | + $delete_list_id = $_POST['out']; |
|
123 | 123 | } |
124 | 124 | if (isset($_POST['id'])) { |
125 | - $delete_list_id=$_POST['id']; |
|
125 | + $delete_list_id = $_POST['id']; |
|
126 | 126 | } |
127 | 127 | for ($i = 0; $i < count($delete_list_id); $i++) { |
128 | 128 | MessageManager::delete_message_by_user_sender(api_get_user_id(), $delete_list_id[$i]); |
129 | 129 | } |
130 | - $delete_list_id=array(); |
|
130 | + $delete_list_id = array(); |
|
131 | 131 | $social_right_content .= MessageManager::outbox_display($keyword); |
132 | 132 | } elseif ($action == 'deleteone') { |
133 | 133 | $delete_list_id = array(); |
134 | 134 | $id = Security::remove_XSS($_GET['id']); |
135 | 135 | MessageManager::delete_message_by_user_sender(api_get_user_id(), $id); |
136 | - $delete_list_id=array(); |
|
136 | + $delete_list_id = array(); |
|
137 | 137 | $social_right_content .= MessageManager::outbox_display($keyword); |
138 | 138 | } else { |
139 | 139 | $social_right_content .= MessageManager::outbox_display($keyword); |
@@ -7,40 +7,40 @@ |
||
7 | 7 | require_once '../inc/global.inc.php'; |
8 | 8 | api_block_anonymous_users(); |
9 | 9 | if (api_get_setting('allow_message_tool')!='true') { |
10 | - api_not_allowed(); |
|
10 | + api_not_allowed(); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') { |
14 | - $this_section = SECTION_SOCIAL; |
|
15 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
16 | - $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox')); |
|
14 | + $this_section = SECTION_SOCIAL; |
|
15 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
16 | + $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox')); |
|
17 | 17 | } else { |
18 | - $this_section = SECTION_MYPROFILE; |
|
19 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
18 | + $this_section = SECTION_MYPROFILE; |
|
19 | + $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $social_right_content = null; |
23 | 23 | |
24 | 24 | if (isset($_GET['f']) && $_GET['f']=='social') { |
25 | - $social_parameter = '?f=social'; |
|
25 | + $social_parameter = '?f=social'; |
|
26 | 26 | } else { |
27 | - if (api_get_setting('extended_profile') == 'true') { |
|
28 | - $social_right_content .= '<div class="actions">'; |
|
27 | + if (api_get_setting('extended_profile') == 'true') { |
|
28 | + $social_right_content .= '<div class="actions">'; |
|
29 | 29 | |
30 | - if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
31 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
30 | + if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
31 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'. |
|
32 | 32 | Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>'; |
33 | - } |
|
34 | - if (api_get_setting('allow_message_tool') == 'true') { |
|
35 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
33 | + } |
|
34 | + if (api_get_setting('allow_message_tool') == 'true') { |
|
35 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
|
36 | 36 | Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
37 | 37 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
38 | 38 | Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
39 | 39 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
40 | 40 | Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
41 | - } |
|
42 | - $social_right_content .= '</div>'; |
|
43 | - } |
|
41 | + } |
|
42 | + $social_right_content .= '</div>'; |
|
43 | + } |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | if (empty($_GET['id'])) { |
@@ -3,25 +3,25 @@ discard block |
||
3 | 3 | /** |
4 | 4 | * @package chamilo.messages |
5 | 5 | */ |
6 | -$cidReset= true; |
|
6 | +$cidReset = true; |
|
7 | 7 | require_once '../inc/global.inc.php'; |
8 | 8 | api_block_anonymous_users(); |
9 | -if (api_get_setting('allow_message_tool')!='true') { |
|
9 | +if (api_get_setting('allow_message_tool') != 'true') { |
|
10 | 10 | api_not_allowed(); |
11 | 11 | } |
12 | 12 | |
13 | 13 | if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') { |
14 | 14 | $this_section = SECTION_SOCIAL; |
15 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social')); |
|
16 | - $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox')); |
|
15 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social')); |
|
16 | + $interbreadcrumb[] = array('url' => 'inbox.php?f=social', 'name' => get_lang('Inbox')); |
|
17 | 17 | } else { |
18 | 18 | $this_section = SECTION_MYPROFILE; |
19 | - $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile')); |
|
19 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile')); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | $social_right_content = null; |
23 | 23 | |
24 | -if (isset($_GET['f']) && $_GET['f']=='social') { |
|
24 | +if (isset($_GET['f']) && $_GET['f'] == 'social') { |
|
25 | 25 | $social_parameter = '?f=social'; |
26 | 26 | } else { |
27 | 27 | if (api_get_setting('extended_profile') == 'true') { |
@@ -33,11 +33,11 @@ discard block |
||
33 | 33 | } |
34 | 34 | if (api_get_setting('allow_message_tool') == 'true') { |
35 | 35 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
36 | - Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
36 | + Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
|
37 | 37 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
38 | - Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
38 | + Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; |
|
39 | 39 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
40 | - Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
40 | + Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
41 | 41 | } |
42 | 42 | $social_right_content .= '</div>'; |
43 | 43 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $show_menu = 'messages_inbox'; |
54 | 54 | } |
55 | 55 | |
56 | -$message = ''; |
|
56 | +$message = ''; |
|
57 | 57 | |
58 | 58 | // LEFT COLUMN |
59 | 59 | if (api_get_setting('allow_social_tool') == 'true') { |