summaryrefslogtreecommitdiff
path: root/includes/view/ShiftTypes_view.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-08-28 16:21:10 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-08-28 17:34:00 +0200
commit73175e2b64c85c7a8c528c76452cd82ffa99f925 (patch)
tree7464fe30c04fe245424646a98cfd6247d060e517 /includes/view/ShiftTypes_view.php
parente1762e7764d4ee4f37757ecd2630f62a440dbf0e (diff)
#337: Added routing
Diffstat (limited to 'includes/view/ShiftTypes_view.php')
-rw-r--r--includes/view/ShiftTypes_view.php34
1 files changed, 26 insertions, 8 deletions
diff --git a/includes/view/ShiftTypes_view.php b/includes/view/ShiftTypes_view.php
index e0750617..74e0d7c0 100644
--- a/includes/view/ShiftTypes_view.php
+++ b/includes/view/ShiftTypes_view.php
@@ -24,7 +24,10 @@ function ShiftType_delete_view($shifttype)
buttons([
button(page_link_to('shifttypes'), _('cancel'), 'cancel'),
button(
- page_link_to('shifttypes') . '&action=delete&shifttype_id=' . $shifttype['id'] . '&confirmed',
+ page_link_to(
+ 'shifttypes',
+ ['action' => 'delete', 'shifttype_id' => $shifttype['id'], 'confirmed' => 1]
+ ),
_('delete'),
'ok btn-danger'
)
@@ -81,12 +84,16 @@ function ShiftType_view($shifttype, $angeltype)
buttons([
button(page_link_to('shifttypes'), shifttypes_title(), 'back'),
$angeltype ? button(
- page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'],
+ 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'],
+ 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'
)
@@ -103,11 +110,22 @@ function ShiftType_view($shifttype, $angeltype)
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['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'],
+ 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'
)
@@ -117,7 +135,7 @@ function ShiftTypes_list_view($shifttypes)
return page_with_title(shifttypes_title(), [
msg(),
buttons([
- button(page_link_to('shifttypes') . '&action=edit', _('New shifttype'), 'add')
+ button(page_link_to('shifttypes', ['action' => 'edit']), _('New shifttype'), 'add')
]),
table([
'name' => _('Name'),