From: Moritz Bunkus Date: Thu, 4 Jul 2013 07:20:48 +0000 (+0200) Subject: Mandantenkonfig: Gewichtsoptionen nur anzeigen, wenn Gewichtseinheiten definiert... X-Git-Tag: release-3.1.0beta1~213 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8ad1534a0b797b1889ab90870b652b7ebe21be66;p=kivitendo-erp.git Mandantenkonfig: Gewichtsoptionen nur anzeigen, wenn Gewichtseinheiten definiert sind --- diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm index 29965e1ef..fd2cf6526 100644 --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@ -137,7 +137,7 @@ sub init_defaults { SL::DB::Default->get sub init_all_warehouses { SL::DB::Manager::Warehouse->get_all_sorted } sub init_all_languages { SL::DB::Manager::Language->get_all_sorted } sub init_all_currencies { SL::DB::Manager::Currency->get_all_sorted } -sub init_all_weightunits { SL::DB::Manager::Unit->find_by(name => 'g')->convertible_units } +sub init_all_weightunits { my $unit = SL::DB::Manager::Unit->find_by(name => 'g'); $unit ? $unit->convertible_units : [] } sub init_all_templates { +{ SL::Template->available_templates } } sub init_posting_options { diff --git a/templates/webpages/client_config/_miscellaneous.html b/templates/webpages/client_config/_miscellaneous.html index 82c8fd4ad..46f9ee7aa 100644 --- a/templates/webpages/client_config/_miscellaneous.html +++ b/templates/webpages/client_config/_miscellaneous.html @@ -95,6 +95,7 @@ [% L.radio_button_tag('defaults.currency_id', value=-1, id='defaults.currency_id__1', checked=(SELF.defaults.currency_id == -1)) %] +[% IF SELF.all_weightunits.size %] [% LxERP.t8("Weight") %] @@ -107,6 +108,7 @@ [% L.yes_no_tag('defaults.show_weight', SELF.defaults.show_weight, style=style) %] [% LxERP.t8('Show the weights of articles and the total weight in orders, invoices and delivery notes?') %] +[% END %]