[freeside-commits] freeside/httemplate/elements did_order_item.html, NONE, 1.1 tr-did_order_item.html, NONE, 1.1
Erik Levinson
levinse at wavetail.420.am
Wed Apr 6 01:23:00 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv20854/httemplate/elements
Added Files:
did_order_item.html tr-did_order_item.html
Log Message:
bulk DID order/inventory improvements, RT11291
--- NEW FILE: tr-did_order_item.html ---
% unless ( $opt{'js_only'} ) {
<% include('tr-td-label.html', %opt) %>
<TD <% $cell_style %>>
% }
%
<% include( '/elements/did_order_item.html', %opt ) %>
%
% unless ( $opt{'js_only'} ) {
</TD>
</TR>
% }
<%init>
my( %opt ) = @_;
my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
$opt{'label'} ||= 'Item';
</%init>
--- NEW FILE: did_order_item.html ---
% unless ( $opt{'js_only'} ) {
<INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
<TABLE>
<TR>
% foreach my $field ( @fields ) {
%
% my $value = '';
% $value = $item->get($field);
<TD>
<INPUT TYPE = "text"
NAME = "<%$name%>_<%$field%>"
ID = "<%$id%>_<%$field%>"
SIZE = "<% $size{$field} || 15 %>"
VALUE = "<% scalar($cgi->param($name."_$field"))
|| $value |h %>"
<% $onchange %>
><BR>
<FONT SIZE="-1"><% $label{$field} %></FONT>
</TD>
% }
</TR>
</TABLE>
% }
<%init>
my( %opt ) = @_;
my $name = $opt{'element_name'} || $opt{'field'} || 'orderitemnum';
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 } );
} else {
$item = new FS::did_order_item {};
}
my %size = ( 'npa' => 3,
'latanum' => 3,
'state' => 2,
'quantity' => 3,);
tie my %label, 'Tie::IxHash',
'msa' => 'MSA',
'npa' => 'NPA',
'latanum' => 'LATA #',
'rate_center' => 'Rate Center',
'state' => 'State',
'quantity' => 'Quantity',
;
my @fields = keys %label;
</%init>
More information about the freeside-commits
mailing list