diff options
author | msquare <msquare@notrademark.de> | 2016-10-01 10:48:19 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2016-10-01 10:48:19 +0200 |
commit | d5d2acc7d80920eef5f0ed779a3738a12d5db348 (patch) | |
tree | d2d7eb680c1ecaf72480893bba252ab2d9958804 /includes/pages | |
parent | 6dfefc3bb9f054c472156801e37300059444ecc7 (diff) |
improve code style
Diffstat (limited to 'includes/pages')
-rw-r--r-- | includes/pages/admin_import.php | 4 | ||||
-rw-r--r-- | includes/pages/admin_news.php | 3 | ||||
-rw-r--r-- | includes/pages/user_myshifts.php | 3 | ||||
-rw-r--r-- | includes/pages/user_shifts.php | 7 |
4 files changed, 10 insertions, 7 deletions
diff --git a/includes/pages/admin_import.php b/includes/pages/admin_import.php index 8643dc55..2c36e681 100644 --- a/includes/pages/admin_import.php +++ b/includes/pages/admin_import.php @@ -385,7 +385,7 @@ function shifts_printable($shifts, $shifttypes) { return $shifts_printable; } -function shift_sort($a, $b) { - return ($a['start'] < $b['start']) ? - 1 : 1; +function shift_sort($shift_a, $shift_b) { + return ($shift_a['start'] < $shift_b['start']) ? - 1 : 1; } ?> diff --git a/includes/pages/admin_news.php b/includes/pages/admin_news.php index af7046c9..4226e6ba 100644 --- a/includes/pages/admin_news.php +++ b/includes/pages/admin_news.php @@ -62,8 +62,9 @@ function admin_news() { redirect(page_link_to("news")); break; } - } else + } else { return error("No News found.", true); + } } return $html . '</div>'; } diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index b60d2ed8..3cf0c571 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -82,8 +82,9 @@ function user_myshifts() { } return ShiftEntry_edit_view(User_Nick_render($shifts_user), date("Y-m-d H:i", $shift['start']) . ', ' . shift_length($shift), $shift['Name'], $shift['name'], $shift['angel_type'], $shift['Comment'], $shift['freeloaded'], $shift['freeload_comment'], in_array("user_shifts_admin", $privileges)); - } else + } else { redirect(page_link_to('user_myshifts')); + } } elseif (isset($_REQUEST['cancel']) && preg_match("/^[0-9]*$/", $_REQUEST['cancel'])) { $user_id = $_REQUEST['cancel']; $shift = sql_select(" diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 52167f14..9ad532ca 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -679,10 +679,11 @@ function view_user_shifts() { $user_may_join_shift &= isset($angeltype['user_id']); // you cannot join if you are not confirmed - if ($angeltype['restricted'] == 1 && isset($angeltype['user_id'])) + if ($angeltype['restricted'] == 1 && isset($angeltype['user_id'])) { $user_may_join_shift &= isset($angeltype['confirm_user_id']); - - // you can only join if the shift is in future or running + } + + // you can only join if the shift is in future or running $user_may_join_shift &= time() < $shift['start']; // User shift admins may join anybody in every shift |