From 3efe63fa102b9d2b1d4b3b73c5d4e3652fdcdcff Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Sun, 30 Dec 2012 15:20:44 +0100 Subject: fix #49: "Array" after preview in mass-shift-generation --- includes/pages/admin_shifts.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'includes/pages/admin_shifts.php') diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php index f35fa312..ce94e376 100644 --- a/includes/pages/admin_shifts.php +++ b/includes/pages/admin_shifts.php @@ -74,7 +74,7 @@ function admin_shifts() { elseif ($_REQUEST['mode'] == 'variable') { if (isset ($_REQUEST['change_hours']) && preg_match("/^([0-9]{2}(,|$))/", trim(str_replace(" ", "", $_REQUEST['change_hours'])))) { $mode = 'variable'; - $change_hours = explode(",", $_REQUEST['change_hours']); + $change_hours = array_map('trim', explode(",", $_REQUEST['change_hours'])); } else { $ok = false; $msg .= error("Bitte gib die Schichtwechsel-Stunden kommagetrennt ein.", true); @@ -209,6 +209,7 @@ function admin_shifts() { $hidden_types = ""; foreach ($needed_angel_types as $type_id => $count) $hidden_types .= ''; + sort($change_hours); return template_render('../templates/admin_shift_preview.html', array ( 'shifts_table' => $shifts_table, 'name' => $name, @@ -217,7 +218,7 @@ function admin_shifts() { 'end' => date("Y-m-d H:i", $end), 'mode' => $mode, 'length' => $length, - 'change_hours' => $change_hours, + 'change_hours' => implode(', ', $change_hours), 'angelmode' => $angelmode, 'needed_angel_types' => $hidden_types )); -- cgit v1.2.3-54-g00ecf