diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-10-21 09:12:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-21 09:12:10 +0200 |
commit | 9b08b951a2f7036519a9711ff4aa32a8709e261d (patch) | |
tree | d3e42cbb043a854c11f11e735447bebb302f9d43 /includes/pages/admin_rooms.php | |
parent | 4e65e6f73ae13d5d833e37f5a841c375cdde9530 (diff) | |
parent | 52b8b6b45c68dff281e101bc27375347f296ba5e (diff) |
Merge pull request #651 from MyIgel/shift-deletion-worklog
Save time of past shifts as worklog if they get deleted
Diffstat (limited to 'includes/pages/admin_rooms.php')
-rw-r--r-- | includes/pages/admin_rooms.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php index bc0eb651..c55eb227 100644 --- a/includes/pages/admin_rooms.php +++ b/includes/pages/admin_rooms.php @@ -179,9 +179,16 @@ function admin_rooms() ]); } elseif ($request->input('show') == 'delete') { if ($request->hasPostData('ack')) { + $shifts = Shifts_by_room($room_id); + foreach ($shifts as $shift) { + $shift = Shift($shift['SID']); + + UserWorkLog_from_shift($shift); + mail_shift_delete($shift); + } + Room_delete($room_id); - engelsystem_log('Room deleted: ' . $name); success(sprintf(__('Room %s deleted.'), $name)); redirect(page_link_to('admin_rooms')); } |