Bugzilla – Attachment 190828 Details for
Bug 30849
Make 'pending patron modification notices' on staff home page 'number of modifications at logged in library'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30849: show pending modifications by branch
Bug-30849-show-pending-modifications-by-branch.patch (text/plain), 9.40 KB, created by
Lucas Gass (lukeg)
on 2026-01-02 14:39:12 UTC
(
hide
)
Description:
Bug 30849: show pending modifications by branch
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2026-01-02 14:39:12 UTC
Size:
9.40 KB
patch
obsolete
>From fb84631208f89296f30953626ff2b488d1f76bcc Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 8 Jun 2022 16:05:30 +0000 >Subject: [PATCH] Bug 30849: show pending modifications by branch > >To test: >1. Add some borrower modifications from the OPAC from patrons that belong to some different libraries. >2. On the staff client mainpage (mainpage.pl) you should see a link 'Patrons requesting modifications:' but no way of knowing if they are patrons from your logged in branch or not >3. Apply patch, restart_all >4. Try step 2 again and now you should see something like 'Patrons requesting modifications: Centerville: 1 / All libraries: 2'; >5. Turn on IndependentBranchesPatronModifications. >6. Log in as a superlibrarian, you should see branch specific and All libraries requests. >7. Log in as a non-superlibrarian, you should only see requests for your branch. >8. Trying and and fulfilling some modifcations and make sure the numbers on mainpage.pl are always correct. > >Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> >--- > .../prog/en/modules/intranet-main.tt | 38 ++++++++++++++++--- > mainpage.pl | 13 +++++-- > 2 files changed, 42 insertions(+), 9 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 fe5e0597aaa..360ac1579c1 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 || ( holds_to_pull && CAN_user_circulate_circulate_remaining_permissions ) %] > <div id="area-pending" class="page-section"> > [% IF pending_article_requests %] > <div class="pending-info" id="article_requests_pending"> >@@ -224,11 +224,30 @@ > </div> > [% END %] > >- [% IF ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) %] >- <div class="pending-info" id="patron_updates_pending"> >- <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>: >- <span class="pending-number-link">[% pending_borrower_modifications | html %]</span> >- </div> >+ [% IF CAN_user_borrowers_edit_borrowers && pending_borrower_modifications %] >+ [% IF Koha.Preference('IndependentBranchesPatronModifications') && !CAN_user_superlibrarian %] >+ [% IF pending_local_borrowermods %] >+ <div class="pending-info" id="patron_updates_pending"> >+ Patrons requesting modifications: >+ <a href="/cgi-bin/koha/members/members-update.pl"> >+ <span class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% pending_local_borrowermods | html %]</span> >+ </a> >+ </div> >+ [% END %] >+ [% ELSE %] >+ <div class="pending-info" id="patron_updates_pending"> >+ Patrons requesting modifications: >+ [% IF pending_local_borrowermods %] >+ <a href="/cgi-bin/koha/members/members-update.pl"> >+ <span class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% pending_local_borrowermods | html %]</span> >+ </a> >+ / >+ [% END %] >+ <a href="/cgi-bin/koha/members/members-update.pl"> >+ <span class="pending-number-link">All libraries: [% pending_borrower_modifications | html %]</span> >+ </a> >+ </div> >+ [% END %] > [% END %] > > [% IF CAN_user_borrowers_edit_borrowers && pending_discharge_requests %] >@@ -265,6 +284,13 @@ > </div> > [% END %] > >+ [% IF holds_to_pull && CAN_user_circulate_circulate_remaining_permissions %] >+ <div class="pending-info" id="holds_to_pull"> >+ <a href="/cgi-bin/koha/circ/pendingreserves.pl">New holds to pull</a>: >+ <span class="pending-number-link">[% holds_to_pull | html %]</span> >+ </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 21a1ad3c445..64aeb6b2e1a 100755 >--- a/mainpage.pl >+++ b/mainpage.pl >@@ -37,6 +37,8 @@ use Koha::Suggestions; > use Koha::BackgroundJobs; > use Koha::CurbsidePickups; > use Koha::Tickets; >+use Koha::Token; >+use Koha::Holds; > > my $query = CGI->new; > >@@ -102,9 +104,11 @@ if ( C4::Context->only_my_library ) { > ); > } > >-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( >+my $pending_borrower_modifications = Koha::Patron::Modifications->pending_count($branch); >+my $local_pendingmodifications_count = Koha::Patron::Modifications->pending_count( C4::Context->userenv()->{'branch'} ); >+ >+my $pending_discharge_requests = Koha::Patron::Discharge::count( { pending => 1 } ); >+my $pending_article_requests = Koha::ArticleRequests->search_limited( > { > status => Koha::ArticleRequest::Status::Requested, > $branch ? ( 'me.branchcode' => $branch ) : (), >@@ -130,6 +134,7 @@ 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 = Koha::Holds->search( found => undef )->count; > > if ( C4::Context->preference('CurbsidePickup') ) { > $template->param( >@@ -157,9 +162,11 @@ $template->param( > pendingcomments => $pendingcomments, > pendingtags => $pendingtags, > pending_borrower_modifications => $pending_borrower_modifications, >+ pending_local_borrowermods => $local_pendingmodifications_count, > pending_discharge_requests => $pending_discharge_requests, > pending_article_requests => $pending_article_requests, > pending_problem_reports => $pending_problem_reports, >+ holds_to_pull => $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 30849
:
135823
|
137644
|
190826
|
190828
|
190840
|
190842