diff options
author | levinse <levinse> | 2011-04-15 03:15:36 +0000 |
---|---|---|
committer | levinse <levinse> | 2011-04-15 03:15:36 +0000 |
commit | f4531e22c9e060274dc9718f829b52abbe8e2d33 (patch) | |
tree | 0c8ed2abe0f5334b10d58e60723759bc4761a580 /httemplate/elements | |
parent | 1e9400bf7d19612a317a882637a21f95204367be (diff) |
bulk DID orders/inventory enhancements, RT11291
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/did_order_item.html | 100 |
1 files changed, 64 insertions, 36 deletions
diff --git a/httemplate/elements/did_order_item.html b/httemplate/elements/did_order_item.html index 0f5a76516..00668f94f 100644 --- a/httemplate/elements/did_order_item.html +++ b/httemplate/elements/did_order_item.html @@ -4,24 +4,70 @@ <TABLE> <TR> -% foreach my $field ( @textfields ) { -% -% my $value = ''; -% $value = $item->get($field); +% my $value = ''; - <TD> +% $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> - </TD> -% } -% my $value = ''; + <BR><FONT SIZE="-1">Quantity</FONT> + </TD> + +% $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', @@ -32,10 +78,11 @@ 'field' => "${name}_latanum", 'curr_value' => scalar($cgi->param("${name}_latanum")) || $value, - ) + ) %> <BR><FONT SIZE="-1">LATA #</FONT> </TD> + % $value = $item->get('state'); <TD><% include('/elements/select-state.html', 'disable_empty' => 0, @@ -44,10 +91,11 @@ 'prefix' => "${name}_", 'state' => scalar($cgi->param("${name}_state")) || $value, - ) + ) %> <BR><FONT SIZE="-1">State</FONT> </TD> + </TR> </TABLE> @@ -61,15 +109,6 @@ 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 } ); @@ -77,15 +116,4 @@ if ( $curr_value ) { $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> |