[freeside-commits] freeside/httemplate/elements did_order_item.html, 1.1.2.3, 1.1.2.4

Erik Levinson levinse at wavetail.420.am
Thu Apr 14 20:09:54 PDT 2011


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv15204/httemplate/elements

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	did_order_item.html 
Log Message:
bulk DID orders/inventory enhancements, RT11291

Index: did_order_item.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/did_order_item.html,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -w -d -r1.1.2.3 -r1.1.2.4
--- did_order_item.html	11 Apr 2011 23:03:33 -0000	1.1.2.3
+++ did_order_item.html	15 Apr 2011 03:09:52 -0000	1.1.2.4
@@ -4,24 +4,70 @@
 
   <TABLE>
     <TR>
-%     foreach my $field ( @textfields ) {
-%
 %       my $value = '';
-%         $value = $item->get($field);
 
+%     $value = $item->get('quantity');
         <TD>
           <INPUT TYPE  = "text"
-                 NAME  = "<%$name%>_<%$field%>"
-                 ID    = "<%$id%>_<%$field%>"
-                 SIZE  = "<% $size{$field} || 15 %>"
-                 VALUE = "<% scalar($cgi->param($name."_$field"))
+                 NAME  = "<%$name%>_quantity"
+                 ID    = "<%$id%>_quantity"
+                 SIZE  = "3"
+                 VALUE = "<% scalar($cgi->param($name."_quantity"))
                              || $value |h %>"
-                 <% $onchange %>
           >
-          <BR><FONT SIZE="-1"><% $label{$field} %></FONT>
+          <BR><FONT SIZE="-1">Quantity</FONT>
         </TD>
-%     }
-%     my $value = '';
+      
+%     $value = $item->get('npa');
+      <TD>
+          <INPUT TYPE  = "text"
+                 NAME  = "<%$name%>_npa"
+                 ID    = "<%$id%>_npa"
+                 SIZE  = "3"
+                 VALUE = "<% scalar($cgi->param($name."_npa"))
+                             || $value |h %>"
+          >
+          <BR><FONT SIZE="-1">NPA</FONT>
+      </TD>
+
+%     $value = $item->get('ratecenternum');
+      <TD>
+        <% include('/elements/select-table.html',
+                         'name_col'      => 'description',
+                         'table'         => 'rate_center',
+                         'disable_empty' => 0,
+                         'empty_label'   => ' ',
+                         'field'         => "${name}_ratecenternum",
+                         'id'            => "${id}_ratecenternum",
+                         'curr_value'    => scalar($cgi->param("${name}_ratecenternum"))
+                                             || $value,
+                         'post_options'  => [ 0 => 'Add new...' ],
+                         onchange        => 'ratecenter_changed',
+                  )
+         %>
+        <BR><FONT SIZE="-1">Rate Center</FONT>
+        <div style="display:none; font-size: 80%" id="<%$id%>_rc_div">
+             - add new: <INPUT TYPE  = "text"
+                 NAME  = "<%$name%>_rc_new"
+                 ID    = "<%$id%>_rc_new">
+        </div>
+      </TD>
+
+%     $value = $item->get('msanum');
+      <TD>
+        <% include('/elements/select-table.html',
+                         'name_col'      => 'description',
+                         'table'         => 'msa',
+                         'disable_empty' => 0,
+                         'empty_label'   => ' ',
+                         'field'         => "${name}_msanum",
+                         'curr_value'    => scalar($cgi->param("${name}_msanum"))
+                                             || $value,
+                   )
+         %>
+        <BR><FONT SIZE="-1">MSA</FONT>
+      </TD>
+
 %     $value = $item->get('latanum');
       <TD><% include('/elements/select-table.html',
                          'name_col'      => 'description',
@@ -36,6 +82,7 @@
             %>
         <BR><FONT SIZE="-1">LATA #</FONT>
       </TD>
+
 %     $value = $item->get('state');
       <TD><% include('/elements/select-state.html',
                          'disable_empty' => 0,
@@ -48,6 +95,7 @@
             %>
           <BR><FONT SIZE="-1">State</FONT>
       </TD>
+
     </TR>
   </TABLE>
 
@@ -61,15 +109,6 @@
 
 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 } );
@@ -77,15 +116,4 @@
   $item = new FS::did_order_item {};
 }
 
-my %size = ( 'npa' => 3, 
-	     'quantity' => 3,);
-
-tie my %label, 'Tie::IxHash',
-  'quantity' => 'Quantity',
-  'npa'        => 'NPA',
-  'ratecenter'        => 'Rate Center',
-  'msa'        => 'MSA',
-;
-my @textfields = keys %label;
-
 </%init>



More information about the freeside-commits mailing list