summaryrefslogtreecommitdiff
path: root/includes/view
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-12-16 10:19:38 +0100
committerPhilip Häusler <msquare@notrademark.de>2014-12-17 14:59:41 +0100
commit3f8e5e47c05a2cf8fe4e51034523b0b6021b45f5 (patch)
treec0a09efb977bc903d61b7fbf5b041bdc852c65c2 /includes/view
parent526167ed11a9e13d20698029bc08f13cd574d946 (diff)
add update, delete and view for shift type
Diffstat (limited to 'includes/view')
-rw-r--r--includes/view/ShiftTypes_view.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/includes/view/ShiftTypes_view.php b/includes/view/ShiftTypes_view.php
index 580e4c45..5210f29c 100644
--- a/includes/view/ShiftTypes_view.php
+++ b/includes/view/ShiftTypes_view.php
@@ -1,6 +1,13 @@
<?php
function ShiftType_delete_view($shifttype) {
+ return page_with_title(sprintf(_("Delete shifttype %s"), $shifttype['name']), array(
+ info(sprintf(_("Do you want to delete shifttype %s?"), $shifttype['name']), true),
+ buttons(array(
+ button(page_link_to('shifttypes'), _("cancel"), 'cancel'),
+ button(page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'] . '&confirmed', _("delete"), 'ok')
+ ))
+ ));
}
function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $shifttype_id) {
@@ -25,7 +32,21 @@ function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $s
]);
}
-function ShiftType_view($shifttype) {
+function ShiftType_view($shifttype, $angeltype) {
+ $parsedown = new Parsedown();
+ $title = $shifttype['name'];
+ if ($angeltype)
+ $title .= ' <small>' . sprintf(_('for team %s'), $angeltype['name']) . '</small>';
+ return page_with_title($title, [
+ msg(),
+ buttons([
+ button(page_link_to('shifttypes'), shifttypes_title(), 'back'),
+ $angeltype ? button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], $angeltype['name']) : '',
+ button(page_link_to('shifttypes'), _('edit'), 'edit'),
+ button(page_link_to('shifttypes'), _('delete'), 'delete')
+ ]),
+ $parsedown->parse($shifttype['description'])
+ ]);
}
function ShiftTypes_list_view($shifttypes) {