Einlagern: Nach der Artikelauswahl per Popup automatisch "Erneuern" drücken.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 23 Jan 2008 16:04:23 +0000 (16:04 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 23 Jan 2008 16:04:23 +0000 (16:04 +0000)
bin/mozilla/common.pl
js/part_selection.js
templates/webpages/generic/part_selection_de.html
templates/webpages/generic/part_selection_master.html
templates/webpages/wh/warehouse_selection_stock_de.html
templates/webpages/wh/warehouse_selection_stock_master.html

index d2ac1fa..f3fc1e8 100644 (file)
@@ -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,
index 8113e8b..5e5ff80 100644 (file)
@@ -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);
index f6c8b02..4569bef 100644 (file)
@@ -9,6 +9,7 @@
   <input type="hidden" name="allow_creation" value="[% HTML.escape(allow_creation) %]">
   <input type="hidden" name="action_on_part_selected" value="[% HTML.escape(action_on_part_selected) %]">
   <input type="hidden" name="filter" value="[% HTML.escape(filter) %]">
+  <input type="hidden" name="options" value="[% HTML.escape(options) %]">
   <input type="hidden" name="new_description" value="[% HTML.escape(description) %]">
 
   <div class="listtop">[% title %]</div>
@@ -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();
         }
 
 
           input.value = name;
         }
 
+        [%- IF click_button %]
+        window.opener.document.[% formname %].[% click_button %].click();
+        [%- END %]
+
         self.close();
       }
       //-->
index 41c3f51..7eb7ef6 100644 (file)
@@ -9,6 +9,7 @@
   <input type="hidden" name="allow_creation" value="[% HTML.escape(allow_creation) %]">
   <input type="hidden" name="action_on_part_selected" value="[% HTML.escape(action_on_part_selected) %]">
   <input type="hidden" name="filter" value="[% HTML.escape(filter) %]">
+  <input type="hidden" name="options" value="[% HTML.escape(options) %]">
   <input type="hidden" name="new_description" value="[% HTML.escape(description) %]">
 
   <div class="listtop">[% title %]</div>
@@ -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();
         }
 
 
           input.value = name;
         }
 
+        [%- IF click_button %]
+        window.opener.document.[% formname %].[% click_button %].click();
+        [%- END %]
+
         self.close();
       }
       //-->
index 745c5f2..c36d581 100644 (file)
@@ -96,7 +96,7 @@
      <th align="right" nowrap>Artikelbeschreibung</th>
      <td>
       <input name="description" size="30" value="[% HTML.escape(description) %]">
-      <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'no_services:no_assemblies')" value="?">
+      <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'no_services:no_assemblies:click_button=update_button')" value="?">
      </td>
     </tr>
 
   </p>
 
   <p>
-   <input type="submit" class="submit" name="action" value="Erneuern">
+   <input type="submit" class="submit" name="action" id="update_button" value="Erneuern">
    [%- IF parts_id %]
    <input type="submit" class="submit" name="action" value="Einlagern">
    [%- END %]
index a3475d1..8ff944e 100644 (file)
@@ -96,7 +96,7 @@
      <th align="right" nowrap><translate>Part Description</translate></th>
      <td>
       <input name="description" size="30" value="[% HTML.escape(description) %]">
-      <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'no_services:no_assemblies')" value="?">
+      <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'no_services:no_assemblies:click_button=update_button')" value="?">
      </td>
     </tr>
 
   </p>
 
   <p>
-   <input type="submit" class="submit" name="action" value="<translate>Update</translate>">
+   <input type="submit" class="submit" name="action" id="update_button" value="<translate>Update</translate>">
    [%- IF parts_id %]
    <input type="submit" class="submit" name="action" value="<translate>Stock</translate>">
    [%- END %]