From 8fe3c79a79ba9812be27e48950797f2bc25f7cbe Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Thu, 17 Aug 2023 12:31:08 +0000 Subject: [PATCH] Bug 33766: Fix ambiguous "Login" field This patch introduces a new syspref 'OPACLoginLabelTextContent' which can be set to the following values - Cardnumber - Username - Cardnumber or Username To test: - Check that the label for - The masthead inc - The opac-auth template - The opac-main template - The opac-password-recovery template - The opac-registration-confirmation template - The opac-reset-password template - The sco-main template reflect the changes you made to the syspref Signed-off-by: Matt Blenkinsop Signed-off-by: Owen Leonard --- ...1y_fix_ambiguous_form-field_in_opac-auth.tt | 18 ++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/modules/admin/preferences/opac.pref | 10 ++++++++++ .../bootstrap/en/includes/masthead.inc | 2 +- .../bootstrap/en/modules/opac-auth.tt | 2 +- .../bootstrap/en/modules/opac-main.tt | 2 +- .../en/modules/opac-password-recovery.tt | 2 +- .../modules/opac-registration-confirmation.tt | 2 +- .../en/modules/opac-reset-password.tt | 2 +- .../bootstrap/en/modules/sco/sco-main.tt | 2 +- 10 files changed, 36 insertions(+), 7 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_33766-a11y_fix_ambiguous_form-field_in_opac-auth.tt diff --git a/installer/data/mysql/atomicupdate/bug_33766-a11y_fix_ambiguous_form-field_in_opac-auth.tt b/installer/data/mysql/atomicupdate/bug_33766-a11y_fix_ambiguous_form-field_in_opac-auth.tt new file mode 100755 index 0000000000..3bb5322875 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_33766-a11y_fix_ambiguous_form-field_in_opac-auth.tt @@ -0,0 +1,18 @@ +use Modern::Perl; + +return { + bug_number => "33766", + description => "Add syspref to determine text content of userid input field's label.", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do( + q{INSERT IGNORE INTO systempreferences (variable,value) VALUES ('OPACLoginLabelTextContent','Cardnumber') } + ); + + # sysprefs + say $out "Added new system preference 'OPACLoginLabelTextContent'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 314efd51a8..ba6e0cb41d 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -481,6 +481,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACLocalCoverImages','0','1','Display local cover images on OPAC search and details pages.','YesNo'), ('OpacLocationBranchToDisplay','holding','holding|home|both','In the OPAC, under location show which branch for Location in the record details.','Choice'), ('OpacLocationOnDetail','holding','holding|home|both|column','In the OPAC detail, display the shelving location on its own column or under a library columns.', 'Choice'), +('OPACLoginLabelTextContent','Cardnumber',NULL,NULL,NULL), ('OPACMandatoryHoldDates', '', '|start|end|both', 'Define which hold dates are required on OPAC reserve form', 'Choice'), ('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'), ('OpacMaintenanceNotice','','','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'), 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 39815ecf72..4a5bb4fea0 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 @@ -171,6 +171,15 @@ OPAC: column: "on a separate column" - "for items on the OPAC record details page." - "
Note: If 'on a separate column' is selected, you still need to enable the item_shelving_location display on the configure columns administration page." + - + - Use + - pref: OPACLoginLabelTextContent + default: Cardnumber + choices: + Cardnumber: Cardnumber + Username: Username + "Cardnumber or Username": Cardnumber or Username + - "as the text content of the userid input field's label." - - pref: OPACShowMusicalInscripts default: 0 @@ -529,6 +538,7 @@ OPAC: type: textarea syntax: text/html class: code + - - pref: OpacBrowseSearch default: 0 diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index dbe22e3beb..cd5054f076 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -426,7 +426,7 @@