+my $pending_borrower_modifications = Koha::Patron::Modifications->pending_count( $branch );
+my $pending_discharge_requests = Koha::Patron::Discharge::count({ pending => 1 });
+my $pending_article_requests = Koha::ArticleRequests->search_limited(
+ {
+ status => Koha::ArticleRequest::Status::Pending,
+ $branch ? ( 'me.branchcode' => $branch ) : (),
+ }
+)->count;
+my $pending_problem_reports = Koha::ProblemReports->search({ status => 'New' });
+
+$template->param(
+ pendingcomments => $pendingcomments,
+ pendingtags => $pendingtags,
+ pending_borrower_modifications => $pending_borrower_modifications,
+ pending_discharge_requests => $pending_discharge_requests,
+ pending_article_requests => $pending_article_requests,
+ pending_problem_reports => $pending_problem_reports
+);
+