fix sign out button and remove edit button for "myshifts" when viewing other users

This commit is contained in:
Jan-Philipp Litza 2012-12-27 14:46:55 +01:00
parent c0bdfe0871
commit 7a2eae0a4b
1 changed files with 4 additions and 3 deletions

View File

@ -79,9 +79,10 @@ function user_myshifts() {
$html .= '<td>' . $shift['name'] . '</td>'; $html .= '<td>' . $shift['name'] . '</td>';
$html .= '<td>' . $shift['Comment'] . '</td>'; $html .= '<td>' . $shift['Comment'] . '</td>';
$html .= '<td>'; $html .= '<td>';
$html .= '<a href="' . page_link_to('user_myshifts') . '&edit=' . $shift['id'] . '">' . Get_Text('edit') . '</a>'; if ($id == $user['UID'])
if ($shift['start'] - time() > $LETZTES_AUSTRAGEN * 3600) $html .= '<a href="' . page_link_to('user_myshifts') . '&edit=' . $shift['id'] . '">' . Get_Text('edit') . '</a>';
$html .= ' | <a href="' . page_link_to('user_myshifts') . '&cancel=' . $shift['id'] . '">' . Get_Text('sign_off') . '</a>'; if (($shift['start'] - time() > $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges))
$html .= ' | <a href="' . page_link_to('user_myshifts') . (($id != $user['UID'])? '&id=' . $id : '') . '&cancel=' . $shift['id'] . '">' . Get_Text('sign_off') . '</a>';
$html .= '</td>'; $html .= '</td>';
$html .= '</tr>'; $html .= '</tr>';
} }