diff --git a/includes/view/EventConfig_view.php b/includes/view/EventConfig_view.php index 7c369bb0..d184166f 100644 --- a/includes/view/EventConfig_view.php +++ b/includes/view/EventConfig_view.php @@ -48,7 +48,7 @@ function EventConfig_info($event_config) { // Event name, start+end date are set if ($event_config['event_name'] != null && $event_config['event_start_date'] != null && $event_config['event_end_date'] != null) { - return sprintf(_("%s, from %s to %s"), $event_config['event_name'], date("Y-m-d", $event_config['event_start_date']), date(_("Y-m-d"), $event_config['event_end_date'])); + return sprintf(_("%s, from %s to %s"), $event_config['event_name'], date(_("Y-m-d"), $event_config['event_start_date']), date(_("Y-m-d"), $event_config['event_end_date'])); } // Event name, start date are set @@ -58,7 +58,7 @@ function EventConfig_info($event_config) { // Event start+end date are set if ($event_config['event_start_date'] != null && $event_config['event_end_date'] != null) { - return sprintf(_("Event from %s to %s"), date("Y-m-d", $event_config['event_start_date']), date(_("Y-m-d"), $event_config['event_end_date'])); + return sprintf(_("Event from %s to %s"), date(_("Y-m-d"), $event_config['event_start_date']), date(_("Y-m-d"), $event_config['event_end_date'])); } // Only event name is set diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index c53bf972..7ad580f4 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -45,40 +45,7 @@ function Shift_view($shift, $shifttype, $room, $angeltypes_source, $user_shifts, $needed_angels = ''; foreach ($shift['NeedAngels'] as $needed_angeltype) { - $class = 'progress-bar-warning'; - if ($needed_angeltype['taken'] == 0) { - $class = 'progress-bar-danger'; - } - if ($needed_angeltype['taken'] >= $needed_angeltype['count']) { - $class = 'progress-bar-success'; - } - $needed_angels .= '
'; - - $needed_angels .= '
' . Shift_signup_button_render($shift, $angeltypes[$needed_angeltype['TID']]) . '
'; - - $needed_angels .= '

' . AngelType_name_render($angeltypes[$needed_angeltype['TID']]) . '

'; - $needed_angels .= progress_bar(0, $needed_angeltype['count'], min($needed_angeltype['taken'], $needed_angeltype['count']), $class, $needed_angeltype['taken'] . ' / ' . $needed_angeltype['count']); - - $angels = []; - foreach ($shift['ShiftEntry'] as $shift_entry) { - if ($shift_entry['TID'] == $needed_angeltype['TID']) { - $entry = User_Nick_render(User($shift_entry['UID'])); - if ($shift_entry['freeloaded']) { - $entry = '' . $entry . ''; - } - if ($user_shift_admin) { - $entry .= '
'; - $entry .= button_glyph(page_link_to('user_myshifts') . '&edit=' . $shift_entry['id'] . '&id=' . $shift_entry['UID'], 'pencil', 'btn-xs'); - $entry .= button_glyph(page_link_to('user_shifts') . '&entry_id=' . $shift_entry['id'], 'trash', 'btn-xs'); - $entry .= '
'; - } - $angels[] = $entry; - } - } - - $needed_angels .= join(', ', $angels); - - $needed_angels .= '
'; + $needed_angels .= Shift_view_render_needed_angeltype($needed_angeltype, $angeltypes, $shift, $user_shift_admin); } return page_with_title($shift['name'] . ' %c', [ @@ -99,7 +66,7 @@ function Shift_view($shift, $shifttype, $room, $angeltypes_source, $user_shifts, div('col-sm-3 col-xs-6', [ '

' . _('Start') . '

', '

', - glyph('calendar') . date('Y-m-d', $shift['start']), + glyph('calendar') . date(_('Y-m-d'), $shift['start']), '
', glyph('time') . date('H:i', $shift['start']), '

' @@ -107,7 +74,7 @@ function Shift_view($shift, $shifttype, $room, $angeltypes_source, $user_shifts, div('col-sm-3 col-xs-6', [ '

' . _('End') . '

', '

', - glyph('calendar') . date('Y-m-d', $shift['end']), + glyph('calendar') . date(_('Y-m-d'), $shift['end']), '
', glyph('time') . date('H:i', $shift['end']), '

' @@ -131,6 +98,50 @@ function Shift_view($shift, $shifttype, $room, $angeltypes_source, $user_shifts, ]); } +function Shift_view_render_needed_angeltype($needed_angeltype, $angeltypes, $shift, $user_shift_admin) { + $needed_angels = ''; + + $class = 'progress-bar-warning'; + if ($needed_angeltype['taken'] == 0) { + $class = 'progress-bar-danger'; + } + if ($needed_angeltype['taken'] >= $needed_angeltype['count']) { + $class = 'progress-bar-success'; + } + $needed_angels .= '
'; + + $needed_angels .= '
' . Shift_signup_button_render($shift, $angeltypes[$needed_angeltype['TID']]) . '
'; + + $needed_angels .= '

' . AngelType_name_render($angeltypes[$needed_angeltype['TID']]) . '

'; + $needed_angels .= progress_bar(0, $needed_angeltype['count'], min($needed_angeltype['taken'], $needed_angeltype['count']), $class, $needed_angeltype['taken'] . ' / ' . $needed_angeltype['count']); + + $angels = []; + foreach ($shift['ShiftEntry'] as $shift_entry) { + if ($shift_entry['TID'] == $needed_angeltype['TID']) { + $angels[] = Shift_view_render_shift_entry($shift_entry, $user_shift_admin); + } + } + + $needed_angels .= join(', ', $angels); + $needed_angels .= '
'; + + return $needed_angels; +} + +function Shift_view_render_shift_entry($shift_entry, $user_shift_admin) { + $entry = User_Nick_render(User($shift_entry['UID'])); + if ($shift_entry['freeloaded']) { + $entry = '' . $entry . ''; + } + if ($user_shift_admin) { + $entry .= '
'; + $entry .= button_glyph(page_link_to('user_myshifts') . '&edit=' . $shift_entry['id'] . '&id=' . $shift_entry['UID'], 'pencil', 'btn-xs'); + $entry .= button_glyph(page_link_to('user_shifts') . '&entry_id=' . $shift_entry['id'], 'trash', 'btn-xs'); + $entry .= '
'; + } + return $entry; +} + /** * Calc shift length in format 12:23h. * diff --git a/locale/de_DE.UTF-8/LC_MESSAGES/default.mo b/locale/de_DE.UTF-8/LC_MESSAGES/default.mo index 5b992222..7e98477d 100644 Binary files a/locale/de_DE.UTF-8/LC_MESSAGES/default.mo and b/locale/de_DE.UTF-8/LC_MESSAGES/default.mo differ diff --git a/locale/de_DE.UTF-8/LC_MESSAGES/default.po b/locale/de_DE.UTF-8/LC_MESSAGES/default.po index 0c810ee1..0dbdafec 100644 --- a/locale/de_DE.UTF-8/LC_MESSAGES/default.po +++ b/locale/de_DE.UTF-8/LC_MESSAGES/default.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Engelsystem 2.0\n" "POT-Creation-Date: 2016-11-15 17:40+0100\n" -"PO-Revision-Date: 2016-11-15 17:40+0100\n" +"PO-Revision-Date: 2016-11-15 17:49+0100\n" "Last-Translator: msquare \n" "Language-Team: \n" "Language: de_DE\n" @@ -2027,7 +2027,7 @@ msgstr "Wir haben aktuell keine Informationen über das Event." #: /Users/msquare/workspace/projects/engelsystem/includes/view/EventConfig_view.php:19 #, php-format msgid "from %s to %s" -msgstr "von %s bis %s" +msgstr "vom %s bis %s" #: /Users/msquare/workspace/projects/engelsystem/includes/view/EventConfig_view.php:23 #, php-format @@ -2052,7 +2052,7 @@ msgstr "Abbau endet in %c" #: /Users/msquare/workspace/projects/engelsystem/includes/view/EventConfig_view.php:51 #, php-format msgid "%s, from %s to %s" -msgstr "%s, von %s bis %s" +msgstr "%s, vom %s bis %s" #: /Users/msquare/workspace/projects/engelsystem/includes/view/EventConfig_view.php:51 #: /Users/msquare/workspace/projects/engelsystem/includes/view/EventConfig_view.php:56 @@ -2063,7 +2063,7 @@ msgstr "d.m.Y" #: /Users/msquare/workspace/projects/engelsystem/includes/view/EventConfig_view.php:56 #, php-format msgid "%s, starting %s" -msgstr "%s, ab %s" +msgstr "%s, ab dem %s" #: /Users/msquare/workspace/projects/engelsystem/includes/view/EventConfig_view.php:61 #, php-format