summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/bulk-477_cust_pkg.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-12-05 18:12:09 -0800
committerMark Wells <mark@freeside.biz>2014-12-05 18:12:09 -0800
commit56d10a0d13cc291eb5ee6197c35b10407794f89c (patch)
treeb366470fe4158d9a924ce1b227f357cef28e1497 /httemplate/edit/process/bulk-477_cust_pkg.html
parentde75ffb000acb9e09518a5eb12b3cbfffa12e814 (diff)
477 report: detect errors and fix them more easily, #32499, from #24047
Diffstat (limited to 'httemplate/edit/process/bulk-477_cust_pkg.html')
-rw-r--r--httemplate/edit/process/bulk-477_cust_pkg.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/httemplate/edit/process/bulk-477_cust_pkg.html b/httemplate/edit/process/bulk-477_cust_pkg.html
new file mode 100644
index 000000000..064f73b60
--- /dev/null
+++ b/httemplate/edit/process/bulk-477_cust_pkg.html
@@ -0,0 +1,20 @@
+<% $cgi->redirect($fsurl.'search/477_cust_pkg.html?redirect='.$session) %>
+<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
+my $edit_acl = $curuser->access_right('Edit FCC report configuration');
+my $global_edit_acl = $curuser->access_right('Edit FCC report configuration for all agents');
+die "access denied" unless $edit_acl or $global_edit_acl;
+
+my %error;
+foreach my $param ($cgi->param) {
+ $param =~ /^pkgnum(\d+)pkgpart(\d+)$/ or next;
+ my $pkgpart = $2;
+ my $part_pkg = FS::part_pkg->by_key($pkgpart);
+ my $hashref = decode_json( $cgi->param($param) );
+ my $error = $part_pkg->set_fcc_options($hashref);
+ $error{$pkgpart} = $error if $error; # XXX report this somehow
+}
+
+my $session = $cgi->param('redirect');
+
+</%init>