From 0cc34628e92772bf7d2814b2cf1694d9b942f343 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 2 Jan 2026 16:04:04 +0000 Subject: [PATCH] Bug 36073: Add holds queue notification to mainpage 1. Make some holds for several different branches 2. Build the holds queue ( perl /kohadevbox/koha/misc/cronjobs/holds/build_holds_queue.pl ) 3. From the mainpage you should now see something like: Holds queue: Midway: 1 / All libraries: 1 4. CLick on the link to make sure the link works and the count is accurate 5. Test this with both superlibrarians and staff you have the 'circulate_circulate_remaining_permissions' permission. Signed-off-by: Owen Leonard Signed-off-by: David Nind --- .../prog/en/modules/intranet-main.tt | 17 ++++++++++++++++- mainpage.pl | 10 ++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt index b2da666889..23b8558813 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -186,7 +186,7 @@
[%# Following statement must be in one line for translatability %] - [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count || ( holds_with_cancellation_requests && CAN_user_circulate_circulate_remaining_permissions ) || self_registered_count || ( CAN_user_borrowers_edit_borrowers && holds_to_pull ) %] + [% IF ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_suggestions_suggestions_manage && ( pendingsuggestions || all_pendingsuggestions )) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) || ( ( Koha.Preference('OpacCatalogConcerns') || Koha.Preference('CatalogConcerns') ) && pending_biblio_tickets && CAN_user_editcatalogue_edit_catalogue ) || ( Koha.Preference('OPACReportProblem') && CAN_user_problem_reports && pending_problem_reports.count ) || already_ran_jobs || new_curbside_pickups.count || ( holds_with_cancellation_requests && CAN_user_circulate_circulate_remaining_permissions ) || self_registered_count || ( CAN_user_borrowers_edit_borrowers && holds_to_pull ) || ( CAN_user_circulate_circulate_remaining_permissions && holds_queue_count ) %]
[% IF pending_article_requests %]
@@ -299,6 +299,21 @@
[% END %] + [% IF CAN_user_circulate_circulate_remaining_permissions && holds_queue_count %] + + [% END %] + [% IF new_curbside_pickups.count %]
New curbside pickups: diff --git a/mainpage.pl b/mainpage.pl index 122bf93e8f..1e88c2c5b0 100755 --- a/mainpage.pl +++ b/mainpage.pl @@ -154,6 +154,16 @@ my $local_holds_to_pull = Koha::Holds->search( { join => 'item' } )->count; +my $holds_queue_count = Koha::Hold::HoldsQueueItems->search()->count; + +my $local_holds_queue_count = + Koha::Hold::HoldsQueueItems->search( { 'me.holdingbranch' => C4::Context->userenv()->{'branch'} } )->count; + +$template->param( + holds_queue_count => $holds_queue_count, + local_holds_queue_count => $local_holds_queue_count, +); + if ( C4::Context->preference('CurbsidePickup') ) { $template->param( new_curbside_pickups => Koha::CurbsidePickups->search( -- 2.39.5