From 93b47e88aad220cd05eb024d81127f73cfe5073e Mon Sep 17 00:00:00 2001 From: Ross Parker <> Date: Fri, 30 Jun 2023 10:23:16 +0800 Subject: [PATCH] v5.22.01 --- Free Learning/CHANGEDB.php | 5 +++++ Free Learning/CHANGELOG.txt | 4 ++++ Free Learning/hook_parentalDashboard_unitHistory.php | 2 +- Free Learning/hook_studentDashboard_unitHistory.php | 4 +++- Free Learning/manifest.php | 2 +- Free Learning/src/Tables/UnitHistory.php | 4 ---- Free Learning/version.php | 2 +- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Free Learning/CHANGEDB.php b/Free Learning/CHANGEDB.php index 486b23a..09cc63c 100644 --- a/Free Learning/CHANGEDB.php +++ b/Free Learning/CHANGEDB.php @@ -2235,3 +2235,8 @@ $sql[$count][0] = '5.22.00'; $sql[$count][1] = " INSERT INTO `gibbonSetting` (`gibbonSettingID` ,`scope` ,`name` ,`nameDisplay` ,`description` ,`value`) VALUES (NULL , 'Free Learning', 'unitHistoryChart', 'Unit History Chart', 'Which chart type should be used in the Unit History table?', 'Doughnut');end"; + +//v5.22.01 +++$count; +$sql[$count][0] = '5.22.01'; +$sql[$count][1] = ""; diff --git a/Free Learning/CHANGELOG.txt b/Free Learning/CHANGELOG.txt index d116b32..ebf10a4 100644 --- a/Free Learning/CHANGELOG.txt +++ b/Free Learning/CHANGELOG.txt @@ -1,5 +1,9 @@ CHANGELOG ========= +v5.22.01 +-------- +Restricted parent and student dashboard hooks to current year's data + v5.22.00 -------- Added Unit History chart option diff --git a/Free Learning/hook_parentalDashboard_unitHistory.php b/Free Learning/hook_parentalDashboard_unitHistory.php index fce9cbf..ca63a62 100644 --- a/Free Learning/hook_parentalDashboard_unitHistory.php +++ b/Free Learning/hook_parentalDashboard_unitHistory.php @@ -54,7 +54,7 @@ $page->scripts->add('chart'); $page->stylesheets->add('module-freeLearning', 'modules/Free Learning/css/module.css'); - $returnInt .= $container->get(UnitHistory::class)->create($gibbonPersonID, true, $canBrowse, $disableParentEvidence); + $returnInt .= $container->get(UnitHistory::class)->create($gibbonPersonID, true, $canBrowse, $disableParentEvidence, $session->get('gibbonSchoolYearID')); } return $returnInt; diff --git a/Free Learning/hook_studentDashboard_unitHistory.php b/Free Learning/hook_studentDashboard_unitHistory.php index d0826b6..d242035 100644 --- a/Free Learning/hook_studentDashboard_unitHistory.php +++ b/Free Learning/hook_studentDashboard_unitHistory.php @@ -32,6 +32,8 @@ $returnInt .= __('You do not have access to this action.'); $returnInt .= ''; } else { + $canBrowse = isActionAccessible($guid, $connection2, '/modules/Free Learning/units_browse.php'); + $returnInt .= "

"; $returnInt .= sprintf(__m('%1$sView Showcase of Student Work%2$s'), "", ''); $returnInt .= sprintf(__m('%1$sBrowse Units%2$s'), "", ''); @@ -48,7 +50,7 @@ $page->scripts->add('chart'); $page->stylesheets->add('module-freeLearning', 'modules/Free Learning/css/module.css'); - $returnInt .= $container->get(UnitHistory::class)->create($gibbonPersonID, true); + $returnInt .= $container->get(UnitHistory::class)->create($gibbonPersonID, true, $canBrowse, false, $session->get('gibbonSchoolYearID')); } return $returnInt; diff --git a/Free Learning/manifest.php b/Free Learning/manifest.php index 4adb5b7..957ff21 100644 --- a/Free Learning/manifest.php +++ b/Free Learning/manifest.php @@ -25,7 +25,7 @@ $entryURL = 'units_browse.php'; $type = 'Additional'; $category = 'Learn'; -$version = '5.22.00'; +$version = '5.22.01'; $author = 'Ross Parker'; $url = 'http://rossparker.org/free-learning'; diff --git a/Free Learning/src/Tables/UnitHistory.php b/Free Learning/src/Tables/UnitHistory.php index 6902518..6b8360f 100644 --- a/Free Learning/src/Tables/UnitHistory.php +++ b/Free Learning/src/Tables/UnitHistory.php @@ -52,10 +52,6 @@ public function create($gibbonPersonID, $summary = false, $canBrowse = true, $di ->sortBy(['freeLearningUnitStudent.status', 'freeLearningUnit.name']) ->fromPOST('unitHistory'); - if ($summary) { - $criteria->pageSize(8); - } - $units = $this->unitStudentGateway->queryUnitsByStudent($criteria, $gibbonPersonID, $gibbonSchoolYearID, $dateStart, $dateEnd); $flCourses = $this->unitStudentGateway->selectCoursesByStudent($gibbonPersonID, $gibbonSchoolYearID)->fetchGroupedUnique(); diff --git a/Free Learning/version.php b/Free Learning/version.php index 4790f48..e3cded2 100755 --- a/Free Learning/version.php +++ b/Free Learning/version.php @@ -20,5 +20,5 @@ /** * Sets version information. */ -$moduleVersion = '5.22.00'; +$moduleVersion = '5.22.01'; $coreVersion = '24.0.00';