Skip to content

Commit

Permalink
v1.5.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Parker committed Nov 2, 2021
1 parent 2d9294c commit 105afad
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 66 deletions.
5 changes: 5 additions & 0 deletions ATL/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,8 @@
++$count;
$sql[$count][0] = '1.5.03';
$sql[$count][1] = '';

//v1.5.04
++$count;
$sql[$count][0] = '1.5.04';
$sql[$count][1] = '';
4 changes: 4 additions & 0 deletions ATL/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CHANGELOG
=========
v1.5.04
-------
Removed deprecated function calls

v1.5.03
-------
Finished session variable refactoring
Expand Down
4 changes: 0 additions & 4 deletions ATL/atl_manage_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@
->add(__('Manage {courseClass} ATLs', ['courseClass' => $class['course'].'.'.$class['class']]), 'atl_manage.php', ['gibbonCourseClassID' => $gibbonCourseClassID])
->add(__('Add Multiple Columns'));

if (isset($_GET['return'])) {
returnProcess($guid, $_GET['return'], null, null);
}

$form = Form::create('ATL', $session->get('absoluteURL').'/modules/ATL/atl_manage_addProcess.php?gibbonCourseClassID='.$gibbonCourseClassID.'&address='.$session->get('address'));
$form->addHiddenValue('address', $session->get('address'));

Expand Down
5 changes: 3 additions & 2 deletions ATL/atl_manage_addProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

include '../../gibbon.php';
use Gibbon\Services\Format;

include '../../gibbon.php';

$gibbonCourseClassID = $_GET['gibbonCourseClassID'];
$URL = $session->get('absoluteURL').'/index.php?q=/modules/'.getModuleName($_GET['address'])."/atl_manage_add.php&gibbonCourseClassID=$gibbonCourseClassID";
Expand Down Expand Up @@ -47,7 +48,7 @@
$completeDate = null;
$complete = 'N';
} else {
$completeDate = dateConvert($guid, $completeDate);
$completeDate = Format::date($completeDate);
$complete = 'Y';
}
$gibbonPersonIDCreator = $session->get('gibbonPersonID');
Expand Down
4 changes: 0 additions & 4 deletions ATL/atl_manage_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@
->add(__('Manage {courseClass} ATLs', ['courseClass' => $row['course'].'.'.$row['class']]), 'atl_manage.php', ['gibbonCourseClassID' => $gibbonCourseClassID])
->add(__('Delete Column'));

if (isset($_GET['return'])) {
returnProcess($guid, $_GET['return'], null, null);
}

$form = DeleteForm::createForm($session->get('absoluteURL').'/modules/'.$session->get('module').'/atl_manage_deleteProcess.php?atlColumnID='.$atlColumnID);
$form->addHiddenValue('gibbonCourseClassID', $gibbonCourseClassID);
echo $form->getOutput();
Expand Down
4 changes: 0 additions & 4 deletions ATL/atl_manage_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@
->add(__('Manage {courseClass} ATLs', ['courseClass' => $class['course'].'.'.$class['class']]), 'atl_manage.php', ['gibbonCourseClassID' => $gibbonCourseClassID])
->add(__('Edit Column'));

if (isset($_GET['return'])) {
returnProcess($guid, $_GET['return'], null, null);
}

$form = Form::create('ATL', $session->get('absoluteURL').'/modules/ATL/atl_manage_editProcess.php?atlColumnID='.$atlColumnID.'&gibbonCourseClassID='.$gibbonCourseClassID.'&address='.$session->get('address'));
$form->addHiddenValue('address', $session->get('address'));

Expand Down
5 changes: 3 additions & 2 deletions ATL/atl_manage_editProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

include '../../gibbon.php';
use Gibbon\Services\Format;

include '../../gibbon.php';

$gibbonCourseClassID = $_GET['gibbonCourseClassID'];
$atlColumnID = $_GET['atlColumnID'];
Expand Down Expand Up @@ -74,7 +75,7 @@
$completeDate = null;
$complete = 'N';
} else {
$completeDate = dateConvert($guid, $completeDate);
$completeDate = Format::date($completeDate);
$complete = 'Y';
}
$gibbonPersonIDLastEdit = $session->get('gibbonPersonID');
Expand Down
9 changes: 6 additions & 3 deletions ATL/atl_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use Gibbon\Forms\DatabaseFormFactory;

use Gibbon\Forms\Form;
use Gibbon\Services\Format;
use Gibbon\Forms\DatabaseFormFactory;
use Gibbon\Domain\System\SettingGateway;

//Module includes
include './modules/'.$session->get('module').'/moduleFunctions.php';
Expand Down Expand Up @@ -149,8 +151,9 @@
echo $form->getOutput();
}

$showParentAttainmentWarning = getSettingByScope($connection2, 'Markbook', 'showParentAttainmentWarning');
$showParentEffortWarning = getSettingByScope($connection2, 'Markbook', 'showParentEffortWarning');
$settingGateway = $container->get(SettingGateway::class);
$showParentAttainmentWarning = $settingGateway->getSettingByScope('Markbook', 'showParentAttainmentWarning');
$showParentEffortWarning = $settingGateway->getSettingByScope('Markbook', 'showParentEffortWarning');

if (!empty($gibbonPersonID) and count($options) > 0) {
//Confirm access to this student
Expand Down
20 changes: 10 additions & 10 deletions ATL/atl_write.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

use Gibbon\Services\Format;
use Gibbon\Domain\System\SettingGateway;

//Module includes
include './modules/'.$session->get('module').'/moduleFunctions.php';
Expand Down Expand Up @@ -278,15 +279,14 @@
$title .= __(substr($externalAssessmentFields[3], (strpos($externalAssessmentFields[3], '_') + 1))).' | ';
$title .= __($externalAssessmentFields[1]);

//Get PAS
$PAS = getSettingByScope($connection2, 'System', 'primaryAssessmentScale');
try {
$dataPAS = array('gibbonScaleID' => $PAS);
$sqlPAS = 'SELECT * FROM gibbonScale WHERE gibbonScaleID=:gibbonScaleID';
$resultPAS = $connection2->prepare($sqlPAS);
$resultPAS->execute($dataPAS);
} catch (PDOException $e) {
}
//Get PAS
$PAS = $container->get(SettingGateway::class)->getSettingByScope('System', 'primaryAssessmentScale');

$dataPAS = array('gibbonScaleID' => $PAS);
$sqlPAS = 'SELECT * FROM gibbonScale WHERE gibbonScaleID=:gibbonScaleID';
$resultPAS = $connection2->prepare($sqlPAS);
$resultPAS->execute($dataPAS);

if ($resultPAS->rowCount() == 1) {
$rowPAS = $resultPAS->fetch();
$title .= ' | '.$rowPAS['name'].' '.__('Scale').' ';
Expand Down Expand Up @@ -322,7 +322,7 @@
echo "<span title='".htmlPrep($row['description'])."'>".$row['name'].'</span><br/>';
echo "<span style='font-size: 90%; font-style: italic; font-weight: normal'>";
if ($row['completeDate'] != '') {
echo __('Marked on').' '.dateConvertBack($guid, $row['completeDate']).'<br/>';
echo __('Marked on').' '.Format::date($row['completeDate']).'<br/>';
} else {
echo __('Unmarked').'<br/>';
}
Expand Down
6 changes: 1 addition & 5 deletions ATL/atl_write_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@
->add(__('Write {courseClass} ATLs', ['courseClass' => $class['course'].'.'.$class['class']]), 'atl_write.php', ['gibbonCourseClassID' => $gibbonCourseClassID])
->add(__('Enter ATL Results'));

if (isset($_GET['return'])) {
returnProcess($guid, $_GET['return'], null, null);
}

$data = array('gibbonCourseClassID' => $gibbonCourseClassID, 'atlColumnID' => $atlColumnID, 'today' => date('Y-m-d'));
$sql = "SELECT gibbonPerson.gibbonPersonID, gibbonPerson.title, gibbonPerson.surname, gibbonPerson.preferredName, gibbonPerson.dateStart, atlEntry.*
FROM gibbonCourseClassPerson
Expand All @@ -124,7 +120,7 @@
} else {
$table = $form->addRow()->addTable()->setClass('smallIntBorder fullWidth colorOddEven noMargin noPadding noBorder');

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

$header = $table->addHeaderRow();
$header->addTableCell(__('Student'))->rowSpan(2);
Expand Down
5 changes: 3 additions & 2 deletions ATL/atl_write_dataProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

include '../../gibbon.php';
use Gibbon\Services\Format;

include '../../gibbon.php';

$gibbonCourseClassID = $_GET['gibbonCourseClassID'];
$atlColumnID = $_GET['atlColumnID'];
Expand Down Expand Up @@ -109,7 +110,7 @@
$completeDate = null;
$complete = 'N';
} else {
$completeDate = dateConvert($guid, $completeDate);
$completeDate = Format::dateConvert($completeDate);
$complete = 'Y';
}
try {
Expand Down
50 changes: 25 additions & 25 deletions ATL/cli/goLiveNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,38 +40,38 @@
echo __('This script cannot be run from a browser, only via CLI.')."\n\n";
} else {
//SCAN THROUGH ALL ATLS GOING LIVE TODAY
try {
$data = array('completeDate' => date('Y-m-d'));
$sql = 'SELECT atlColumn.*, gibbonCourseClass.nameShort AS class, gibbonCourse.nameShort AS course FROM atlColumn JOIN gibbonCourseClass ON (atlColumn.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID) WHERE completeDate=:completeDate';
$result = $connection2->prepare($sql);
$result->execute($data);
} catch (PDOException $e) {
}

$data = array('completeDate' => date('Y-m-d'));
$sql = 'SELECT atlColumn.*, gibbonCourseClass.nameShort AS class, gibbonCourse.nameShort AS course FROM atlColumn JOIN gibbonCourseClass ON (atlColumn.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID) JOIN gibbonCourse ON (gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID) WHERE completeDate=:completeDate';
$result = $connection2->prepare($sql);
$result->execute($data);

while ($row = $result->fetch()) {
try {
$dataPerson = array('gibbonCourseClassID' => $row['gibbonCourseClassID'], 'today' => date('Y-m-d'));
$sqlPerson = "SELECT gibbonCourseClassPerson.*
FROM gibbonCourseClassPerson
JOIN gibbonPerson ON (gibbonCourseClassPerson.gibbonPersonID=gibbonPerson.gibbonPersonID)
JOIN gibbonCourseClass ON (gibbonCourseClassPerson.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID)
WHERE (role='Teacher' OR role='Assistant' OR role='Student')
AND gibbonCourseClassPerson.gibbonCourseClassID=:gibbonCourseClassID
AND gibbonPerson.status='Full' AND (dateStart IS NULL OR dateStart<=:today) AND (dateEnd IS NULL OR dateEnd>=:today)
AND gibbonCourseClass.reportable='Y'
AND gibbonCourseClassPerson.reportable='Y'";
$resultPerson = $connection2->prepare($sqlPerson);
$resultPerson->execute($dataPerson);
} catch (PDOException $e) {
}
$dataPerson = array('gibbonCourseClassID' => $row['gibbonCourseClassID'], 'today' => date('Y-m-d'));
$sqlPerson = "SELECT gibbonCourseClassPerson.*
FROM gibbonCourseClassPerson
JOIN gibbonPerson ON (gibbonCourseClassPerson.gibbonPersonID=gibbonPerson.gibbonPersonID)
JOIN gibbonCourseClass ON (gibbonCourseClassPerson.gibbonCourseClassID=gibbonCourseClass.gibbonCourseClassID)
WHERE (role='Teacher' OR role='Assistant' OR role='Student')
AND gibbonCourseClassPerson.gibbonCourseClassID=:gibbonCourseClassID
AND gibbonPerson.status='Full' AND (dateStart IS NULL OR dateStart<=:today) AND (dateEnd IS NULL OR dateEnd>=:today)
AND gibbonCourseClass.reportable='Y'
AND gibbonCourseClassPerson.reportable='Y'";
$resultPerson = $connection2->prepare($sqlPerson);
$resultPerson->execute($dataPerson);

$notificationGateway = new \Gibbon\Domain\System\NotificationGateway($pdo);

while ($rowPerson = $resultPerson->fetch()) {
if ($rowPerson['role'] == 'Teacher' || $rowPerson['role'] == 'Assistant') {
$notificationSender = new \Gibbon\Comms\NotificationSender($notificationGateway, $session);
$notificationText = sprintf(__('Your ATL column for class %1$s has gone live today.'), $row['course'].'.'.$row['class']);
setNotification($connection2, $guid, $rowPerson['gibbonPersonID'], $notificationText, 'ATL', '/index.php?q=/modules/ATL/atl_write.php&gibbonCourseClassID='.$row['gibbonCourseClassID']);
$notificationSender->addNotification($rowPerson['gibbonPersonID'], $notificationText, 'ATL', '/index.php?q=/modules/ATL/atl_write.php&gibbonCourseClassID='.$row['gibbonCourseClassID']);
$notificationSender->sendNotifications();
} else {
$notificationSender = new \Gibbon\Comms\NotificationSender($notificationGateway, $session);
$notificationText = sprintf(__('You have new ATL assessment feedback for class %1$s.'), $row['course'].'.'.$row['class']);
setNotification($connection2, $guid, $rowPerson['gibbonPersonID'], $notificationText, 'ATL', '/index.php?q=/modules/ATL/atl_view.php');
$notificationSender->addNotification($rowPerson['gibbonPersonID'], $notificationText, 'ATL', '/index.php?q=/modules/ATL/atl_view.php');
$notificationSender->sendNotifications();
}
}
}
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.03';
$version = '1.5.04';
$author = 'Ross Parker';
$url = 'http://rossparker.org';

Expand Down
7 changes: 4 additions & 3 deletions ATL/moduleFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
*/

use Gibbon\Forms\Form;
use Gibbon\Services\Format;
use Gibbon\Forms\DatabaseFormFactory;

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

$output = '';

//Get school years in reverse order
Expand Down Expand Up @@ -82,7 +83,7 @@ function getATLRecord($guid, $connection2, $gibbonPersonID) {
$output .= "<span title='".htmlPrep($rowATL['description'])."'><b><u>".$rowATL['course'].'<br/>'.$rowATL['name'].'</u></b></span><br/>';
$output .= "<span style='font-size: 90%; font-style: italic; font-weight: normal'>";
if ($rowATL['completeDate'] != '') {
$output .= 'Marked on '.dateConvertBack($guid, $rowATL['completeDate']).'<br/>';
$output .= 'Marked on '.Format::date($rowATL['completeDate']).'<br/>';
} else {
$output .= 'Unmarked<br/>';
}
Expand Down Expand Up @@ -116,7 +117,7 @@ function getATLRecord($guid, $connection2, $gibbonPersonID) {

function sidebarExtra($guid, $connection2, $gibbonCourseClassID, $mode = 'manage', $highestAction = '') {
global $pdo, $session;

$output = '';

$output .= '<div class="column-no-break">';
Expand Down
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.03';
$moduleVersion = '1.5.04';
$coreVersion = '22.0.00';

0 comments on commit 105afad

Please sign in to comment.