summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authormark <mark>2010-12-29 22:56:47 +0000
committermark <mark>2010-12-29 22:56:47 +0000
commit6fc8a42e503e4e1f12659e1cfef7f5f26577034f (patch)
treefcac659b42217a4013afe04a98ac956f2c650cdb /httemplate/edit/process
parent15a9fae1bde88fb279534de4effae20e43fbee27 (diff)
cust_location editing features, RT#10766
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/cust_location.cgi38
1 files changed, 38 insertions, 0 deletions
diff --git a/httemplate/edit/process/cust_location.cgi b/httemplate/edit/process/cust_location.cgi
new file mode 100644
index 000000000..790fc8ea4
--- /dev/null
+++ b/httemplate/edit/process/cust_location.cgi
@@ -0,0 +1,38 @@
+% if ($error) {
+% $cgi->param('error', Dumper($error));
+% $cgi->redirect(popurl(3). 'edit/cust_location.cgi?'. $cgi->query_string );
+% } else {
+
+ <% header("Location changed") %>
+ <SCRIPT TYPE="text/javascript">
+ window.top.location.reload();
+ </SCRIPT>
+ </BODY>
+ </HTML>
+
+% }
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied"
+ unless $curuser->access_right('Change customer package');
+
+my $locationnum = $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,
+});
+die "unknown locationnum $locationnum" unless $cust_location;
+
+my $new = {
+ map { $_ => scalar($cgi->param($_)) }
+ qw( address1 address2 city county state zip country )
+};
+
+my $error = $cust_location->move_to($new);
+
+</%init>