Skip to content

Commit

Permalink
v1.0.01
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Parker committed Nov 2, 2021
1 parent af7c53d commit a31d490
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 31 deletions.
7 changes: 6 additions & 1 deletion Alumni/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,9 @@
UPDATE `gibbonSetting` SET `name` = 'socialNetworkLink' ,`nameDisplay` = 'Social Network Link', `description` = 'A URL pointing to a Social Network page for the school\'s alumni group.' WHERE `scope` = 'Alumni' and name = 'facebookLink';end
INSERT INTO `gibbonAction` SET `name` = 'Alumni Settings', `precedence` = '0', `category` = 'Admin', `description` = 'Allows privileged users to manage all alumni settings.', `URLList` = 'alumni_settings.php', `entryURL` = 'alumni_settings.php', `defaultPermissionAdmin` = 'Y', `defaultPermissionTeacher` = 'N', `defaultPermissionStudent` = 'N', `defaultPermissionParent` = 'N', `defaultPermissionSupport` = 'N', `categoryPermissionStaff` = 'Y', `categoryPermissionStudent` = 'Y', `categoryPermissionParent` = 'Y', `categoryPermissionOther` = 'Y', `gibbonModuleID` = (SELECT `gibbonModuleID` FROM `gibbonModule` WHERE `name` = 'Alumni');end
INSERT INTO `gibbonPermission` (`permissionID` ,`gibbonRoleID` ,`gibbonActionID`) VALUES (NULL , '1', (SELECT `gibbonActionID` FROM `gibbonAction` JOIN `gibbonModule` ON (`gibbonAction`.`gibbonModuleID` = `gibbonModule`.`gibbonModuleID`) WHERE `gibbonModule`.`name` = 'Alumni' AND `gibbonAction`.`name` = 'Alumni Settings'));end
";
";

//v1.0.01
++$count;
$sql[$count][0] = "1.0.01";
$sql[$count][1] = "";
6 changes: 5 additions & 1 deletion Alumni/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
CHANGELOG
=========
v1.0.01
-------
Removed deprecated function calls

v1.0.00
-------
Refatored code
Refactored code
Support to multilanguage
Changed setting/link Facebook page to Social Network page
Settings Social Network link and Show Public Registration in the interface.
Expand Down
4 changes: 1 addition & 3 deletions Alumni/alumni_manage_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
if (isset($_GET['editID'])) {
$editLink = $session->get('absoluteURL').'/index.php?q=/modules/Alumni/alumni_manage_edit.php&alumniAlumnusID='.$_GET['editID'].'&graduatingYear='.$graduatingYear;
}
if (isset($_GET['return'])) {
returnProcess($guid, $_GET['return'], $editLink, null);
}
$page->return->setEditLink($editLink);

$form = Form::create('action', $session->get('absoluteURL').'/modules/'.$session->get('module').'/alumni_manage_addProcess.php?graduatingYear='.$graduatingYear);
$form->setFactory(DatabaseFormFactory::create($pdo));
Expand Down
6 changes: 4 additions & 2 deletions Alumni/alumni_manage_addProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
use Gibbon\Services\Format;
use Gibbon\Domain\System\SettingGateway;
use Gibbon\Module\Alumni\AlumniGateway;

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

$enableDescriptors = getSettingByScope($connection2, 'Behaviour', 'enableDescriptors');
$enableLevels = getSettingByScope($connection2, 'Behaviour', 'enableLevels');
$settingGateway = $container->get(SettingGateway::class);
$enableDescriptors = $settingGateway->getSettingByScope('Behaviour', 'enableDescriptors');
$enableLevels = $settingGateway->getSettingByScope('Behaviour', 'enableLevels');

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

Expand Down
4 changes: 0 additions & 4 deletions Alumni/alumni_manage_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
->add(__m('Manage Alumni'), 'alumni_manage.php')
->add(__m('Delete'));

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

//Check if alumniAlumnusID specified
$alumniAlumnusID = $_GET['alumniAlumnusID'] ?? '';
$graduatingYear = $_GET['graduatingYear'] ?? '';
Expand Down
4 changes: 0 additions & 4 deletions Alumni/alumni_manage_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
->add(__m('Manage Alumni'), 'alumni_manage.php')
->add(__m('Edit'));

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

$graduatingYear = $_GET['graduatingYear'] ?? '';
$alumniAlumnusID = $_GET['alumniAlumnusID'] ?? '';

Expand Down
4 changes: 0 additions & 4 deletions Alumni/alumni_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
$page->addError(__m('You do not have access to this action.'));
} else {
$page->breadcrumbs->add(__m('Alumni Settings'));

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

$settingGateway = $container->get(SettingGateway::class);
$alumniSocialNetworkSetting = $settingGateway->getSettingByScope('Alumni', 'socialNetworkLink');
Expand Down
2 changes: 1 addition & 1 deletion Alumni/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL = "alumni_manage.php";
$type = "Additional";
$category = "People";
$version = "1.0.00";
$version = "1.0.01";
$author = "Ross Parker";
$url = "http://rossparker.org/free-learning";

Expand Down
15 changes: 7 additions & 8 deletions Alumni/publicRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

$settingGateway = $container->get(SettingGateway::class);
$enablePublicRegistration = $settingGateway->getSettingByScope('Alumni', 'showPublicRegistration');

$loggedIn = $session->has('username');

if ($enablePublicRegistration != "Y") {
Expand All @@ -40,7 +40,7 @@
'orgName' => $session->get('organisationNameShort') ?? ''
]));

$publicRegistrationMinimumAge = getSettingByScope($connection2, 'User Admin', 'publicRegistrationMinimumAge');
$publicRegistrationMinimumAge = $settingGateway->getSettingByScope('User Admin', 'publicRegistrationMinimumAge');

$returns = [];
$returns['error5'] = __m('Your request failed because you do not meet the minimum age for joining this site ({minimumAge} years of age).', ['minimumAge' => $publicRegistrationMinimumAge]);
Expand All @@ -50,16 +50,15 @@
if (isset($_GET['editID'])) {
$editLink = $session->get('absoluteURL').'/index.php?q=/modules/User Admin/user_manage_edit.php&gibbonPersonID='.$_GET['editID'].'&search='.$_GET['search'];
}
if (isset($_GET['return'])) {
returnProcess($guid, $_GET['return'], $editLink, $returns);
}
$page->return->setEditLink($editLink);
$page->return->addReturns($returns);

$page->write(__m("This registration form is for former members of the {orgName} community who wish to reconnect. Please fill in your details here, and someone from our alumni team will get back to you.",
$page->write(__m("This registration form is for former members of the {orgName} community who wish to reconnect. Please fill in your details here, and someone from our alumni team will get back to you.",
['orgName' => $session->get('organisationNameShort')]));

$socialNetworkLink = $settingGateway->getSettingByScope('Alumni', 'socialNetworkLink');
if (!empty($socialNetworkLink)) {
$page->write(__m("Please don't forget to take a look at, and like, our {socialNetworkLink}",
$page->write(__m("Please don't forget to take a look at, and like, our {socialNetworkLink}",
['socialNetworkLink' => Format::link($socialNetworkLink, __m('alumni Social Network page'), ['target' => '_blank'])]));
}

Expand Down
6 changes: 4 additions & 2 deletions Alumni/publicRegistrationProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@

use Gibbon\Services\Format;
use Gibbon\Module\Alumni\AlumniGateway;
use Gibbon\Domain\System\SettingGateway;

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

$URL = $session->get('absoluteURL').'/index.php?q=/modules/Alumni/publicRegistration.php';

$enablePublicRegistration = getSettingByScope($connection2, 'Alumni', 'showPublicRegistration');
$settingGateway = $container->get(SettingGateway::class);
$enablePublicRegistration = $settingGateway->getSettingByScope('Alumni', 'showPublicRegistration');
$loggedIn = $session->has('username');

if ($enablePublicRegistration != "Y" || ($enablePublicRegistration && !empty($loggedIn))) {
Expand Down Expand Up @@ -54,7 +56,7 @@
header("Location: {$URL}");
} else {
//Check publicRegistrationMinimumAge
$publicRegistrationMinimumAge = getSettingByScope($connection2, 'User Admin', 'publicRegistrationMinimumAge');
$publicRegistrationMinimumAge = $settingGateway->getSettingByScope('User Admin', 'publicRegistrationMinimumAge');

if (empty($publicRegistrationMinimumAge)) {
$ageFail = true;
Expand Down
2 changes: 1 addition & 1 deletion Alumni/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
/**
* Sets version information.
*/
$moduleVersion = '1.0.00';
$moduleVersion = '1.0.01';
$coreVersion = '22.0.00';

0 comments on commit a31d490

Please sign in to comment.