Bugzilla – Attachment 115372 Details for
Bug 13188
Make it possible to configure mandatory patron data differently between OPAC registration and modification
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13188: Add PatronSelfModificationMandatoryField system preference
Bug-13188-Add-PatronSelfModificationMandatoryField.patch (text/plain), 5.42 KB, created by
Lucas Gass (lukeg)
on 2021-01-19 22:44:53 UTC
(
hide
)
Description:
Bug 13188: Add PatronSelfModificationMandatoryField system preference
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-01-19 22:44:53 UTC
Size:
5.42 KB
patch
obsolete
>From b374aca3b4205bebb4595887712ed385a72e2ad9 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 19 Jan 2021 22:39:57 +0000 >Subject: [PATCH] Bug 13188: Add PatronSelfModificationMandatoryField system > preference > >TEST PLAN: >1. Apply patch, updatedatabase, restart_all >2. In the PatronSelfRegistrationBorrowerMandatoryField add the field password. >3. Go to the self registration page on make sure password is required. >4. Now go to the OPAC modification page, make some changes and attempt to submit. It should work. >5. Go to PatronSelfModificationMandatoryField and select some fields. >6. The columns you selected should now be required. >7. On the PatronSelfModificationMandatoryField page, make sure the select all and clear all buttons work. > >NOTE: This patch is not ready for sign-off, I would like to see Bug 17364 make it in so I can easily add exclusions. >For example, you should not be able to make password required for borrower modification, if you do you will see the warning 'You have not filled out all required fields. Please fill in all missing fields and resubmit.'. >--- > ...bug_13188_add_PatronSelfModificationMandatoryField_syspref.perl | 7 +++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 5 +++++ > opac/opac-memberentry.pl | 3 ++- > 4 files changed, 15 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_13188_add_PatronSelfModificationMandatoryField_syspref.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_13188_add_PatronSelfModificationMandatoryField_syspref.perl b/installer/data/mysql/atomicupdate/bug_13188_add_PatronSelfModificationMandatoryField_syspref.perl >new file mode 100644 >index 0000000000..9462d3b3ea >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_13188_add_PatronSelfModificationMandatoryField_syspref.perl >@@ -0,0 +1,7 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('PatronSelfModificationMandatoryField','', NULL,'Define the required fields when a patron is editing their information via the OPAC.','multiple'); >+ }); >+ NewVersion($DBversion, 13188, "Allow configuration of required fields when a patron is editing their information via the OPAC"); >+} >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 7f0afaa594..0dccc26983 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -499,6 +499,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('PatronDuplicateMatchingAddFields','surname|firstname|dateofbirth', NULL,'A list of fields separated by "|" to deduplicate patrons when created','Free'), > ('patronimages','0',NULL,'Enable patron images for the staff interface','YesNo'), > ('PatronRemovalDelay','',NULL,'Delay for removing anonymized patrons', 'Integer'), >+('PatronSelfModificationMandatoryField','',NULL,'Name the fields you don\'t want to be required when a patron is editing their information via the OPAC.','free'), > ('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display 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'), > ('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'), >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 c0fc56e502..fa03f57ed5 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 >@@ -816,6 +816,11 @@ OPAC: > - "days after account creation." > - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/cleanup_database.pl</code> cronjob. Ask your system administrator to schedule it." > - >+ - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> must be filled in on the patron modification screen:" >+ - pref: PatronSelfModificationMandatoryField >+ type: modalselect >+ source: borrowers >+ - > - "The following <a href='http://schema.koha-community.org/__VERSION__/tables/borrowers.html' target='blank'>database columns</a> must be filled in on the patron entry screen:" > - pref: PatronSelfRegistrationBorrowerMandatoryField > type: modalselect >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index a3f1ae61b8..f5a7df3e55 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -389,7 +389,8 @@ sub GetMandatoryFields { > > my %mandatory_fields; > >- my $BorrowerMandatoryField = >+ my $BorrowerMandatoryField = $action eq 'edit' || $action eq 'update' ? >+ C4::Context->preference("PatronSelfModificationMandatoryField") : > C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField"); > > my @fields = split( /\|/, $BorrowerMandatoryField ); >-- >2.11.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 13188
:
115371
|
115372
|
116085
|
122752
|
123335
|
125272
|
125273
|
125274
|
128409
|
128413
|
128414
|
128415
|
128416
|
128417
|
128418