From 2cff6d9eb85034b367292460b415187b53131c22 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 18 Dec 2018 10:21:52 +0100 Subject: [PATCH] Minor - format code --- main/auth/courses.php | 3 +-- main/gradebook/gradebook_display_summary.php | 17 ++++++----------- main/gradebook/lib/GradebookUtils.php | 1 + 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/main/auth/courses.php b/main/auth/courses.php index feea52bdb8..dffcfd5975 100755 --- a/main/auth/courses.php +++ b/main/auth/courses.php @@ -30,10 +30,9 @@ if (api_get_setting('course_catalog_published') !== 'true') { } // For students +$user_can_view_page = true; if (api_get_setting('allow_students_to_browse_courses') === 'false') { $user_can_view_page = false; -} else { - $user_can_view_page = true; } //For teachers/admins diff --git a/main/gradebook/gradebook_display_summary.php b/main/gradebook/gradebook_display_summary.php index 8941588b7f..9c4f7e9ebe 100644 --- a/main/gradebook/gradebook_display_summary.php +++ b/main/gradebook/gradebook_display_summary.php @@ -30,10 +30,6 @@ $userList = CourseManager::get_user_list_from_course_code( switch ($action) { case 'export_all': - $params = []; - $pdf = new PDF('A4', 'P', $params); - - $pdfList = []; $cats = Category::load($cat_id, null, null, null, null, null, false); $studentList = CourseManager::get_user_list_from_course_code( api_get_course_id(), @@ -44,7 +40,6 @@ switch ($action) { ); $tpl = new Template('', false, false, false); - $courseInfo = api_get_course_info(); $params = [ 'pdf_title' => sprintf(get_lang('GradeFromX'), $courseInfo['name']), @@ -56,22 +51,22 @@ switch ($action) { 'show_grade_generated_date' => true, 'show_real_course_teachers' => false, 'show_teacher_as_myself' => false, + 'orientation' => 'P', ]; - $pdf = new PDF('A4', $params['orientation'], $params, $tpl); - + $htmlList = []; foreach ($userList as $index => $value) { - $pdfList[] = GradebookUtils::generateTable( + $htmlList[] = GradebookUtils::generateTable( $value['user_id'], $cats, - false, + true, true, $studentList, $pdf ); } - if (!empty($pdfList)) { + if (!empty($htmlList)) { // Print certificates (without the common header/footer/watermark // stuff) and return as one multiple-pages PDF /*$address = api_get_setting('institution_address'); @@ -80,7 +75,7 @@ switch ($action) { $pdf->custom_header = array('html' => "
$address
$phone
");*/ // stuff) and return as one multiple-pages PDF $pdf->html_to_pdf( - $pdfList, + $htmlList, null, null, false, diff --git a/main/gradebook/lib/GradebookUtils.php b/main/gradebook/lib/GradebookUtils.php index 30c70aa4ba..27e345a026 100644 --- a/main/gradebook/lib/GradebookUtils.php +++ b/main/gradebook/lib/GradebookUtils.php @@ -1618,6 +1618,7 @@ class GradebookUtils $loadStats = [2]; } } + $gradebooktable = new GradebookTable( $cat, $allcat,