bulk DID orders/inventory improvements, RT11291
[freeside.git] / httemplate / elements / did_order_item.html
index 00668f9..b582683 100644 (file)
@@ -14,6 +14,7 @@
                  SIZE  = "3"
                  VALUE = "<% scalar($cgi->param($name."_quantity"))
                              || $value |h %>"
+                 <% $onchange %>
           >
           <BR><FONT SIZE="-1">Quantity</FONT>
       </TD>
@@ -26,6 +27,7 @@
                  SIZE  = "3"
                  VALUE = "<% scalar($cgi->param($name."_npa"))
                              || $value |h %>"
+                 <% $onchange %>
           >
           <BR><FONT SIZE="-1">NPA</FONT>
       </TD>
@@ -109,6 +111,15 @@ my $id = $opt{'id'} || 'orderitemnum';
 
 my $curr_value = $opt{'curr_value'} || $opt{'value'};
 
+my $onchange = '';
+if ( $opt{'onchange'} ) {
+  $onchange = $opt{'onchange'};
+  $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
+  $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack.  all onchange
+                                        #callbacks should act the same
+ $onchange = 'onChange="'. $onchange. '"';
+}
+
 my $item;
 if ( $curr_value ) {
   $item = qsearchs('did_order_item', { 'orderitemnum' => $curr_value } );