2 % #$cgi->param('error', $error);
3 % #$cgi->redirect(popurl(3). 'misc/detach_pkg.html?'. $cgi->query_string );
4 % #XXX actually redirect back and display the error instead
5 % errorpage_popup($error);
8 <& /elements/header-popup.html, emt("Services moved") &>
9 <SCRIPT TYPE="text/javascript">
18 my $curuser = $FS::CurrentUser::CurrentUser;
19 die "access denied" unless $curuser->access_right('Bulk move customer services');
21 $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'illegal pkgnum';
24 my $cust_pkg = qsearchs({
25 'table' => 'cust_pkg',
26 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
27 'hashref' => { 'pkgnum' => $pkgnum },
28 'extra_sql' => ' AND '. $curuser->agentnums_sql,
29 }) or die 'unknown pkgnum';
32 foreach my $param (grep /^svcnum\d+$/, $cgi->param) {
33 $param =~ /^svcnum(\d+)$/ or die "guru meditation #309";
34 push @svcnum, $1 if $cgi->param($param);
37 my $error = $cust_pkg->grab_svcnums(@svcnum);