-tr-select-cust_location.html and elements/location.html: optionally support alternat...
[freeside.git] / httemplate / misc / qual.html
1 <% include('/elements/header-popup.html', 'Service Qualification' ) %>
2
3 <% include('/elements/error.html') %>
4
5 <FORM NAME="QualForm" ACTION="<% $p %>edit/process/qual.cgi" METHOD="POST">
6
7 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $cust_main->custnum %>">
8
9 <% ntable("#cccccc", 2) %>
10
11 <% include('/elements/tr-td-label.html',
12              'cgi'       => $cgi,
13              'label'    => 'Qualify using',
14              'cell_style' => 'font-weight: bold',
15              'id' => 'exportnum',
16           )
17 %>
18 <TD>
19 <% include('/elements/select.html',
20              'cgi'       => $cgi,
21              'field'    => 'exportnum',
22              'options'  => \@export_options,
23              'labels'   => $export_labels,
24              'curr_value' => $cgi->param('exportnum'),
25           )
26 %>
27 </TD>
28 </TR>
29
30 <% include('/elements/tr-input-text.html',
31              'cgi'       => $cgi,
32              'label'    => 'Service Telephone Number',
33              'field'    => 'phonenum',
34              'size'     => '12',
35              'value'    => $cgi->param('phonenum'),
36           )
37 %>
38
39 <% include('/elements/tr-select-cust_location.html',
40              'cgi'       => $cgi,
41              'cust_main' => $cust_main,
42              'alt_format' => 1, # XXX: use a config option
43              'is_optional' => 1,
44              'no_bold' => 1,
45           )
46 %>
47 </TABLE>
48
49 <BR>
50 <INPUT type="submit" VALUE="Qualify" onClick = "this.disabled=true;">
51
52 </FORM>
53 </BODY>
54 </HTML>
55 <%init>
56
57 my $curuser = $FS::CurrentUser::CurrentUser;
58
59 die "access denied"
60   unless $curuser->access_right('Order customer package'); # XXX: fix this
61
62 my $conf = new FS::Conf;
63 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
64
65 $cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum";
66 my $custnum = $1;
67 my $cust_main = qsearchs({
68   'table'     => 'cust_main',
69   'hashref'   => { 'custnum' => $custnum },
70   'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
71 });
72
73 my @exports = grep { $_->can('qual') } qsearch( 'part_export', {} );
74 my @export_options = ( 0 );
75 my $export_labels = { '0' => '(manual)' };
76 foreach my $export ( @exports ) {
77     push @export_options, $export->exportnum;
78     $export_labels->{$export->exportnum} = $export->exportname;
79 }
80
81 </%init>