From 94f3406dd6f85ad4c5ac33d6995c438630c2c028 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 23 Jan 2008 16:04:23 +0000 Subject: [PATCH] =?utf8?q?Einlagern:=20Nach=20der=20Artikelauswahl=20per?= =?utf8?q?=20Popup=20automatisch=20"Erneuern"=20dr=C3=BCcken.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/common.pl | 16 ++++++++++++++-- js/part_selection.js | 1 + .../webpages/generic/part_selection_de.html | 7 ++++++- .../webpages/generic/part_selection_master.html | 7 ++++++- .../wh/warehouse_selection_stock_de.html | 4 ++-- .../wh/warehouse_selection_stock_master.html | 4 ++-- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index d2ac1fa69..f3fc1e80a 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -127,9 +127,19 @@ sub part_selection_internal { $order_dir = 1; $order_dir = $form->{"order_dir"} if (defined($form->{"order_dir"})); - %options = map { $_ => 1 } split m/:/, $form->{options}; + my %options; - map { $form->{$_} = 1 if ($options{$_}) } qw(no_services no_assemblies); + foreach my $opt (split m/:/, $form->{options}) { + if ($opt =~ /=/) { + my ($key, $value) = split m/=/, $opt, 2; + $options{$key} = $value; + + } else { + $options{$opt} = 1; + } + } + + map { $form->{$_} = $options{$_} if ($options{$_}) } qw(no_services no_assemblies click_button); $parts = Common->retrieve_parts(\%myconfig, $form, $order_by, $order_dir); @@ -156,6 +166,8 @@ sub part_selection_internal { }, @header_sort); + $form->{formname} ||= 'Form'; + $form->{title} = $locale->text("Select a part"); $form->header(); print $form->parse_html_template("generic/part_selection", { "HEADER" => \@header, diff --git a/js/part_selection.js b/js/part_selection.js index 8113e8ba3..5e5ff80a6 100644 --- a/js/part_selection.js +++ b/js/part_selection.js @@ -33,6 +33,7 @@ function part_selection_window(input_partnumber, input_description, input_partsi "input_partnotes=" + escape_more(input_partnotes) + "&" + "filter=" + escape_more(filter) + "&" + "options=" + escape_more(options) + "&" + + "formname=" + escape_more(formname) + "&" + "allow_creation=" + (allow_creation ? "1" : "0") + "&" + "action_on_part_selected=" + (null == action_on_part_selected ? "" : action_on_part_selected.value); //alert(url); diff --git a/templates/webpages/generic/part_selection_de.html b/templates/webpages/generic/part_selection_de.html index f6c8b02fb..4569befd8 100644 --- a/templates/webpages/generic/part_selection_de.html +++ b/templates/webpages/generic/part_selection_de.html @@ -9,6 +9,7 @@ +
[% title %]
@@ -92,7 +93,7 @@ } if (document.Form.action_on_part_selected.value != "") { window.opener.document.getElementsByName("action")[0].value = document.Form.action_on_part_selected.value; - window.opener.document.Form.submit(); + window.opener.document.[% formname %].submit(); } @@ -107,6 +108,10 @@ input.value = name; } + [%- IF click_button %] + window.opener.document.[% formname %].[% click_button %].click(); + [%- END %] + self.close(); } //--> diff --git a/templates/webpages/generic/part_selection_master.html b/templates/webpages/generic/part_selection_master.html index 41c3f5181..7eb7ef6b2 100644 --- a/templates/webpages/generic/part_selection_master.html +++ b/templates/webpages/generic/part_selection_master.html @@ -9,6 +9,7 @@ +
[% title %]
@@ -92,7 +93,7 @@ } if (document.Form.action_on_part_selected.value != "") { window.opener.document.getElementsByName("action")[0].value = document.Form.action_on_part_selected.value; - window.opener.document.Form.submit(); + window.opener.document.[% formname %].submit(); } @@ -107,6 +108,10 @@ input.value = name; } + [%- IF click_button %] + window.opener.document.[% formname %].[% click_button %].click(); + [%- END %] + self.close(); } //--> diff --git a/templates/webpages/wh/warehouse_selection_stock_de.html b/templates/webpages/wh/warehouse_selection_stock_de.html index 745c5f25f..c36d581f3 100644 --- a/templates/webpages/wh/warehouse_selection_stock_de.html +++ b/templates/webpages/wh/warehouse_selection_stock_de.html @@ -96,7 +96,7 @@ Artikelbeschreibung - + @@ -124,7 +124,7 @@

- + [%- IF parts_id %] [%- END %] diff --git a/templates/webpages/wh/warehouse_selection_stock_master.html b/templates/webpages/wh/warehouse_selection_stock_master.html index a3475d1c7..8ff944ebe 100644 --- a/templates/webpages/wh/warehouse_selection_stock_master.html +++ b/templates/webpages/wh/warehouse_selection_stock_master.html @@ -96,7 +96,7 @@ Part Description - + @@ -124,7 +124,7 @@

- + [%- IF parts_id %] [%- END %] -- 2.20.1