summaryrefslogtreecommitdiff
path: root/httemplate/misc/order_pkg.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc/order_pkg.html')
-rw-r--r--httemplate/misc/order_pkg.html75
1 files changed, 75 insertions, 0 deletions
diff --git a/httemplate/misc/order_pkg.html b/httemplate/misc/order_pkg.html
new file mode 100644
index 000000000..2c8335154
--- /dev/null
+++ b/httemplate/misc/order_pkg.html
@@ -0,0 +1,75 @@
+<% include('/elements/header-popup.html', 'Order new package' ) %>
+
+<SCRIPT TYPE="text/javascript">
+
+ function enable_order_pkg () {
+ if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) {
+ document.OrderPkgForm.submit.disabled = false;
+ } else {
+ document.OrderPkgForm.submit.disabled = true;
+ }
+ }
+
+</SCRIPT>
+
+<% include('/elements/error.html') %>
+
+<FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/quick-cust_pkg.cgi" METHOD="POST">
+
+<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $cust_main->custnum %>">
+
+<% ntable("#cccccc", 2) %>
+<TR>
+ <TH ALIGN="right">Package</TH>
+ <TD COLSPAN=7>
+ <% include('/elements/select-cust-part_pkg.html',
+ 'curr_value' => $pkgpart,
+ 'cust_main' => $cust_main,
+ 'onchange' => 'enable_order_pkg',
+ )
+ %>
+ </TD>
+</TR>
+
+% if ( $conf->exists('pkg_referral') ) {
+ <% include('/elements/tr-select-part_referral.html',
+ 'curr_value' => scalar( $cgi->param('refnum') ), #get rid of empty_label first# || $cust_main->refnum,
+ 'disable_empty' => 1,
+ 'multiple' => $conf->exists('pkg_referral-multiple'),
+ 'colspan' => 7,
+ )
+ %>
+% }
+
+<% include('/elements/tr-select-cust_location.html',
+ 'cgi' => $cgi,
+ 'cust_main' => $cust_main,
+ )
+%>
+
+</TABLE>
+
+<BR>
+<INPUT NAME="submit" TYPE="submit" VALUE="Order Package" <% $pkgpart ? '' : 'DISABLED' %>>
+
+</FORM>
+</BODY>
+</HTML>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Order customer package');
+
+my $conf = new FS::Conf;
+
+$cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum";
+my $custnum = $1;
+my $cust_main = qsearchs({
+ 'table' => 'cust_main',
+ 'hashref' => { 'custnum' => $custnum },
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+});
+
+my $pkgpart = scalar($cgi->param('pkgpart'));
+
+</%init>