Skip to content

Commit

Permalink
Closing Bugfix #23
Browse files Browse the repository at this point in the history
- Fix the missing " from the German language file
- Hide/show the shift button based on Critter permission level
- Critter shifts filter is updated to match the permission level
  • Loading branch information
RustyBraze committed Sep 7, 2024
1 parent 243fd1b commit c8017b0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
6 changes: 5 additions & 1 deletion includes/pages/user_shifts.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ function load_types()
)'
. ($isShico ? '' :
'WHERE angel_types.hide_on_shift_view = 0
OR user_angel_type.user_id IS NOT NULL ') .
OR (
user_angel_type.user_id IS NOT NULL
AND
NOT `user_angel_type`.`confirm_user_id` IS NULL
) ') .
'ORDER BY `angel_types`.`name`
',
[
Expand Down
39 changes: 25 additions & 14 deletions includes/view/AngelTypes_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,25 +520,36 @@ function AngelType_view(
'',
__('general.add')
) : '');

// Let's create the tabs as we go, so we can hide if needed
// Tab #1 -> INFO
$pagetabs = [
__('Info') => AngelType_view_info(
$angeltype,
$members,
$admin_user_angeltypes,
$admin_angeltypes,
$supporter
),
];
// Tab #2 -> Only if the user deserves :)
if ($admin_user_angeltypes ||
!$angeltype->hide_on_shift_view ||
($angeltype->hide_on_shift_view && (!is_null($user_angeltype) && $user_angeltype->confirm_user_id))) {
// Yup, you can see this: admin, not to hide or confirmed user
$pagetabs[__('general.shifts')] = AngelType_view_shifts(
$angeltype,
$shiftsFilterRenderer,
$shiftCalendarRenderer
);
}

return page_with_title(
$back . ' ' . sprintf(__('Team %s'), htmlspecialchars($angeltype->name)) . ' ' . $add,
[
AngelType_view_buttons($angeltype, $user_angeltype, $admin_angeltypes, $supporter, $user_license, $user),
msg(),
tabs([
__('Info') => AngelType_view_info(
$angeltype,
$members,
$admin_user_angeltypes,
$admin_angeltypes,
$supporter
),
__('general.shifts') => AngelType_view_shifts(
$angeltype,
$shiftsFilterRenderer,
$shiftCalendarRenderer
),
], $tab),
tabs($pagetabs, $tab),
],
true
);
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/de_DE/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ msgstr "Dein Konto wurde gelöscht."

msgid ""
"Your %s account has been deleted. If you have any questions regarding your "
"account deletion, please contact the Info Desk.
"account deletion, please contact the Info Desk."
msgstr ""
"Dein %s-Konto wurde gelöscht. Wenn Du dazu Fragen hast, kontaktiere bitte "
"den Info Desk."
Expand Down

0 comments on commit c8017b0

Please sign in to comment.