add possibility to show already done shifts in admin active view

This commit is contained in:
Philip Häusler 2015-08-13 20:28:48 +02:00
parent 1c9a3fa89e
commit 34be996f22
1 changed files with 26 additions and 19 deletions

View File

@ -1,4 +1,5 @@
<?php
function admin_active_title() {
return _("Active angels");
}
@ -12,8 +13,12 @@ function admin_active() {
$count = $forced_count;
$limit = "";
$set_active = "";
if (isset($_REQUEST['search']))
$search = strip_request_item('search');
$show_all_shifts = isset($_REQUEST['show_all_shifts']);
if (isset($_REQUEST['set_active'])) {
$ok = true;
@ -98,6 +103,7 @@ function admin_active() {
FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID`
LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID`
WHERE `User`.`Gekommen` = 1
" . ($show_all_shifts ? "" : "AND `Shifts`.`end` < " . time()) . "
GROUP BY `User`.`UID`
ORDER BY `force_active` DESC, `shift_length` DESC" . $limit);
@ -154,6 +160,7 @@ function admin_active() {
return page_with_title(admin_active_title(), array(
form(array(
form_text('search', _("Search angel:"), $search),
form_checkbox('show_all_shifts', _("Show all shifts"), $show_all_shifts),
form_submit('submit', _("Search"))
)),
$set_active == "" ? form(array(