From 74647e16d37fac9425a4561b49618b52cdc3e75c Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Fri, 22 Aug 2014 22:34:13 +0200 Subject: add basic bootstrap theme --- includes/pages/user_shifts.php | 55 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 28 deletions(-) (limited to 'includes/pages/user_shifts.php') diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 1e94b99f..2adce0d5 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -138,15 +138,10 @@ function user_shifts() { $room_select = html_select_key('rid', 'rid', $room_array, $rid); $angel_types = ""; - foreach ($types as $type) { - $angel_types .= template_render('../templates/admin_shifts_angel_types.html', array( - 'id' => $type['id'], - 'type' => $type['name'], - 'value' => $needed_angel_types[$type['id']] - )); - } + foreach ($types as $type) + $angel_types .= form_spinner('type_' . $type['id'], $type['name'], $needed_angel_types[$type['id']]); - return page(array( + return page_with_title(shifts_title(), array( msg(), '', form(array( @@ -182,7 +177,7 @@ function user_shifts() { redirect(page_link_to('user_shifts')); } - return page(array( + return page_with_title(shifts_title(), array( error(sprintf(_("Do you want to delete the shift %s from %s to %s?"), $shift['name'], date("Y-m-d H:i", $shift['start']), date("H:i", $shift['end'])), true), '' . _("delete") . '' )); @@ -457,7 +452,7 @@ function view_user_shifts() { $shifts[$k]['own'] = in_array($shift['SID'], array_keys($ownshifts)); } - $shifts_table = ''; + $shifts_table = '
-
'; foreach ($myrooms as $key => $room) { $rid = $room["id"]; if (array_sum($block[$rid]) == 0) { @@ -734,19 +729,25 @@ function view_user_shifts() { if ($user['api_key'] == "") User_reset_api_key($user); - return msg() . template_render('../templates/user_shifts.html', array( - 'room_select' => make_select($rooms, $_SESSION['user_shifts']['rooms'], "rooms", _("Rooms")), - 'start_select' => html_select_key("start_day", "start_day", array_combine($days, $days), $_SESSION['user_shifts']['start_day']), - 'start_time' => $_SESSION['user_shifts']['start_time'], - 'end_select' => html_select_key("end_day", "end_day", array_combine($days, $days), $_SESSION['user_shifts']['end_day']), - 'end_time' => $_SESSION['user_shifts']['end_time'], - 'type_select' => make_select($types, $_SESSION['user_shifts']['types'], "types", _("Tasks") . '1'), - 'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", _("Occupancy")), - 'task_notice' => '1' . _("The tasks shown here are influenced by the preferences you defined in your settings!") . " " . _("Description of the jobs.") . "", - 'new_style_checkbox' => '', - 'shifts_table' => $shifts_table, - 'ical_text' => '

' . _("iCal export") . '

' . sprintf(_("Export of shown shifts. iCal format or JSON format available (please keep secret, otherwise reset the api key)."), page_link_to_absolute('ical') . '&key=' . $user['api_key'], page_link_to_absolute('shifts_json_export') . '&key=' . $user['api_key'], page_link_to('user_myshifts') . '&reset') . '

', - 'filter' => _("Filter") + return page(array( + '
', + msg(), + template_render('../templates/user_shifts.html', array( + 'title' => shifts_title(), + 'room_select' => make_select($rooms, $_SESSION['user_shifts']['rooms'], "rooms", _("Rooms")), + 'start_select' => html_select_key("start_day", "start_day", array_combine($days, $days), $_SESSION['user_shifts']['start_day']), + 'start_time' => $_SESSION['user_shifts']['start_time'], + 'end_select' => html_select_key("end_day", "end_day", array_combine($days, $days), $_SESSION['user_shifts']['end_day']), + 'end_time' => $_SESSION['user_shifts']['end_time'], + 'type_select' => make_select($types, $_SESSION['user_shifts']['types'], "types", _("Tasks") . '1'), + 'filled_select' => make_select($filled, $_SESSION['user_shifts']['filled'], "filled", _("Occupancy")), + 'task_notice' => '1' . _("The tasks shown here are influenced by the preferences you defined in your settings!") . " " . _("Description of the jobs.") . "", + 'new_style_checkbox' => '', + 'shifts_table' => $shifts_table, + 'ical_text' => '

' . _("iCal export") . '

' . sprintf(_("Export of shown shifts. iCal format or JSON format available (please keep secret, otherwise reset the api key)."), page_link_to_absolute('ical') . '&key=' . $user['api_key'], page_link_to_absolute('shifts_json_export') . '&key=' . $user['api_key'], page_link_to('user_myshifts') . '&reset') . '

', + 'filter' => _("Filter") + )), + '
' )); } @@ -771,14 +772,12 @@ function get_ids_from_array($array) { function make_select($items, $selected, $name, $title = null) { $html_items = array(); if (isset($title)) - $html_items[] = '
  • ' . $title . '
  • ' . "\n"; + $html_items[] = '

    ' . $title . '

    ' . "\n"; foreach ($items as $i) - $html_items[] = '
  • ' . (! isset($i['enabled']) || $i['enabled'] ? '' : ' unconfirmed') . '
  • '; - $html = '
    ' . "\n"; - $html .= '' . "\n"; $html .= buttons(array( button("javascript: check_all('selection_" . $name . "')", _("All"), ""), button("javascript: uncheck_all('selection_" . $name . "')", _("None"), "") -- cgit v1.2.3-54-g00ecf
    -