Bug 26265: (QA follow-up) Remove g option from regex, add few dirs
[koha-equinox.git] / circ / checkout-notes.pl
index b0638f4..324d15e 100755 (executable)
@@ -33,18 +33,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         query           => $query,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { circulation => "manage_checkout_notes" },
+        flagsrequired   => { circulate => "manage_checkout_notes" },
     }
 );
 
-my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count;
-my @notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] });
-
-$template->param(
-    pending_checkout_notes => $pending_checkout_notes,
-    notes                  => \@notes,
-);
-
 my $action;
 foreach (qw( seen notseen )) {
     $action = $_ if ( $query->param("mark_selected-$_") );
@@ -65,9 +57,11 @@ if ( $action eq 'seen' ) {
     }
 }
 
+my $notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] });
 $template->param(
     selected_count => scalar(@issue_ids),
     action         => $action,
+    notes          => $notes,
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;