summaryrefslogtreecommitdiff
path: root/httemplate/misc/qual.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc/qual.html')
-rw-r--r--httemplate/misc/qual.html110
1 files changed, 110 insertions, 0 deletions
diff --git a/httemplate/misc/qual.html b/httemplate/misc/qual.html
new file mode 100644
index 000000000..6df8daae4
--- /dev/null
+++ b/httemplate/misc/qual.html
@@ -0,0 +1,110 @@
+<% include('/elements/header-popup.html', 'Service Qualification' ) %>
+
+<% include('/elements/error.html') %>
+
+<FORM NAME = "QualForm"
+ ACTION = "<% $p %>edit/process/qual.cgi"
+ METHOD = "POST"
+ onSubmit = "document.QualForm.submitButton.disabled=true;"
+>
+
+<INPUT TYPE="hidden" NAME="<%$cust_or_prospect%>num" VALUE="<% $custnum_or_prospectnum %>">
+
+<% ntable("#cccccc", 2) %>
+
+<% include('/elements/tr-td-label.html',
+ 'cgi' => $cgi,
+ 'label' => 'Qualify using',
+ #'cell_style' => 'font-weight: bold',
+ 'id' => 'exportnum',
+ )
+%>
+<TD>
+<% include('/elements/select.html',
+ 'cgi' => $cgi,
+ 'field' => 'exportnum',
+ 'options' => \@export_options,
+ 'labels' => $export_labels,
+ 'curr_value' => $exportnum,
+ )
+%>
+</TD>
+</TR>
+
+<% include('/elements/tr-input-text.html',
+ 'cgi' => $cgi,
+ 'label' => 'Service phone number',
+ 'field' => 'phonenum',
+ 'size' => '12',
+ 'value' => scalar($cgi->param('phonenum')),
+
+ 'valign' => 'middle',
+ 'colspan' => 6,
+ 'prefix' => '<TABLE><TR><TD>',
+ 'postfix' => '</TD><TD><FONT SIZE="-2">'. join('<BR>',
+ 'Line-share (non dry loops) - always fill in',
+ 'Dry loops - always leave empty',
+ ). '</FONT></TD></TR></TABLE>',
+ )
+%>
+
+<% include('/elements/tr-select-cust_location.html',
+ 'cgi' => $cgi,
+ $table => $cust_main_or_prospect_main,
+ 'alt_format' => $conf->exists('qual-alt_address_format'),
+ 'disable_empty' => $conf->exists('qual-alt_address_format'),
+ 'no_bold' => 1,
+ #required for ikano.. config? 'is_optional' => 1,
+ )
+%>
+</TABLE>
+
+<BR>
+<INPUT TYPE = "submit"
+ NAME = "submitButton"
+ ID = "submitButton"
+ VALUE = "Qualify"
+>
+
+</FORM>
+</BODY>
+</HTML>
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied"
+ unless $curuser->access_right('Qualify service');
+
+my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
+$cgi->param('custnum') =~ /^(\d+)$/;
+my $custnum = $1;
+$cgi->param('prospectnum') =~ /^(\d+)$/;
+my $prospectnum = $1;
+my $cust_or_prospect = $custnum ? "cust" : "prospect";
+my $table = $cust_or_prospect . "_main";
+my $custnum_or_prospectnum = $custnum ? $custnum : $prospectnum;
+my $cust_main_or_prospect_main = qsearchs({
+ 'table' => $table,
+ 'hashref' => { $cust_or_prospect."num" => $custnum_or_prospectnum },
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+});
+die "neither prospect nor customer specified or found"
+ unless $cust_main_or_prospect_main;
+
+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;
+}
+my $exportnum = $cgi->param('error')
+ ? scalar($cgi->param('exportnum'))
+ : scalar(@exports) == 1
+ ? $exports[0]->exportnum
+ : '';
+
+</%init>