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 <% include('/elements/location.html',
11 'object' => $cust_location,
17 <SCRIPT TYPE="text/javascript">
18 function areyousure() {
19 return confirm('Modify this service location?');
22 <INPUT TYPE="submit" VALUE="Submit" onclick="return areyousure()">
30 my $conf = new FS::Conf;
32 my $curuser = $FS::CurrentUser::CurrentUser;
34 # it's the same access right you'd need to do this by editing packages
36 unless $curuser->access_right('Change customer package');
38 my $locationnum = scalar($cgi->param('locationnum'));
39 my $cust_location = qsearchs({
40 'select' => 'cust_location.*',
41 'table' => 'cust_location',
42 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
43 'hashref' => { 'locationnum' => $locationnum },
44 'extra_sql' => ' AND '. $curuser->agentnums_sql,
45 }) or die "unknown locationnum $locationnum";
47 die "can't edit disabled locationnum $locationnum" if $cust_location->disabled;
49 my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_location->custnum })
50 or die "can't get cust_main record for custnum ". $cust_location->custnum;
52 my @cust_pkgs = qsearch('cust_pkg', { 'locationnum' => $locationnum });