summaryrefslogtreecommitdiff
path: root/includes/controller/shifts_controller.php
diff options
context:
space:
mode:
authorBot <bot@myigel.name>2017-01-03 03:22:48 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-03 03:22:48 +0100
commit356b2582f3e6a43ecf2607acad4a7fe0b37f659a (patch)
treee02c9214b23a0b9ec33aa725db962d565bd30a82 /includes/controller/shifts_controller.php
parentd71e7bbfad2f07f82df0c515608996d250fd4182 (diff)
PPHDoc, formatting, fixes, cleanup
Diffstat (limited to 'includes/controller/shifts_controller.php')
-rw-r--r--includes/controller/shifts_controller.php34
1 files changed, 32 insertions, 2 deletions
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php
index e2dd712b..a9f4ec28 100644
--- a/includes/controller/shifts_controller.php
+++ b/includes/controller/shifts_controller.php
@@ -1,16 +1,28 @@
<?php
use Engelsystem\ShiftSignupState;
+/**
+ * @param array $shift
+ * @return string
+ */
function shift_link($shift)
{
return page_link_to('shifts') . '&action=view&shift_id=' . $shift['SID'];
}
+/**
+ * @param array $shift
+ * @return string
+ */
function shift_delete_link($shift)
{
return page_link_to('user_shifts') . '&delete_shift=' . $shift['SID'];
}
+/**
+ * @param array $shift
+ * @return string
+ */
function shift_edit_link($shift)
{
return page_link_to('user_shifts') . '&edit_shift=' . $shift['SID'];
@@ -18,6 +30,8 @@ function shift_edit_link($shift)
/**
* Edit a single shift.
+ *
+ * @return string
*/
function shift_edit_controller()
{
@@ -162,6 +176,9 @@ function shift_edit_controller()
);
}
+/**
+ * @return string
+ */
function shift_delete_controller()
{
global $privileges;
@@ -205,6 +222,9 @@ function shift_delete_controller()
]);
}
+/**
+ * @return array
+ */
function shift_controller()
{
global $user, $privileges;
@@ -249,6 +269,9 @@ function shift_controller()
];
}
+/**
+ * @return array|false
+ */
function shifts_controller()
{
if (!isset($_REQUEST['action'])) {
@@ -256,17 +279,21 @@ function shifts_controller()
}
switch ($_REQUEST['action']) {
- default:
- redirect(page_link_to('?'));
case 'view':
return shift_controller();
case 'next':
return shift_next_controller();
+ default:
+ redirect(page_link_to('?'));
}
+
+ return false;
}
/**
* Redirects the user to his next shift.
+ *
+ * @return false
*/
function shift_next_controller()
{
@@ -286,6 +313,7 @@ function shift_next_controller()
}
redirect(page_link_to('user_shifts'));
+ exit;
}
/**
@@ -346,6 +374,8 @@ function shifts_json_export_controller()
/**
* Returns users shifts to export.
+ *
+ * @return array
*/
function load_ical_shifts()
{