summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Philipp Litza <janphilipp@litza.de>2012-12-30 15:20:44 +0100
committerJan-Philipp Litza <janphilipp@litza.de>2012-12-30 15:20:44 +0100
commit3efe63fa102b9d2b1d4b3b73c5d4e3652fdcdcff (patch)
tree2764f2f85fbaf5689e9bb57f58d6b277197be2c8
parentde695c0fe49c2a56cc46460640412b67fefc090f (diff)
fix #49: "Array" after preview in mass-shift-generation
-rw-r--r--includes/pages/admin_shifts.php5
1 files changed, 3 insertions, 2 deletions
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 .= '<input type="hidden" name="type_' . $type_id . '" value="' . $count . '" />';
+ 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
));