From 31f2e890b5b3e1b0ad29a877ff67bc641ea1fc40 Mon Sep 17 00:00:00 2001 From: levinse Date: Wed, 6 Apr 2011 08:24:27 +0000 Subject: bulk DID order/inventory improvements, RT11291 --- httemplate/elements/did_order_item.html | 69 ++++++++++++++++++++++++++++++ httemplate/elements/tr-did_order_item.html | 24 +++++++++++ 2 files changed, 93 insertions(+) create mode 100644 httemplate/elements/did_order_item.html create mode 100644 httemplate/elements/tr-did_order_item.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/did_order_item.html b/httemplate/elements/did_order_item.html new file mode 100644 index 000000000..263826ecc --- /dev/null +++ b/httemplate/elements/did_order_item.html @@ -0,0 +1,69 @@ +% unless ( $opt{'js_only'} ) { + + + + + +% foreach my $field ( @fields ) { +% +% my $value = ''; +% $value = $item->get($field); + + +% } + +
+ " + <% $onchange %> + >
+ <% $label{$field} %> +
+ +% } +<%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; + + diff --git a/httemplate/elements/tr-did_order_item.html b/httemplate/elements/tr-did_order_item.html new file mode 100644 index 000000000..7824aee03 --- /dev/null +++ b/httemplate/elements/tr-did_order_item.html @@ -0,0 +1,24 @@ +% unless ( $opt{'js_only'} ) { + + <% include('tr-td-label.html', %opt) %> + > + +% } +% + <% include( '/elements/did_order_item.html', %opt ) %> +% +% unless ( $opt{'js_only'} ) { + + + + +% } +<%init> + +my( %opt ) = @_; + +my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + +$opt{'label'} ||= 'Item'; + + -- cgit v1.2.1