This commit was generated by cvs2svn to compensate for changes in r11022,
[freeside.git] / httemplate / edit / cust_location.cgi
1 <% include('/elements/header-popup.html', "Edit Location") %>
2
3 <% include('/elements/error.html') %>
4
5 <FORM NAME="EditLocationForm" 
6 ACTION="<% $p %>edit/process/cust_location.cgi" METHOD=POST>
7 <INPUT TYPE="hidden" NAME="locationnum" VALUE="<% $locationnum %>">
8
9 <% ntable('#cccccc') %>
10 <% include('/elements/location.html',
11             'object'        => $cust_location,
12             'no_asterisks'  => 1,
13             ) %>
14 </TABLE>
15
16 <BR>
17 <SCRIPT TYPE="text/javascript">
18 function areyousure() {
19   return confirm('Modify this service location?');
20 }
21 </SCRIPT>
22 <INPUT TYPE="submit" VALUE="Submit" onclick="return areyousure()">
23
24 </FORM>
25 </BODY>
26 </HTML>
27
28 <%init>
29
30 my $conf = new FS::Conf;
31
32 my $curuser = $FS::CurrentUser::CurrentUser;
33
34 # it's the same access right you'd need to do this by editing packages
35 die "access denied"
36   unless $curuser->access_right('Change customer package');
37
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";
46
47 die "can't edit disabled locationnum $locationnum" if $cust_location->disabled;
48
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;
51
52 my @cust_pkgs = qsearch('cust_pkg', { 'locationnum' => $locationnum });
53
54 </%init>