From e7b0e9934d2df55a7971eaac42cc6b27a9733a32 Mon Sep 17 00:00:00 2001 From: msquare Date: Fri, 29 Dec 2017 16:20:30 +0100 Subject: [PATCH] add shift filter buttons at the top --- includes/pages/user_shifts.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 0be4aa67..81b405b1 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -313,11 +313,19 @@ function get_ids_from_array($array) */ function make_select($items, $selected, $name, $title = null, $additionalButtons = []) { + $html = ''; $htmlItems = []; if (isset($title)) { - $htmlItems[] = '

' . $title . '

' . "\n"; + $html .= '

' . $title . '

' . "\n"; } + $buttons = []; + $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', _('All')); + $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', _('None')); + $buttons = array_merge($buttons, $additionalButtons); + + $html .= buttons($buttons); + foreach ($items as $i) { $htmlItems[] = '
' . '