@@ -488,7 +488,7 @@ |
||
488 | 488 | $remind_list |
489 | 489 | ); |
490 | 490 | |
491 | - // Destruction of the Question object |
|
491 | + // Destruction of the Question object |
|
492 | 492 | unset($objQuestionTmp); |
493 | 493 | if ($debug) { |
494 | 494 | error_log(" -- end question -- "); |
@@ -258,13 +258,13 @@ |
||
258 | 258 | ), 'first'); |
259 | 259 | |
260 | 260 | $coachName = api_get_person_name($userResult['firstname'], $userResult['lastname']); |
261 | - } |
|
261 | + } |
|
262 | 262 | |
263 | - $courses[] = array( |
|
264 | - 'id' => $courseId, |
|
265 | - 'name' => $course['title'], |
|
266 | - 'coachName' => $coachName, |
|
267 | - ); |
|
263 | + $courses[] = array( |
|
264 | + 'id' => $courseId, |
|
265 | + 'name' => $course['title'], |
|
266 | + 'coachName' => $coachName, |
|
267 | + ); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | echo json_encode($courses); |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | $thematic = new Thematic(); |
12 | 12 | |
13 | 13 | switch ($action) { |
14 | - case 'save_thematic_plan': |
|
15 | - /*$title_list = $_REQUEST['title']; |
|
14 | + case 'save_thematic_plan': |
|
15 | + /*$title_list = $_REQUEST['title']; |
|
16 | 16 | $description_list = $_REQUEST['desc']; |
17 | 17 | //$description_list = $_REQUEST['description']; |
18 | 18 | $description_type = $_REQUEST['description_type']; |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | $thematic_plan_data = $thematic->get_thematic_plan_data(); |
26 | 26 | $return = $thematic->get_thematic_plan_div($thematic_plan_data); |
27 | 27 | echo $return[$_REQUEST['thematic_id']];*/ |
28 | - break; |
|
29 | - case 'save_thematic_advance': |
|
30 | - if (!api_is_allowed_to_edit(null, true)) { |
|
31 | - echo ''; |
|
32 | - exit; |
|
33 | - } |
|
34 | - /* |
|
28 | + break; |
|
29 | + case 'save_thematic_advance': |
|
30 | + if (!api_is_allowed_to_edit(null, true)) { |
|
31 | + echo ''; |
|
32 | + exit; |
|
33 | + } |
|
34 | + /* |
|
35 | 35 | if (($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) || (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) ) { |
36 | 36 | if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) { |
37 | 37 | $start_date_error = true; |
@@ -79,80 +79,80 @@ discard block |
||
79 | 79 | $thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true); |
80 | 80 | $return = $thematic->get_thematic_advance_div($thematic_advance_data); |
81 | 81 | echo $return[$_REQUEST['thematic_id']][$_REQUEST['thematic_advance_id']];*/ |
82 | - break; |
|
83 | - case 'get_datetime_by_attendance': |
|
84 | - $attendance_id = intval($_REQUEST['attendance_id']); |
|
85 | - $thematic_advance_id = intval($_REQUEST['thematic_advance_id']); |
|
82 | + break; |
|
83 | + case 'get_datetime_by_attendance': |
|
84 | + $attendance_id = intval($_REQUEST['attendance_id']); |
|
85 | + $thematic_advance_id = intval($_REQUEST['thematic_advance_id']); |
|
86 | 86 | |
87 | - $label = ''; |
|
88 | - $input_select = ''; |
|
89 | - if (!empty($attendance_id)) { |
|
90 | - $attendance = new Attendance(); |
|
91 | - $thematic = new Thematic(); |
|
92 | - $thematic_list = $thematic->get_thematic_list(); |
|
87 | + $label = ''; |
|
88 | + $input_select = ''; |
|
89 | + if (!empty($attendance_id)) { |
|
90 | + $attendance = new Attendance(); |
|
91 | + $thematic = new Thematic(); |
|
92 | + $thematic_list = $thematic->get_thematic_list(); |
|
93 | 93 | |
94 | - $my_list = $thematic_list_temp = array(); |
|
95 | - foreach ($thematic_list as $item) { |
|
96 | - $my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']); |
|
97 | - $thematic_list_temp = array_merge($my_list, $thematic_list_temp); |
|
98 | - } |
|
99 | - $new_thematic_list = array(); |
|
94 | + $my_list = $thematic_list_temp = array(); |
|
95 | + foreach ($thematic_list as $item) { |
|
96 | + $my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']); |
|
97 | + $thematic_list_temp = array_merge($my_list, $thematic_list_temp); |
|
98 | + } |
|
99 | + $new_thematic_list = array(); |
|
100 | 100 | |
101 | - foreach($thematic_list_temp as $item) { |
|
102 | - if (!empty($item['attendance_id']) ) { |
|
103 | - $new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']); |
|
104 | - } |
|
105 | - } |
|
101 | + foreach($thematic_list_temp as $item) { |
|
102 | + if (!empty($item['attendance_id']) ) { |
|
103 | + $new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']); |
|
104 | + } |
|
105 | + } |
|
106 | 106 | |
107 | - $attendance_calendar = $attendance->get_attendance_calendar($attendance_id); |
|
107 | + $attendance_calendar = $attendance->get_attendance_calendar($attendance_id); |
|
108 | 108 | |
109 | - $label = get_lang('StartDate'); |
|
110 | - if (!empty($attendance_calendar)) { |
|
111 | - $input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" size="5">'; |
|
112 | - foreach ($attendance_calendar as $calendar) { |
|
113 | - $selected = null; |
|
114 | - $insert = true; |
|
115 | - //checking if was already taken |
|
116 | - foreach ($new_thematic_list as $key => $thematic_item) { |
|
117 | - //if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) { |
|
118 | - if ($calendar['db_date_time'] == $thematic_item['start_date'] ) { |
|
119 | - $insert = false; |
|
120 | - if ($thematic_advance_id == $key) { |
|
121 | - $insert = true; |
|
122 | - $selected = 'selected'; |
|
123 | - } |
|
124 | - break; |
|
125 | - } |
|
126 | - } |
|
127 | - if ($insert == true) { |
|
128 | - $input_select .= '<option '.$selected.' value="'.$calendar['date_time'].'">'.$calendar['date_time'].'</option>'; |
|
129 | - } |
|
130 | - } |
|
131 | - $input_select .= '</select>'; |
|
132 | - } else { |
|
133 | - $input_select .= '<em>'.get_lang('ThereAreNoRegisteredDatetimeYet').'</em>'; |
|
134 | - } |
|
135 | - } |
|
136 | - ?> |
|
109 | + $label = get_lang('StartDate'); |
|
110 | + if (!empty($attendance_calendar)) { |
|
111 | + $input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" size="5">'; |
|
112 | + foreach ($attendance_calendar as $calendar) { |
|
113 | + $selected = null; |
|
114 | + $insert = true; |
|
115 | + //checking if was already taken |
|
116 | + foreach ($new_thematic_list as $key => $thematic_item) { |
|
117 | + //if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) { |
|
118 | + if ($calendar['db_date_time'] == $thematic_item['start_date'] ) { |
|
119 | + $insert = false; |
|
120 | + if ($thematic_advance_id == $key) { |
|
121 | + $insert = true; |
|
122 | + $selected = 'selected'; |
|
123 | + } |
|
124 | + break; |
|
125 | + } |
|
126 | + } |
|
127 | + if ($insert == true) { |
|
128 | + $input_select .= '<option '.$selected.' value="'.$calendar['date_time'].'">'.$calendar['date_time'].'</option>'; |
|
129 | + } |
|
130 | + } |
|
131 | + $input_select .= '</select>'; |
|
132 | + } else { |
|
133 | + $input_select .= '<em>'.get_lang('ThereAreNoRegisteredDatetimeYet').'</em>'; |
|
134 | + } |
|
135 | + } |
|
136 | + ?> |
|
137 | 137 | <div class="form-group"> |
138 | 138 | <label class="col-sm-2 control-label"><?php echo $label ?></label> |
139 | 139 | <div class="col-sm-10"><?php echo $input_select ?></div> |
140 | 140 | </div> |
141 | 141 | <?php |
142 | - break; |
|
143 | - case 'update_done_thematic_advance': |
|
144 | - $thematic_advance_id = intval($_GET['thematic_advance_id']); |
|
145 | - $total_average = 0; |
|
146 | - if (!empty($thematic_advance_id)) { |
|
147 | - $thematic = new Thematic(); |
|
148 | - $affected_rows = $thematic->update_done_thematic_advances($thematic_advance_id); |
|
149 | - //if ($affected_rows) { |
|
150 | - $total_average = $thematic->get_total_average_of_thematic_advances(api_get_course_id(), api_get_session_id()); |
|
151 | - //} |
|
152 | - } |
|
153 | - echo $total_average; |
|
154 | - break; |
|
155 | - default: |
|
156 | - echo ''; |
|
142 | + break; |
|
143 | + case 'update_done_thematic_advance': |
|
144 | + $thematic_advance_id = intval($_GET['thematic_advance_id']); |
|
145 | + $total_average = 0; |
|
146 | + if (!empty($thematic_advance_id)) { |
|
147 | + $thematic = new Thematic(); |
|
148 | + $affected_rows = $thematic->update_done_thematic_advances($thematic_advance_id); |
|
149 | + //if ($affected_rows) { |
|
150 | + $total_average = $thematic->get_total_average_of_thematic_advances(api_get_course_id(), api_get_session_id()); |
|
151 | + //} |
|
152 | + } |
|
153 | + echo $total_average; |
|
154 | + break; |
|
155 | + default: |
|
156 | + echo ''; |
|
157 | 157 | } |
158 | 158 | exit; |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | } |
732 | 732 | |
733 | 733 | break; |
734 | - case 'get_user_skill_ranking': |
|
734 | + case 'get_user_skill_ranking': |
|
735 | 735 | $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank'); |
736 | 736 | $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $whereCondition); |
737 | 737 | $result = msort($result, 'skills_acquired', 'asc'); |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | |
1282 | 1282 | if (!empty($item['certif_min_score']) && !empty($item['document_id'])) { |
1283 | 1283 | $item['certificates'] = Display::return_icon('accept.png', get_lang('WithCertificate'), array(), ICON_SIZE_SMALL); |
1284 | - $item['has_certificates'] = '1'; |
|
1284 | + $item['has_certificates'] = '1'; |
|
1285 | 1285 | } else { |
1286 | 1286 | $item['certificates'] = Display::return_icon('warning.png', get_lang('NoCertificate'), array(), ICON_SIZE_SMALL); |
1287 | 1287 | $item['has_certificates'] = '0'; |
@@ -758,7 +758,7 @@ |
||
758 | 758 | // $gidReset = true; |
759 | 759 | } // end else |
760 | 760 | |
761 | - // Now check for anonymous user mode |
|
761 | + // Now check for anonymous user mode |
|
762 | 762 | if (isset($use_anonymous) && $use_anonymous) { |
763 | 763 | //if anonymous mode is set, then try to set the current user as anonymous |
764 | 764 | //if he doesn't have a login yet |
@@ -401,19 +401,19 @@ |
||
401 | 401 | |
402 | 402 | public function format_yes_no_optional($value) |
403 | 403 | { |
404 | - $return = ''; |
|
405 | - switch($value) { |
|
406 | - case 0: |
|
407 | - $return = get_lang('No'); |
|
408 | - break; |
|
409 | - case 1: |
|
410 | - $return = get_lang('Yes'); |
|
411 | - break; |
|
412 | - case 2: |
|
413 | - $return = get_lang('Optional'); |
|
414 | - break; |
|
415 | - } |
|
416 | - return $return; |
|
404 | + $return = ''; |
|
405 | + switch($value) { |
|
406 | + case 0: |
|
407 | + $return = get_lang('No'); |
|
408 | + break; |
|
409 | + case 1: |
|
410 | + $return = get_lang('Yes'); |
|
411 | + break; |
|
412 | + case 2: |
|
413 | + $return = get_lang('Optional'); |
|
414 | + break; |
|
415 | + } |
|
416 | + return $return; |
|
417 | 417 | |
418 | 418 | } |
419 | 419 |
@@ -720,11 +720,11 @@ discard block |
||
720 | 720 | return false; |
721 | 721 | } |
722 | 722 | |
723 | - /** |
|
724 | - * @param int $itemId |
|
725 | - * @param int $fieldId |
|
726 | - * @return array |
|
727 | - */ |
|
723 | + /** |
|
724 | + * @param int $itemId |
|
725 | + * @param int $fieldId |
|
726 | + * @return array |
|
727 | + */ |
|
728 | 728 | public function getAllValuesByItemAndField($itemId, $fieldId) |
729 | 729 | { |
730 | 730 | $fieldId = intval($fieldId); |
@@ -847,7 +847,6 @@ discard block |
||
847 | 847 | /** |
848 | 848 | * Deletes all values from an item |
849 | 849 | * @param int $itemId (session id, course id, etc) |
850 | - |
|
851 | 850 | * @assert (-1,-1) == null |
852 | 851 | */ |
853 | 852 | public function deleteValuesByItem($itemId) |
@@ -108,24 +108,24 @@ |
||
108 | 108 | */ |
109 | 109 | function utf8_sort($array) |
110 | 110 | { |
111 | - $old_locale = setlocale(LC_ALL, null); |
|
112 | - $code = api_get_language_isocode(); |
|
113 | - $locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8'); |
|
114 | - $try_sort = false; |
|
111 | + $old_locale = setlocale(LC_ALL, null); |
|
112 | + $code = api_get_language_isocode(); |
|
113 | + $locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8'); |
|
114 | + $try_sort = false; |
|
115 | 115 | |
116 | - foreach($locale_list as $locale) { |
|
117 | - $my_local = setlocale(LC_COLLATE, $locale); |
|
118 | - if ($my_local) { |
|
119 | - $try_sort = true; |
|
120 | - break; |
|
121 | - } |
|
122 | - } |
|
116 | + foreach($locale_list as $locale) { |
|
117 | + $my_local = setlocale(LC_COLLATE, $locale); |
|
118 | + if ($my_local) { |
|
119 | + $try_sort = true; |
|
120 | + break; |
|
121 | + } |
|
122 | + } |
|
123 | 123 | |
124 | - if ($try_sort) { |
|
125 | - uasort($array, 'strcoll'); |
|
126 | - } |
|
127 | - setlocale(LC_COLLATE, $old_locale); |
|
128 | - return $array; |
|
124 | + if ($try_sort) { |
|
125 | + uasort($array, 'strcoll'); |
|
126 | + } |
|
127 | + setlocale(LC_COLLATE, $old_locale); |
|
128 | + return $array; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -591,13 +591,13 @@ |
||
591 | 591 | |
592 | 592 | } |
593 | 593 | |
594 | - /** |
|
595 | - * Add a tab to platform |
|
596 | - * @param string $tabName |
|
597 | - * @param string $url |
|
598 | - * |
|
599 | - * @return boolean |
|
600 | - */ |
|
594 | + /** |
|
595 | + * Add a tab to platform |
|
596 | + * @param string $tabName |
|
597 | + * @param string $url |
|
598 | + * |
|
599 | + * @return boolean |
|
600 | + */ |
|
601 | 601 | public function addTab($tabName, $url) |
602 | 602 | { |
603 | 603 | $sql = "SELECT * FROM settings_current |