From 663b89d06a2c97fb0e7915ba409310fbefefea98 Mon Sep 17 00:00:00 2001 From: levinse Date: Mon, 6 Dec 2010 06:36:02 +0000 Subject: -tr-select-cust_location.html and elements/location.html: optionally support alternate address format and optional address -nearly finished qualifications, RT7111 --- httemplate/misc/qual.html | 81 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 httemplate/misc/qual.html (limited to 'httemplate/misc') diff --git a/httemplate/misc/qual.html b/httemplate/misc/qual.html new file mode 100644 index 000000000..779634281 --- /dev/null +++ b/httemplate/misc/qual.html @@ -0,0 +1,81 @@ +<% include('/elements/header-popup.html', 'Service Qualification' ) %> + +<% include('/elements/error.html') %> + +
+ + + +<% ntable("#cccccc", 2) %> + +<% include('/elements/tr-td-label.html', + 'cgi' => $cgi, + 'label' => 'Qualify using', + 'cell_style' => 'font-weight: bold', + 'id' => 'exportnum', + ) +%> + +<% include('/elements/select.html', + 'cgi' => $cgi, + 'field' => 'exportnum', + 'options' => \@export_options, + 'labels' => $export_labels, + 'curr_value' => $cgi->param('exportnum'), + ) +%> + + + +<% include('/elements/tr-input-text.html', + 'cgi' => $cgi, + 'label' => 'Service Telephone Number', + 'field' => 'phonenum', + 'size' => '12', + 'value' => $cgi->param('phonenum'), + ) +%> + +<% include('/elements/tr-select-cust_location.html', + 'cgi' => $cgi, + 'cust_main' => $cust_main, + 'alt_format' => 1, # XXX: use a config option + 'is_optional' => 1, + 'no_bold' => 1, + ) +%> + + +
+ + +
+ + +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('Order customer package'); # XXX: fix this + +my $conf = new FS::Conf; +my $date_format = $conf->config('date_format') || '%m/%d/%Y'; + +$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 @exports = grep { $_->can('qual') } qsearch( 'part_export', {} ); +my @export_options = ( 0 ); +my $export_labels = { '0' => '(manual)' }; +foreach my $export ( @exports ) { + push @export_options, $export->exportnum; + $export_labels->{$export->exportnum} = $export->exportname; +} + + -- cgit v1.2.1