From 01463f0ac06ffc1fb23c267bbcb083576849b9d6 Mon Sep 17 00:00:00 2001
From: Jan-Philipp Litza
Date: Fri, 16 Sep 2011 12:22:03 +0200
Subject: [PATCH] make shift creation more comfortable by automatically
selecting mode on changes to the according fields and remembering entries if
error occurs
---
includes/pages/admin_shifts.php | 6 ++++--
templates/admin_shifts.html | 12 ++++++------
templates/admin_shifts_angel_types.html | 10 ++++++++--
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php
index 7ef53d6c..5dacb3ff 100644
--- a/includes/pages/admin_shifts.php
+++ b/includes/pages/admin_shifts.php
@@ -226,7 +226,7 @@ function admin_shifts() {
unset ($_SESSION['admin_shifts_types']);
}
- $room_select = html_select_key('rid', $room_array, '');
+ $room_select = html_select_key('rid', $room_array, $_REQUEST['rid']);
$angel_types = "";
foreach ($types as $type) {
$angel_types .= template_render('../templates/admin_shifts_angel_types.html', array (
@@ -244,9 +244,11 @@ function admin_shifts() {
'end' => date("Y-m-d H:i", $end),
'mode_single_selected' => $_REQUEST['mode'] == 'single' ? 'checked="checked"' : '',
'mode_multi_selected' => $_REQUEST['mode'] == 'multi' ? 'checked="checked"' : '',
+ 'mode_multi_length' => !empty($_REQUEST['length'])? $_REQUEST['length'] : '120',
'mode_variable_selected' => $_REQUEST['mode'] == 'variable' ? 'checked="checked"' : '',
+ 'mode_variable_hours' => !empty($_REQUEST['change_hours'])? $_REQUEST['change_hours'] : '00, 04, 08, 10, 12, 14, 16, 18, 20, 22',
'angelmode_location_selected' => $_REQUEST['angelmode'] == 'location' ? 'checked="checked"' : '',
'angelmode_manually_selected' => $_REQUEST['angelmode'] == 'manually' ? 'checked="checked"' : ''
));
}
-?>
\ No newline at end of file
+?>
diff --git a/templates/admin_shifts.html b/templates/admin_shifts.html
index 1fb62bcd..bfcc4623 100644
--- a/templates/admin_shifts.html
+++ b/templates/admin_shifts.html
@@ -34,25 +34,25 @@
-
+
Mehrere Schichten erstellen:
Schichtlänge in Minuten:
-
+
-
+
Mehrere Schichten mit variabler Länge erstellen:
Schichtwechsel-Stunden:
-
+
Benötigte Engel:
@@ -61,11 +61,11 @@
-
+
Es werden folgende Engel benötigt:
%angel_types%
-
\ No newline at end of file
+
diff --git a/templates/admin_shifts_angel_types.html b/templates/admin_shifts_angel_types.html
index 31d2379c..04e31c81 100644
--- a/templates/admin_shifts_angel_types.html
+++ b/templates/admin_shifts_angel_types.html
@@ -6,11 +6,17 @@