From b8fc23615be0ad6d89a8dda296c71c4023b25359 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 5 Jun 2013 08:50:06 +0200 Subject: [PATCH] =?utf8?q?Migration=20Freitext-Lagerfeld=20nach=20wirklich?= =?utf8?q?en=20Lager=20verbessert.=20Automatisches=20Durchsuchen=20war=20u?= =?utf8?q?nsauber,=20hier=20wurde=20nur=20der=20erste=20Treffer=20gefunden?= =?utf8?q?.=20Leer-Auswahl=20von=20einzelnen=20Lagerpl=C3=A4tze=20nachdem?= =?utf8?q?=20schon=20ein=20Lagerplatz=20ausgew=C3=A4hlt=20wurde,=20aktuali?= =?utf8?q?siert=20nicht=20den=20Lagerplatz=20richtig.=20Zumindestens=20bei?= =?utf8?q?m=20Anlegen=20abgefangen=20und=20ein=20Hinweis=20bei=20dem=20Mig?= =?utf8?q?rationsdialog=20geschrieben.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- locale/de/all | 1 + sql/Pg-upgrade2/default_bin_parts.pl | 4 +++- .../webpages/dbupgrade/default_bin_parts.html | 15 +++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/locale/de/all b/locale/de/all index 14872fb53..4288fc9e3 100755 --- a/locale/de/all +++ b/locale/de/all @@ -830,6 +830,7 @@ $self->{texts} = { 'Employee' => 'Bearbeiter', 'Employee #1 saved!' => 'Benutzer #1 gespeichert!', 'Employees' => 'Benutzer', + 'Empty selection for warehouse will not be added, even if the old bin is still visible (use back and forth to edit again).' => '', 'Empty transaction!' => 'Buchung ist leer!', 'End date' => 'Enddatum', 'Enter a description for this new draft.' => 'Geben Sie eine Beschreibung für diesen Entwurf ein.', diff --git a/sql/Pg-upgrade2/default_bin_parts.pl b/sql/Pg-upgrade2/default_bin_parts.pl index 89ec6195e..948067cf7 100644 --- a/sql/Pg-upgrade2/default_bin_parts.pl +++ b/sql/Pg-upgrade2/default_bin_parts.pl @@ -66,7 +66,9 @@ sub run { foreach my $i (1 .. $::form->{rowcount}) { # Best Case: Lagerplatz aus Liste gewählt - if ($::form->{"bin_id_$i"}) { + # bei zurückspringen auf leeres lager, wird der lagerplatz nicht zurückgesetzt + # erstmal an dieser stelle abfangen, damit nichts angelegt wird + if ($::form->{"bin_id_$i"} && $::form->{"warehouse_id_$i"}) { $prepared_update_query->execute($::form->{"warehouse_id_$i"}, $::form->{"bin_id_$i"}, $::form->{"partid_$i"}) || $self->db_error($update_query); } elsif ($CREATE_BINS) { # Lager vorhanden, bzw. vorher erstellt. alte bins automatisch hinzufügen und zum Standardlagerplatz verdrahten diff --git a/templates/webpages/dbupgrade/default_bin_parts.html b/templates/webpages/dbupgrade/default_bin_parts.html index 07b397e8b..2c7413d6c 100644 --- a/templates/webpages/dbupgrade/default_bin_parts.html +++ b/templates/webpages/dbupgrade/default_bin_parts.html @@ -50,22 +50,25 @@ control.options[bin_index].selected = true; } + function bin_match(rowcount) { - for (i = 1; i < rowcount + 1; i++) { // über alle parts_id + for (i = 1; i <= rowcount + 1; i++) { // über alle parts_id var lagerplatz = document.getElementById("bin_" + i).value; var control = document.getElementById("bin_id_" + i); var bin_index = 0; - //alert(lagerplatz); for (j = 0; j < warehouses.length; j++) { // über alle lager var warehouse = warehouses[j]; for (k = 0; k < warehouse['bins'].length; k++) { // über alle lagerplätze if (lagerplatz == warehouse['bins'][k]['description']) { - //alert('ware ' + warehouse['bins'][k]['description']); var lager = document.getElementById("warehouse_id_" + i); lager.selectedIndex = j; bin_index = k; + for (bin_i = 0; bin_i < warehouse['bins'].length; bin_i++) { + control.options[bin_i] = new Option(warehouse['bins'][bin_i]['description'], warehouse['bins'][bin_i]['id']); + } + control.options[bin_index].selected = true; break; /*var lagerplatz = document.getElementById("bin_id_" + i); alert('lagerplatz ' + lagerplatz.value); @@ -75,11 +78,6 @@ } } } - for (i = 0; i < warehouse['bins'].length; i++) { - control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']); - } - control.options[bin_index].selected = true; - } @@ -104,6 +102,7 @@

[% 'This has been changed in this version, therefore please change the "old" bins to some real warehouse bins.' | $T8 %]

[% 'If your old bins match exactly Bins in the Warehouse CLICK on AUTOMATICALLY MATCH BINS.' | $T8 %]

[% 'Otherwise you can simply check create warehouse and bins and define a name for the warehouse (Bins will be created automatically) and then continue' | $T8 %]

+

[% 'Empty selection for warehouse will not be added, even if the old bin is still visible (use back and forth to edit again).' | $T8 %]

-- 2.20.1