Skip to content

Commit

Permalink
v5.21.15
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Parker committed Apr 8, 2023
1 parent e87ba7d commit b5a9b6f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Free Learning/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -2204,3 +2204,8 @@
++$count;
$sql[$count][0] = '5.21.14';
$sql[$count][1] = "";

//v5.21.15
++$count;
$sql[$count][0] = '5.21.15';
$sql[$count][1] = "";
4 changes: 4 additions & 0 deletions Free Learning/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CHANGELOG
=========
v5.21.15
--------
Added Term filter to My Unit History

v5.21.14
--------
Added notifications for collaborators of enrolling learner
Expand Down
2 changes: 1 addition & 1 deletion Free Learning/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL = 'units_browse.php';
$type = 'Additional';
$category = 'Learn';
$version = '5.21.14';
$version = '5.21.15';
$author = 'Ross Parker';
$url = 'http://rossparker.org/free-learning';

Expand Down
35 changes: 31 additions & 4 deletions Free Learning/report_unitHistory_my.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

use Gibbon\Forms\Form;
use Gibbon\Forms\DatabaseFormFactory;
use Gibbon\Domain\System\SettingGateway;
use Gibbon\Domain\School\SchoolYearTermGateway;
use Gibbon\Module\FreeLearning\Tables\UnitHistory;

// Module includes
Expand All @@ -28,13 +30,14 @@
// Access denied
$page->addError(__('You do not have access to this action.'));
} else {
//Get action with highest precendence
// Get action with highest precendence
$highestAction = getHighestGroupedAction($guid, $_GET['q'], $connection2);
if ($highestAction == false) {
$page->addError(__('The highest grouped action cannot be determined.'));
} else {
// Filter
$gibbonSchoolYearID = $_GET['gibbonSchoolYearID'] ?? $session->get('gibbonSchoolYearID');
$gibbonSchoolYearTermID = $_GET['gibbonSchoolYearTermID'] ?? null;

$form = Form::create('search', $session->get('absoluteURL').'/index.php', 'get');
$form->setFactory(DatabaseFormFactory::create($pdo));
Expand All @@ -47,18 +50,42 @@
$row = $form->addRow();
$row->addLabel('gibbonSchoolYearID', __('School Year'));
$row->addSelectSchoolYear('gibbonSchoolYearID', 'Recent')->selected($gibbonSchoolYearID);

$settingGateway = $container->get(SettingGateway::class);
$bigDataSchool = $settingGateway->getSettingByScope('Free Learning', 'bigDataSchool');
if ($bigDataSchool == "Y") {
$dataSelect = [];
$sqlSelect = "SELECT gibbonSchoolYear.gibbonSchoolYearID as chainedTo, gibbonSchoolYearTerm.gibbonSchoolYearTermID as value, gibbonSchoolYearTerm.name FROM gibbonSchoolYearTerm JOIN gibbonSchoolYear ON (gibbonSchoolYearTerm.gibbonSchoolYearID=gibbonSchoolYear.gibbonSchoolYearID) ORDER BY gibbonSchoolYearTerm.sequenceNumber";
$rowFilter = $form->addRow();
$rowFilter->addLabel('gibbonSchoolYearTermID', __('Term'));
$rowFilter->addSelect('gibbonSchoolYearTermID')
->fromQueryChained($pdo, $sqlSelect, $dataSelect, 'gibbonSchoolYearID')
->placeholder()
->selected($gibbonSchoolYearTermID);
}

$row = $form->addRow();
$row->addSearchSubmit($session, __('Clear Filters'));

echo $form->getOutput();

//Proceed!
// Proceed!
$page->scripts->add('chart');

$page->breadcrumbs->add(__m('My Unit History'));

$table = $container->get(UnitHistory::class)->create($session->get('gibbonPersonID'), false, true, false, $gibbonSchoolYearID);
// Convert term ID into start and end dates
$dateStart = null;
$dateEnd = null;
if (!is_null($gibbonSchoolYearTermID)) {
$schoolYearTermGateway = $container->get(SchoolYearTermGateway::class);
$term = $schoolYearTermGateway->getByID($gibbonSchoolYearTermID);
$dateStart = $term['firstDay'];
$dateEnd = $term['lastDay'];
}

$table = $container->get(UnitHistory::class)->create($session->get('gibbonPersonID'), false, true, false, $gibbonSchoolYearID, $dateStart, $dateEnd);

echo $table;
}
}
}
2 changes: 1 addition & 1 deletion Free Learning/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
/**
* Sets version information.
*/
$moduleVersion = '5.21.14';
$moduleVersion = '5.21.15';
$coreVersion = '24.0.00';

0 comments on commit b5a9b6f

Please sign in to comment.