summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorlevinse <levinse>2011-04-22 23:17:39 +0000
committerlevinse <levinse>2011-04-22 23:17:39 +0000
commitdad39ad50ddc5cbb549a0207262d94a4886d5fec (patch)
treecca5a44660eb621140d192174ba7ff9457a2da32 /httemplate
parent9d354e2a0b212a3459d93f3698f26e200577f289 (diff)
bulk DID orders/inventory improvements, RT11291
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/did_order.html2
-rw-r--r--httemplate/elements/did_order_item.html11
-rw-r--r--httemplate/misc/phone_avail-import.html13
3 files changed, 25 insertions, 1 deletions
diff --git a/httemplate/edit/did_order.html b/httemplate/edit/did_order.html
index cbd33007d..5837d438c 100644
--- a/httemplate/edit/did_order.html
+++ b/httemplate/edit/did_order.html
@@ -44,6 +44,7 @@
'name' => 'Bulk DID Order',
'field_callback' => $field_callback,
'html_bottom' => $javascript,
+ 'body_etc' => 'onLoad="stockcust_changed()"',
)
%>
<%init>
@@ -109,7 +110,6 @@ my $javascript = <<END;
custnum_select.disabled = false;
}
custnum.value = '';
- custnum_search.value = '';
}
/* o2m or something else is broken, can't put this in the actual
diff --git a/httemplate/elements/did_order_item.html b/httemplate/elements/did_order_item.html
index 00668f94f..b582683b7 100644
--- a/httemplate/elements/did_order_item.html
+++ b/httemplate/elements/did_order_item.html
@@ -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 } );
diff --git a/httemplate/misc/phone_avail-import.html b/httemplate/misc/phone_avail-import.html
index 635b8f69c..b6fea7ec2 100644
--- a/httemplate/misc/phone_avail-import.html
+++ b/httemplate/misc/phone_avail-import.html
@@ -45,6 +45,16 @@ Import a file containing phone numbers (DIDs).
<TD><% $format %><INPUT TYPE="hidden" NAME="format" VALUE="<% $format %>"></TD>
</TR>
+% if ( scalar(@exports) == 1 ) {
+% my $export = $exports[0];
+ <TR>
+ <TD>Export</TD>
+ <TD>
+ <INPUT TYPE="hidden" name="exportnum" value="<%$export->exportnum%>">
+ <% $export->exportname %>
+ </TD>
+ </TR>
+% } else {
<% include( '/elements/tr-select-table.html',
'table' => 'part_export',
'name_col' => 'label',
@@ -55,6 +65,7 @@ Import a file containing phone numbers (DIDs).
#'label_callback' =>
)
%>
+% }
<TR>
<TH ALIGN="right">Country code</TH>
@@ -145,5 +156,7 @@ if ( $order ) {
my $availbatch =
time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
+
+my @exports = qsearch('part_export', { 'exporttype' => 'internal_diddb', });
</%init>