diff options
Diffstat (limited to 'includes/view')
-rw-r--r-- | includes/view/ShiftTypes_view.php | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/includes/view/ShiftTypes_view.php b/includes/view/ShiftTypes_view.php index a7df2c87..580e4c45 100644 --- a/includes/view/ShiftTypes_view.php +++ b/includes/view/ShiftTypes_view.php @@ -4,6 +4,25 @@ function ShiftType_delete_view($shifttype) { } function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $shifttype_id) { + $angeltypes_select = [ + '' => _('All') + ]; + foreach ($angeltypes as $angeltype) + $angeltypes_select[$angeltype['id']] = $angeltype['name']; + + return page_with_title($shifttype_id ? _('Edit shifttype') : _('Create shifttype'), [ + msg(), + buttons([ + button(page_link_to('shifttypes'), shifttypes_title(), 'back') + ]), + form([ + form_text('name', _('Name'), $name), + form_select('angeltype_id', _('Angeltype'), $angeltypes_select, $angeltype_id), + form_textarea('description', _('Description'), $description), + form_info('', _('Please use markdown for the description.')), + form_submit('submit', _('Save')) + ]) + ]); } function ShiftType_view($shifttype) { @@ -12,21 +31,21 @@ function ShiftType_view($shifttype) { function ShiftTypes_list_view($shifttypes) { foreach ($shifttypes as &$shifttype) { $shifttype['actions'] = table_buttons([ - button(page_link_to('shifttypes') . '&action=edit&shifttype_id=' . $shifttype['id'], _("edit"), "btn-xs"), - button(page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttypes['id'], _("delete"), "btn-xs") + button(page_link_to('shifttypes') . '&action=edit&shifttype_id=' . $shifttype['id'], _('edit'), 'btn-xs'), + button(page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'], _('delete'), 'btn-xs') ]); } - return page_with_title(shifttypes_title(), array( + return page_with_title(shifttypes_title(), [ msg(), - buttons(array( - button(page_link_to('shifttypes') . '&action=edit', _("New shifttype"), 'add') - )), - table(array( - 'name' => _("Name"), - 'actions' => "" - ), $shifttypes) - )); + buttons([ + button(page_link_to('shifttypes') . '&action=edit', _('New shifttype'), 'add') + ]), + table([ + 'name' => _('Name'), + 'actions' => '' + ], $shifttypes) + ]); } ?>
\ No newline at end of file |