@@ -15,16 +15,16 @@ discard block |
||
15 | 15 | //Add the JS needed to use the jqgrid |
16 | 16 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
17 | 17 | // setting breadcrumbs |
18 | -$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
18 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
19 | 19 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
20 | 20 | if ($action == 'add') { |
21 | - $interbreadcrumb[] = array('url' => 'usergroups.php','name' => get_lang('Classes')); |
|
22 | - $interbreadcrumb[] = array('url' => '#','name' => get_lang('Add')); |
|
21 | + $interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
22 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add')); |
|
23 | 23 | } elseif ($action == 'edit') { |
24 | - $interbreadcrumb[] = array('url' => 'usergroups.php','name' => get_lang('Classes')); |
|
25 | - $interbreadcrumb[] = array('url' => '#','name' => get_lang('Edit')); |
|
24 | + $interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
25 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit')); |
|
26 | 26 | } else { |
27 | - $interbreadcrumb[] = array('url' => '#','name' => get_lang('Classes')); |
|
27 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Classes')); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | // The header. |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | ); |
56 | 56 | |
57 | 57 | //Column config |
58 | -$column_model = array( |
|
59 | - array('name'=>'name', 'index'=>'name', 'width'=>'35', 'align'=>'left'), |
|
60 | - array('name'=>'users', 'index'=>'users', 'width'=>'15', 'align'=>'left'), |
|
61 | - array('name'=>'courses', 'index'=>'courses', 'width'=>'15', 'align'=>'left'), |
|
62 | - array('name'=>'sessions', 'index'=>'sessions', 'width'=>'15', 'align'=>'left'), |
|
63 | - array('name'=>'group_type', 'index'=>'group_type', 'width'=>'15', 'align'=>'center'), |
|
64 | - array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'center', 'sortable'=>'false','formatter'=>'action_formatter'), |
|
58 | +$column_model = array( |
|
59 | + array('name'=>'name', 'index'=>'name', 'width'=>'35', 'align'=>'left'), |
|
60 | + array('name'=>'users', 'index'=>'users', 'width'=>'15', 'align'=>'left'), |
|
61 | + array('name'=>'courses', 'index'=>'courses', 'width'=>'15', 'align'=>'left'), |
|
62 | + array('name'=>'sessions', 'index'=>'sessions', 'width'=>'15', 'align'=>'left'), |
|
63 | + array('name'=>'group_type', 'index'=>'group_type', 'width'=>'15', 'align'=>'center'), |
|
64 | + array('name'=>'actions', 'index'=>'actions', 'width'=>'20', 'align'=>'center', 'sortable'=>'false', 'formatter'=>'action_formatter'), |
|
65 | 65 | ); |
66 | 66 | |
67 | 67 | //Autowidth |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | //With this function we can add actions to the jgrid |
74 | 74 | $action_links = 'function action_formatter (cellvalue, options, rowObject) { |
75 | 75 | return \'' |
76 | - .' <a href="add_users_to_usergroup.php?id=\'+options.rowId+\'">' . Display::return_icon('user_to_class.png', get_lang('SubscribeUsersToClass'), null, ICON_SIZE_MEDIUM) . '</a>' |
|
77 | - .' <a href="add_courses_to_usergroup.php?id=\'+options.rowId+\'">' . Display::return_icon('course_to_class.png', get_lang('SubscribeClassToCourses'), null, ICON_SIZE_MEDIUM) . '</a>' |
|
78 | - .' <a href="add_sessions_to_usergroup.php?id=\'+options.rowId+\'">' . Display::return_icon('sessions_to_class.png', get_lang('SubscribeClassToSessions'), null, ICON_SIZE_MEDIUM) . '</a>' |
|
79 | - .' <a href="?action=edit&id=\'+options.rowId+\'">' . Display::return_icon('edit.png', get_lang('Edit'), null, ICON_SIZE_SMALL) . '</a>' |
|
80 | - .' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?action=delete&id=\'+options.rowId+\'">' . Display::return_icon('delete.png', get_lang('Delete'), null, ICON_SIZE_SMALL) . '</a>\'; |
|
76 | + .' <a href="add_users_to_usergroup.php?id=\'+options.rowId+\'">'.Display::return_icon('user_to_class.png', get_lang('SubscribeUsersToClass'), null, ICON_SIZE_MEDIUM).'</a>' |
|
77 | + .' <a href="add_courses_to_usergroup.php?id=\'+options.rowId+\'">'.Display::return_icon('course_to_class.png', get_lang('SubscribeClassToCourses'), null, ICON_SIZE_MEDIUM).'</a>' |
|
78 | + .' <a href="add_sessions_to_usergroup.php?id=\'+options.rowId+\'">'.Display::return_icon('sessions_to_class.png', get_lang('SubscribeClassToSessions'), null, ICON_SIZE_MEDIUM).'</a>' |
|
79 | + .' <a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), null, ICON_SIZE_SMALL).'</a>' |
|
80 | + .' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;" href="?action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), null, ICON_SIZE_SMALL).'</a>\'; |
|
81 | 81 | }'; |
82 | 82 | |
83 | 83 | ?> |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } else { |
129 | 129 | echo '<div class="actions">'; |
130 | 130 | echo '<a href="'.api_get_self().'">'. |
131 | - Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
131 | + Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
132 | 132 | echo '</div>'; |
133 | 133 | $token = Security::get_token(); |
134 | 134 | $form->addElement('hidden', 'sec_token'); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | return $this->render( |
44 | 44 | '@ChamiloPage/latest.html.twig', |
45 | - [ 'pages' => $pagesToShow ] |
|
45 | + ['pages' => $pagesToShow] |
|
46 | 46 | ); |
47 | 47 | } |
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -136,7 +136,7 @@ |
||
136 | 136 | ); |
137 | 137 | /** @var Category $category */ |
138 | 138 | foreach ($categories as $category) { |
139 | - $faq->addChild( |
|
139 | + $faq->addChild( |
|
140 | 140 | $category->getHeadline(), |
141 | 141 | array( |
142 | 142 | 'route' => 'faq', |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | * @param $stok |
429 | 429 | * @param $code |
430 | 430 | * @param $search_term |
431 | - * @return html |
|
431 | + * @return string |
|
432 | 432 | */ |
433 | 433 | function return_register_button($course, $stok, $code, $search_term) |
434 | 434 | { |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | * @param $stok |
444 | 444 | * @param $search_term |
445 | 445 | * @param $code |
446 | - * @return html |
|
446 | + * @return string |
|
447 | 447 | */ |
448 | 448 | function return_unregister_button($course, $stok, $search_term, $code) |
449 | 449 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $el.prepend('<?php echo Display::display_icon('nolines_minus.gif'); ?>'); |
61 | 61 | |
62 | 62 | $.ajax({ |
63 | - url: '<?php echo api_get_path(WEB_AJAX_PATH) . 'course.ajax.php' ?>', |
|
63 | + url: '<?php echo api_get_path(WEB_AJAX_PATH).'course.ajax.php' ?>', |
|
64 | 64 | type: 'GET', |
65 | 65 | dataType: 'json', |
66 | 66 | data: { |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | $pageLength = (!empty($_REQUEST['pageLength']) ? intval($_REQUEST['pageLength']) : 10); |
129 | 129 | $pageCurrent = (!empty($_REQUEST['pageCurrent']) ? intval($_REQUEST['pageCurrent']) : 1); |
130 | 130 | $form = '<form action="'.$webAction.'" method="GET" class="form-horizontal">'; |
131 | - $form .= '<input type="hidden" name="action" value="' . $action . '">'; |
|
132 | - $form .= '<input type="hidden" name="pageCurrent" value="' . $pageCurrent . '">'; |
|
133 | - $form .= '<input type="hidden" name="pageLength" value="' . $pageLength . '">'; |
|
131 | + $form .= '<input type="hidden" name="action" value="'.$action.'">'; |
|
132 | + $form .= '<input type="hidden" name="pageCurrent" value="'.$pageCurrent.'">'; |
|
133 | + $form .= '<input type="hidden" name="pageLength" value="'.$pageLength.'">'; |
|
134 | 134 | $form .= '<div class="form-group">'; |
135 | 135 | $form .= '<div class="col-sm-12">'; |
136 | 136 | $form .= '<select name="category_code" onchange="submit();" class="selectpicker show-tick form-control">'; |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | foreach ($browse_course_categories[0] as $category) { |
139 | 139 | $categoryCode = $category['code']; |
140 | 140 | $countCourse = $category['count_courses']; |
141 | - $form .= '<option '. ($categoryCode == $codeType? 'selected="selected" ':'') .' value="' . $category['code'] . '">' . $category['name'] . ' ( '. $countCourse .' ) </option>'; |
|
141 | + $form .= '<option '.($categoryCode == $codeType ? 'selected="selected" ' : '').' value="'.$category['code'].'">'.$category['name'].' ( '.$countCourse.' ) </option>'; |
|
142 | 142 | if (!empty($browse_course_categories[$categoryCode])) { |
143 | - foreach ($browse_course_categories[$categoryCode] as $subCategory){ |
|
143 | + foreach ($browse_course_categories[$categoryCode] as $subCategory) { |
|
144 | 144 | $subCategoryCode = $subCategory['code']; |
145 | - $form .= '<option '. ($subCategoryCode == $codeType ? 'selected="selected" ':'') .' value="' . $subCategory['code'] . '"> ---' . $subCategory['name'] . ' ( '. $subCategory['count_courses'] .' ) </option>'; |
|
145 | + $form .= '<option '.($subCategoryCode == $codeType ? 'selected="selected" ' : '').' value="'.$subCategory['code'].'"> ---'.$subCategory['name'].' ( '.$subCategory['count_courses'].' ) </option>'; |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | } |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | if (!empty($categoryTitle)) { |
321 | 321 | $listCategory = CourseManager::getCategoriesList(); |
322 | 322 | $categoryTitle = $listCategory[$categoryTitle]; |
323 | - $html .= '<span class="category">'. $categoryTitle.'</span>'; |
|
323 | + $html .= '<span class="category">'.$categoryTitle.'</span>'; |
|
324 | 324 | $html .= '<div class="cribbon"></div>'; |
325 | 325 | } |
326 | 326 | $teachers = CourseManager::getTeachersFromCourseByCode($course['code']); |
@@ -331,13 +331,13 @@ discard block |
||
331 | 331 | if ($count > 2) { |
332 | 332 | break; |
333 | 333 | } |
334 | - $name = $value['firstname'].' ' . $value['lastname']; |
|
334 | + $name = $value['firstname'].' '.$value['lastname']; |
|
335 | 335 | $html .= '<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'"> |
336 | 336 | <img src="'.$value['avatar'].'"/></a>'; |
337 | 337 | $html .= '<div class="teachers-details"><h5> |
338 | 338 | <a href="'.$value['url'].'" class="ajax" data-title="'.$name.'">' |
339 | - . $name . '</a></h5></div>'; |
|
340 | - $count ++; |
|
339 | + . $name.'</a></h5></div>'; |
|
340 | + $count++; |
|
341 | 341 | } |
342 | 342 | $html .= '</div></div>'; |
343 | 343 | $html .= '<div class="user-actions">'; |
@@ -360,8 +360,8 @@ discard block |
||
360 | 360 | $title = cut($course['title'], 70); |
361 | 361 | $ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote'; |
362 | 362 | $rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']); |
363 | - $html .= '<h4 class="title"><a href="' . $linkCourse . '">' . cut($title, 60) . '</a></h4>'; |
|
364 | - $html .= '<div class="ranking">'. $rating . '</div>'; |
|
363 | + $html .= '<h4 class="title"><a href="'.$linkCourse.'">'.cut($title, 60).'</a></h4>'; |
|
364 | + $html .= '<div class="ranking">'.$rating.'</div>'; |
|
365 | 365 | |
366 | 366 | return $html; |
367 | 367 | } |
@@ -376,8 +376,8 @@ discard block |
||
376 | 376 | $title = $course['title']; |
377 | 377 | $html = ''; |
378 | 378 | if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
379 | - $html = '<a data-title="' . $title . '" class="ajax btn btn-default btn-sm" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="' . get_lang('Description') . '">' . |
|
380 | - Display::returnFontAwesomeIcon('info-circle') . '</a>'; |
|
379 | + $html = '<a data-title="'.$title.'" class="ajax btn btn-default btn-sm" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="'.get_lang('Description').'">'. |
|
380 | + Display::returnFontAwesomeIcon('info-circle').'</a>'; |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | return $html; |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | */ |
391 | 391 | function return_goto_button($course) |
392 | 392 | { |
393 | - $html = ' <a class="btn btn-default btn-sm" title="' . get_lang('GoToCourse') . '" href="'.api_get_course_url($course['code']).'">'. |
|
393 | + $html = ' <a class="btn btn-default btn-sm" title="'.get_lang('GoToCourse').'" href="'.api_get_course_url($course['code']).'">'. |
|
394 | 394 | Display::returnFontAwesomeIcon('share').'</a>'; |
395 | 395 | |
396 | 396 | return $html; |
@@ -429,8 +429,8 @@ discard block |
||
429 | 429 | */ |
430 | 430 | function return_register_button($course, $stok, $code, $search_term) |
431 | 431 | { |
432 | - $html = ' <a class="btn btn-success btn-sm" title="' . get_lang('Subscribe') . '" href="'.api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' . |
|
433 | - Display::returnFontAwesomeIcon('sign-in') . '</a>'; |
|
432 | + $html = ' <a class="btn btn-success btn-sm" title="'.get_lang('Subscribe').'" href="'.api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">'. |
|
433 | + Display::returnFontAwesomeIcon('sign-in').'</a>'; |
|
434 | 434 | return $html; |
435 | 435 | } |
436 | 436 | |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | */ |
445 | 445 | function return_unregister_button($course, $stok, $search_term, $code) |
446 | 446 | { |
447 | - $html = ' <a class="btn btn-danger btn-sm" title="' . get_lang('Unsubscribe') . '" href="'. api_get_self().'?action=unsubscribe&sec_token='.$stok.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">' . |
|
448 | - Display::returnFontAwesomeIcon('sign-out') . '</a>'; |
|
447 | + $html = ' <a class="btn btn-danger btn-sm" title="'.get_lang('Unsubscribe').'" href="'.api_get_self().'?action=unsubscribe&sec_token='.$stok.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">'. |
|
448 | + Display::returnFontAwesomeIcon('sign-out').'</a>'; |
|
449 | 449 | return $html; |
450 | 450 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $iso = api_get_language_isocode(api_get_interface_language()); |
26 | 26 | $languageCondition = ''; |
27 | 27 | |
28 | - if (file_exists(api_get_path(SYS_PATH) . "web/assets/select2/dist/js/i18n/$iso.js")) { |
|
28 | + if (file_exists(api_get_path(SYS_PATH)."web/assets/select2/dist/js/i18n/$iso.js")) { |
|
29 | 29 | $html .= api_get_asset("select2/dist/js/i18n/$iso.js"); |
30 | 30 | $languageCondition = "language: '$iso',"; |
31 | 31 | } |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | //Get the minimumInputLength for select2 |
52 | 52 | $minimumInputLength = $this->getAttribute('minimumInputLength') > 3 ? |
53 | - $this->getAttribute('minimumInputLength') : |
|
54 | - 3 |
|
53 | + $this->getAttribute('minimumInputLength') : 3 |
|
55 | 54 | ; |
56 | 55 | |
57 | 56 | $plHolder = $this->getAttribute('placeholder'); |
@@ -81,7 +80,7 @@ discard block |
||
81 | 80 | $multiple = $multiple ? 'true' : 'false'; |
82 | 81 | |
83 | 82 | $max = $this->getAttribute('maximumSelectionLength'); |
84 | - $max = !empty($max) ? "maximumSelectionLength: $max, ": ''; |
|
83 | + $max = !empty($max) ? "maximumSelectionLength: $max, " : ''; |
|
85 | 84 | |
86 | 85 | $html .= <<<JS |
87 | 86 | <script> |
@@ -125,7 +124,7 @@ discard block |
||
125 | 124 | $this->removeAttribute('url_function'); |
126 | 125 | $this->setAttribute('style', 'width: 100%;'); |
127 | 126 | |
128 | - return parent::toHtml() . $html; |
|
127 | + return parent::toHtml().$html; |
|
129 | 128 | } |
130 | 129 | |
131 | 130 | /** |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | require_once '../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, |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | require_once '../inc/global.inc.php'; |
15 | 15 | $this_section = SECTION_COURSES; |
16 | -$current_course_tool = TOOL_GROUP; |
|
16 | +$current_course_tool = TOOL_GROUP; |
|
17 | 17 | |
18 | 18 | // Notice for unauthorized people. |
19 | 19 | api_protect_course_script(true); |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | $current_group = GroupManager :: get_group_properties($group_id); |
23 | 23 | |
24 | 24 | $nameTools = get_lang('EditGroup'); |
25 | -$interbreadcrumb[] = array ('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); |
|
26 | -$interbreadcrumb[] = array ('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']); |
|
25 | +$interbreadcrumb[] = array('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); |
|
26 | +$interbreadcrumb[] = array('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']); |
|
27 | 27 | |
28 | 28 | $is_group_member = GroupManager :: is_tutor_of_group(api_get_user_id(), $group_id); |
29 | 29 |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | $nParent = 0; // the number of /.. into the url |
41 | 41 | while (substr($cwd, -3, 3) == '/..') { |
42 | 42 | // go to parent directory |
43 | - $cwd= substr($cwd, 0, -3); |
|
44 | - if (strlen($cwd) == 0) { $cwd='/'; } |
|
43 | + $cwd = substr($cwd, 0, -3); |
|
44 | + if (strlen($cwd) == 0) { $cwd = '/'; } |
|
45 | 45 | $nParent++; |
46 | 46 | } |
47 | 47 | for (; $nParent > 0; $nParent--) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | if ($action == 'list') { |
57 | 57 | /*==== List files ====*/ |
58 | - if ($debug>0) { error_log("sending file list",0); } |
|
58 | + if ($debug > 0) { error_log("sending file list", 0); } |
|
59 | 59 | |
60 | 60 | // get files list |
61 | 61 | $files = DocumentManager::get_all_document_data($_course, $cwd, 0, NULL, false); |
@@ -251,7 +251,7 @@ |
||
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
254 | - $modify_icons .= '<a href="gradebook_edit_all.php?selectcat=' .$cat->get_id() . '&' . $courseParams.'">' . |
|
254 | + $modify_icons .= '<a href="gradebook_edit_all.php?selectcat=' .$cat->get_id() . '&' . $courseParams.'">' . |
|
255 | 255 | Display::return_icon( |
256 | 256 | 'percentage.png', |
257 | 257 | get_lang('EditAllWeights'), |
@@ -732,7 +732,7 @@ |
||
732 | 732 | } |
733 | 733 | |
734 | 734 | /** |
735 | - * @param null $course_code |
|
735 | + * @param string $course_code |
|
736 | 736 | * @param int $gradebook_model_id |
737 | 737 | * @return mixed |
738 | 738 | */ |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | $course_code = Database::escape_string($course_code); |
79 | 79 | if (!empty($link_id)) { |
80 | 80 | $link_id = intval($link_id); |
81 | - $sql = 'UPDATE ' . Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK) . ' |
|
82 | - SET weight = ' . "'" . Database::escape_string((float) $weight) . "'" . ' |
|
83 | - WHERE course_code = "' . $course_code . '" AND id = ' . $link_id; |
|
81 | + $sql = 'UPDATE '.Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK).' |
|
82 | + SET weight = ' . "'".Database::escape_string((float) $weight)."'".' |
|
83 | + WHERE course_code = "' . $course_code.'" AND id = '.$link_id; |
|
84 | 84 | Database::query($sql); |
85 | 85 | } |
86 | 86 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | // TODO find the corresponding category (the first one for this course, ordered by ID) |
102 | 102 | $l = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
103 | - $sql = "DELETE FROM $l WHERE id = ".(int)$link_id; |
|
103 | + $sql = "DELETE FROM $l WHERE id = ".(int) $link_id; |
|
104 | 104 | Database::query($sql); |
105 | 105 | |
106 | 106 | return true; |
@@ -195,8 +195,8 @@ discard block |
||
195 | 195 | $visibility_icon = ($cat->is_visible() == 0) ? 'invisible' : 'visible'; |
196 | 196 | $visibility_command = ($cat->is_visible() == 0) ? 'set_visible' : 'set_invisible'; |
197 | 197 | |
198 | - $modify_icons .= '<a class="view_children" data-cat-id="' . $cat->get_id() . '" href="javascript:void(0);">' . |
|
199 | - Display::return_icon('view_more_stats.gif', get_lang('Show'), '', ICON_SIZE_SMALL) . '</a>'; |
|
198 | + $modify_icons .= '<a class="view_children" data-cat-id="'.$cat->get_id().'" href="javascript:void(0);">'. |
|
199 | + Display::return_icon('view_more_stats.gif', get_lang('Show'), '', ICON_SIZE_SMALL).'</a>'; |
|
200 | 200 | |
201 | 201 | if (!api_is_allowed_to_edit(null, true)) { |
202 | 202 | $modify_icons .= Display::url( |
@@ -206,9 +206,9 @@ discard block |
||
206 | 206 | '', |
207 | 207 | ICON_SIZE_SMALL |
208 | 208 | ), |
209 | - 'personal_stats.php?' . http_build_query([ |
|
209 | + 'personal_stats.php?'.http_build_query([ |
|
210 | 210 | 'selectcat' => $cat->get_id() |
211 | - ]) . '&' . api_get_cidreq(), |
|
211 | + ]).'&'.api_get_cidreq(), |
|
212 | 212 | [ |
213 | 213 | 'class' => 'ajax', |
214 | 214 | 'data-title' => get_lang('FlatView') |
@@ -224,16 +224,16 @@ discard block |
||
224 | 224 | if (api_get_setting('gradebook_locking_enabled') == 'true') { |
225 | 225 | if ($cat->is_locked()) { |
226 | 226 | if (api_is_platform_admin()) { |
227 | - $modify_icons .= ' <a onclick="javascript:if (!confirm(\'' . addslashes(get_lang('ConfirmToUnlockElement')) . '\')) return false;" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $cat->get_id() . '&action=unlock">' . |
|
228 | - Display::return_icon('lock.png', get_lang('UnLockEvaluation'), '', ICON_SIZE_SMALL) . '</a>'; |
|
227 | + $modify_icons .= ' <a onclick="javascript:if (!confirm(\''.addslashes(get_lang('ConfirmToUnlockElement')).'\')) return false;" href="'.api_get_self().'?'.api_get_cidreq().'&category_id='.$cat->get_id().'&action=unlock">'. |
|
228 | + Display::return_icon('lock.png', get_lang('UnLockEvaluation'), '', ICON_SIZE_SMALL).'</a>'; |
|
229 | 229 | } else { |
230 | - $modify_icons .= ' <a href="#">' . Display::return_icon('lock_na.png', get_lang('GradebookLockedAlert'), '', ICON_SIZE_SMALL) . '</a>'; |
|
230 | + $modify_icons .= ' <a href="#">'.Display::return_icon('lock_na.png', get_lang('GradebookLockedAlert'), '', ICON_SIZE_SMALL).'</a>'; |
|
231 | 231 | } |
232 | - $modify_icons .= ' <a href="gradebook_flatview.php?export_pdf=category&selectcat=' . $cat->get_id() . '" >' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL) . '</a>'; |
|
232 | + $modify_icons .= ' <a href="gradebook_flatview.php?export_pdf=category&selectcat='.$cat->get_id().'" >'.Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL).'</a>'; |
|
233 | 233 | } else { |
234 | - $modify_icons .= ' <a onclick="javascript:if (!confirm(\'' . addslashes(get_lang('ConfirmToLockElement')) . '\')) return false;" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $cat->get_id() . '&action=lock">' . |
|
235 | - Display::return_icon('unlock.png', get_lang('LockEvaluation'), '', ICON_SIZE_SMALL) . '</a>'; |
|
236 | - $modify_icons .= ' <a href="#" >' . Display::return_icon('pdf_na.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL) . '</a>'; |
|
234 | + $modify_icons .= ' <a onclick="javascript:if (!confirm(\''.addslashes(get_lang('ConfirmToLockElement')).'\')) return false;" href="'.api_get_self().'?'.api_get_cidreq().'&category_id='.$cat->get_id().'&action=lock">'. |
|
235 | + Display::return_icon('unlock.png', get_lang('LockEvaluation'), '', ICON_SIZE_SMALL).'</a>'; |
|
236 | + $modify_icons .= ' <a href="#" >'.Display::return_icon('pdf_na.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL).'</a>'; |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
@@ -241,44 +241,44 @@ discard block |
||
241 | 241 | if ($cat->is_locked() && !api_is_platform_admin()) { |
242 | 242 | $modify_icons .= Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL); |
243 | 243 | } else { |
244 | - $modify_icons .= '<a href="gradebook_edit_cat.php?editcat=' . $cat->get_id() . '&'.$courseParams.'">' . |
|
244 | + $modify_icons .= '<a href="gradebook_edit_cat.php?editcat='.$cat->get_id().'&'.$courseParams.'">'. |
|
245 | 245 | Display::return_icon( |
246 | 246 | 'edit.png', |
247 | 247 | get_lang('Modify'), |
248 | 248 | '', |
249 | 249 | ICON_SIZE_SMALL |
250 | - ) . '</a>'; |
|
250 | + ).'</a>'; |
|
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
254 | - $modify_icons .= '<a href="gradebook_edit_all.php?selectcat=' .$cat->get_id() . '&' . $courseParams.'">' . |
|
254 | + $modify_icons .= '<a href="gradebook_edit_all.php?selectcat='.$cat->get_id().'&'.$courseParams.'">'. |
|
255 | 255 | Display::return_icon( |
256 | 256 | 'percentage.png', |
257 | 257 | get_lang('EditAllWeights'), |
258 | 258 | '', |
259 | 259 | ICON_SIZE_SMALL |
260 | - ) . '</a>'; |
|
260 | + ).'</a>'; |
|
261 | 261 | |
262 | - $modify_icons .= '<a href="gradebook_flatview.php?selectcat=' .$cat->get_id() . '&' . $courseParams. '">' . |
|
262 | + $modify_icons .= '<a href="gradebook_flatview.php?selectcat='.$cat->get_id().'&'.$courseParams.'">'. |
|
263 | 263 | Display::return_icon( |
264 | 264 | 'stats.png', |
265 | 265 | get_lang('FlatView'), |
266 | 266 | '', |
267 | 267 | ICON_SIZE_SMALL |
268 | - ) . '</a>'; |
|
269 | - $modify_icons .= ' <a href="' . api_get_self() .'?visiblecat=' . $cat->get_id() . '&' .$visibility_command . '=&selectcat=' . $selectcat .'&' . $courseParams. '">' . |
|
268 | + ).'</a>'; |
|
269 | + $modify_icons .= ' <a href="'.api_get_self().'?visiblecat='.$cat->get_id().'&'.$visibility_command.'=&selectcat='.$selectcat.'&'.$courseParams.'">'. |
|
270 | 270 | Display::return_icon( |
271 | - $visibility_icon . '.png', |
|
271 | + $visibility_icon.'.png', |
|
272 | 272 | get_lang('Visible'), |
273 | 273 | '', |
274 | 274 | ICON_SIZE_SMALL |
275 | - ) . '</a>'; |
|
275 | + ).'</a>'; |
|
276 | 276 | |
277 | 277 | if ($cat->is_locked() && !api_is_platform_admin()) { |
278 | 278 | $modify_icons .= Display::return_icon('delete_na.png', get_lang('DeleteAll'), '', ICON_SIZE_SMALL); |
279 | 279 | } else { |
280 | - $modify_icons .= ' <a href="' . api_get_self() . '?deletecat=' . $cat->get_id() . '&selectcat=' . $selectcat . '&' . $courseParams. '" onclick="return confirmation();">' . |
|
281 | - Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_SMALL) . '</a>'; |
|
280 | + $modify_icons .= ' <a href="'.api_get_self().'?deletecat='.$cat->get_id().'&selectcat='.$selectcat.'&'.$courseParams.'" onclick="return confirmation();">'. |
|
281 | + Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_SMALL).'</a>'; |
|
282 | 282 | } |
283 | 283 | } |
284 | 284 | |
@@ -307,22 +307,22 @@ discard block |
||
307 | 307 | if ($is_locked && !api_is_platform_admin()) { |
308 | 308 | $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL); |
309 | 309 | } else { |
310 | - $modify_icons = '<a href="gradebook_edit_eval.php?editeval=' . $eval->get_id() . '&' . $courseParams. '">' . |
|
311 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
310 | + $modify_icons = '<a href="gradebook_edit_eval.php?editeval='.$eval->get_id().'&'.$courseParams.'">'. |
|
311 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
312 | 312 | } |
313 | 313 | |
314 | - $modify_icons .= ' <a href="' . api_get_self() . '?visibleeval=' . $eval->get_id() . '&' . $visibility_command . '=&selectcat=' . $selectcat . '&'.$courseParams. ' ">' . |
|
315 | - Display::return_icon($visibility_icon . '.png', get_lang('Visible'), '', ICON_SIZE_SMALL) . '</a>'; |
|
314 | + $modify_icons .= ' <a href="'.api_get_self().'?visibleeval='.$eval->get_id().'&'.$visibility_command.'=&selectcat='.$selectcat.'&'.$courseParams.' ">'. |
|
315 | + Display::return_icon($visibility_icon.'.png', get_lang('Visible'), '', ICON_SIZE_SMALL).'</a>'; |
|
316 | 316 | if (api_is_allowed_to_edit(null, true)) { |
317 | - $modify_icons .= ' <a href="gradebook_showlog_eval.php?visiblelog=' . $eval->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '">' . |
|
318 | - Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL) . '</a>'; |
|
317 | + $modify_icons .= ' <a href="gradebook_showlog_eval.php?visiblelog='.$eval->get_id().'&selectcat='.$selectcat.' &'.$courseParams.'">'. |
|
318 | + Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL).'</a>'; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | if ($is_locked && !api_is_platform_admin()) { |
322 | - $modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); |
|
322 | + $modify_icons .= ' '.Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); |
|
323 | 323 | } else { |
324 | - $modify_icons .= ' <a href="' . api_get_self() . '?deleteeval=' . $eval->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '" onclick="return confirmation();">' . |
|
325 | - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>'; |
|
324 | + $modify_icons .= ' <a href="'.api_get_self().'?deleteeval='.$eval->get_id().'&selectcat='.$selectcat.' &'.$courseParams.'" onclick="return confirmation();">'. |
|
325 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
326 | 326 | } |
327 | 327 | return $modify_icons; |
328 | 328 | } |
@@ -354,21 +354,21 @@ discard block |
||
354 | 354 | if ($is_locked && !api_is_platform_admin()) { |
355 | 355 | $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL); |
356 | 356 | } else { |
357 | - $modify_icons = '<a href="gradebook_edit_link.php?editlink=' . $link->get_id() . '&' . $courseParams.'">' . |
|
358 | - Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>'; |
|
357 | + $modify_icons = '<a href="gradebook_edit_link.php?editlink='.$link->get_id().'&'.$courseParams.'">'. |
|
358 | + Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>'; |
|
359 | 359 | } |
360 | - $modify_icons .= ' <a href="' . api_get_self() . '?visiblelink=' . $link->get_id() . '&' . $visibility_command . '=&selectcat=' . $selectcat . '&'.$courseParams. ' ">' . |
|
361 | - Display::return_icon($visibility_icon . '.png', get_lang('Visible'), '', ICON_SIZE_SMALL) . '</a>'; |
|
362 | - $modify_icons .= ' <a href="gradebook_showlog_link.php?visiblelink=' . $link->get_id() . '&selectcat=' . $selectcat . '&' . $courseParams. '">' . |
|
363 | - Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL) . '</a>'; |
|
360 | + $modify_icons .= ' <a href="'.api_get_self().'?visiblelink='.$link->get_id().'&'.$visibility_command.'=&selectcat='.$selectcat.'&'.$courseParams.' ">'. |
|
361 | + Display::return_icon($visibility_icon.'.png', get_lang('Visible'), '', ICON_SIZE_SMALL).'</a>'; |
|
362 | + $modify_icons .= ' <a href="gradebook_showlog_link.php?visiblelink='.$link->get_id().'&selectcat='.$selectcat.'&'.$courseParams.'">'. |
|
363 | + Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL).'</a>'; |
|
364 | 364 | |
365 | 365 | //If a work is added in a gradebook you can only delete the link in the work tool |
366 | 366 | |
367 | 367 | if ($is_locked && !api_is_platform_admin()) { |
368 | - $modify_icons .= ' ' . Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); |
|
368 | + $modify_icons .= ' '.Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL); |
|
369 | 369 | } else { |
370 | - $modify_icons .= ' <a href="' . api_get_self() . '?deletelink=' . $link->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '" onclick="return confirmation();">' . |
|
371 | - Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>'; |
|
370 | + $modify_icons .= ' <a href="'.api_get_self().'?deletelink='.$link->get_id().'&selectcat='.$selectcat.' &'.$courseParams.'" onclick="return confirmation();">'. |
|
371 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | return $modify_icons; |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | $sql = "SELECT * FROM $table l |
392 | 392 | WHERE |
393 | 393 | course_code = '$course_code' AND |
394 | - type = ".(int)$resource_type . " AND |
|
395 | - ref_id = " . (int)$resource_id; |
|
394 | + type = ".(int) $resource_type." AND |
|
395 | + ref_id = " . (int) $resource_id; |
|
396 | 396 | $res = Database::query($sql); |
397 | 397 | |
398 | 398 | if (Database::num_rows($res) < 1) { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | } |
416 | 416 | // TODO find the corresponding category (the first one for this course, ordered by ID) |
417 | 417 | $l = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
418 | - $sql = "SELECT * FROM $l WHERE id = " . (int) $link_id; |
|
418 | + $sql = "SELECT * FROM $l WHERE id = ".(int) $link_id; |
|
419 | 419 | $res = Database::query($sql); |
420 | 420 | $row = array(); |
421 | 421 | if (Database::num_rows($res) > 0) { |
@@ -433,10 +433,10 @@ discard block |
||
433 | 433 | { |
434 | 434 | $course_table = Database::get_main_table(TABLE_MAIN_COURSE); |
435 | 435 | $tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
436 | - $sql = 'SELECT c.id FROM ' . $course_table . ' c |
|
437 | - INNER JOIN ' . $tbl_grade_links . ' l |
|
436 | + $sql = 'SELECT c.id FROM '.$course_table.' c |
|
437 | + INNER JOIN ' . $tbl_grade_links.' l |
|
438 | 438 | ON c.code = l.course_code |
439 | - WHERE l.id=' . intval($id_link) . ' OR l.category_id=' . intval($id_link); |
|
439 | + WHERE l.id=' . intval($id_link).' OR l.category_id='.intval($id_link); |
|
440 | 440 | $res = Database::query($sql); |
441 | 441 | $array = Database::fetch_array($res, 'ASSOC'); |
442 | 442 | return $array['id']; |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | { |
546 | 546 | $result = Result :: load($resid); |
547 | 547 | if ($importscore > $eval_max) { |
548 | - header('Location: gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '&overwritemax='); |
|
548 | + header('Location: gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&overwritemax='); |
|
549 | 549 | exit; |
550 | 550 | } |
551 | 551 | $result[0]->set_score($importscore); |
@@ -589,8 +589,8 @@ discard block |
||
589 | 589 | { |
590 | 590 | $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
591 | 591 | $sql = 'SELECT COUNT(*) as count |
592 | - FROM ' . $table . ' gc |
|
593 | - WHERE gc.cat_id="' . intval($cat_id) . '" AND user_id="' . intval($user_id) . '" '; |
|
592 | + FROM ' . $table.' gc |
|
593 | + WHERE gc.cat_id="' . intval($cat_id).'" AND user_id="'.intval($user_id).'" '; |
|
594 | 594 | $rs_exist = Database::query($sql); |
595 | 595 | $row = Database::fetch_array($rs_exist); |
596 | 596 | if ($row['count'] == 0) { |
@@ -613,8 +613,8 @@ discard block |
||
613 | 613 | public static function get_certificate_by_user_id($cat_id, $user_id) |
614 | 614 | { |
615 | 615 | $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
616 | - $sql = 'SELECT * FROM ' . $table_certificate . ' |
|
617 | - WHERE cat_id="' . intval($cat_id) . '" AND user_id="' . intval($user_id) . '"'; |
|
616 | + $sql = 'SELECT * FROM '.$table_certificate.' |
|
617 | + WHERE cat_id="' . intval($cat_id).'" AND user_id="'.intval($user_id).'"'; |
|
618 | 618 | |
619 | 619 | $result = Database::query($sql); |
620 | 620 | $row = Database::fetch_array($result, 'ASSOC'); |
@@ -633,18 +633,18 @@ discard block |
||
633 | 633 | $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
634 | 634 | $table_user = Database::get_main_table(TABLE_MAIN_USER); |
635 | 635 | $sql = 'SELECT DISTINCT u.user_id, u.lastname, u.firstname, u.username |
636 | - FROM ' . $table_user . ' u |
|
637 | - INNER JOIN ' . $table_certificate . ' gc |
|
636 | + FROM ' . $table_user.' u |
|
637 | + INNER JOIN ' . $table_certificate.' gc |
|
638 | 638 | ON u.user_id=gc.user_id '; |
639 | 639 | if (!is_null($cat_id) && $cat_id > 0) { |
640 | - $sql.=' WHERE cat_id=' . intval($cat_id); |
|
640 | + $sql .= ' WHERE cat_id='.intval($cat_id); |
|
641 | 641 | } |
642 | 642 | if (!empty($userList)) { |
643 | 643 | $userList = array_map('intval', $userList); |
644 | 644 | $userListCondition = implode("','", $userList); |
645 | 645 | $sql .= " AND u.user_id IN ('$userListCondition')"; |
646 | 646 | } |
647 | - $sql.=' ORDER BY u.firstname'; |
|
647 | + $sql .= ' ORDER BY u.firstname'; |
|
648 | 648 | $rs = Database::query($sql); |
649 | 649 | |
650 | 650 | $list_users = array(); |
@@ -665,10 +665,10 @@ discard block |
||
665 | 665 | { |
666 | 666 | $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE); |
667 | 667 | $sql = 'SELECT gc.score_certificate, gc.created_at, gc.path_certificate, gc.cat_id, gc.user_id, gc.id |
668 | - FROM ' . $table_certificate . ' gc |
|
669 | - WHERE gc.user_id="' . intval($user_id) . '" '; |
|
668 | + FROM ' . $table_certificate.' gc |
|
669 | + WHERE gc.user_id="' . intval($user_id).'" '; |
|
670 | 670 | if (!is_null($cat_id) && $cat_id > 0) { |
671 | - $sql.=' AND cat_id=' . intval($cat_id); |
|
671 | + $sql .= ' AND cat_id='.intval($cat_id); |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | $rs = Database::query($sql); |
@@ -696,12 +696,12 @@ discard block |
||
696 | 696 | $variables = isset($content_html['variables']) ? $content_html['variables'] : null; |
697 | 697 | $contentHead = null; |
698 | 698 | |
699 | - $path_image = api_get_path(WEB_COURSE_PATH) . api_get_course_path($course_code) . '/document/images/gallery'; |
|
699 | + $path_image = api_get_path(WEB_COURSE_PATH).api_get_course_path($course_code).'/document/images/gallery'; |
|
700 | 700 | $new_content_html = str_replace('../images/gallery', $path_image, $new_content_html); |
701 | 701 | |
702 | - $path_image_in_default_course = api_get_path(WEB_CODE_PATH) . 'default_course_document'; |
|
702 | + $path_image_in_default_course = api_get_path(WEB_CODE_PATH).'default_course_document'; |
|
703 | 703 | $new_content_html = str_replace('/main/default_course_document', $path_image_in_default_course, $new_content_html); |
704 | - $new_content_html = str_replace(SYS_CODE_PATH . 'img/', api_get_path(WEB_IMG_PATH), $new_content_html); |
|
704 | + $new_content_html = str_replace(SYS_CODE_PATH.'img/', api_get_path(WEB_IMG_PATH), $new_content_html); |
|
705 | 705 | |
706 | 706 | $dom = new DOMDocument(); |
707 | 707 | $dom->loadHTML($new_content_html); |
@@ -750,9 +750,9 @@ discard block |
||
750 | 750 | $session_id = api_get_session_id(); |
751 | 751 | |
752 | 752 | $t = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY); |
753 | - $sql = "SELECT * FROM $t WHERE course_code = '" . Database::escape_string($course_code) . "' "; |
|
753 | + $sql = "SELECT * FROM $t WHERE course_code = '".Database::escape_string($course_code)."' "; |
|
754 | 754 | if (!empty($session_id)) { |
755 | - $sql .= " AND session_id = " . (int) $session_id; |
|
755 | + $sql .= " AND session_id = ".(int) $session_id; |
|
756 | 756 | } else { |
757 | 757 | $sql .= " AND (session_id IS NULL OR session_id = 0) "; |
758 | 758 | } |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | if (!empty($session_id)) { |
765 | 765 | $my_session_id = api_get_session_id(); |
766 | 766 | $s_name = api_get_session_name($my_session_id); |
767 | - $cat->set_name($course_code . ' - ' . get_lang('Session') . ' ' . $s_name); |
|
767 | + $cat->set_name($course_code.' - '.get_lang('Session').' '.$s_name); |
|
768 | 768 | $cat->set_session_id($session_id); |
769 | 769 | } else { |
770 | 770 | $cat->set_name($course_code); |
@@ -886,13 +886,13 @@ discard block |
||
886 | 886 | |
887 | 887 | if ($use_grade_model) { |
888 | 888 | if ($parent_id == 0) { |
889 | - $title = api_strtoupper(get_lang('Average')) . '<br />' . get_lang('Detailed'); |
|
889 | + $title = api_strtoupper(get_lang('Average')).'<br />'.get_lang('Detailed'); |
|
890 | 890 | } else { |
891 | - $title = api_strtoupper(get_lang('Average')) . '<br />' . $cat[0]->get_description() . ' - (' . $cat[0]->get_name() . ')'; |
|
891 | + $title = api_strtoupper(get_lang('Average')).'<br />'.$cat[0]->get_description().' - ('.$cat[0]->get_name().')'; |
|
892 | 892 | } |
893 | 893 | } else { |
894 | 894 | if ($parent_id == 0) { |
895 | - $title = api_strtoupper(get_lang('Average')) . '<br />' . get_lang('Detailed'); |
|
895 | + $title = api_strtoupper(get_lang('Average')).'<br />'.get_lang('Detailed'); |
|
896 | 896 | } else { |
897 | 897 | $title = api_strtoupper(get_lang('Average')); |
898 | 898 | } |
@@ -946,11 +946,11 @@ discard block |
||
946 | 946 | } else { |
947 | 947 | $column = 0; |
948 | 948 | $table->setCellContents($row, $column, get_lang('NoResults')); |
949 | - $table->updateCellAttributes($row, $column, 'colspan="' . $columns . '" align="center" class="row_odd"'); |
|
949 | + $table->updateCellAttributes($row, $column, 'colspan="'.$columns.'" align="center" class="row_odd"'); |
|
950 | 950 | } |
951 | 951 | |
952 | 952 | $pdfParams = array( |
953 | - 'filename' => get_lang('FlatView') . '_' . api_get_utc_datetime(), |
|
953 | + 'filename' => get_lang('FlatView').'_'.api_get_utc_datetime(), |
|
954 | 954 | 'pdf_title' => $title, |
955 | 955 | 'course_code' => $course_code, |
956 | 956 | 'add_signatures' => true |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | $a_students = array(); |
1036 | 1036 | while ($user = Database::fetch_array($result)) { |
1037 | 1037 | if (!array_key_exists($user['user_id'], $a_students)) { |
1038 | - $a_current_student = array (); |
|
1038 | + $a_current_student = array(); |
|
1039 | 1039 | $a_current_student[] = $user['user_id']; |
1040 | 1040 | $a_current_student[] = $user['username']; |
1041 | 1041 | $a_current_student[] = $user['lastname']; |
@@ -1093,7 +1093,7 @@ discard block |
||
1093 | 1093 | foreach ($links as $link) { |
1094 | 1094 | // links are always in a course |
1095 | 1095 | $coursecode = $link->get_course_code(); |
1096 | - if (!array_key_exists($coursecode,$coursecodes)) { |
|
1096 | + if (!array_key_exists($coursecode, $coursecodes)) { |
|
1097 | 1097 | $coursecodes[$coursecode] = '1'; |
1098 | 1098 | $users = array_merge($users, GradebookUtils::get_users_in_course($coursecode)); |
1099 | 1099 | } |
@@ -1106,7 +1106,7 @@ discard block |
||
1106 | 1106 | * Search students matching a given last name and/or first name |
1107 | 1107 | * @author Bert Steppé |
1108 | 1108 | */ |
1109 | - public static function find_students($mask= '') |
|
1109 | + public static function find_students($mask = '') |
|
1110 | 1110 | { |
1111 | 1111 | // students shouldn't be here // don't search if mask empty |
1112 | 1112 | if (!api_is_allowed_to_edit() || empty ($mask)) { |
@@ -1117,23 +1117,23 @@ discard block |
||
1117 | 1117 | $tbl_user = Database :: get_main_table(TABLE_MAIN_USER); |
1118 | 1118 | $tbl_cru = Database :: get_main_table(TABLE_MAIN_COURSE_USER); |
1119 | 1119 | $sql = 'SELECT DISTINCT user.user_id, user.lastname, user.firstname, user.email, user.official_code |
1120 | - FROM ' . $tbl_user . ' user'; |
|
1120 | + FROM ' . $tbl_user.' user'; |
|
1121 | 1121 | if (!api_is_platform_admin()) { |
1122 | - $sql .= ', ' . $tbl_cru . ' cru'; |
|
1122 | + $sql .= ', '.$tbl_cru.' cru'; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | - $sql .= ' WHERE user.status = ' . STUDENT; |
|
1126 | - $sql .= ' AND (user.lastname LIKE '."'%" . $mask . "%'"; |
|
1127 | - $sql .= ' OR user.firstname LIKE '."'%" . $mask . "%')"; |
|
1125 | + $sql .= ' WHERE user.status = '.STUDENT; |
|
1126 | + $sql .= ' AND (user.lastname LIKE '."'%".$mask."%'"; |
|
1127 | + $sql .= ' OR user.firstname LIKE '."'%".$mask."%')"; |
|
1128 | 1128 | |
1129 | 1129 | if (!api_is_platform_admin()) { |
1130 | 1130 | $sql .= ' AND user.user_id = cru.user_id AND |
1131 | 1131 | cru.relation_type <> '.COURSE_RELATION_TYPE_RRHH.' AND |
1132 | 1132 | cru.c_id in ( |
1133 | - SELECT c_id FROM '.$tbl_cru . ' |
|
1133 | + SELECT c_id FROM '.$tbl_cru.' |
|
1134 | 1134 | WHERE |
1135 | - user_id = ' . api_get_user_id() . ' AND |
|
1136 | - status = ' . COURSEMANAGER . ' |
|
1135 | + user_id = ' . api_get_user_id().' AND |
|
1136 | + status = ' . COURSEMANAGER.' |
|
1137 | 1137 | ) |
1138 | 1138 | '; |
1139 | 1139 | } |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | $sql = 'SELECT ref_id FROM '.$table_link.' |
1178 | 1178 | WHERE id = '.$linkId.' AND type='.LINK_ATTENDANCE; |
1179 | 1179 | |
1180 | - $rs_attendance = Database::query($sql); |
|
1180 | + $rs_attendance = Database::query($sql); |
|
1181 | 1181 | if (Database::num_rows($rs_attendance) > 0) { |
1182 | 1182 | $row_attendance = Database::fetch_array($rs_attendance); |
1183 | 1183 | $sql = 'UPDATE '.$tbl_attendance.' SET attendance_weight ='.$weight.' |
@@ -1272,7 +1272,7 @@ discard block |
||
1272 | 1272 | 'course' => $courseInfo['title'], |
1273 | 1273 | 'score' => $certificateInfo['score_certificate'], |
1274 | 1274 | 'date' => api_format_date($certificateInfo['created_at'], DATE_FORMAT_SHORT), |
1275 | - 'link' => api_get_path(WEB_PATH) . "certificates/index.php?id={$certificateInfo['id']}" |
|
1275 | + 'link' => api_get_path(WEB_PATH)."certificates/index.php?id={$certificateInfo['id']}" |
|
1276 | 1276 | ]; |
1277 | 1277 | } |
1278 | 1278 | |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | 'course' => $course['title'], |
1337 | 1337 | 'score' => $certificateInfo['score_certificate'], |
1338 | 1338 | 'date' => api_format_date($certificateInfo['created_at'], DATE_FORMAT_SHORT), |
1339 | - 'link' => api_get_path(WEB_PATH) . "certificates/index.php?id={$certificateInfo['id']}" |
|
1339 | + 'link' => api_get_path(WEB_PATH)."certificates/index.php?id={$certificateInfo['id']}" |
|
1340 | 1340 | ]; |
1341 | 1341 | } |
1342 | 1342 | } |