fix editing of events that have reasons, from #31702
[freeside.git] / httemplate / edit / process / bulk-part_pkg-fcc.html
index 17579aa..8ef3308 100644 (file)
 %   }
 <% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?redirect='.$session) %>
 % } else {
-<% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?classnum='.$classnum) %>
+<% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?classnum='.$classnum.$jump) %>
 % }
 <%init>
 my $curuser = $FS::CurrentUser::CurrentUser;
-die "access denied"
-  unless $curuser->access_right('Bulk edit package definitions');
+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;
 
 # non-atomic; report errors but allow successful changes to go through
 # not that I even know how you'd get an error doing this
@@ -39,4 +40,8 @@ foreach my $param ($cgi->param) {
 
 my $classnum = $cgi->param('classnum');
 
+my $jump = '';
+if ( $cgi->param('jump') =~ /^pkgpart(\d+)$/ ) {
+  $jump = '#'.$1;
+}
 </%init>