Skip to content

Commit

Permalink
v1.5.10
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Sep 23, 2022
1 parent b72deb2 commit a1fa7e4
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 15 deletions.
5 changes: 5 additions & 0 deletions ATL/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,8 @@
++$count;
$sql[$count][0] = '1.5.09';
$sql[$count][1] = '';

//v1.5.10
++$count;
$sql[$count][0] = '1.5.10';
$sql[$count][1] = '';
5 changes: 5 additions & 0 deletions ATL/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
CHANGELOG
=========
v1.5.10
-------
Fixed visualization showing data that has not gone live
Added a Go Live date reminder to the Write ATL page

v1.5.09
-------
Fixed student and parent PHP dashboard warning and exception
Expand Down
6 changes: 5 additions & 1 deletion ATL/atl_write_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
$form->addRow()->addHeading(__('Students'));
$form->addRow()->addAlert(__('There are no records to display.'), 'error');
} else {
$table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth colorOddEven noMargin noPadding noBorder');
$table = $form->addRow()->setClass('p-0')->addTable()->setClass('smallIntBorder fullWidth colorOddEven noMargin noPadding noBorder');

$completeText = !empty($values['completeDate'])? __('Marked on').' '.Format::date($values['completeDate']) : __('Unmarked');

Expand Down Expand Up @@ -170,6 +170,10 @@
$row->addLabel('completeDate', __('Go Live Date'))->prepend('1. ')->append('<br/>'.__('2. Column is hidden until date is reached.'));
$row->addDate('completeDate');

if (!empty($values['completeDate']) && $values['completeDate'] > date('Y-m-d', strtotime('+1 day'))) {
$row = $form->addRow()->addAlert(__m('Your Go Live date is more than 24 hours in the future. If you have completed this ATL, be sure to update your Go Live date to set it to the next school day.'), 'message');
}

$row = $form->addRow();
$row->addSubmit();

Expand Down
2 changes: 1 addition & 1 deletion ATL/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL = 'atl_write.php';
$type = 'Additional';
$category = 'Assess';
$version = '1.5.09';
$version = '1.5.10';
$author = 'Ross Parker';
$url = 'http://rossparker.org';

Expand Down
19 changes: 8 additions & 11 deletions ATL/moduleFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
use Gibbon\Contracts\Services\Session;

function getATLRecord($guid, $connection2, $gibbonPersonID) {
global $session;
global $session, $container;

require_once $session->get('absolutePath').'/modules/ATL/src/Domain/ATLColumnGateway.php';

$atlColumnGateway = $container->get(ATLColumnGateway::class);

$output = '';

Expand All @@ -49,16 +53,9 @@ function getATLRecord($guid, $connection2, $gibbonPersonID) {
$results = false;
while ($rowYears = $resultYears->fetch()) {
//Get and output ATLs
try {
$dataATL = array('gibbonPersonID1' => $gibbonPersonID, 'gibbonPersonID2' => $gibbonPersonID, 'gibbonSchoolYearID' => $rowYears['gibbonSchoolYearID']);
$sqlATL = "SELECT DISTINCT atlColumn.*, atlEntry.*, gibbonCourse.name AS course, gibbonCourseClass.nameShort AS class, gibbonPerson.dateStart FROM gibbonCourse JOIN gibbonCourseClass ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID) JOIN gibbonCourseClassPerson ON (gibbonCourseClassPerson.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN atlColumn ON (atlColumn.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN atlEntry ON (atlEntry.atlColumnID=atlColumn.atlColumnID) JOIN gibbonPerson ON (atlEntry.gibbonPersonIDStudent=gibbonPerson.gibbonPersonID) WHERE gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID1 AND atlEntry.gibbonPersonIDStudent=:gibbonPersonID2 AND gibbonSchoolYearID=:gibbonSchoolYearID AND completeDate<='".date('Y-m-d')."' AND gibbonCourseClass.reportable='Y' AND gibbonCourseClassPerson.reportable='Y' ORDER BY completeDate DESC, gibbonCourse.nameShort, gibbonCourseClass.nameShort";
$resultATL = $connection2->prepare($sqlATL);
$resultATL->execute($dataATL);
} catch (PDOException $e) {
$output .= "<div class='error'>".$e->getMessage().'</div>';
}
$entries = $atlColumnGateway->selectATLEntriesByStudent($rowYears['gibbonSchoolYearID'], $gibbonPersonID)->fetchAll();

if ($resultATL->rowCount() > 0) {
if (!empty($entries)) {
$results = true;
$output .= '<h4>';
$output .= $rowYears['name'];
Expand All @@ -75,7 +72,7 @@ function getATLRecord($guid, $connection2, $gibbonPersonID) {
$output .= '</tr>';

$count = 0;
while ($rowATL = $resultATL->fetch()) {
foreach ($entries as $rowATL) {
if ($count % 2 == 0) {
$rowNum = 'even';
} else {
Expand Down
31 changes: 30 additions & 1 deletion ATL/src/Domain/ATLColumnGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ATLColumnGateway extends QueryableGateway

public function getATLRubricByStudent($gibbonSchoolYearID, $gibbonPersonID)
{
$data = array('gibbonSchoolYearID' => $gibbonSchoolYearID, 'gibbonPersonID' => $gibbonPersonID);
$data = array('gibbonSchoolYearID' => $gibbonSchoolYearID, 'gibbonPersonID' => $gibbonPersonID, 'today' => date('Y-m-d'));
$sql = "SELECT
gibbonPerson.gibbonPersonID,
surname,
Expand All @@ -38,11 +38,40 @@ public function getATLRubricByStudent($gibbonSchoolYearID, $gibbonPersonID)
WHERE status='Full'
AND gibbonStudentEnrolment.gibbonSchoolYearID=:gibbonSchoolYearID
AND gibbonPerson.gibbonPersonID=:gibbonPersonID
AND atlColumn.completeDate<=:today
AND gibbonCourseClassPerson.role='Student'
AND gibbonCourseClass.reportable='Y'
AND gibbonCourseClassPerson.reportable='Y'
ORDER BY surname, preferredName
LIMIT 0, 1";

return $this->db()->selectOne($sql, $data);
}

public function selectATLEntriesByStudent($gibbonSchoolYearID, $gibbonPersonID)
{
$data = ['gibbonPersonID' => $gibbonPersonID, 'gibbonSchoolYearID' => $gibbonSchoolYearID, 'today' => date('Y-m-d')];
$sql = "SELECT DISTINCT
atlColumn.*,
atlEntry.*,
gibbonCourse.name AS course,
gibbonCourseClass.nameShort AS class,
gibbonPerson.dateStart
FROM gibbonCourse
JOIN gibbonCourseClass ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID)
JOIN gibbonCourseClassPerson ON (gibbonCourseClassPerson.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN atlColumn ON (atlColumn.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID)
JOIN atlEntry ON (atlEntry.atlColumnID=atlColumn.atlColumnID)
JOIN gibbonPerson ON (atlEntry.gibbonPersonIDStudent=gibbonPerson.gibbonPersonID)
WHERE gibbonCourseClassPerson.gibbonPersonID=:gibbonPersonID
AND atlEntry.gibbonPersonIDStudent=:gibbonPersonID
AND gibbonSchoolYearID=:gibbonSchoolYearID
AND atlColumn.completeDate<=:today
AND gibbonCourseClassPerson.role='Student'
AND gibbonCourseClass.reportable='Y'
AND gibbonCourseClassPerson.reportable='Y'
ORDER BY atlColumn.completeDate DESC, gibbonCourse.nameShort, gibbonCourseClass.nameShort";

return $this->db()->select($sql, $data);
}

}
2 changes: 1 addition & 1 deletion ATL/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
/**
* Sets version information.
*/
$moduleVersion = '1.5.09';
$moduleVersion = '1.5.10';
$coreVersion = '23.0.00';

0 comments on commit a1fa7e4

Please sign in to comment.