Skip to content

Commit

Permalink
Departments: add an Edit Enrolment link to the Department Class page …
Browse files Browse the repository at this point in the history
…for users with enrolment access
  • Loading branch information
SKuipers committed May 6, 2024
1 parent 6e1a271 commit dc371ab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ v27.0.00
Behaviour: added the ability to able to link a behaviour record to some other existing behaviour record
Behaviour: added positive behaviour records to the Daily Behaviour Summary CLI script
Behaviour: added a my_permission so that teachers are restricted to only view behaviours created by them
Departments: added an Edit Enrolment link to the Department Class page for users with enrolment access
Finance: added a fees list and notes column to the Export option in Manage Invoices
Library: added ui changes to Library module browsing through library shelves and improved search page
Library: added automatic shelf generation by search term, automatic shelf updates, and auto-shuffling
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Timetable/CourseEnrolmentGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function queryCourseEnrolmentByClass(QueryCriteria $criteria, $gibbonScho
->newQuery()
->from($this->getTableName())
->cols([
'gibbonCourseClassPerson.gibbonCourseClassPersonID', 'gibbonCourseClass.gibbonCourseClassID', 'gibbonPerson.gibbonPersonID', 'gibbonPerson.title', 'gibbonPerson.surname', 'gibbonPerson.preferredName', 'gibbonPerson.status', 'gibbonPerson.dateStart', 'gibbonPerson.dateEnd', 'gibbonPerson.email', 'gibbonPerson.privacy', 'gibbonPerson.image_240', 'gibbonPerson.dob', 'gibbonCourseClassPerson.reportable', 'gibbonCourseClassPerson.role', "(CASE WHEN gibbonCourseClassPerson.role LIKE 'Teacher%' THEN 0 WHEN gibbonCourseClassPerson.role LIKE 'Assistant%' THEN 1 WHEN gibbonCourseClassPerson.role LIKE 'Technician%' THEN 2 WHEN gibbonCourseClassPerson.role LIKE 'Parent%' THEN 3 WHEN gibbonCourseClassPerson.role LIKE 'Student%' THEN 4 ELSE 5 END) as roleSortOrder", "'Student' as roleCategory", 'gibbonCourse.gibbonYearGroupIDList as yearGroup'
'gibbonCourseClassPerson.gibbonCourseClassPersonID', 'gibbonCourseClass.gibbonCourseClassID', 'gibbonCourseClass.gibbonCourseID', 'gibbonPerson.gibbonPersonID', 'gibbonPerson.title', 'gibbonPerson.surname', 'gibbonPerson.preferredName', 'gibbonPerson.status', 'gibbonPerson.dateStart', 'gibbonPerson.dateEnd', 'gibbonPerson.email', 'gibbonPerson.privacy', 'gibbonPerson.image_240', 'gibbonPerson.dob', 'gibbonCourseClassPerson.reportable', 'gibbonCourseClassPerson.role', "(CASE WHEN gibbonCourseClassPerson.role LIKE 'Teacher%' THEN 0 WHEN gibbonCourseClassPerson.role LIKE 'Assistant%' THEN 1 WHEN gibbonCourseClassPerson.role LIKE 'Technician%' THEN 2 WHEN gibbonCourseClassPerson.role LIKE 'Parent%' THEN 3 WHEN gibbonCourseClassPerson.role LIKE 'Student%' THEN 4 ELSE 5 END) as roleSortOrder", "'Student' as roleCategory", 'gibbonCourse.gibbonYearGroupIDList as yearGroup'
])
->innerJoin('gibbonCourseClass', 'gibbonCourseClass.gibbonCourseClassID=gibbonCourseClassPerson.gibbonCourseClassID')
->innerJoin('gibbonCourse', 'gibbonCourseClass.gibbonCourseID=gibbonCourse.gibbonCourseID')
Expand Down
11 changes: 11 additions & 0 deletions src/Tables/Prefab/ClassGroupTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function build($gibbonSchoolYearID, $gibbonCourseClassID)
$highestAction = getHighestGroupedAction($guid, '/modules/Students/student_view_details.php', $connection2);

$canViewStaff = isActionAccessible($guid, $connection2, '/modules/Staff/staff_view_details.php');
$canEditEnrolment = isActionAccessible($guid, $connection2, '/modules/Timetable Admin/courseEnrolment_manage_class_edit.php');

$canViewStudents = isActionAccessible($guid, $connection2, '/modules/Students/student_view_details.php', 'View Student Profile_brief')
|| ($highestAction == 'View Student Profile_full' || $highestAction == 'View Student Profile_fullNoNotes' || $highestAction == 'View Student Profile_fullEditAllNotes');
Expand All @@ -77,6 +78,16 @@ public function build($gibbonSchoolYearID, $gibbonCourseClassID)
$this->addMetaData('gridClass', 'rounded-sm bg-blue-100 border');
$this->addMetaData('gridItemClass', 'w-1/2 sm:w-1/3 md:w-1/5 my-2 sm:my-4 text-center');

if ($canEditEnrolment && count($participants) > 0) {
$this->addHeaderAction('edit', __('Edit Enrolment'))
->setURL('/modules/Timetable Admin/courseEnrolment_manage_class_edit.php')
->addParam('gibbonSchoolYearID', $gibbonSchoolYearID)
->addParam('gibbonCourseID', $participants->getRow(0)['gibbonCourseID'] ?? '')
->addParam('gibbonCourseClassID', $gibbonCourseClassID)
->displayLabel()
->append('  |  ');
}

if ($canViewConfidential) {
$this->addHeaderAction('export', __('Export to Excel'))
->setURL('/modules/Departments/department_course_classExport.php')
Expand Down

0 comments on commit dc371ab

Please sign in to comment.