Bug 17189: Add the ability to define several memcached namespaces - tests
[koha.git] / mainpage.pl
index ab3a7ab..f4efc65 100755 (executable)
@@ -20,7 +20,7 @@
 # along with Koha; if not, see <http://www.gnu.org/licenses>.
 
 use Modern::Perl;
-use CGI;
+use CGI qw ( -utf8 );
 use C4::Output;
 use C4::Auth;
 use C4::Koha;
@@ -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;
@@ -63,14 +65,15 @@ my $branch =
 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 );
+my $pending_borrower_modifications = Koha::Patron::Modifications->pending_count( $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,
 );
 
 #