a few fixes and polishes in myshifts, shifts and menu

main
Jan-Philipp Litza 12 years ago
parent b60603d76c
commit 2d0b2542c9

@ -71,6 +71,7 @@ function user_myshifts() {
$shifts = sql_select("SELECT * FROM `ShiftEntry` JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`) JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`) WHERE `UID`=" . sql_escape($shifts_user['UID']) . " ORDER BY `start`");
$html = "";
$timesum = 0;
foreach ($shifts as $shift) {
if (time() > $shift['end'])
$html .= '<tr class="done">';
@ -91,6 +92,7 @@ function user_myshifts() {
$shift_entries[] = $user_source['Nick'];
}
$html .= join(", ", $shift_entries);
$timesum += ($shift['end'] - $shift['start']) / (60*60);
}
$html .= '</td>';
@ -109,6 +111,7 @@ function user_myshifts() {
return msg().template_render('../templates/user_myshifts.html', array (
'intro' => sprintf(Get_Text('pub_myshifts_intro'), $LETZTES_AUSTRAGEN),
'shifts' => $html,
'time_sum' => $timesum,
'msg' => $msg,
'ical_text' => sprintf(Get_Text('inc_schicht_ical_text'),
page_link_to_absolute('ical') . '&key=' . $shifts_user['ical_key'],

@ -262,8 +262,7 @@ function user_shifts() {
}
return template_render('../templates/user_shifts_add.html', array (
//'date' => date("Y-m-d H:i", $shift['start']) . ', ' . date("H:i", $shift['end'] - $shift['start']) . 'h',
'date' => date("Y-m-d H:i", $shift['start']) . ', ' . shift_length($shift),
'date' => date("Y-m-d H:i", $shift['start']) . ' &ndash; ' . date('Y-m-d H:i', $shift['end']) . ' (' . shift_length($shift) . ')',
'title' => $shift['name'],
'location' => $shift['Name'],
'angel' => $user_text,

@ -121,8 +121,8 @@ function make_langselect() {
else
$URL = $_SERVER["REQUEST_URI"] . "?SetLanguage=";
$html = '<p class="content"><a class="sprache" href="' . $URL . 'DE"><img src="pic/flag/de.png" alt="DE" title="Deutsch"></a>';
$html .= '<a class="sprache" href="' . $URL . 'EN"><img src="pic/flag/en.png" alt="EN" title="English"></a></p>';
$html = '<p class="content"><a class="sprache" href="' . htmlspecialchars($URL) . 'DE"><img src="pic/flag/de.png" alt="DE" title="Deutsch"></a>';
$html .= '<a class="sprache" href="' . htmlspecialchars($URL) . 'EN"><img src="pic/flag/en.png" alt="EN" title="English"></a></p>';
return '<nav class="container"><h4>' . Get_Text("Sprache") . '</h4>' . $html . '</nav>';
}
?>

@ -28,6 +28,16 @@
<tbody>
%shifts%
</tbody>
<tfoot>
<tr>
<th>Summe</th>
<th>%time_sum% Stunden</th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</tfoot>
</table>
<hr />
<h2>iCal Export</h2>

Loading…
Cancel
Save