Pflichtenhefte Angebote/Aufträge: "Artikel allen Abschnitten zuweisen" fixen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 2 Aug 2013 09:53:19 +0000 (11:53 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 1 Apr 2014 11:09:09 +0000 (13:09 +0200)
js/requirement_spec.js
templates/webpages/requirement_spec_order/_assignment_form.html

index e059e84..00e4319 100644 (file)
@@ -408,10 +408,18 @@ ns.disable_create_quotation_order_commands = function(key, opt) {
 };
 
 ns.assign_order_part_id_to_all = function() {
-  var order_part_id = $('#quoations_and_orders_order_id').val();
-  $('#quotations_and_orders_form SELECT[name="sections[].order_part_id"]').each(function(idx, elt) {
+  var order_part_id   = $('#quotations_and_orders_order_id').val();
+  var order_part_name = $('#quotations_and_orders_order_id_name').val();
+
+  $('#quotations_and_orders_form INPUT[name="sections[].order_part_id"]').each(function(idx, elt) {
     $(elt).val(order_part_id);
   });
+
+  $('#quotations_and_orders_form [id^=quotations_and_orders_sections_order_pard_id_]').filter(function() {
+    return $(this).attr('id') && $(this).attr('id').match("^quotations_and_orders_sections_order_pard_id_[0-9]+_name$");
+  }).each(function(idx, elt) {
+    $(elt).val(order_part_name);
+  });
 };
 
 // -------------------------------------------------------------------------
index 69d3379..28cc667 100644 (file)
@@ -18,7 +18,7 @@
   <tr>
    <td>[% LxERP.t8("Assign the following article to all sections") %]:</td>
    <td>
-    [% P.part_picker('quotations_and_orders_dummy', INSTANCE_CONF.get_requirement_spec_section_order_part_id, convertible_unit=SELF.h_unit_name, id='quoations_and_orders_order_id', style=style) %]
+    [% P.part_picker('quotations_and_orders_dummy', INSTANCE_CONF.get_requirement_spec_section_order_part_id, convertible_unit=SELF.h_unit_name, id='quotations_and_orders_order_id', style=style) %]
     [% L.button_tag('kivi.requirement_spec.assign_order_part_id_to_all()', LxERP.t8('Assign article')) %]
    </td>
   </tr>
@@ -41,7 +41,7 @@
     <td>[% HTML.escape(section.fb_number) %]</td>
     <td>[% HTML.escape(section.title) %]</td>
     <td>[% HTML.escape(P.truncate(section.description)) %]</td>
-    <td>[% P.part_picker('sections[].order_part_id', section.order_part_id, convertible_unit=SELF.h_unit_name, id='quoations_and_orders_sections_order_pard_id_' _ loop.count, style=style) %]</td>
+    <td>[% P.part_picker('sections[].order_part_id', section.order_part_id, convertible_unit=SELF.h_unit_name, id='quotations_and_orders_sections_order_pard_id_' _ loop.count, style=style) %]</td>
    </tr>
    [% END %]
   </tbody>