Bugzilla – Attachment 190848 Details for
Bug 36063
Add holds to pull notification to staff interface home page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36063: Add local_holds_to_pull and adjust filters
Bug-36063-Add-localholdstopull-and-adjust-filters.patch (text/plain), 6.88 KB, created by
David Nind
on 2026-01-02 19:13:20 UTC
(
hide
)
Description:
Bug 36063: Add local_holds_to_pull and adjust filters
Filename:
MIME Type:
Creator:
David Nind
Created:
2026-01-02 19:13:20 UTC
Size:
6.88 KB
patch
obsolete
>From 4494c722839de279472be47ec1a0d348c3196e99 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 2 Jan 2026 15:25:55 +0000 >Subject: [PATCH] Bug 36063: Add local_holds_to_pull and adjust filters > >To test: >1. APPLY PATCH, restart_all >2. Make some holds >3. Go to the staff interface home page, you should see 'New holds to > pull: X'. >4. Check those holds in so they are waiting. Now they should not be > counted against the number you see on the staff main page. >5. Log in as a staff member with Staff access but without > circulate_remaining_permissions. >6. You should not see the 'New holds to pull: X' line. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/en/modules/intranet-main.tt | 17 ++++++++++++- > mainpage.pl | 25 ++++++++++++++++++- > 2 files changed, 40 insertions(+), 2 deletions(-) > >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 740713c564..b2da666889 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 @@ > <div class="row"> > <div class="col-sm-12"> > [%# 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 %] >+ [% 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 ) %] > <div id="area-pending" class="page-section"> > [% IF pending_article_requests %] > <div class="pending-info" id="article_requests_pending"> >@@ -284,6 +284,21 @@ > </div> > [% END %] > >+ [% IF CAN_user_circulate_circulate_remaining_permissions && holds_to_pull %] >+ <div class="pending-info" id="holds_to_pull"> >+ Holds to pull: >+ [% IF local_holds_to_pull %] >+ <a href="/cgi-bin/koha/circ/pendingreserves.pl"> >+ <span class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% local_holds_to_pull | html %]</span> >+ </a> >+ / >+ [% END %] >+ <a href="/cgi-bin/koha/circ/pendingreserves.pl"> >+ <span class="pending-number-link">All libraries: [% holds_to_pull | html %]</span> >+ </a> >+ </div> >+ [% END %] >+ > [% IF new_curbside_pickups.count %] > <div class="pending-info" id="new_curbside_pickups"> > <a href="/cgi-bin/koha/circ/curbside_pickups.pl">New curbside pickups</a>: >diff --git a/mainpage.pl b/mainpage.pl >index ecc5111380..122bf93e8f 100755 >--- a/mainpage.pl >+++ b/mainpage.pl >@@ -24,7 +24,8 @@ use CGI qw ( -utf8 ); > use C4::Output qw( output_html_with_http_headers ); > use C4::Auth qw( get_template_and_user ); > use C4::Koha; >-use C4::Tags qw( get_count_by_tag_status ); >+use C4::Tags qw( get_count_by_tag_status ); >+use Koha::DateUtils qw( dt_from_string ); > use Koha::AdditionalContents; > use Koha::Patron::Modifications; > use Koha::Patron::Discharge; >@@ -133,6 +134,26 @@ unless ( $logged_in_user->has_permission( { parameters => 'manage_background_job > $template->param( > holds_with_cancellation_requests => Koha::Holds->waiting->filter_by_has_cancellation_requests->count ); > >+my $holds_to_pull_start_date = C4::Context->preference('HoldsToPullStartDate') || 2; >+my $reserves_to_pull_from = dt_from_string()->subtract( days => $holds_to_pull_start_date ); >+ >+my $holds_to_pull = Koha::Holds->search( >+ { >+ found => undef, >+ reservedate => { '>=' => $reserves_to_pull_from->ymd() } >+ } >+)->count; >+ >+#get local holds to pull by looking for holds with an item homebranch that matches the loggedinuser's location >+my $local_holds_to_pull = Koha::Holds->search( >+ { >+ 'me.found' => undef, >+ 'item.homebranch' => C4::Context->userenv()->{'branch'}, >+ 'me.reservedate' => { '>=' => $reserves_to_pull_from->ymd() } >+ }, >+ { join => 'item' } >+)->count; >+ > if ( C4::Context->preference('CurbsidePickup') ) { > $template->param( > new_curbside_pickups => Koha::CurbsidePickups->search( >@@ -163,6 +184,8 @@ $template->param( > pending_discharge_requests => $pending_discharge_requests, > pending_article_requests => $pending_article_requests, > pending_problem_reports => $pending_problem_reports, >+ holds_to_pull => $holds_to_pull, >+ local_holds_to_pull => $local_holds_to_pull, > ); > > output_html_with_http_headers $query, $cookie, $template->output; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36063
:
161997
|
162000
|
190830
|
190833
|
190834
|
190843
|
190844
|
190846
| 190848