From 115e5a24fdbd1afcabfea1e308aae00b6cd55106 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 9 Nov 2018 12:30:41 +0100 Subject: [PATCH] =?utf8?q?Artikel=20nicht=20l=C3=B6schen=20k=C3=B6nnen,=20?= =?utf8?q?wenn=20in=20Preisregeln=20verwendet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit behebt #353 "Preisregeln Wenn Artikel gelöscht wird" --- SL/Controller/Part.pm | 5 ++++- locale/de/all | 1 + locale/en/all | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index 27a23daa8..804ad1590 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -6,6 +6,7 @@ use parent qw(SL::Controller::Base); use Clone qw(clone); use SL::DB::Part; use SL::DB::PartsGroup; +use SL::DB::PriceRuleItem; use SL::DB::Shop; use SL::Controller::Helper::GetModels; use SL::Locale::String qw(t8); @@ -1266,7 +1267,8 @@ sub parse_add_items_to_objects { sub _setup_form_action_bar { my ($self) = @_; - my $may_edit = $::auth->assert('part_service_assembly_edit', 'may fail'); + my $may_edit = $::auth->assert('part_service_assembly_edit', 'may fail'); + my $used_in_pricerules = !!SL::DB::Manager::PriceRuleItem->get_all_count(where => [type => 'part', value_int => $self->part->id]); for my $bar ($::request->layout->get('actionbar')) { $bar->add( @@ -1292,6 +1294,7 @@ sub _setup_form_action_bar { disabled => !$self->part->id ? t8('This object has not been saved yet.') : !$may_edit ? t8('You do not have the permissions to access this function.') : !$self->part->orphaned ? t8('This object has already been used.') + : $used_in_pricerules ? t8('This object is used in price rules.') : undef, ], diff --git a/locale/de/all b/locale/de/all index b433df548..e99d817a7 100755 --- a/locale/de/all +++ b/locale/de/all @@ -3503,6 +3503,7 @@ $self->{texts} = { 'This module can help you identify and correct such entries by analyzing the general ledger and presenting you likely solutions but also allowing you to fix problems yourself.' => 'Dieses Modul kann Ihnen helfen, problematische Einträge im Hauptbuch zu identifizieren und teilweise zu beheben. Dabei werden je nach Problem mögliche Lösungen aufgezeigt, wobei Sie die entscheiden können, welche Probleme automatisch gelöst werden sollen.', 'This object has already been used.' => 'Dieses Objekt wird bereits verwendet.', 'This object has not been saved yet.' => 'Das Objekt wurde noch nicht gespeichert.', + 'This object is used in price rules.' => 'Dieses Objekt wird in Preisregeln verwendet.', 'This option controls the inventory system.' => 'Dieser Parameter legt die Warenbuchungsmethode fest.', 'This option controls the method used for determining the startdate for the balance report.' => 'Diese Option bestimmt, wie das Startdatum für den Bilanzbericht ermittelt wird', 'This option controls the method used for profit determination.' => 'Dieser Parameter legt die Berechnungsmethode für die Gewinnermittlung fest.', diff --git a/locale/en/all b/locale/en/all index 6a0002908..6b8c4f802 100644 --- a/locale/en/all +++ b/locale/en/all @@ -3502,6 +3502,7 @@ $self->{texts} = { 'This module can help you identify and correct such entries by analyzing the general ledger and presenting you likely solutions but also allowing you to fix problems yourself.' => '', 'This object has already been used.' => '', 'This object has not been saved yet.' => '', + 'This object is used in price rules.' => '', 'This option controls the inventory system.' => '', 'This option controls the method used for determining the startdate for the balance report.' => '', 'This option controls the method used for profit determination.' => '', -- 2.20.1