Bug 16570: Do not tell all checked-in items are part of a rotating collection
[koha.git] / mainpage.pl
index 09450f6..d9e01b7 100755 (executable)
@@ -28,7 +28,8 @@ use C4::NewsChannels; # GetNewsToDisplay
 use C4::Review qw/numberofreviews/;
 use C4::Suggestions qw/CountSuggestion/;
 use C4::Tags qw/get_count_by_tag_status/;
-use Koha::Borrower::Modifications;
+use Koha::Patron::Modifications;
+use Koha::Patron::Discharge;
 
 my $query = new CGI;
 
@@ -55,7 +56,8 @@ $template->param(
 );
 
 my $branch =
-  C4::Context->preference("IndependentBranches")
+  (      C4::Context->preference("IndependentBranchesPatronModifications")
+      || C4::Context->preference("IndependentBranches") )
   && !$flags->{'superlibrarian'}
   ? C4::Context->userenv()->{'branch'}
   : undef;
@@ -64,13 +66,15 @@ my $pendingcomments    = numberofreviews(0);
 my $pendingtags        = get_count_by_tag_status(0);
 my $pendingsuggestions = CountSuggestion("ASKED");
 my $pending_borrower_modifications =
-  Koha::Borrower::Modifications->GetPendingModificationsCount( $branch );
+  Koha::Patron::Modifications->GetPendingModificationsCount( $branch );
+my $pending_discharge_requests = Koha::Patron::Discharge::count({ pending => 1 });
 
 $template->param(
     pendingcomments                => $pendingcomments,
     pendingtags                    => $pendingtags,
     pendingsuggestions             => $pendingsuggestions,
     pending_borrower_modifications => $pending_borrower_modifications,
+    pending_discharge_requests     => $pending_discharge_requests,
 );
 
 #