blob: f5cf7dd0786e8781838932b442965d74ff51b33e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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_popup($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>
|