From ac6b8a876f9911f6e01344083e7385543b840753 Mon Sep 17 00:00:00 2001 From: Lucas Gass 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. Trying and and fulfilling some modifcations and make sure the numbers on mainpage.pl are always correct. Signed-off-by: Sally --- .../intranet-tmpl/prog/en/modules/intranet-main.tt | 13 +++++++++---- mainpage.pl | 3 +++ 2 files changed, 12 insertions(+), 4 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 1b556f379b..04e0f6014a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -206,11 +206,16 @@ [% END %] - - [% IF ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) %] + [% IF CAN_user_borrowers_edit_borrowers && pending_borrower_modifications %] [% END %] diff --git a/mainpage.pl b/mainpage.pl index 6972d39871..85984ca76d 100755 --- a/mainpage.pl +++ b/mainpage.pl @@ -93,6 +93,8 @@ if( C4::Context->only_my_library ){ } 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( { @@ -112,6 +114,7 @@ $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 -- 2.30.2