default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / edit / process / bulk-477_cust_pkg.html
1 <% $cgi->redirect($fsurl.'search/477_cust_pkg.html?redirect='.$session) %>
2 <%init>
3 my $curuser = $FS::CurrentUser::CurrentUser;
4 my $edit_acl = $curuser->access_right('Edit FCC report configuration');
5 my $global_edit_acl = $curuser->access_right('Edit FCC report configuration for all agents');
6 die "access denied" unless $edit_acl or $global_edit_acl;
7
8 my %error;
9 foreach my $param ($cgi->param) {
10   $param =~ /^pkgnum(\d+)pkgpart(\d+)$/ or next;
11   my $pkgpart = $2;
12   my $part_pkg = FS::part_pkg->by_key($pkgpart);
13   my $hashref = decode_json( $cgi->param($param) );
14   my $error = $part_pkg->set_fcc_options($hashref);
15   $error{$pkgpart} = $error if $error; # XXX report this somehow
16 }
17
18 my $session = $cgi->param('redirect');
19
20 </%init>