Skip to content

Commit

Permalink
v3.1.07
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Parker committed Mar 18, 2022
1 parent 7b028d9 commit 59599af
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 35 deletions.
5 changes: 5 additions & 0 deletions Credentials/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,8 @@
++$count;
$sql[$count][0] = '3.1.06';
$sql[$count][1] = "";

//3.1.07
++$count;
$sql[$count][0] = '3.1.07';
$sql[$count][1] = "";
4 changes: 4 additions & 0 deletions Credentials/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CHANGELOG
=========
v3.1.07
-------
Refactoring of linkTop divs

v3.1.06
-------
Removed deprecated function calls
Expand Down
14 changes: 8 additions & 6 deletions Credentials/credentials_student.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

use Gibbon\Http\Url;
use Gibbon\Services\Format;
use Gibbon\Tables\DataTable;
use Gibbon\Module\Credentials\CredentialsCredentialGateway;
use Gibbon\Services\Format;

//Module includes
include './modules/Credentials/moduleFunctions.php';
Expand All @@ -45,7 +46,7 @@
$gibbonSchoolYearID = $session->get('gibbonSchoolYearID');

$studentGateway = $container->get(CredentialsCredentialGateway::class);
;

$criteria = $studentGateway->newQueryCriteria();
$students = $studentGateway->queryStudentBySchoolYear($criteria, $gibbonSchoolYearID, $gibbonPersonID);

Expand All @@ -64,12 +65,13 @@
$page->breadcrumbs->add(Format::name('', $student['preferredName'], $student['surname'], 'Student'));

if ($search != '' or $allStudents != '') {
echo "<div class='linkTop'>";
echo "<a href='".$session->get('absoluteURL')."/index.php?q=/modules/Credentials/credentials.php&search=$search&allStudents=$allStudents'>".__m('Back to Search Results').'</a>';
echo '</div>';
$params = [
"search" => $search,
"allStudents" => $allStudents
];
$page->navigator->addSearchResultsAction(Url::fromModuleRoute('Credentials', 'credentials.php')->withQueryParams($params));
}


$studentCredentials = $studentGateway->queryViewCredentialsByPerson($criteria, $gibbonPersonID);

// DATA TABLE
Expand Down
27 changes: 16 additions & 11 deletions Credentials/credentials_student_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
'allStudents' => $allStudents,
]);
$page->breadcrumbs->add(
Format::name('', $student['preferredName'], $student['surname'], 'Student'), 'credentials_student.php', [
'gibbonPersonID' => $gibbonPersonID,
'search' => $search,
'allStudents' => $allStudents,
]
Format::name('', $student['preferredName'], $student['surname'], 'Student'), 'credentials_student.php', [
'gibbonPersonID' => $gibbonPersonID,
'search' => $search,
'allStudents' => $allStudents,
]
);
$page->breadcrumbs->add(__m('Add Credential'));

Expand All @@ -77,16 +77,21 @@
}
$page->return->setEditLink($editLink);

if ($search != '') {
echo "<div class='linkTop'>";
echo "<a href='".$session->get('absoluteURL')."/index.php?q=/modules/Credentials/credentials_student.php&gibbonPersonID=$gibbonPersonID&search=$search&allStudents=$allStudents'>".__m('Back').'</a>';
echo '</div>';
}

$form = Form::create('action', $session->get('absoluteURL').'/modules/'.$session->get('module').'/credentials_student_addProcess.php?gibbonPersonID='.$gibbonPersonID.'&search='.$search.'&allStudents='.$allStudents);

$form->addHiddenValue('address', $session->get('address'));

if ($search != '') {
$params = [
"search" => $search,
"allStudents" => $allStudents,
"gibbonPersonID" => $gibbonPersonID
];
$form->addHeaderAction('back', __('Back'))
->setURL('/modules/Credentials/credentials_student.php')
->addParams($params);
}

$credentialsWebsiteGateway = $container->get(CredentialsWebsiteGateway::class);

$criteria = $credentialsWebsiteGateway->newQueryCriteria()
Expand Down
35 changes: 20 additions & 15 deletions Credentials/credentials_student_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
$searchColumns = $studentGateway->getSearchableColumns();

$criteria = $studentGateway->newQueryCriteria()
->searchBy($searchColumns, $search)
->sortBy(['surname', 'preferredName'])
->filterBy('all', $allStudents)
->fromPOST();
->searchBy($searchColumns, $search)
->sortBy(['surname', 'preferredName'])
->filterBy('all', $allStudents)
->fromPOST();
$students = $studentGateway->queryStudentBySchoolYear($criteria, $gibbonSchoolYearID, $gibbonPersonID);

if ($students->getResultCount() != 1) {
Expand All @@ -66,11 +66,11 @@
'allStudents' => $allStudents,
]);
$page->breadcrumbs->add(
Format::name('', $student['preferredName'], $student['surname'], 'Student'), 'credentials_student.php', [
'gibbonPersonID' => $gibbonPersonID,
'search' => $search,
'allStudents' => $allStudents,
]
Format::name('', $student['preferredName'], $student['surname'], 'Student'), 'credentials_student.php', [
'gibbonPersonID' => $gibbonPersonID,
'search' => $search,
'allStudents' => $allStudents,
]
);
$page->breadcrumbs->add(__m('Edit Credential'));

Expand All @@ -85,12 +85,6 @@
//Let's go!
$values = $studentGateway->getById($credentialsCredentialID);

if ($search != '') {
echo "<div class='linkTop'>";
echo "<a href='".$session->get('absoluteURL')."/index.php?q=/modules/Credentials/credentials_student.php&gibbonPersonID=$gibbonPersonID&search=$search&allStudents=$allStudents'>".__m('Back').'</a>';
echo '</div>';
}

if ($values['password'] != '') {
//Decrypt
$values['password'] = getDecryptCredentialOpenssl($values['password']);
Expand All @@ -100,6 +94,17 @@

$form->addHiddenValue('address', $session->get('address'));

if ($search != '') {
$params = [
"search" => $search,
"allStudents" => $allStudents,
"gibbonPersonID" => $gibbonPersonID
];
$form->addHeaderAction('back', __('Back'))
->setURL('/modules/Credentials/credentials_student.php')
->addParams($params);
}

$sql = "SELECT credentialsWebsiteID as value, title as name FROM credentialsWebsite WHERE active='Y' ORDER BY title";
$row = $form->addRow();
$row->addLabel('credentialsWebsiteID', __m('Website'));
Expand Down
2 changes: 1 addition & 1 deletion Credentials/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$entryURL = 'credentials.php';
$type = 'Additional';
$category = 'Admin';
$version = '3.1.06';
$version = '3.1.07';
$author = 'Ross Parker';
$url = 'http://rossparker.org';

Expand Down
4 changes: 2 additions & 2 deletions Credentials/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
/**
* Sets version information.
*/
$moduleVersion = '3.1.06';
$coreVersion = '22.0.00';
$moduleVersion = '3.1.07';
$coreVersion = '23.0.00';

0 comments on commit 59599af

Please sign in to comment.