diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index b24a7fdf..f54cf066 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -48,6 +48,9 @@ function user_controller() { } } + if ($user_source['api_key'] == "") + User_reset_api_key($user_source); + return array( $user_source['Nick'], User_view($user_source, $admin_user_privilege, User_is_freeloader($user_source), User_angeltypes($user_source), User_groups($user_source), $shifts, $user['UID'] == $user_source['UID']) diff --git a/includes/pages/user_myshifts.php b/includes/pages/user_myshifts.php index 35aa8f54..d1c60dd6 100644 --- a/includes/pages/user_myshifts.php +++ b/includes/pages/user_myshifts.php @@ -26,7 +26,7 @@ function user_myshifts() { } return page_with_title(_("Reset API key"), array( error(_("If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports."), true), - button(page_link_to('myshifts') . '&reset=ack', _("Continue"), 'btn-danger') + button(page_link_to('user_myshifts') . '&reset=ack', _("Continue"), 'btn-danger') )); } elseif (isset($_REQUEST['edit']) && preg_match("/^[0-9]*$/", $_REQUEST['edit'])) { $id = $_REQUEST['edit']; diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 370544a1..04a94c3f 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -1,4 +1,5 @@ '; $query = "SELECT `NeededAngelTypes`.`count`, `AngelTypes`.`id`, `AngelTypes`.`restricted`, `UserAngelTypes`.`confirm_user_id`, `AngelTypes`.`name`, `UserAngelTypes`.`user_id` FROM `NeededAngelTypes` @@ -534,7 +538,9 @@ function view_user_shifts() { $style .= " text-decoration: line-through;"; } if (in_array('user_shifts_admin', $privileges)) - $entry_list[] = "" . User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', _("delete")) . ''; + $entry_list[] = "" . User_Nick_render($entry) . ' ' . table_buttons(array( + button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], glyph('trash'), 'btn-xs') + )) . ''; else $entry_list[] = "" . User_Nick_render($entry) . ""; } @@ -632,7 +638,10 @@ function view_user_shifts() { ); if (in_array('admin_shifts', $privileges)) - $shift_row['info'] .= ' ' . img_button('?p=user_shifts&edit_shift=' . $shift['SID'], 'pencil', 'edit') . img_button('?p=user_shifts&delete_shift=' . $shift['SID'], 'bin', _("delete")); + $shift_row['info'] .= ' ' . table_buttons(array( + button(page_link_to('user_shifts') . '&edit_shift=' . $shift['SID'], glyph('edit'), 'btn-xs'), + button(page_link_to('user_shifts') . '&delete_shift=' . $shift['SID'], glyph('trash'), 'btn-xs') + )); $shift_row['entries'] .= '
'; $is_free = false; $shift_has_special_needs = 0 < sql_num_query("SELECT `id` FROM `NeededAngelTypes` WHERE `shift_id` = " . $shift['SID']); @@ -659,7 +668,9 @@ function view_user_shifts() { $freeloader = 0; foreach ($entries as $entry) { if (in_array('user_shifts_admin', $privileges)) - $member = User_Nick_render($entry) . ' ' . img_button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], 'bin', _("delete")); + $member = User_Nick_render($entry) . ' ' . table_buttons(array( + button(page_link_to('user_shifts') . '&entry_id=' . $entry['id'], glyph('trash'), 'btn-xs') + )); else $member = User_Nick_render($entry); if ($entry['freeloaded']) { @@ -743,7 +754,7 @@ function view_user_shifts() { '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' =>msg(). $shifts_table, + 'shifts_table' => msg() . $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") )), diff --git a/includes/sys_template.php b/includes/sys_template.php index bf0e81fc..e707ab71 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -373,10 +373,6 @@ function html_select_key($id, $name, $rows, $selected) { return $html; } -function img_button($link, $icon, $text, $extra_text = '') { - return '' . $text . '' . (empty($extra_text) ? '' : ' ' . $extra_text) . ''; -} - function ReplaceSmilies($neueckig) { $neueckig = str_replace(";o))", "", $neueckig); $neueckig = str_replace(":-))", "", $neueckig); diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 912579e7..0bea946c 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -131,11 +131,12 @@ function User_view($user_source, $admin_user_privilege, $freeloader, $user_angel $myshift['comment'] .= '

' . _("Freeloaded") . '

'; } - $myshift['actions'] = ""; + $myshift['actions'] = array(); if ($its_me || in_array('user_shifts_admin', $privileges)) - $myshift['actions'] .= img_button(page_link_to('user_myshifts') . '&edit=' . $shift['id'] . '&id=' . $user_source['UID'], 'pencil', _("edit")); + $myshift['actions'][] = button(page_link_to('user_myshifts') . '&edit=' . $shift['id'] . '&id=' . $user_source['UID'], glyph('edit') . _('edit'), 'btn-xs'); if (($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600) || in_array('user_shifts_admin', $privileges)) - $myshift['actions'] .= img_button(page_link_to('user_myshifts') . ((! $its_me) ? '&id=' . $user_source['UID'] : '') . '&cancel=' . $shift['id'], 'cross', _("sign off")); + $myshift['actions'][] = button(page_link_to('user_myshifts') . ((! $its_me) ? '&id=' . $user_source['UID'] : '') . '&cancel=' . $shift['id'], glyph('trash') . _('sign off'), 'btn-xs'); + $myshift['actions'] = table_buttons($myshift['actions']); if ($shift['freeloaded']) $timesum += - 2 * ($shift['end'] - $shift['start']); @@ -182,8 +183,9 @@ function User_view($user_source, $admin_user_privilege, $freeloader, $user_angel buttons(array( $admin_user_privilege ? button(page_link_to('admin_user') . '&id=' . $user_source['UID'], ' ' . _("edit")) : '', ! $user_source['Gekommen'] ? button(page_link_to('admin_arrive') . '&arrived=' . $user_source['UID'], _("arrived")) : '', - $its_me ? button(page_link_to_absolute('ical') . '&key=' . $user_source['api_key'], ' ' . _("iCal Export")) : '', - $its_me ? button(page_link_to_absolute('shifts_json_export') . '&key=' . $user_source['api_key'], ' ' . _("JSON Export")) : '' + $its_me ? button(page_link_to_absolute('ical') . '&key=' . $user_source['api_key'], glyph('calendar') . _("iCal Export")) : '', + $its_me ? button(page_link_to_absolute('shifts_json_export') . '&key=' . $user_source['api_key'], glyph('export') . _("JSON Export")) : '', + $its_me ? button(page_link_to_absolute('user_myshifts') . '&reset', glyph('repeat') . _('Reset API key')) : '' )), ($its_me || $admin_user_privilege) ? '

' . _("Shifts") . '

' : '', ($its_me || $admin_user_privilege) ? table(array( diff --git a/public/pic/icons/add.png b/public/pic/icons/add.png deleted file mode 100644 index 6332fefe..00000000 Binary files a/public/pic/icons/add.png and /dev/null differ diff --git a/public/pic/icons/application_form_edit.png b/public/pic/icons/application_form_edit.png deleted file mode 100644 index af486c94..00000000 Binary files a/public/pic/icons/application_form_edit.png and /dev/null differ diff --git a/public/pic/icons/arrow_left.png b/public/pic/icons/arrow_left.png deleted file mode 100644 index 5dc69678..00000000 Binary files a/public/pic/icons/arrow_left.png and /dev/null differ diff --git a/public/pic/icons/bin.png b/public/pic/icons/bin.png deleted file mode 100644 index f5b829e3..00000000 Binary files a/public/pic/icons/bin.png and /dev/null differ diff --git a/public/pic/icons/clock.png b/public/pic/icons/clock.png deleted file mode 100644 index 450d6b3a..00000000 Binary files a/public/pic/icons/clock.png and /dev/null differ diff --git a/public/pic/icons/cross.png b/public/pic/icons/cross.png deleted file mode 100644 index 9447309a..00000000 Binary files a/public/pic/icons/cross.png and /dev/null differ diff --git a/public/pic/icons/door_in.png b/public/pic/icons/door_in.png deleted file mode 100644 index 41676a0a..00000000 Binary files a/public/pic/icons/door_in.png and /dev/null differ diff --git a/public/pic/icons/email.png b/public/pic/icons/email.png deleted file mode 100644 index 3d6d5711..00000000 Binary files a/public/pic/icons/email.png and /dev/null differ diff --git a/public/pic/icons/engel.png b/public/pic/icons/engel.png deleted file mode 100644 index ea6cc942..00000000 Binary files a/public/pic/icons/engel.png and /dev/null differ diff --git a/public/pic/icons/lock.png b/public/pic/icons/lock.png deleted file mode 100644 index c75f88b6..00000000 Binary files a/public/pic/icons/lock.png and /dev/null differ diff --git a/public/pic/icons/pencil.png b/public/pic/icons/pencil.png deleted file mode 100644 index de7a9b6b..00000000 Binary files a/public/pic/icons/pencil.png and /dev/null differ diff --git a/public/pic/icons/tick.png b/public/pic/icons/tick.png deleted file mode 100644 index 5a75e2f4..00000000 Binary files a/public/pic/icons/tick.png and /dev/null differ