Skip to content

Commit

Permalink
v2.1.03
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Jun 16, 2023
1 parent 65663b3 commit b204a56
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
6 changes: 6 additions & 0 deletions Help Desk/CHANGEDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,9 @@
$sql[$count][0]="2.1.02";
$sql[$count][1]="
";

//v2.1.03
$count++;
$sql[$count][0]="2.1.03";
$sql[$count][1]="
";
4 changes: 4 additions & 0 deletions Help Desk/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CHANGELOG
=========
v2.1.03
-------
Added the option to search owners and technicians in Issues page

v2.1.02
-------
Added school-year date defaults to the Issues page
Expand Down
13 changes: 6 additions & 7 deletions Help Desk/issues_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

$row = $form->addRow();
$row->addLabel('search', __('Search'))
->description(__('Issue ID, Name or Description.'));
->description(__m('Issue ID, Name, Description, Owner or Technician.'));
$row->addTextField('search')
->setValue($criteria->getSearchText());

Expand Down Expand Up @@ -274,13 +274,12 @@
//Owner & Technician Column
$table->addColumn('gibbonPersonID', __('Owner'))
->description(__('Technician'))
->format(function ($row) use ($userGateway) {
$owner = $userGateway->getByID($row['gibbonPersonID']);
$output = Format::bold(Format::name($owner['title'], $owner['preferredName'], $owner['surname'], 'Staff')) . '<br/>';
->sortable(['surnameOwner', 'preferredNameOwner'])
->format(function ($row) {
$output = Format::bold(Format::name($row['titleOwner'], $row['preferredNameOwner'], $row['surnameOwner'], 'Staff')) . '<br/>';

$tech = $userGateway->getByID($row['techPersonID']);
if (!empty($tech)) {
$output .= Format::small(Format::name($tech['title'], $tech['preferredName'], $tech['surname'], 'Staff'));
if (!empty($row['surnameTech'])) {
$output .= Format::small(Format::name($row['titleTech'], $row['preferredNameTech'], $row['surnameTech'], 'Staff'));
}

return $output;
Expand Down
2 changes: 1 addition & 1 deletion Help Desk/manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
$entryURL = 'issues_view.php';
$type = 'Additional';
$category = 'Other';
$version = '2.1.02';
$version = '2.1.03';
$author = 'Ray Clark, Ashton Power & Adrien Tremblay';
$url = 'https://github.com/GibbonEdu/module-helpDesk';

Expand Down
12 changes: 9 additions & 3 deletions Help Desk/src/Domain/IssueGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class IssueGateway extends QueryableGateway

private static $tableName = 'helpDeskIssue';
private static $primaryKey = 'issueID';
private static $searchableColumns = ['issueID', 'issueName', 'description'];
private static $searchableColumns = ['issueID', 'issueName', 'description', 'owner.preferredName', 'owner.surname', 'tech.preferredName', 'tech.surname'];

public function selectActiveIssueByTechnician($technicianID) {
$select = $this
Expand All @@ -44,11 +44,17 @@ public function queryIssues($criteria, $gibbonPersonID = null, $relation = null,
$query = $this
->newQuery()
->from('helpDeskIssue')
->cols(['helpDeskIssue.*', 'techID.gibbonPersonID AS techPersonID', 'helpDeskDepartments.departmentName', 'helpDeskSubcategories.subcategoryName', 'helpDeskSubcategories.departmentID', 'gibbonSpace.name AS facility'])
->cols(['helpDeskIssue.*', 'techID.gibbonPersonID AS techPersonID', 'helpDeskDepartments.departmentName', 'helpDeskSubcategories.subcategoryName', 'helpDeskSubcategories.departmentID', 'gibbonSpace.name AS facility',

'owner.preferredName as preferredNameOwner', 'owner.surname as surnameOwner', 'owner.title as titleOwner',
'tech.preferredName as preferredNameTech', 'tech.surname as surnameTech', 'tech.title as titleTech',
])
->leftJoin('helpDeskTechnicians AS techID', 'helpDeskIssue.technicianID=techID.technicianID')
->leftJoin('helpDeskSubcategories', 'helpDeskIssue.subcategoryID=helpDeskSubcategories.subcategoryID')
->leftJoin('helpDeskDepartments', 'helpDeskSubcategories.departmentID=helpDeskDepartments.departmentID')
->leftJoin('gibbonSpace', 'helpDeskIssue.gibbonSpaceID=gibbonSpace.gibbonSpaceID');
->leftJoin('gibbonSpace', 'helpDeskIssue.gibbonSpaceID=gibbonSpace.gibbonSpaceID')
->leftJoin('gibbonPerson as owner', 'owner.gibbonPersonID=helpDeskIssue.gibbonPersonID')
->leftJoin('gibbonPerson as tech', 'tech.gibbonPersonID=techID.gibbonPersonID');


if ($relation == 'My Issues') {
Expand Down
2 changes: 1 addition & 1 deletion Help Desk/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Sets version information
*/
$moduleVersion='2.1.02';
$moduleVersion='2.1.03';
$coreVersion = '22.0.00';

?>

0 comments on commit b204a56

Please sign in to comment.