From de53e9a856f69917fd37d00821d90e89d8185d55 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 11 Sep 2014 18:12:16 +0200 Subject: [PATCH] =?utf8?q?PriceRule:=20L=C3=B6schen=20von=20Preisregeln?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/PriceRule.pm | 7 +++---- locale/de/all | 2 +- sql/Pg-upgrade2/price_rules_cascade_delete.sql | 6 ++++++ templates/webpages/price_rule/report_top.html | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 sql/Pg-upgrade2/price_rules_cascade_delete.sql diff --git a/SL/Controller/PriceRule.pm b/SL/Controller/PriceRule.pm index 6d66a458e..3f5983264 100644 --- a/SL/Controller/PriceRule.pm +++ b/SL/Controller/PriceRule.pm @@ -70,11 +70,10 @@ sub action_update { sub action_destroy { my ($self) = @_; - $self->price_rule->obsolete(1); - $self->price_rule->save; - flash_later('info', $::locale->text('The price rule has been obsoleted.')); + $self->price_rule->delete; + flash_later('info', $::locale->text('The price rule has been deleted.')); - $self->redirect_to(action => 'list'); + $self->redirect_to($::form->{callback} || (action => 'list')); } sub action_add_item_row { diff --git a/locale/de/all b/locale/de/all index 93669fd0d..c784af136 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2558,7 +2558,7 @@ $self->{texts} = { 'The predefined text is in use and cannot be deleted.' => 'Der vordefinierte Textblock wird verwendet und kann nicht gelöscht werden.', 'The preferred one is to install packages provided by your operating system distribution (e.g. Debian or RPM packages).' => 'Die bevorzugte Art, ein Perl-Modul zu installieren, ist durch Installation eines von Ihrem Betriebssystem zur Verfügung gestellten Paketes (z.B. Debian-Pakete oder RPM).', 'The price rule has been created.' => 'Die Preisregel wurde angelegt.', - 'The price rule has been obsoleted.' => 'Diese Preisregel ist nicht mehr gültig', + 'The price rule has been deleted.' => 'Die Preisregel wurde gelöscht.', 'The price rule has been saved.' => 'Die preisregel wurde gespeichert.', 'The printer could not be deleted.' => 'Der Drucker konnte nicht gelöscht werden.', 'The printer has been created.' => 'Der Drucker wurde angelegt.', diff --git a/sql/Pg-upgrade2/price_rules_cascade_delete.sql b/sql/Pg-upgrade2/price_rules_cascade_delete.sql new file mode 100644 index 000000000..543894f18 --- /dev/null +++ b/sql/Pg-upgrade2/price_rules_cascade_delete.sql @@ -0,0 +1,6 @@ +-- @tag: price_rules_cascade_delete +-- @description: Preisregeln: Beim Löschen items mitlöschen +-- @depends: release_3_1_0 price_rules + +ALTER TABLE price_rule_items DROP CONSTRAINT "price_rule_items_price_rules_id_fkey"; +ALTER TABLE price_rule_items ADD FOREIGN KEY (price_rules_id) REFERENCES price_rules(id) ON DELETE CASCADE; diff --git a/templates/webpages/price_rule/report_top.html b/templates/webpages/price_rule/report_top.html index 5762161a8..2d2e52ccc 100644 --- a/templates/webpages/price_rule/report_top.html +++ b/templates/webpages/price_rule/report_top.html @@ -1,3 +1,4 @@ [%- USE L %] +[%- PROCESS 'common/flash.html' %] [%- PROCESS 'price_rule/_filter.html' filter=SELF.filter %]
-- 2.20.1