1 <% include('/elements/header-popup.html', "Edit Location") %>
3 <% include('/elements/error.html') %>
5 <FORM NAME="EditLocationForm"
6 ACTION="<% $p %>edit/process/cust_location.cgi" METHOD=POST>
7 <INPUT TYPE="hidden" NAME="locationnum" VALUE="<% $locationnum %>">
9 <% ntable('#cccccc') %>
10 <& /elements/location.html,
11 'object' => $cust_location,
13 # these are service locations, so they need all this stuff
15 'enable_district' => 1,
16 'enable_censustract' => 1,
18 <& /elements/standardize_locations.html,
19 'form' => 'EditLocationForm',
20 'callback' => 'document.EditLocationForm.submit();',
22 'with_census_functions' => 1,
27 <SCRIPT TYPE="text/javascript">
29 confirm('Modify this service location?') &&
30 standardize_locations();
33 function submit_abort() {
37 <INPUT TYPE="button" NAME="submitButton" VALUE="Submit" onclick="go()">
44 my $conf = new FS::Conf;
46 my $curuser = $FS::CurrentUser::CurrentUser;
48 # it's the same access right you'd need to do this by editing packages
50 unless $curuser->access_right('Change customer package');
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";
61 die "can't edit disabled locationnum $locationnum" if $cust_location->disabled;
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;
66 my @cust_pkgs = qsearch('cust_pkg', { 'locationnum' => $locationnum });