diff options
author | Felix Favre <gnomus@gnomus.de> | 2014-08-24 15:52:25 +0200 |
---|---|---|
committer | Felix Favre <gnomus@gnomus.de> | 2014-08-24 15:52:25 +0200 |
commit | 4faca9864f80dfd90cba248855602ab7680cab53 (patch) | |
tree | 9f2d5d76adc7d14e89d51c0073103e9d7ad717f4 /includes/pages/admin_shifts.php | |
parent | efe853246f99c59e48ac66955b40fb7e09da0a5b (diff) | |
parent | f9e577352dd31f2846c3a340a1de82dd73961568 (diff) |
Merge branch 'master' of github.com:planetcyborg/engelsystem
Conflicts:
themes/theme1.scss
Diffstat (limited to 'includes/pages/admin_shifts.php')
-rw-r--r-- | includes/pages/admin_shifts.php | 43 |
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")) + )) )); } |