Bugzilla – Attachment 176399 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 self-registrations alert on staff interface main page
Bug-35028-Add-self-registrations-alert-on-staff-in.patch (text/plain), 10.35 KB, created by
William Lavoie
on 2025-01-10 21:04:11 UTC
(
hide
)
Description:
Bug 35028: Add self-registrations alert on staff interface main page
Filename:
MIME Type:
Creator:
William Lavoie
Created:
2025-01-10 21:04:11 UTC
Size:
10.35 KB
patch
obsolete
>From 6e7dfe379e4250a2719827bc09f5d70020f83fa2 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 self-registrations alert on staff interface > main page >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This adds a new system preference PatronSelfRegistrationAlert to enable >or disable alerts (disabled by default) > >Test plan: >1. Create patron category SELFREG >2. Enable PatronSelfRegistration and set > PatronSelfRegistrationDefaultCategory to SELFREG and > PatronSelfRegistrationAlert to "Show" >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 "Self-registrations 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 "Self-registrations 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) >Signed-off-by: William Lavoie <william.lavoie@inLibro.com> >--- > installer/data/mysql/atomicupdate/bug-35028.pl | 15 +++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/opac.pref | 6 ++++++ > .../prog/en/modules/intranet-main.tt | 15 ++++++++++++++- > mainpage.pl | 12 ++++++++++++ > 5 files changed, 48 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug-35028.pl > >diff --git a/installer/data/mysql/atomicupdate/bug-35028.pl b/installer/data/mysql/atomicupdate/bug-35028.pl >new file mode 100644 >index 0000000000..87a8c5348f >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-35028.pl >@@ -0,0 +1,15 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => '35028', >+ description => 'Add system preference PatronSelfRegistrationAlert', >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( " >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('PatronSelfRegistrationAlert','0',NULL,'If enabled, an alter will be shown on staff interface home page when there are self-registered patrons.','YesNo') >+ " ); >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index ede2d4d275..607e07a41a 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -612,6 +612,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'), > ('PatronSelfModificationMandatoryField','',NULL,'Define the required fields when a patron is editing their information via the OPAC','free'), > ('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'), >+('PatronSelfRegistrationAlert','0',NULL,'If enabled, an alter will be shown on staff interface home page when there are self-registered patrons.','YesNo'), > ('PatronSelfRegistrationBorrowerMandatoryField','surname|firstname',NULL,'Choose the mandatory fields for a patron\'s account, when registering via the OPAC.','free'), > ('PatronSelfRegistrationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when registering a new patron via the OPAC.','free'), > ('PatronSelfRegistrationConfirmEmail', '0', NULL, 'Require users to confirm their email address by entering it twice.', 'YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 24411cd343..a17170402b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -888,6 +888,12 @@ OPAC: > - '<br>If you choose <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EmailAddressForPatronRegistrations">EmailAddressForPatronRegistrations</a> you have to enter a valid email address: ' > - pref: EmailAddressForPatronRegistrations > class: email >+ - >+ - pref: PatronSelfRegistrationAlert >+ choices: >+ 0: "Don't show" >+ 1: "Show" >+ - an alert on staff interface home page when there are patrons in the category defined by <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PatronSelfRegistrationDefaultCategory">PatronSelfRegistrationDefaultCategory</a>. > Suggestions: > - > - pref: OpacSuggestionManagedBy >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 c32de6ab9b..99f3383b73 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -180,7 +180,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 ) %] >+ [% 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 %] > <div id="area-pending" class="page-section"> > [% IF pending_article_requests %] > <div class="pending-info" id="article_requests_pending"> >@@ -275,6 +275,19 @@ > <span class="pending-number-link">[% holds_with_cancellation_requests | html %]</span> > </div> > [% END %] >+ >+ [% IF self_registered_count %] >+ <div class="pending-info" id="self_registered_patrons_info"> >+ Self-registrations from: >+ <a class="self-registration-link pending-number-link self-registration-link-all" href="/cgi-bin/koha/members/member.pl?categorycode_filter=[% Koha.Preference('PatronSelfRegistrationDefaultCategory') | html %]">All libraries: [% self_registered_count | html %]</a> >+ >+ [% IF self_registered_mybranch_count %] >+ <span>/</span> >+ <a class="self-registration-link pending-number-link self-registration-link-branch" href="/cgi-bin/koha/members/member.pl?categorycode_filter=[% Koha.Preference('PatronSelfRegistrationDefaultCategory') | html %]&branchcode_filter=[% Branches.GetLoggedInBranchcode | html %]">[% Branches.GetLoggedInBranchname | html %]: [% self_registered_mybranch_count | html %]</a> >+ [% END %] >+ </div> >+ [% END %] >+ > </div> > > [% END %] >diff --git a/mainpage.pl b/mainpage.pl >index d84408538e..2b78894aaa 100755 >--- a/mainpage.pl >+++ b/mainpage.pl >@@ -138,6 +138,18 @@ if ( C4::Context->preference('CurbsidePickup') ) { > ); > } > >+if ( C4::Context->preference('PatronSelfRegistrationAlert') ) { >+ my $categorycode = C4::Context->preference('PatronSelfRegistrationDefaultCategory'); >+ my $branchcode = C4::Context::mybranch(); >+ >+ my $rs = Koha::Patrons->search( { categorycode => $categorycode } ); >+ >+ $template->param( >+ self_registered_count => $rs->count, >+ self_registered_mybranch_count => $rs->search( { branchcode => $branchcode } )->count, >+ ); >+} >+ > $template->param( > pendingcomments => $pendingcomments, > pendingtags => $pendingtags, >-- >2.43.0
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