Bug 31028: Add display to details page
[koha-ffzg.git] / mainpage.pl
index b34a46d..53f6335 100755 (executable)
@@ -35,6 +35,7 @@ use Koha::Quotes;
 use Koha::Suggestions;
 use Koha::BackgroundJobs;
 use Koha::CurbsidePickups;
+use Koha::Tickets;
 
 my $query = CGI->new;
 
@@ -103,6 +104,17 @@ my $pending_article_requests = Koha::ArticleRequests->search_limited(
 )->count;
 my $pending_problem_reports = Koha::ProblemReports->search({ status => 'New' });
 
+if ( C4::Context->preference('OpacCatalogConcerns') || C4::Context->preference('CatalogConcerns') ) {
+    my $pending_biblio_tickets = Koha::Tickets->search(
+        {
+            resolved_date => undef,
+            biblio_id     => { '!=' => undef }
+        }
+    );
+    $template->param(
+        pending_biblio_tickets => $pending_biblio_tickets->count );
+}
+
 unless ( $logged_in_user->has_permission( { parameters => 'manage_background_jobs' } ) ) {
     my $already_ran_jobs = Koha::BackgroundJobs->search(
         { borrowernumber => $logged_in_user->borrowernumber } )->count ? 1 : 0;
@@ -114,9 +126,8 @@ if ( C4::Context->preference('CurbsidePickup') ) {
         new_curbside_pickups => Koha::CurbsidePickups->search(
             {
                 branchcode                => $homebranch,
-                scheduled_pickup_datetime => { '>' => \'DATE(NOW())' },
             }
-        )->filter_by_to_be_staged
+        )->filter_by_to_be_staged->filter_by_scheduled_today,
     );
 }