Skip to content

Commit

Permalink
v2.4.00
Browse files Browse the repository at this point in the history
  • Loading branch information
hmerrettICHK authored Jun 28, 2021
1 parent d8a7f30 commit fcb5b00
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 109 deletions.
4 changes: 4 additions & 0 deletions Info Grid/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CHANGELOG
=========
v2.3.02
-------
Refactored session variables and null coalesce

v2.3.01
-------
Added Afrikaans as a language option
Expand Down
2 changes: 1 addition & 1 deletion Info Grid/hook_dashboard_infoGridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
global $container, $autoloader;
$autoloader->addPsr4('Gibbon\\Module\\InfoGrid\\', realpath(__DIR__).'/src');

$roleCategory = getRoleCategory($_SESSION[$guid]['gibbonRoleIDCurrent'], $connection2);
$roleCategory = getRoleCategory($session->get('gibbonRoleIDCurrent'), $connection2);
$canManage = isActionAccessible($guid, $connection2, '/modules/Info Grid/infoGrid_manage.php');

$table = $container->get(InfoGrid::class)->create($roleCategory, $canManage);
Expand Down
Binary file modified Info Grid/i18n/af_ZA/LC_MESSAGES/Info Grid.mo
Binary file not shown.
72 changes: 0 additions & 72 deletions Info Grid/i18n/af_ZA/LC_MESSAGES/Info Grid.po

This file was deleted.

2 changes: 1 addition & 1 deletion Info Grid/infoGrid_credits.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

//Module includes
include './modules/'.$_SESSION[$guid]['module'].'/moduleFunctions.php';
include './modules/'.$session->get('module').'/moduleFunctions.php';

if (isActionAccessible($guid, $connection2, '/modules/Info Grid/infoGrid_view.php') == false) {
//Acess denied
Expand Down
4 changes: 2 additions & 2 deletions Info Grid/infoGrid_manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@

$search = isset($_GET['search'])? $_GET['search'] : '';

$form = Form::create('search', $_SESSION[$guid]['absoluteURL'].'/index.php', 'get');
$form = Form::create('search', $session->get('absoluteURL').'/index.php', 'get');
$form->setTitle(__('Search'));
$form->setClass('noIntBorder fullWidth');

$form->addHiddenValue('q', '/modules/'.$_SESSION[$guid]['module'].'/infoGrid_manage.php');
$form->addHiddenValue('q', '/modules/'.$session->get('module').'/infoGrid_manage.php');

$row = $form->addRow();
$row->addLabel('search', __('Search For'))->description(__('Title'));
Expand Down
8 changes: 4 additions & 4 deletions Info Grid/infoGrid_manage_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@
$returns = array();
$editLink = '';
if (isset($_GET['editID'])) {
$editLink = $_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/Info Grid/infoGrid_manage_edit.php&infoGridEntryID='.$_GET['editID'].'&search='.$_GET['search'];
$editLink = $session->get('absoluteURL').'/index.php?q=/modules/Info Grid/infoGrid_manage_edit.php&infoGridEntryID='.$_GET['editID'].'&search='.$_GET['search'];
}
if (isset($_GET['return'])) {
returnProcess($guid, $_GET['return'], $editLink, $returns);
}

if ($_GET['search'] != '') { echo "<div class='linkTop'>";
echo "<a href='".$_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/Info Grid/infoGrid_manage.php&search='.$_GET['search']."'>Back to Search Results</a>";
echo "<a href='".$session->get('absoluteURL').'/index.php?q=/modules/Info Grid/infoGrid_manage.php&search='.$_GET['search']."'>Back to Search Results</a>";
echo '</div>';
}

$form = Form::create('action', $_SESSION[$guid]['absoluteURL'].'/modules/Info Grid/infoGrid_manage_addProcess.php?search='.$_GET['search']);
$form = Form::create('action', $session->get('absoluteURL').'/modules/Info Grid/infoGrid_manage_addProcess.php?search='.$_GET['search']);

$form->addHiddenValue('address', $_SESSION[$guid]['address']);
$form->addHiddenValue('address', $session->get('address'));

$row = $form->addRow();
$row->addLabel('title', __('Title'));
Expand Down
18 changes: 9 additions & 9 deletions Info Grid/infoGrid_manage_addProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@



$URL = $_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/'.getModuleName($_POST['address']).'/infoGrid_manage_add.php&search='.$_GET['search'];
$URL = $session->get('absoluteURL').'/index.php?q=/modules/'.getModuleName($_POST['address']).'/infoGrid_manage_add.php&search='.$_GET['search'];

if (isActionAccessible($guid, $connection2, '/modules/Info Grid/infoGrid_manage_add.php') == false) {
//Fail 0
$URL = $URL.'&return=error0';
header("Location: {$URL}");
} else {
//Proceed!
$title = $_POST['title'];
$staff = $_POST['staff'];
$student = $_POST['student'];
$parent = $_POST['parent'];
$priority = $_POST['priority'];
$url = $_POST['url'];
$logoLicense = $_POST['logoLicense'];
$title = $_POST['title'] ?? '';
$staff = $_POST['staff'] ?? '';
$student = $_POST['student'] ?? '';
$parent = $_POST['parent'] ?? '';
$priority = $_POST['priority'] ?? '';
$url = $_POST['url'] ?? '';
$logoLicense = $_POST['logoLicense'] ?? '';

if ($title == '' or $staff == '' or $student == '' or $parent == '' or $priority == '' or $url == '') {
//Fail 3
Expand All @@ -64,7 +64,7 @@

//Write to database
try {
$data = array('title' => $title, 'staff'=>$staff, 'student'=>$student, 'parent'=>$parent, 'priority' => $priority, 'url' => $url, 'logo' => $logo, 'logoLicense' => $logoLicense, 'gibbonPersonIDCreator' => $_SESSION[$guid]['gibbonPersonID'], 'timestampCreated' => date('Y-m-d H:i:s'));
$data = array('title' => $title, 'staff'=>$staff, 'student'=>$student, 'parent'=>$parent, 'priority' => $priority, 'url' => $url, 'logo' => $logo, 'logoLicense' => $logoLicense, 'gibbonPersonIDCreator' => $session->get('gibbonPersonID'), 'timestampCreated' => date('Y-m-d H:i:s'));
$sql = 'INSERT INTO infoGridEntry SET title=:title, staff=:staff, student=:student, parent=:parent, priority=:priority, url=:url, logo=:logo, logoLicense=:logoLicense, gibbonPersonIDCreator=:gibbonPersonIDCreator, timestampCreated=:timestampCreated';
$result = $connection2->prepare($sql);
$result->execute($data);
Expand Down
4 changes: 2 additions & 2 deletions Info Grid/infoGrid_manage_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@

if ($_GET['search'] != '') {
echo "<div class='linkTop'>";
echo "<a href='".$_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/Info Grid/infoGrid_manage.php&search='.$_GET['search']."'>Back to Search Results</a>";
echo "<a href='".$session->get('absoluteURL').'/index.php?q=/modules/Info Grid/infoGrid_manage.php&search='.$_GET['search']."'>Back to Search Results</a>";
echo '</div>';
}

$form = DeleteForm::createForm($_SESSION[$guid]['absoluteURL']."/modules/Info Grid/infoGrid_manage_deleteProcess.php?infoGridEntryID=$infoGridEntryID&search=".$_GET['search']);
$form = DeleteForm::createForm($session->get('absoluteURL')."/modules/Info Grid/infoGrid_manage_deleteProcess.php?infoGridEntryID=$infoGridEntryID&search=".$_GET['search']);
echo $form->getOutput();
}
}
Expand Down
6 changes: 3 additions & 3 deletions Info Grid/infoGrid_manage_deleteProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

include './moduleFunctions.php';

$infoGridEntryID = $_POST['infoGridEntryID'];
$URL = $_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/'.getModuleName($_POST['address'])."/infoGrid_manage_delete.php&infoGridEntryID=$infoGridEntryID&search=".$_GET['search'];
$URLDelete = $_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/'.getModuleName($_POST['address']).'/infoGrid_manage.php&search='.$_GET['search'];
$infoGridEntryID = $_POST['infoGridEntryID'] ?? '';
$URL = $session->get('absoluteURL').'/index.php?q=/modules/'.getModuleName($_POST['address'])."/infoGrid_manage_delete.php&infoGridEntryID=$infoGridEntryID&search=".$_GET['search'];
$URLDelete = $session->get('absoluteURL').'/index.php?q=/modules/'.getModuleName($_POST['address']).'/infoGrid_manage.php&search='.$_GET['search'];

if (isActionAccessible($guid, $connection2, '/modules/Info Grid/infoGrid_manage_delete.php') == false) {
//Fail 0
Expand Down
8 changes: 4 additions & 4 deletions Info Grid/infoGrid_manage_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@

if ($_GET['search'] != '') {
echo "<div class='linkTop'>";
echo "<a href='".$_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/Info Grid/infoGrid_manage.php&search='.$_GET['search']."'>Back to Search Results</a>";
echo "<a href='".$session->get('absoluteURL').'/index.php?q=/modules/Info Grid/infoGrid_manage.php&search='.$_GET['search']."'>Back to Search Results</a>";
echo '</div>';
}

$form = Form::create('action', $_SESSION[$guid]['absoluteURL'].'/modules/Info Grid/infoGrid_manage_editProcess.php?infoGridEntryID='.$infoGridEntryID.'&search='.$_GET['search']);
$form = Form::create('action', $session->get('absoluteURL').'/modules/Info Grid/infoGrid_manage_editProcess.php?infoGridEntryID='.$infoGridEntryID.'&search='.$_GET['search']);

$form->addHiddenValue('address', $_SESSION[$guid]['address']);
$form->addHiddenValue('address', $session->get('address'));

$row = $form->addRow();
$row->addLabel('title', __('Title'));
Expand Down Expand Up @@ -92,7 +92,7 @@
$row->addLabel('file', __('Logo'))->description(__('335px x 140px'));
$row->addFileUpload('file')
->accepts('.jpg,.jpeg,.gif,.png')
->setAttachment('logo', $_SESSION[$guid]['absoluteURL'], $values['logo']);
->setAttachment('logo', $session->get('absoluteURL'), $values['logo']);

$row = $form->addRow();
$row->addLabel('logoLicense', __m('Logo License/Credits'));
Expand Down
16 changes: 8 additions & 8 deletions Info Grid/infoGrid_manage_editProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
include './moduleFunctions.php';

$infoGridEntryID = $_GET['infoGridEntryID'];
$URL = $_SESSION[$guid]['absoluteURL'].'/index.php?q=/modules/'.getModuleName($_POST['address'])."/infoGrid_manage_edit.php&infoGridEntryID=$infoGridEntryID&search=".$_GET['search'];
$URL = $session->get('absoluteURL').'/index.php?q=/modules/'.getModuleName($_POST['address'])."/infoGrid_manage_edit.php&infoGridEntryID=$infoGridEntryID&search=".$_GET['search'];

if (isActionAccessible($guid, $connection2, '/modules/Info Grid/infoGrid_manage_edit.php') == false) {
//Fail 0
Expand Down Expand Up @@ -56,13 +56,13 @@
$row = $result->fetch();

//Validate Inputs
$title = $_POST['title'];
$staff = $_POST['staff'];
$student = $_POST['student'];
$parent = $_POST['parent'];
$priority = $_POST['priority'];
$url = $_POST['url'];
$logoLicense = $_POST['logoLicense'];
$title = $_POST['title'] ?? '';
$staff = $_POST['staff'] ?? '';
$student = $_POST['student'] ?? '';
$parent = $_POST['parent'] ?? '';
$priority = $_POST['priority'] ?? '';
$url = $_POST['url'] ?? '';
$logoLicense = $_POST['logoLicense'] ?? '';

if ($title == '' or $staff == '' or $student == '' or $parent == '' or $priority == '' or $url == '') {
//Fail 3
Expand Down
2 changes: 1 addition & 1 deletion Info Grid/infoGrid_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
if ($highestAction == false) {
$page->addError(__('The highest grouped action cannot be determined.'));
} else {
$roleCategory = getRoleCategory($_SESSION[$guid]['gibbonRoleIDCurrent'], $connection2);
$roleCategory = getRoleCategory($session->get('gibbonRoleIDCurrent'), $connection2);
$canManage = isActionAccessible($guid, $connection2, '/modules/Info Grid/infoGrid_manage.php');

$table = $container->get(InfoGrid::class)->create($roleCategory, $canManage);
Expand Down
2 changes: 1 addition & 1 deletion Info Grid/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL = 'infoGrid_manage.php';
$type = 'Additional';
$category = 'Other';
$version = '2.3.01';
$version = '2.3.02';
$author = 'Ross Parker';
$url = 'http://rossparker.org';

Expand Down
2 changes: 1 addition & 1 deletion Info Grid/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
/**
* Sets version information.
*/
$moduleVersion = '2.3.01';
$moduleVersion = '2.3.02';

0 comments on commit fcb5b00

Please sign in to comment.