summaryrefslogtreecommitdiff
path: root/includes/controller/shifts_controller.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/controller/shifts_controller.php
parente1762e7764d4ee4f37757ecd2630f62a440dbf0e (diff)
#337: Added routing
Diffstat (limited to 'includes/controller/shifts_controller.php')
-rw-r--r--includes/controller/shifts_controller.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php
index 21c6e160..f4f3f119 100644
--- a/includes/controller/shifts_controller.php
+++ b/includes/controller/shifts_controller.php
@@ -1,4 +1,5 @@
<?php
+
use Engelsystem\ShiftSignupState;
/**
@@ -7,7 +8,7 @@ use Engelsystem\ShiftSignupState;
*/
function shift_link($shift)
{
- $link = page_link_to('shifts') . '&action=view';
+ $link = page_link_to('shifts', ['action' => 'view']);
if (isset($shift['SID'])) {
$link .= '&shift_id=' . $shift['SID'];
}
@@ -20,7 +21,7 @@ function shift_link($shift)
*/
function shift_delete_link($shift)
{
- return page_link_to('user_shifts') . '&delete_shift=' . $shift['SID'];
+ return page_link_to('user_shifts', ['delete_shift' => $shift['SID']]);
}
/**
@@ -29,7 +30,7 @@ function shift_delete_link($shift)
*/
function shift_edit_link($shift)
{
- return page_link_to('user_shifts') . '&edit_shift=' . $shift['SID'];
+ return page_link_to('user_shifts', ['edit_shift' => $shift['SID']]);
}
/**
@@ -228,7 +229,9 @@ function shift_delete_controller()
date('Y-m-d H:i', $shift['start']),
date('H:i', $shift['end'])
), true),
- '<a class="button" href="?p=user_shifts&delete_shift=' . $shift_id . '&delete">' . _('delete') . '</a>'
+ '<a class="button" href="'
+ . page_link_to('user_shifts', ['delete_shift' => $shift_id, 'delete' => 1]) .
+ '">' . _('delete') . '</a>'
]);
}