small bug fixes

This commit is contained in:
Xu 2023-12-27 12:06:35 +01:00
parent 197d0d724a
commit 99dd081651
4 changed files with 24 additions and 14 deletions

View File

@ -414,15 +414,6 @@ function admin_shifts()
$shift->createdBy()->associate(auth()->user()); $shift->createdBy()->associate(auth()->user());
$shift->save(); $shift->save();
engelsystem_log(
'Shift created: ' . $shifttypes[$shift->shift_type_id]
. ' with title ' . $shift->title
. ' with description ' . $shift->description
. ' from ' . $shift->start->format('Y-m-d H:i')
. ' to ' . $shift->end->format('Y-m-d H:i')
. ', transaction: ' . $transactionId
);
$needed_angel_types_info = []; $needed_angel_types_info = [];
foreach ($session->get('admin_shifts_types', []) as $type_id => $count) { foreach ($session->get('admin_shifts_types', []) as $type_id => $count) {
$angel_type_source = AngelType::find($type_id); $angel_type_source = AngelType::find($type_id);
@ -436,7 +427,13 @@ function admin_shifts()
$needed_angel_types_info[] = $angel_type_source->name . ': ' . $count; $needed_angel_types_info[] = $angel_type_source->name . ': ' . $count;
} }
} }
engelsystem_log('Shift needs following angel types: ' . join(', ', $needed_angel_types_info)); engelsystem_log('Shift created: ' . $shifttypes[$shift->shift_type_id]
. ' with title ' . $shift->title
. ' with description ' . $shift->description
. ' from ' . $shift->start->format('Y-m-d H:i')
. ' to ' . $shift->end->format('Y-m-d H:i')
. ', transaction: ' . $transactionId
. '; needed angel types: ' . join(', ', $needed_angel_types_info));
} }
success('Shifts created.'); success('Shifts created.');

View File

@ -122,8 +122,9 @@ function Users_view(
'/admin-user', '/admin-user',
['id' => $user->id] ['id' => $user->id]
), ),
'pencil', icon('pencil'),
'btn-sm', 'btn-sm',
'',
__('form.edit') __('form.edit')
), ),
]); ]);
@ -563,7 +564,10 @@ function User_view(
'actions' => __('general.actions'), 'actions' => __('general.actions'),
], $my_shifts)); ], $my_shifts));
} elseif ($user_source->state->force_active) { } elseif ($user_source->state->force_active) {
$myshifts_table = success(__('You have done enough.'), true); $myshifts_table = success(__(
'myshifts.sucess',
[($its_me ? __('You have') : ($user_source->name . ' ' . __('has')))]
), true);
} }
} }

View File

@ -1187,8 +1187,14 @@ msgstr "Dauer"
msgid "Name & Workmates" msgid "Name & Workmates"
msgstr "Name & Kollegen" msgstr "Name & Kollegen"
msgid "You have done enough." msgid "myshifts.sucess"
msgstr "Du hast genug gemacht." msgstr "%s genug gemacht."
msgid "You have"
msgstr "Du hast"
msgid "has"
msgstr "hat"
msgid "Vouchers" msgid "Vouchers"
msgstr "Gutscheine" msgstr "Gutscheine"

View File

@ -934,3 +934,6 @@ msgstr "Actions"
msgid "general.back" msgid "general.back"
msgstr "Back" msgstr "Back"
msgid "myshifts.sucess"
msgstr "%s done enough."