fixed merge fail - reconstructed new shift view

main
Philip Häusler 12 years ago
parent 9270b54eb1
commit ff99dd5b71

@ -408,7 +408,6 @@ function view_user_shifts() {
} }
} }
} }
$shifts_table="<table id=\"shifts\"><thead><tr><th>-</th>"; $shifts_table="<table id=\"shifts\"><thead><tr><th>-</th>";
foreach($myrooms as $room) { foreach($myrooms as $room) {
$rid=$room["id"]; $rid=$room["id"];
@ -496,7 +495,7 @@ function view_user_shifts() {
if(time() > $shift['start']) { if(time() > $shift['start']) {
$entry_list[] = $inner_text . ' (vorbei)'; $entry_list[] = $inner_text . ' (vorbei)';
} elseif($angeltype['restricted'] == 1 && isset($angeltype['user_id']) && !isset($angeltype['confirm_user_id'])) { } elseif($angeltype['restricted'] == 1 && isset($angeltype['user_id']) && !isset($angeltype['confirm_user_id'])) {
$entry_list[] = $inner_text . ' <img src="pic/icons/lock.png" alt="unconfirmed" title="Du bist für diesen Engeltyp noch nicht freigeschaltet." />'; $entry_list[] = $inner_text . ' <img src="pic/lock.png" alt="unconfirmed" title="Du bist für diesen Engeltyp noch nicht freigeschaltet." />';
} else { } else {
$entry_list[] = $inner_text . ' <a href="' . page_link_to('user_settings') . '#angel_types_anchor">(Werde ' . $angeltype['name'] .')</a>'; $entry_list[] = $inner_text . ' <a href="' . page_link_to('user_settings') . '#angel_types_anchor">(Werde ' . $angeltype['name'] .')</a>';
} }
@ -533,7 +532,7 @@ function view_user_shifts() {
} }
$shifts_table.='</tbody></table><script type="text/javascript">scrolltable(document.getElementById("shifts"))</script>'; $shifts_table.='</tbody></table><script type="text/javascript">scrolltable(document.getElementById("shifts"))</script>';
// qqq // qqq
} else { } else {
$shifts_table = array(); $shifts_table = array();
foreach ($shifts as $shift) { foreach ($shifts as $shift) {
$info = array (); $info = array ();
@ -605,7 +604,7 @@ function view_user_shifts() {
if(time() > $shift['end']) { if(time() > $shift['end']) {
$entry_list[] = $inner_text . ' (vorbei)'; $entry_list[] = $inner_text . ' (vorbei)';
} elseif($angeltype['restricted'] == 1 && isset($angeltype['user_id']) && !isset($angeltype['confirm_user_id'])) { } elseif($angeltype['restricted'] == 1 && isset($angeltype['user_id']) && !isset($angeltype['confirm_user_id'])) {
$entry_list[] = $inner_text . ' <img src="pic/icons/lock.png" alt="unconfirmed" title="Du bist für diesen Engeltyp noch nicht freigeschaltet." />'; $entry_list[] = $inner_text . ' <img src="pic/lock.png" alt="unconfirmed" title="Du bist für diesen Engeltyp noch nicht freigeschaltet." />';
} else { } else {
$entry_list[] = $inner_text . ' <a href="' . page_link_to('user_settings') . '#angel_types_anchor">(Werde ' . $angeltype['name'] .')</a>'; $entry_list[] = $inner_text . ' <a href="' . page_link_to('user_settings') . '#angel_types_anchor">(Werde ' . $angeltype['name'] .')</a>';
} }
@ -633,12 +632,12 @@ function view_user_shifts() {
'info' => ucfirst(Get_Text("time")) . "/" . ucfirst(Get_Text("room")), 'info' => ucfirst(Get_Text("time")) . "/" . ucfirst(Get_Text("room")),
'entries' => ucfirst(Get_Text("entries")) 'entries' => ucfirst(Get_Text("entries"))
), $shifts_table); ), $shifts_table);
} }
if ($user['ical_key'] == "") if ($user['ical_key'] == "")
user_reset_ical_key($user); user_reset_ical_key($user);
return msg() . template_render('../templates/user_shifts.html', array ( return msg() . template_render('../templates/user_shifts.html', array (
'room_select' => make_select($rooms, $_SESSION['user_shifts']['rooms'], "rooms", ucfirst(Get_Text("rooms"))), 'room_select' => make_select($rooms, $_SESSION['user_shifts']['rooms'], "rooms", ucfirst(Get_Text("rooms"))),
'day_select' => make_select($days, $_SESSION['user_shifts']['days'], "days", ucfirst(Get_Text("days"))), 'day_select' => make_select($days, $_SESSION['user_shifts']['days'], "days", ucfirst(Get_Text("days"))),
'type_select' => make_select($types, $_SESSION['user_shifts']['types'], "types", ucfirst(Get_Text("tasks")) . '<sup>1</sup>'), 'type_select' => make_select($types, $_SESSION['user_shifts']['types'], "types", ucfirst(Get_Text("tasks")) . '<sup>1</sup>'),
@ -648,7 +647,7 @@ return msg() . template_render('../templates/user_shifts.html', array (
'shifts_table' => $shifts_table, 'shifts_table' => $shifts_table,
'ical_text' => sprintf(Get_Text('inc_schicht_ical_text'), htmlspecialchars(make_user_shifts_ical_link($user['ical_key'])), page_link_to('user_myshifts') . '&amp;reset'), 'ical_text' => sprintf(Get_Text('inc_schicht_ical_text'), htmlspecialchars(make_user_shifts_ical_link($user['ical_key'])), page_link_to('user_myshifts') . '&amp;reset'),
'filter' => ucfirst(Get_Text("to_filter")), 'filter' => ucfirst(Get_Text("to_filter")),
)); ));
} }
function make_user_shifts_ical_link($key) { function make_user_shifts_ical_link($key) {
@ -674,7 +673,7 @@ function make_select($items, $selected, $name, $title = null) {
$html_items[] = '<li class="heading">' . $title . '</li>' . "\n"; $html_items[] = '<li class="heading">' . $title . '</li>' . "\n";
foreach ($items as $i) foreach ($items as $i)
$html_items[] = '<li><label><input type="checkbox" name="' . $name . '[]" value="' . $i['id'] . '"' . (in_array($i['id'], $selected) ? ' checked="checked"' : '') . '> ' . $i['name'] . '</label>' . (!isset($i['enabled']) || $i['enabled'] ? '' : ' <img src="pic/icons/lock.png" alt="unconfirmed" title="Du bist für diesen Engeltyp noch nicht freigeschaltet." />') . '</li>'; $html_items[] = '<li><label><input type="checkbox" name="' . $name . '[]" value="' . $i['id'] . '"' . (in_array($i['id'], $selected) ? ' checked="checked"' : '') . '> ' . $i['name'] . '</label>' . (!isset($i['enabled']) || $i['enabled'] ? '' : ' <img src="pic/lock.png" alt="unconfirmed" title="Du bist für diesen Engeltyp noch nicht freigeschaltet." />') . '</li>';
$html = '<div class="selection ' . $name . '">' . "\n"; $html = '<div class="selection ' . $name . '">' . "\n";
$html .= '<ul id="selection_' . $name . '">' . "\n"; $html .= '<ul id="selection_' . $name . '">' . "\n";
$html .= implode("\n", $html_items); $html .= implode("\n", $html_items);

Loading…
Cancel
Save