diff --git a/Help Desk/CHANGEDB.php b/Help Desk/CHANGEDB.php index a8f82cc..4740642 100644 --- a/Help Desk/CHANGEDB.php +++ b/Help Desk/CHANGEDB.php @@ -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]=" +"; diff --git a/Help Desk/CHANGELOG.txt b/Help Desk/CHANGELOG.txt index 830568b..c3b0394 100644 --- a/Help Desk/CHANGELOG.txt +++ b/Help Desk/CHANGELOG.txt @@ -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 diff --git a/Help Desk/issues_view.php b/Help Desk/issues_view.php index 3728d6c..9f5723b 100644 --- a/Help Desk/issues_view.php +++ b/Help Desk/issues_view.php @@ -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()); @@ -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')) . '
'; + ->sortable(['surnameOwner', 'preferredNameOwner']) + ->format(function ($row) { + $output = Format::bold(Format::name($row['titleOwner'], $row['preferredNameOwner'], $row['surnameOwner'], 'Staff')) . '
'; - $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; diff --git a/Help Desk/manifest.php b/Help Desk/manifest.php index 7899e77..a2aa723 100644 --- a/Help Desk/manifest.php +++ b/Help Desk/manifest.php @@ -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'; diff --git a/Help Desk/src/Domain/IssueGateway.php b/Help Desk/src/Domain/IssueGateway.php index 12640de..470a3f5 100644 --- a/Help Desk/src/Domain/IssueGateway.php +++ b/Help Desk/src/Domain/IssueGateway.php @@ -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 @@ -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') { diff --git a/Help Desk/version.php b/Help Desk/version.php index d6f9835..307cebc 100644 --- a/Help Desk/version.php +++ b/Help Desk/version.php @@ -20,7 +20,7 @@ /** * Sets version information */ -$moduleVersion='2.1.02'; +$moduleVersion='2.1.03'; $coreVersion = '22.0.00'; ?>