@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | |
71 | 71 | $zip_file = CourseArchiver::createBackup($course); |
72 | 72 | Display::display_confirmation_message(get_lang('BackupCreated')); |
73 | - echo '<br /><a class="btn btn-primary btn-large" href="' . api_get_path(WEB_CODE_PATH) . 'course_info/download.php?archive=' . $zip_file . '&' . api_get_cidreq() . '"> |
|
74 | - ' . get_lang('Download') . '</a>'; |
|
73 | + echo '<br /><a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'"> |
|
74 | + ' . get_lang('Download').'</a>'; |
|
75 | 75 | |
76 | 76 | } elseif (Security::check_token('post') && ( |
77 | 77 | isset($_POST['backup_option']) && |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $form = new FormValidator( |
97 | 97 | 'create_backup_form', |
98 | 98 | 'post', |
99 | - api_get_self() . '?' . api_get_cidreq() |
|
99 | + api_get_self().'?'.api_get_cidreq() |
|
100 | 100 | ); |
101 | 101 | $form->addElement('header', get_lang('SelectOptionForBackup')); |
102 | 102 | $form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | require_once __DIR__.'/../inc/global.inc.php'; |
16 | -$current_course_tool = TOOL_COURSE_MAINTENANCE; |
|
16 | +$current_course_tool = TOOL_COURSE_MAINTENANCE; |
|
17 | 17 | api_protect_course_script(true); |
18 | 18 | |
19 | 19 | // Check access rights (only teachers are allowed here) |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package chamilo.gradebook |
7 | 7 | */ |
8 | 8 | require_once __DIR__.'/../inc/global.inc.php'; |
9 | -$current_course_tool = TOOL_GRADEBOOK; |
|
9 | +$current_course_tool = TOOL_GRADEBOOK; |
|
10 | 10 | |
11 | 11 | if (!api_is_student_boss()) { |
12 | 12 | api_protect_course_script(true); |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | ini_set('max_execution_time', 0); |
17 | 17 | |
18 | 18 | //extra javascript functions for in html head: |
19 | -$htmlHeadXtra[] ="<script> |
|
19 | +$htmlHeadXtra[] = "<script> |
|
20 | 20 | function confirmation() { |
21 | - if (confirm(\" " . trim(get_lang('AreYouSureToDelete')) . " ?\")) { |
|
21 | + if (confirm(\" " . trim(get_lang('AreYouSureToDelete'))." ?\")) { |
|
22 | 22 | return true; |
23 | 23 | } else { |
24 | 24 | return false; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | api_not_allowed(true); |
32 | 32 | } |
33 | 33 | |
34 | -$cat_id = isset($_GET['cat_id']) ? (int)$_GET['cat_id'] : null; |
|
34 | +$cat_id = isset($_GET['cat_id']) ? (int) $_GET['cat_id'] : null; |
|
35 | 35 | $action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null; |
36 | 36 | $filterOfficialCode = isset($_POST['filter']) ? Security::remove_XSS($_POST['filter']) : null; |
37 | 37 | $filterOfficialCodeGet = isset($_GET['filter']) ? Security::remove_XSS($_GET['filter']) : null; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | $course_code = api_get_course_id(); |
74 | 74 | |
75 | -$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
76 | -$interbreadcrumb[] = array('url' => '#','name' => get_lang('GradebookListOfStudentsCertificates')); |
|
75 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
76 | +$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsCertificates')); |
|
77 | 77 | |
78 | 78 | $this_section = SECTION_COURSES; |
79 | 79 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $certificate = new Certificate($_GET['certificate_id']); |
86 | 86 | $result = $certificate->delete(true); |
87 | 87 | Security::clear_token(); |
88 | - if ($result ==true) { |
|
88 | + if ($result == true) { |
|
89 | 89 | Display::display_confirmation_message(get_lang('CertificateRemoved')); |
90 | 90 | } else { |
91 | 91 | Display::display_error_message(get_lang('CertificateNotRemoved')); |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | |
105 | 105 | //with this fix the teacher only can view 1 gradebook |
106 | 106 | if (api_is_platform_admin()) { |
107 | - $stud_id= (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
107 | + $stud_id = (api_is_allowed_to_edit() ? null : api_get_user_id()); |
|
108 | 108 | } else { |
109 | - $stud_id= api_get_user_id(); |
|
109 | + $stud_id = api_get_user_id(); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $total_weight = $cats[0]->get_weight(); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $alleval = $cats[0]->get_evaluations($stud_id); |
116 | 116 | $alllink = $cats[0]->get_links($stud_id); |
117 | 117 | |
118 | - $datagen = new GradebookDataGenerator ($allcat,$alleval, $alllink); |
|
118 | + $datagen = new GradebookDataGenerator($allcat, $alleval, $alllink); |
|
119 | 119 | |
120 | 120 | $total_resource_weight = 0; |
121 | 121 | if (!empty($datagen)) { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $newarray[] = array_slice($data, 1); |
133 | 133 | } |
134 | 134 | |
135 | - foreach($newarray as $item) { |
|
135 | + foreach ($newarray as $item) { |
|
136 | 136 | $total_resource_weight = $total_resource_weight + $item['2']; |
137 | 137 | } |
138 | 138 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | if ($filter === 'true') { |
151 | 151 | echo '<br />'; |
152 | 152 | $options = UserManager::getOfficialCodeGrouped(); |
153 | - $options =array_merge(array('all' => get_lang('All')), $options); |
|
153 | + $options = array_merge(array('all' => get_lang('All')), $options); |
|
154 | 154 | $form = new FormValidator( |
155 | 155 | 'official_code_filter', |
156 | 156 | 'POST', |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | echo $filterForm; |
198 | 198 | |
199 | -if (count($certificate_list) == 0 ) { |
|
199 | +if (count($certificate_list) == 0) { |
|
200 | 200 | echo Display::display_warning_message(get_lang('NoResultsAvailable')); |
201 | 201 | } else { |
202 | 202 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $certificates = Display::url(get_lang('Certificate'), $url, array('target'=>'_blank', 'class' => 'btn btn-default')); |
220 | 220 | echo $certificates; |
221 | 221 | echo '<a onclick="return confirmation();" href="gradebook_display_certificate.php?sec_token='.$token.'&'.api_get_cidreq().'&action=delete&cat_id='.$cat_id.'&certificate_id='.$value_certificate['id'].'"> |
222 | - '.Display::return_icon('delete.png',get_lang('Delete')).' |
|
222 | + '.Display::return_icon('delete.png', get_lang('Delete')).' |
|
223 | 223 | </a>'; |
224 | 224 | echo '</td></tr>'; |
225 | 225 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | require_once __DIR__.'/../inc/global.inc.php'; |
12 | -$current_course_tool = TOOL_GRADEBOOK; |
|
12 | +$current_course_tool = TOOL_GRADEBOOK; |
|
13 | 13 | |
14 | 14 | api_protect_course_script(); |
15 | 15 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | api_not_allowed(true); |
22 | 22 | } |
23 | 23 | |
24 | -$cat_id = isset($_GET['selectcat']) ? (int)$_GET['selectcat'] : null; |
|
24 | +$cat_id = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : null; |
|
25 | 25 | $action = isset($_GET['action']) && $_GET['action'] ? $_GET['action'] : null; |
26 | 26 | |
27 | 27 | $userList = CourseManager::get_user_list_from_course_code( |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | |
114 | 114 | $course_code = api_get_course_id(); |
115 | 115 | |
116 | -$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
117 | -$interbreadcrumb[] = array('url' => '#','name' => get_lang('GradebookListOfStudentsReports')); |
|
116 | +$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?', 'name' => get_lang('Gradebook')); |
|
117 | +$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradebookListOfStudentsReports')); |
|
118 | 118 | |
119 | 119 | $this_section = SECTION_COURSES; |
120 | 120 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | echo '</div>'; |
133 | 133 | |
134 | -if (count($userList) == 0 ) { |
|
134 | +if (count($userList) == 0) { |
|
135 | 135 | echo Display::display_warning_message(get_lang('NoResultsAvailable')); |
136 | 136 | } else { |
137 | 137 | echo '<br /><br /><table class="data_table">'; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | require_once __DIR__.'/../inc/global.inc.php'; |
9 | 9 | require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/fe/exportgradebook.php'; |
10 | 10 | |
11 | -$current_course_tool = TOOL_GRADEBOOK; |
|
11 | +$current_course_tool = TOOL_GRADEBOOK; |
|
12 | 12 | |
13 | 13 | api_protect_course_script(true); |
14 | 14 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | null, |
75 | 75 | 'simple_search_form', |
76 | 76 | null, |
77 | - api_get_self() . '?selectcat=' . $category_id |
|
77 | + api_get_self().'?selectcat='.$category_id |
|
78 | 78 | ); |
79 | 79 | $values = $simple_search_form->exportValues(); |
80 | 80 | |
@@ -148,15 +148,15 @@ discard block |
||
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
151 | -if (isset($_GET['exportpdf'])) { |
|
152 | - $interbreadcrumb[] = array ( |
|
153 | - 'url' => api_get_self().'?selectcat=' . Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(), |
|
151 | +if (isset($_GET['exportpdf'])) { |
|
152 | + $interbreadcrumb[] = array( |
|
153 | + 'url' => api_get_self().'?selectcat='.Security::remove_XSS($_GET['selectcat']).'&'.api_get_cidreq(), |
|
154 | 154 | 'name' => get_lang('FlatView') |
155 | 155 | ); |
156 | 156 | |
157 | 157 | $pageNum = isset($_GET['flatviewlist_page_nr']) ? intval($_GET['flatviewlist_page_nr']) : null; |
158 | 158 | $perPage = isset($_GET['flatviewlist_per_page']) ? intval($_GET['flatviewlist_per_page']) : null; |
159 | - $url = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
159 | + $url = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
160 | 160 | 'exportpdf' => '', |
161 | 161 | 'offset' => $offset, |
162 | 162 | 'selectcat' => intval($_GET['selectcat']), |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | } |
197 | 197 | |
198 | -if (isset($_GET['print'])) { |
|
198 | +if (isset($_GET['print'])) { |
|
199 | 199 | $printable_data = GradebookUtils::get_printable_data( |
200 | 200 | $cat[0], |
201 | 201 | $users, |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | api_block_anonymous_users(); |
19 | 19 | |
20 | 20 | $interbreadcrumb[] = array( |
21 | - "url" => api_is_student_boss()?"#":api_get_path(WEB_CODE_PATH) . "mySpace/index.php?".api_get_cidreq(), |
|
21 | + "url" => api_is_student_boss() ? "#" : api_get_path(WEB_CODE_PATH)."mySpace/index.php?".api_get_cidreq(), |
|
22 | 22 | "name" => get_lang("MySpace") |
23 | 23 | ); |
24 | 24 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | if (!is_null($gradebook)) { |
114 | - $exportAllLink = api_get_path(WEB_CODE_PATH) . "gradebook/gradebook_display_certificate.php?"; |
|
114 | + $exportAllLink = api_get_path(WEB_CODE_PATH)."gradebook/gradebook_display_certificate.php?"; |
|
115 | 115 | $exportAllLink .= http_build_query(array( |
116 | 116 | "action" => "export_all_certificates", |
117 | 117 | "cidReq" => $selectedCourseInfo['code'], |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $form = new FormValidator( |
247 | 247 | 'certificate_report_form', |
248 | 248 | 'post', |
249 | - api_get_path(WEB_CODE_PATH) . 'gradebook/certificate_report.php' |
|
249 | + api_get_path(WEB_CODE_PATH).'gradebook/certificate_report.php' |
|
250 | 250 | ); |
251 | 251 | $form->addSelect('session', get_lang('Sessions'), $sessions, ['id' => 'session']); |
252 | 252 | $form->addSelect('course', get_lang('Courses'), $courses, ['id' => 'course']); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $searchForm = new FormValidator( |
286 | 286 | 'certificate_report_form', |
287 | 287 | 'post', |
288 | - api_get_path(WEB_CODE_PATH) . 'gradebook/certificate_report.php' |
|
288 | + api_get_path(WEB_CODE_PATH).'gradebook/certificate_report.php' |
|
289 | 289 | ); |
290 | 290 | $searchForm->addSelect('student', get_lang('Students'), $students, ['id' => 'student']); |
291 | 291 | $searchForm->addButtonSearch(); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | require_once __DIR__.'/../inc/global.inc.php'; |
9 | 9 | $_in_course = true; |
10 | 10 | $course_code = api_get_course_id(); |
11 | -if (empty($course_code )) { |
|
11 | +if (empty($course_code)) { |
|
12 | 12 | $_in_course = false; |
13 | 13 | } |
14 | 14 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $my_user_id = api_get_user_id(); |
24 | 24 | $catadd->set_user_id($my_user_id); |
25 | 25 | $catadd->set_parent_id($get_select_cat); |
26 | -$catcourse = Category :: load ($get_select_cat); |
|
26 | +$catcourse = Category :: load($get_select_cat); |
|
27 | 27 | |
28 | 28 | if ($_in_course) { |
29 | 29 | $catadd->set_course_code($course_code); |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | $catadd, |
38 | 38 | 'add_cat_form', |
39 | 39 | null, |
40 | - api_get_self() . '?selectcat='.$get_select_cat.'&'.api_get_cidreq() |
|
40 | + api_get_self().'?selectcat='.$get_select_cat.'&'.api_get_cidreq() |
|
41 | 41 | ); |
42 | 42 | |
43 | 43 | if ($form->validate()) { |
44 | 44 | $values = $form->exportValues(); |
45 | - $select_course=isset($values['select_course']) ? $values['select_course'] : array(); |
|
45 | + $select_course = isset($values['select_course']) ? $values['select_course'] : array(); |
|
46 | 46 | $cat = new Category(); |
47 | 47 | if ($values['hid_parent_id'] == '0') { |
48 | 48 | if ($select_course == 'COURSEINDEPENDENT') { |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | } |
90 | 90 | $cat->set_visible($visible); |
91 | 91 | $result = $cat->add(); |
92 | - header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?addcat=&selectcat=' . $cat->get_parent_id().'&'.api_get_cidreq()); |
|
92 | + header('Location: '.Security::remove_XSS($_SESSION['gradebook_dest']).'?addcat=&selectcat='.$cat->get_parent_id().'&'.api_get_cidreq()); |
|
93 | 93 | exit; |
94 | 94 | } |
95 | 95 | |
96 | 96 | if (!$_in_course) { |
97 | - $interbreadcrumb[] = array ( |
|
97 | + $interbreadcrumb[] = array( |
|
98 | 98 | 'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$get_select_cat.'&'.api_get_cidreq(), |
99 | 99 | 'name' => get_lang('Gradebook') |
100 | 100 | ); |
@@ -7,24 +7,24 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | require_once __DIR__.'/../inc/global.inc.php'; |
10 | -$current_course_tool = TOOL_GRADEBOOK; |
|
10 | +$current_course_tool = TOOL_GRADEBOOK; |
|
11 | 11 | |
12 | 12 | api_protect_course_script(true); |
13 | 13 | api_block_anonymous_users(); |
14 | 14 | GradebookUtils::block_students(); |
15 | 15 | |
16 | -$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0; |
|
16 | +$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0; |
|
17 | 17 | |
18 | 18 | $catadd = new Category(); |
19 | 19 | $catadd->set_user_id(api_get_user_id()); |
20 | 20 | $catadd->set_parent_id($selectCat); |
21 | -$catcourse = Category :: load ($selectCat); |
|
21 | +$catcourse = Category :: load($selectCat); |
|
22 | 22 | $form = new CatForm( |
23 | 23 | CatForm :: TYPE_SELECT_COURSE, |
24 | 24 | $catadd, |
25 | 25 | 'add_cat_form', |
26 | 26 | null, |
27 | - api_get_self() . '?selectcat=' . $selectCat.'&'.api_get_cidreq() |
|
27 | + api_get_self().'?selectcat='.$selectCat.'&'.api_get_cidreq() |
|
28 | 28 | ); |
29 | 29 | |
30 | 30 | if ($form->validate()) { |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | $cat = new Category(); |
33 | 33 | $cat->set_course_code($values['select_course']); |
34 | 34 | $cat->set_name($values['name']); |
35 | - header('location: gradebook_add_link.php?selectcat=' .$selectCat.'&course_code='.Security::remove_XSS($values['select_course']).'&'.api_get_cidreq()); |
|
35 | + header('location: gradebook_add_link.php?selectcat='.$selectCat.'&course_code='.Security::remove_XSS($values['select_course']).'&'.api_get_cidreq()); |
|
36 | 36 | exit; |
37 | 37 | } |
38 | 38 | |
39 | -$interbreadcrumb[] = array ( |
|
39 | +$interbreadcrumb[] = array( |
|
40 | 40 | 'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectCat.'&'.api_get_cidreq(), |
41 | 41 | 'name' => get_lang('Gradebook') |
42 | 42 | ); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } |
165 | 165 | } else { |
166 | 166 | // all students -> get average |
167 | - $students = array(); // user list, needed to make sure we only |
|
167 | + $students = array(); // user list, needed to make sure we only |
|
168 | 168 | // take first attempts into account |
169 | 169 | $rescount = 0; |
170 | 170 | $sum = 0; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $this->get_attendance_data(); |
240 | 240 | $attendance_title = isset($this->attendance_data['name']) ? $this->attendance_data['name'] : ''; |
241 | 241 | $attendance_qualify_title = isset($this->attendance_data['attendance_qualify_title']) ? $this->attendance_data['attendance_qualify_title'] : ''; |
242 | - if ( isset($attendance_qualify_title) && $attendance_qualify_title != '') { |
|
242 | + if (isset($attendance_qualify_title) && $attendance_qualify_title != '') { |
|
243 | 243 | return $this->attendance_data['attendance_qualify_title']; |
244 | 244 | } else { |
245 | 245 | return $attendance_title; |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | $sql = 'SELECT * FROM '.$this->get_attendance_table().' att |
280 | 280 | WHERE att.c_id = '.$this->course_id.' AND att.id = '.intval($this->get_ref_id()).' '; |
281 | 281 | $result = Database::query($sql); |
282 | - $row = Database::fetch_array($result,'ASSOC'); |
|
282 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
283 | 283 | $attendance_id = $row['id']; |
284 | 284 | $url = api_get_path(WEB_PATH).'main/attendance/index.php?action=attendance_sheet_list&gradebook=view&attendance_id='.$attendance_id.'&'.api_get_cidreq_params($this->get_course_code(), $session_id); |
285 | 285 |