diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-06-04 03:30:24 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-06-04 03:30:24 -0700 |
commit | 150a188ede4c1c325aac6420184e5bf746d27ff4 (patch) | |
tree | 1d2d7d66214c6eec0f55b7eba94a0f2f288e0d48 /httemplate/edit | |
parent | 4cd40172ccbfce9cfa49bff5a6338f3c6c978f4b (diff) |
move services between packages, RT#22619
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/process/bulk-cust_svc-pkgnum.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/httemplate/edit/process/bulk-cust_svc-pkgnum.html b/httemplate/edit/process/bulk-cust_svc-pkgnum.html new file mode 100644 index 000000000..5936cc643 --- /dev/null +++ b/httemplate/edit/process/bulk-cust_svc-pkgnum.html @@ -0,0 +1,39 @@ +% if ($error) { +% #$cgi->param('error', $error); +% #$cgi->redirect(popurl(3). 'misc/detach_pkg.html?'. $cgi->query_string ); +% #XXX actually redirect back and display the error instead +% errorpage($error); +% } else { + + <% header(emt("Services moved")) %> + <SCRIPT TYPE="text/javascript"> + window.top.location.reload(); + </SCRIPT> + </BODY> + </HTML> + +% } +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" unless $curuser->access_right('Bulk move customer services'); + +$cgi->param('pkgnum') =~ /^(\d+)$/ or die 'illegal pkgnum'; +my $pkgnum = $1; + +my $cust_pkg = qsearchs({ + 'table' => 'cust_pkg', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'pkgnum' => $pkgnum }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, +}) or die 'unknown pkgnum'; + +my @svcnum = (); +foreach my $param (grep /^svcnum\d+$/, $cgi->param) { + $param =~ /^svcnum(\d+)$/ or die "guru meditation #309"; + push @svcnum, $1 if $cgi->param($param); +} + +my $error = $cust_pkg->grab_svcnums(@svcnum); + +</%init> |