Bugzilla – Attachment 156820 Details for
Bug 35028
Add OPAC self-registration alert on staff interface main page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35028: Add pre-registrations alert on staff interface main page
Bug-35028-Add-pre-registrations-alert-on-staff-int.patch (text/plain), 7.85 KB, created by
Julian Maurice
on 2023-10-11 12:54:58 UTC
(
hide
)
Description:
Bug 35028: Add pre-registrations alert on staff interface main page
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2023-10-11 12:54:58 UTC
Size:
7.85 KB
patch
obsolete
>From a5f5017d83367f8088700feb8653d8d14412b144 Mon Sep 17 00:00:00 2001 >From: jeremy breuillard <jeremy.breuillard@biblibre.com> >Date: Fri, 22 Oct 2021 15:13:36 +0000 >Subject: [PATCH] Bug 35028: Add pre-registrations alert on staff interface > main page >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan: >1. Create patron category SELFREG >2. Enable PatronSelfRegistration and set > PatronSelfRegistrationDefaultCategory to SELFREG >3. Go to OPAC, logout if needed, and create a new account. Remember the > value you set for home library. >4. Go to staff interface, set the current library to the one you set in > step 3. >5. Go to the staff interface main page. You should see at the bottom a > message saying "Pre-registered patron(s) from: All libraries: 1 / > <CURRENT LIBRARY>: 1" (numbers can vary if you already had > self-registered patrons) >6. Click on both links and verify that it shows the correct patrons (or > redirect to the patron detail page if there is only one) >7. Set the current library to another one (one that doesn't have > self-registered patrons) >8. Go to the staff interface main page. You should see at the bottom a > message saying "Pre-registered patron(s) from: All libraries: 1" > (numbers can vary if you already had self-registered patrons) >9. Click on the link and verify that it shows the correct patrons (or > redirect to the patron detail page if there is only one) > >Co-authored-by: Fridolin Somers <fridolin.somers@biblibre.com> >Co-authored-by: Julian Maurice <julian.maurice@biblibre.com> >Sponsored-by: Ãcoles nationales supérieures d'architecture (ENSA) >--- > .../prog/en/modules/intranet-main.tt | 14 +++++++++++++- > mainpage.pl | 19 +++++++++++++++++++ > members/member.pl | 9 +++++++-- > 3 files changed, 39 insertions(+), 3 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 1b4dfe93dd..df90f07f4a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -172,7 +172,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 %] >+ [% 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 || selfRegisteredPatrons %] > <div id="area-pending" class="page-section"> > [% IF pending_article_requests %] > <div class="pending-info" id="article_requests_pending"> >@@ -261,6 +261,18 @@ > </div> > [% END %] > >+ [% IF selfRegisteredPatrons %] >+ <div class="pending-info" id="self_registered_patrons_info"> >+ Pre-registered patron(s) from: >+ <a class="pre-registration-link pending-number-link pre-registration-link-all" href="/cgi-bin/koha/members/member.pl?categorycode_filter=[% Koha.Preference('PatronSelfRegistrationDefaultCategory') | html %]">All libraries: [% selfRegisteredPatrons | html %]</a> >+ >+ [% IF selfRegisteredPatronsInMyBranch %] >+ <span>/</span> >+ <a class="pre-registration-link pending-number-link pre-registration-link-branch" href="/cgi-bin/koha/members/member.pl?categorycode_filter=[% Koha.Preference('PatronSelfRegistrationDefaultCategory') | html %]&branchcode_filter=[% Branches.GetLoggedInBranchcode | html %]">[% Branches.GetLoggedInBranchname | html %]: [% selfRegisteredPatronsInMyBranch | html %]</a> >+ [% END %] >+ </div> >+ [% END %] >+ > </div> > > [% END %] >diff --git a/mainpage.pl b/mainpage.pl >index 855913ae72..71bdcc9ee2 100755 >--- a/mainpage.pl >+++ b/mainpage.pl >@@ -135,6 +135,25 @@ if ( C4::Context->preference('CurbsidePickup') ) { > ); > } > >+my $PatronSelfRegistrationDefaultCategory = C4::Context->preference('PatronSelfRegistrationDefaultCategory'); >+if ($PatronSelfRegistrationDefaultCategory) { >+ my $selfRegisteredPatrons = Koha::Patrons->search( >+ { >+ categorycode => $PatronSelfRegistrationDefaultCategory, >+ } >+ )->count; >+ my $selfRegisteredPatronsInMyBranch = Koha::Patrons->search( >+ { >+ categorycode => $PatronSelfRegistrationDefaultCategory, >+ branchcode => C4::Context::mybranch(), >+ } >+ )->count; >+ $template->param( >+ selfRegisteredPatrons => $selfRegisteredPatrons, >+ selfRegisteredPatronsInMyBranch => $selfRegisteredPatronsInMyBranch, >+ ); >+} >+ > $template->param( > pendingcomments => $pendingcomments, > pendingtags => $pendingtags, >diff --git a/members/member.pl b/members/member.pl >index 909341bcd7..6e8879e577 100755 >--- a/members/member.pl >+++ b/members/member.pl >@@ -65,16 +65,21 @@ if ( $quicksearch and $searchmember && !$circsearch ) { > } > > my $searchfieldstype = $input->param('searchfieldstype') || 'standard'; >+my $branchcode_filter = $input->param('branchcode_filter') // ''; >+my $categorycode_filter = $input->param('categorycode_filter') // ''; > > $template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ); > > my $defer_loading = $input->request_method() eq "GET" && !$circsearch ? 1 : 0; >+if ($branchcode_filter ne '' || $categorycode_filter ne '') { >+ $defer_loading = 0; >+} > > $template->param( > patron_lists => [ GetPatronLists() ], > searchmember => $searchmember, >- branchcode_filter => scalar $input->param('branchcode_filter'), >- categorycode_filter => scalar $input->param('categorycode_filter'), >+ branchcode_filter => $branchcode_filter, >+ categorycode_filter => $categorycode_filter, > searchfieldstype => $searchfieldstype, > PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20, > do_not_defer_loading => !$defer_loading, >-- >2.30.2
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 35028
:
156820
|
175390
|
175391
|
175392
|
175393
|
176399
|
176522
|
176523