From 2fcb9a09fddfd18b6f611d2752d54a84055b3278 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Tue, 6 Aug 2013 14:02:49 +0200 Subject: [PATCH] Zeitformat einstellbar machen --- SL/DB/AuthUser.pm | 2 +- SL/Locale.pm | 7 ++++++- bin/mozilla/am.pl | 1 + locale/de/all | 1 + templates/webpages/am/config.html | 10 ++++++++-- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/SL/DB/AuthUser.pm b/SL/DB/AuthUser.pm index ae05aec71..72df0b03e 100644 --- a/SL/DB/AuthUser.pm +++ b/SL/DB/AuthUser.pm @@ -8,7 +8,7 @@ use SL::DB::MetaSetup::AuthUser; use SL::DB::Manager::AuthUser; use SL::DB::Helper::Util; -use constant CONFIG_VARS => qw(copies countrycode dateformat default_media default_printer_id email favorites fax hide_cvar_search_options mandatory_departments menustyle name +use constant CONFIG_VARS => qw(copies countrycode dateformat timeformat default_media default_printer_id email favorites fax hide_cvar_search_options mandatory_departments menustyle name numberformat show_form_details signature stylesheet taxincluded_checked tel template_format vclimit); __PACKAGE__->meta->add_relationship( diff --git a/SL/Locale.pm b/SL/Locale.pm index 15b57df38..4fc7a5ee0 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -383,7 +383,12 @@ sub parse_date_to_object { sub format_date_object_to_time { my ($self, $datetime, %params) = @_; - return $datetime->strftime('%H:%M'); + my $format = $::myconfig{timeformat} || 'hh:mm'; + $format =~ s/hh/\%H/; + $format =~ s/mm/\%M/; + $format =~ s/ss/\%S/; + + return $datetime->strftime($format); } sub format_date_object { diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index c918770b0..8a4876033 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -960,6 +960,7 @@ sub config { my $locale = $main::locale; _build_cfg_options('dateformat', qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd)); + _build_cfg_options('timeformat', qw(hh:mm hh:mm:ss)); _build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00')); my @formats = (); diff --git a/locale/de/all b/locale/de/all index 9f3e36f80..73db8ac2c 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2238,6 +2238,7 @@ $self->{texts} = { 'This user will have access to the following clients' => 'Dieser Benutzer wird Zugriff auf die folgenden Mandanten haben', 'This vendor number is already in use.' => 'Diese Lieferantennummer wird bereits verwendet.', 'Three Options:' => 'Drei Optionen:', + 'Time Format' => 'Uhrzeitformat', 'Time Tracking' => 'Zeiterfassung', 'Time period for the analysis:' => 'Analysezeitraum:', 'Timestamp' => 'Uhrzeit', diff --git a/templates/webpages/am/config.html b/templates/webpages/am/config.html index c32e17893..c1d9f91e0 100644 --- a/templates/webpages/am/config.html +++ b/templates/webpages/am/config.html @@ -53,8 +53,8 @@ - - [% 'taxincluded checked' | $T8 %] + + [% 'taxincluded checked' | $T8 %] [% L.yes_no_tag('taxincluded_checked', myconfig_taxincluded_checked) %] @@ -72,6 +72,12 @@ [% L.select_tag('dateformat', DATEFORMATS, value_key = 'value', title_key = 'name') %] + + [% 'Time Format' | $T8 %] + + [% L.select_tag('timeformat', TIMEFORMATS, value_key = 'value', title_key = 'name') %] + + [% 'Output Number Format' | $T8 %] -- 2.20.1