From 8ad1534a0b797b1889ab90870b652b7ebe21be66 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 4 Jul 2013 09:20:48 +0200 Subject: [PATCH] Mandantenkonfig: Gewichtsoptionen nur anzeigen, wenn Gewichtseinheiten definiert sind --- SL/Controller/ClientConfig.pm | 2 +- templates/webpages/client_config/_miscellaneous.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 %] -- 2.20.1