stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / edit / cust_location-censustract.html
1 <% include('/elements/header-popup.html', "Edit Census Tract") %>
2
3 <% include('/elements/error.html') %>
4
5 <FORM NAME="EditLocationForm" 
6 ACTION="<% $p %>edit/process/cust_location-censustract.html" METHOD=POST>
7 <INPUT TYPE="hidden" NAME="locationnum" VALUE="<% $locationnum %>">
8
9 <% ntable('#cccccc') %>
10 <& /elements/location.html,
11   'object'              => $cust_location,
12   'no_asterisks'        => 1,
13   'enable_censustract'  => 1,
14   'disabled'            => 'DISABLED',
15 &>
16 <& /elements/standardize_locations.html,
17             'form'          => 'EditLocationForm',
18             'callback'      => 'document.EditLocationForm.submit();',
19             'with_census'   => 1,
20             'with_census_functions' => 1,
21 &>
22 </TABLE>
23
24 <BR>
25 <SCRIPT TYPE="text/javascript">
26 <&| /elements/onload.js &>
27   document.getElementById('enter_censustract').disabled = false;
28 </&>
29 function go() {
30   confirm_censustract();
31 }
32
33 function submit_abort() {
34   nd(1);
35 }
36 </SCRIPT>
37 <INPUT TYPE="button" NAME="submitButton" VALUE="Submit" onclick="go()">
38 </FORM>
39 </BODY>
40 </HTML>
41
42 <%init>
43
44 my $conf = new FS::Conf;
45
46 my $curuser = $FS::CurrentUser::CurrentUser;
47
48 # it's the same access right you'd need to do this by editing packages
49 die "access denied"
50   unless $curuser->access_right('Change customer package');
51
52 my $locationnum = scalar($cgi->param('locationnum'));
53 my $cust_location = qsearchs({
54     'select'    => 'cust_location.*',
55     'table'     => 'cust_location',
56     'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
57     'hashref'   => { 'locationnum' => $locationnum },
58     'extra_sql' => ' AND '. $curuser->agentnums_sql,
59   }) or die "unknown locationnum $locationnum";
60
61 # unlike the regular one, this allows editing disabled locations
62
63 my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_location->custnum })
64   or die "can't get cust_main record for custnum ". $cust_location->custnum;
65
66 </%init>