From f424f11eb366fe64f5f7bb42b21745e22537cab1 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 14 Dec 2010 07:29:13 +0000 Subject: cust_location editing features, RT#10766 --- httemplate/edit/cust_location.cgi | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 httemplate/edit/cust_location.cgi (limited to 'httemplate/edit/cust_location.cgi') diff --git a/httemplate/edit/cust_location.cgi b/httemplate/edit/cust_location.cgi new file mode 100755 index 000000000..80b27c2b3 --- /dev/null +++ b/httemplate/edit/cust_location.cgi @@ -0,0 +1,54 @@ +<% include('/elements/header-popup.html', "Edit Location") %> + +<% include('/elements/error.html') %> + +
+ + +<% ntable('#cccccc') %> +<% include('/elements/location.html', + 'object' => $cust_location, + 'no_asterisks' => 1, + ) %> + + +
+ + + +
+ + + +<%init> + +my $conf = new FS::Conf; + +my $curuser = $FS::CurrentUser::CurrentUser; + +# it's the same access right you'd need to do this by editing packages +die "access denied" + unless $curuser->access_right('Change customer package'); + +my $locationnum = scalar($cgi->param('locationnum')); +my $cust_location = qsearchs({ + 'select' => 'cust_location.*', + 'table' => 'cust_location', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'locationnum' => $locationnum }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, + }) or die "unknown locationnum $locationnum"; + +die "can't edit disabled locationnum $locationnum" if $cust_location->disabled; + +my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_location->custnum }) + or die "can't get cust_main record for custnum ". $cust_location->custnum; + +my @cust_pkgs = qsearch('cust_pkg', { 'locationnum' => $locationnum }); + + -- cgit v1.2.1