Bug 27465: Add column visibility to admin/cities.pl
[koha-ffzg.git] / admin / item_circulation_alerts.pl
index 3e6e6dd..ae6692d 100755 (executable)
@@ -15,8 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
-use strict;
-use warnings;
+use Modern::Perl;
 
 use CGI qw ( -utf8 );
 use File::Basename;
@@ -26,7 +25,6 @@ use JSON;
 
 use C4::Auth;
 use C4::Context;
-use C4::Branch;
 use C4::ItemCirculationAlertPreference;
 use C4::Output;
 
@@ -45,34 +43,18 @@ sub show {
             template_name   => "admin/item_circulation_alerts.tt",
             query           => $input,
             type            => "intranet",
-            authnotrequired => 0,
-            flagsrequired   => { parameters => 'parameters_remaining_permissions' },
+            flagsrequired   => { parameters => 'item_circ_alerts' },
             debug           => defined($input->param('debug')),
         }
     );
 
-    my $br       = GetBranches;
     my $branch   = $input->param('branch') || '*';
-    my @branches = (
-        {
-            branchcode => '*',
-            branchname => 'Default',
-        },
-        sort { $a->{branchname} cmp $b->{branchname} } values %$br,
-    );
-    for (@branches) {
-        $_->{selected} = "selected" if ($branch eq $_->{branchcode});
-    }
-    my $branch_name = exists($br->{$branch}) && $br->{$branch}->{branchname};
-
-    my @categories = Koha::Patron::Categories->search_limited;
+    my @categories = Koha::Patron::Categories->search_with_library_limits;
     my @item_types = Koha::ItemTypes->search;
     my $grid_checkout = $preferences->grid({ branchcode => $branch, notification => 'CHECKOUT' });
     my $grid_checkin  = $preferences->grid({ branchcode => $branch, notification => 'CHECKIN' });
 
     $template->param(branch             => $branch);
-    $template->param(branch_name        => $branch_name || 'Default');
-    $template->param(branches           => \@branches);
     $template->param(categories         => \@categories);
     $template->param(item_types         => \@item_types);
     $template->param(grid_checkout      => $grid_checkout);
@@ -129,7 +111,7 @@ sub dispatch {
         show   => \&show,
         toggle => \&toggle,
     );
-    my $input  = new CGI;
+    my $input  = CGI->new;
     my $action = $input->param('action') || 'show';
     if (not exists $handler{$action}) {
         my $status = 400;