summaryrefslogtreecommitdiff
path: root/includes/view/ShiftTypes_view.php
diff options
context:
space:
mode:
authorBot <bot@myigel.name>2017-01-02 15:43:36 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-02 15:49:53 +0100
commitd71e7bbfad2f07f82df0c515608996d250fd4182 (patch)
tree5083a17b218c08b3a699a0bf15bec926cc2dd185 /includes/view/ShiftTypes_view.php
parent7313e15ce8236e19331fb6639a3a5b97c8f06ecd (diff)
Formatting
Diffstat (limited to 'includes/view/ShiftTypes_view.php')
-rw-r--r--includes/view/ShiftTypes_view.php103
1 files changed, 59 insertions, 44 deletions
diff --git a/includes/view/ShiftTypes_view.php b/includes/view/ShiftTypes_view.php
index e2850ab0..827eec4d 100644
--- a/includes/view/ShiftTypes_view.php
+++ b/includes/view/ShiftTypes_view.php
@@ -12,36 +12,40 @@ function ShiftType_name_render($shifttype)
function ShiftType_delete_view($shifttype)
{
return page_with_title(sprintf(_("Delete shifttype %s"), $shifttype['name']), [
- info(sprintf(_("Do you want to delete shifttype %s?"), $shifttype['name']), true),
- buttons([
- button(page_link_to('shifttypes'), _("cancel"), 'cancel'),
- button(page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'] . '&confirmed', _("delete"), 'ok')
- ])
- ]);
+ info(sprintf(_("Do you want to delete shifttype %s?"), $shifttype['name']), true),
+ buttons([
+ 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)
{
$angeltypes_select = [
- '' => _('All')
- ];
+ '' => _('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'))
- ])
- ]);
+ 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, $angeltype)
@@ -52,16 +56,23 @@ function ShiftType_view($shifttype, $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') . '&action=edit&shifttype_id=' . $shifttype['id'], _('edit'), 'edit'),
- button(page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'], _('delete'), 'delete')
- ]),
- heading(_("Description"), 2),
- $parsedown->parse($shifttype['description'])
- ]);
+ 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') . '&action=edit&shifttype_id=' . $shifttype['id'], _('edit'), 'edit'),
+ button(
+ page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'],
+ _('delete'),
+ 'delete'
+ )
+ ]),
+ heading(_("Description"), 2),
+ $parsedown->parse($shifttype['description'])
+ ]);
}
function ShiftTypes_list_view($shifttypes)
@@ -69,19 +80,23 @@ function ShiftTypes_list_view($shifttypes)
foreach ($shifttypes as &$shifttype) {
$shifttype['name'] = '<a href="' . page_link_to('shifttypes') . '&action=view&shifttype_id=' . $shifttype['id'] . '">' . $shifttype['name'] . '</a>';
$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=' . $shifttype['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(), [
- msg(),
- buttons([
- button(page_link_to('shifttypes') . '&action=edit', _('New shifttype'), 'add')
- ]),
- table([
- 'name' => _('Name'),
- 'actions' => ''
- ], $shifttypes)
- ]);
+ msg(),
+ buttons([
+ button(page_link_to('shifttypes') . '&action=edit', _('New shifttype'), 'add')
+ ]),
+ table([
+ 'name' => _('Name'),
+ 'actions' => ''
+ ], $shifttypes)
+ ]);
}