Skip to content

Commit

Permalink
Students: removed birthday icon from student view of class lists
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Aug 22, 2024
1 parent 3ac1553 commit 4fc1d66
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ v28.0.00
Staff: updated Manage Staff to override required custom fields when manually editing a staff member
Staff: updated family page on Staff Profile to exclude personal details and addresses
Students: added a notification event when student notes are edited
Students: removed birthday icon from student view of class lists
User Admin: added the names of users who made changes to the User Status Log
User Admin: updated Manage Users to override required custom fields when manually editing a user

Expand Down
6 changes: 3 additions & 3 deletions modules/Planner/planner_view_full.php
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,8 @@
// Display attendance grid
$count = 0;

$canViewConfidential = ($highestAction == 'View Student Profile_full' || $highestAction == 'View Student Profile_fullNoNotes' || $highestAction == 'View Student Profile_fullEditAllNotes');

foreach ($participants as $person) {
$form->addHiddenValue($count . '-gibbonPersonID', $person['gibbonPersonID']);
$form->addHiddenValue($count . '-prefilled', $person['log']['prefilled'] ?? '');
Expand All @@ -1275,9 +1277,7 @@
$alert = getAlertBar($guid, $connection2, $person['gibbonPersonID'], $person['privacy'], "id='confidentialPlan$count'");
}

$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');
if ($person['role'] == 'Student' && $canViewStudents) {
if ($person['role'] == 'Student' && $canViewConfidential) {
$icon = Format::userBirthdayIcon($person['dob'], $person['preferredName']);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Tables/Prefab/ClassGroupTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ public function build($gibbonSchoolYearID, $gibbonCourseClassID)

$this->addColumn('image_240')
->setClass('relative')
->format(function ($person) use ($canViewStaff, $canViewStudents) {
->format(function ($person) use ($canViewStaff, $canViewStudents, $canViewConfidential) {
$photo = Format::userPhoto($person['image_240'], 'md', '');
$icon = Format::userBirthdayIcon($person['dob'], $person['preferredName']);
$icon = $canViewConfidential ? Format::userBirthdayIcon($person['dob'], $person['preferredName']) : '';

if ($person['role'] == 'Student') {
$url = Url::fromModuleRoute('Students', 'student_view_details')
->withQueryParams(['gibbonPersonID' => $person['gibbonPersonID']]);
return $canViewStudents
return $canViewStudents && $canViewConfidential
? Format::link($url, $photo).$icon
: $photo.$icon;
} else {
Expand All @@ -138,12 +138,12 @@ public function build($gibbonSchoolYearID, $gibbonCourseClassID)

$this->addColumn('name')
->setClass('text-xs font-bold mt-1')
->format(function ($person) use ($canViewStaff, $canViewStudents) {
->format(function ($person) use ($canViewStaff, $canViewStudents, $canViewConfidential) {
if ($person['role'] == 'Student') {
$name = Format::name($person['title'], $person['preferredName'], $person['surname'], 'Student', false, true);
$url = Url::fromModuleRoute('Students', 'student_view_details')
->withQueryParams(['gibbonPersonID' => $person['gibbonPersonID']]);
$canViewProfile = $canViewStudents;
$canViewProfile = $canViewStudents && $canViewConfidential;
} else {
$name = Format::name($person['title'], $person['preferredName'], $person['surname'], 'Staff', false, false);
$url = Url::fromModuleRoute('Staff', 'staff_view_details')
Expand Down
4 changes: 2 additions & 2 deletions src/Tables/Prefab/FormGroupTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ public function build($gibbonFormGroupID, $canViewConfidential, $canPrint, $sort

$this->addColumn('image_240')
->setClass('relative')
->format(function ($person) use ($canViewStudents) {
->format(function ($person) use ($canViewStudents, $canViewConfidential) {
$url = Url::fromModuleRoute('Students', 'student_view_details')->withQueryParam('gibbonPersonID', $person['gibbonPersonID']);
$photo = Format::userPhoto($person['image_240'], 'md', '');
$icon = Format::userBirthdayIcon($person['dob'], $person['preferredName']);
$icon = $canViewConfidential ? Format::userBirthdayIcon($person['dob'], $person['preferredName']) : '';

return $canViewStudents
? Format::link($url, $photo).$icon
Expand Down

0 comments on commit 4fc1d66

Please sign in to comment.