summaryrefslogtreecommitdiff
path: root/includes/pages/admin_shifts.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-08-23 19:15:10 +0200
committerPhilip Häusler <msquare@notrademark.de>2014-08-23 19:15:10 +0200
commitf9e577352dd31f2846c3a340a1de82dd73961568 (patch)
treeb2997b76d98fc6b7ac1fa40ffe96d664b350f825 /includes/pages/admin_shifts.php
parent7f43f3bfe50a4bfbbaa74d52b889668354ad9fcf (diff)
remove html templates
Diffstat (limited to 'includes/pages/admin_shifts.php')
-rw-r--r--includes/pages/admin_shifts.php43
1 files changed, 26 insertions, 17 deletions
diff --git a/includes/pages/admin_shifts.php b/includes/pages/admin_shifts.php
index 7e3cc3b3..473022eb 100644
--- a/includes/pages/admin_shifts.php
+++ b/includes/pages/admin_shifts.php
@@ -189,15 +189,17 @@ function admin_shifts() {
} while ($shift_end < $end);
}
- $shifts_table = "";
+ $shifts_table = array();
foreach ($shifts as $shift) {
- $shifts_table .= '<tr><td><span class="glyphicon glyphicon-time"></span> ' . date("Y-m-d H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']) . '<br /><span class="glyphicon glyphicon-map-marker"></span> ' . $room_array[$shift['RID']] . '</td>';
- $shifts_table .= '<td>' . $shift['name'];
+ $shifts_table_entry = array(
+ 'timeslot' => '<span class="glyphicon glyphicon-time"></span> ' . date("Y-m-d H:i", $shift['start']) . ' - ' . date("H:i", $shift['end']) . '<br /><span class="glyphicon glyphicon-map-marker"></span> ' . $room_array[$shift['RID']],
+ 'entries' => $shift['name']
+ );
foreach ($types as $type) {
if (isset($needed_angel_types[$type['id']]) && $needed_angel_types[$type['id']] > 0)
- $shifts_table .= '<br /><span class="icon-icon_angel"></span> <b>' . $type['name'] . ':</b> ' . $needed_angel_types[$type['id']] . ' missing';
+ $shifts_table_entry['entries'] .= '<br /><span class="icon-icon_angel"></span> <b>' . $type['name'] . ':</b> ' . $needed_angel_types[$type['id']] . ' missing';
}
- $shifts_table .= '</td></tr>';
+ $shifts_table[] = $shifts_table_entry;
}
// Fürs Anlegen zwischenspeichern:
@@ -206,18 +208,25 @@ function admin_shifts() {
$hidden_types = "";
foreach ($needed_angel_types as $type_id => $count)
- $hidden_types .= '<input type="hidden" name="type_' . $type_id . '" value="' . $count . '" />';
- return template_render('../templates/admin_shift_preview.html', array(
- 'shifts_table' => $shifts_table,
- 'name' => $name,
- 'rid' => $rid,
- 'start' => date("Y-m-d H:i", $start),
- 'end' => date("Y-m-d H:i", $end),
- 'mode' => $mode,
- 'length' => $length,
- 'change_hours' => implode(', ', $change_hours),
- 'angelmode' => $angelmode,
- 'needed_angel_types' => $hidden_types
+ $hidden_types .= form_hidden('type_' . $type_id, $count);
+ return page_with_title(_("Preview"), array(
+ form(array(
+ $hidden_types,
+ form_hidden('name', $name),
+ form_hidden('rid', $rid),
+ form_hidden('start', date("Y-m-d H:i", $start)),
+ form_hidden('end', date("Y-m-d H:i", $end)),
+ form_hidden('mode', $mode),
+ form_hidden('length', $length),
+ form_hidden('change_hours', implode(', ', $change_hours)),
+ form_hidden('angelmode', $angelmode),
+ form_submit('back', _("back")),
+ table(array(
+ 'timeslot' => _("Timeslot"),
+ 'entries' => _("Entries")
+ ), $shifts_table),
+ form_submit('submit', _("Save"))
+ ))
));
}