@@ -207,7 +207,10 @@ discard block |
||
207 | 207 | |
208 | 208 | unset($Courses); |
209 | 209 | ?> |
210 | -<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 | +<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'])) { |
|
211 | + echo '&add=true' ; |
|
212 | +} |
|
213 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
211 | 214 | <legend><?php echo $tool_name.' ('.$session_info['name'].')'; ?></legend> |
212 | 215 | <input type="hidden" name="formSent" value="1" /> |
213 | 216 | |
@@ -230,7 +233,10 @@ discard block |
||
230 | 233 | <div id="ajax_list_courses_multiple"> |
231 | 234 | <select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" class="form-control"> |
232 | 235 | <?php foreach ($nosessionCourses as $enreg) { ?> |
233 | - <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"'; ?>> |
|
236 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) { |
|
237 | + echo 'selected="selected"'; |
|
238 | +} |
|
239 | +?>> |
|
234 | 240 | <?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?> |
235 | 241 | </option> |
236 | 242 | <?php } ?> |
@@ -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,7 +34,7 @@ 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 | 40 | if (isset($_GET['add_type']) && $_GET['add_type'] != '') { |
@@ -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 | |
@@ -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 | |
@@ -299,9 +299,9 @@ discard block |
||
299 | 299 | <select id='destination' name="SessionCoursesList[]" multiple="multiple" size="20" class="form-control"> |
300 | 300 | |
301 | 301 | <?php |
302 | - foreach($sessionCourses as $enreg) { |
|
302 | + foreach ($sessionCourses as $enreg) { |
|
303 | 303 | ?> |
304 | - <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES); ?>"> |
|
304 | + <option value="<?php echo $enreg['id']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')', ENT_QUOTES); ?>"> |
|
305 | 305 | <?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?> |
306 | 306 | </option> |
307 | 307 | <?php |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $course_title = null; |
22 | 22 | $xajax_response = new xajaxResponse(); |
23 | 23 | $return = ''; |
24 | - if(!empty($needle) && !empty($type)) { |
|
24 | + if (!empty($needle) && !empty($type)) { |
|
25 | 25 | // xajax send utf8 datas... datas in db can be non-utf8 datas |
26 | 26 | $charset = api_get_system_encoding(); |
27 | 27 | $needle = api_convert_encoding($needle, $charset, 'utf-8'); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | while ($row = Database::fetch_row($res)) { |
39 | 39 | $course_codes .= '\''.$row[0].'\','; |
40 | 40 | } |
41 | - $course_codes = substr($course_codes,0,(strlen($course_codes)-1)); |
|
41 | + $course_codes = substr($course_codes, 0, (strlen($course_codes) - 1)); |
|
42 | 42 | |
43 | 43 | $cond_course_code = ' AND course.id NOT IN('.$course_codes.') '; |
44 | 44 | } |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | if (api_is_multiple_url_enabled()) { |
70 | 70 | $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
71 | 71 | $access_url_id = api_get_current_access_url_id(); |
72 | - if ($access_url_id != -1){ |
|
72 | + if ($access_url_id != -1) { |
|
73 | 73 | |
74 | - if ($type=='single') { |
|
74 | + if ($type == 'single') { |
|
75 | 75 | $sql = 'SELECT |
76 | 76 | course.id, |
77 | 77 | course.visual_code, |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | $course_title = str_replace("'", "\'", $course_title); |
108 | 108 | $return .= '<a href="javascript: void(0);" onclick="javascript: add_course_to_session(\''.$course['id'].'\',\''.$course_title.' ('.$course['visual_code'].')'.'\')">'.$course['title'].' ('.$course['visual_code'].')</a><br />'; |
109 | 109 | } |
110 | - $xajax_response -> addAssign('ajax_list_courses_single','innerHTML',api_utf8_encode($return)); |
|
110 | + $xajax_response -> addAssign('ajax_list_courses_single', 'innerHTML', api_utf8_encode($return)); |
|
111 | 111 | } else { |
112 | 112 | $return .= '<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:340px;">'; |
113 | 113 | while ($course = Database :: fetch_array($rs)) { |
114 | 114 | $course_list[] = $course['code']; |
115 | - $course_title=str_replace("'","\'",$course_title); |
|
116 | - $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['title'].' ('.$course['visual_code'].')',ENT_QUOTES).'">'.$course['title'].' ('.$course['visual_code'].')</option>'; |
|
115 | + $course_title = str_replace("'", "\'", $course_title); |
|
116 | + $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['title'].' ('.$course['visual_code'].')', ENT_QUOTES).'">'.$course['title'].' ('.$course['visual_code'].')</option>'; |
|
117 | 117 | } |
118 | 118 | $return .= '</select>'; |
119 | 119 | $xajax_response->addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return)); |