|
37 | 37 | // Cancel out early for empty searches |
38 | 38 | if (empty($searchTerm)) die('[]'); |
39 | 39 |
|
| 40 | + /** @var ActionGateway */ |
| 41 | + $actionGateway = $container->get(ActionGateway::class); |
| 42 | + |
40 | 43 | // Check access levels |
41 | 44 | $studentIsAccessible = isActionAccessible($guid, $connection2, '/modules/students/student_view.php'); |
42 | | - $highestActionStudent = getHighestGroupedAction($guid, '/modules/students/student_view.php', $connection2); |
| 45 | + $highestActionStudent = $actionGateway->getHighestGrouped('/modules/students/student_view.php'); |
43 | 46 |
|
44 | 47 | $staffIsAccessible = isActionAccessible($guid, $connection2, '/modules/Staff/staff_view.php'); |
45 | 48 | $classIsAccessible = false; |
46 | 49 | $alarmIsAccessible = isActionAccessible($guid, $connection2, '/modules/System Admin/alarm.php'); |
47 | | - $highestActionClass = getHighestGroupedAction($guid, '/modules/Planner/planner.php', $connection2); |
| 50 | + $highestActionClass = $actionGateway->getHighestGrouped('/modules/Planner/planner.php'); |
48 | 51 | if (isActionAccessible($guid, $connection2, '/modules/Planner/planner.php') and $highestActionClass != 'Lesson Planner_viewMyChildrensClasses') { |
49 | 52 | $classIsAccessible = true; |
50 | 53 | } |
|
60 | 63 | } else { |
61 | 64 | $actions = $session->get('fastFinderActions'); |
62 | 65 | } |
63 | | - |
| 66 | + |
64 | 67 | if (!empty($actions) && is_array($actions)) { |
65 | 68 | foreach ($actions as $action) { |
66 | 69 | // Add actions that match the search query to the result set |
|
145 | 148 | WHEN gibbonPerson.studentID LIKE :search THEN concat(surname, ', ', preferredName, ' (', gibbonFormGroup.name, ', ', gibbonPerson.studentID, ')') |
146 | 149 | WHEN gibbonPerson.firstName LIKE :search AND firstName<>preferredName THEN concat(surname, ', ', firstName, ' \"', preferredName, '\" (', gibbonFormGroup.name, ')' ) |
147 | 150 | ELSE concat(surname, ', ', preferredName, ' (', gibbonFormGroup.name, ')') END) AS name, |
148 | | - NULL as type |
| 151 | + NULL as type |
149 | 152 | FROM gibbonPerson, gibbonStudentEnrolment, gibbonFormGroup, gibbonFamilyChild, gibbonFamilyAdult |
150 | 153 | WHERE gibbonPerson.gibbonPersonID=gibbonStudentEnrolment.gibbonPersonID |
151 | | - AND gibbonStudentEnrolment.gibbonFormGroupID=gibbonFormGroup.gibbonFormGroupID |
| 154 | + AND gibbonStudentEnrolment.gibbonFormGroupID=gibbonFormGroup.gibbonFormGroupID |
152 | 155 | AND gibbonFamilyAdult.gibbonPersonID=:gibbonPersonID |
153 | | - AND gibbonFamilyChild.gibbonPersonID=gibbonPerson.gibbonPersonID |
| 156 | + AND gibbonFamilyChild.gibbonPersonID=gibbonPerson.gibbonPersonID |
154 | 157 | AND gibbonFamilyChild.gibbonFamilyID=gibbonFamilyAdult.gibbonFamilyID"; |
155 | 158 | } |
156 | 159 | // Allow individuals to only search themselves |
|
164 | 167 | NULL as type |
165 | 168 | FROM gibbonPerson, gibbonStudentEnrolment, gibbonFormGroup |
166 | 169 | WHERE gibbonPerson.gibbonPersonID=gibbonStudentEnrolment.gibbonPersonID |
167 | | - AND gibbonStudentEnrolment.gibbonFormGroupID=gibbonFormGroup.gibbonFormGroupID |
| 170 | + AND gibbonStudentEnrolment.gibbonFormGroupID=gibbonFormGroup.gibbonFormGroupID |
168 | 171 | AND gibbonPerson.gibbonPersonID=:gibbonPersonID"; |
169 | 172 | } |
170 | 173 | // Allow searching of all students |
|
0 commit comments