From 87c3436f7780f51ed3ed8a1392983d53fdf356fc Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 11 Mar 2020 04:02:53 +0000 Subject: [PATCH] Bug 3137: (follow-up) Rename using 'collapse', remove syspref lettering and fix guarantor section collapsing Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- ...d_CollapseFieldsPatronAddForm_syspref.perl | 7 ++++ ...7-add_HideFieldsPatronAddForm_syspref.perl | 7 ---- installer/data/mysql/sysprefs.sql | 2 +- .../en/modules/admin/preferences/patrons.pref | 32 +++++++++---------- .../prog/en/modules/members/memberentrygen.tt | 7 ++-- 5 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_3137-add_CollapseFieldsPatronAddForm_syspref.perl delete mode 100644 installer/data/mysql/atomicupdate/bug_3137-add_HideFieldsPatronAddForm_syspref.perl diff --git a/installer/data/mysql/atomicupdate/bug_3137-add_CollapseFieldsPatronAddForm_syspref.perl b/installer/data/mysql/atomicupdate/bug_3137-add_CollapseFieldsPatronAddForm_syspref.perl new file mode 100644 index 0000000000..c3828920d5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_3137-add_CollapseFieldsPatronAddForm_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 ('CollapseFieldsPatronAddForm','',NULL,'Collapse these fields by default when adding a new patron. These fields can still be expanded.','Multiple') }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 4461 - Add CollapseFieldsPatronAddForm system preference)\n"; +} diff --git a/installer/data/mysql/atomicupdate/bug_3137-add_HideFieldsPatronAddForm_syspref.perl b/installer/data/mysql/atomicupdate/bug_3137-add_HideFieldsPatronAddForm_syspref.perl deleted file mode 100644 index 92cbe40aec..0000000000 --- a/installer/data/mysql/atomicupdate/bug_3137-add_HideFieldsPatronAddForm_syspref.perl +++ /dev/null @@ -1,7 +0,0 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('HideFieldsPatronAddForm','',NULL,'Hide these fields by default when adding a new patron. These fields can still be expanded.','Multiple') }); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; -} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index b213986ff5..612dcc20c6 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -128,6 +128,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('CoceHost', '', NULL, 'Coce server URL', 'Free'), ('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'), ('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','YesNo'), +('CollapseFieldsPatronAddForm','',NULL,'Collapse these fields by default when adding a new patron. These fields can still be expanded.','Multiple'), ('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'), ('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'), ('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'), @@ -211,7 +212,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('GoogleOpenIDConnectDefaultBranch', '','','This branch code will be used to create Google OpenID Connect patrons.','Textarea'), ('GoogleOpenIDConnectDefaultCategory','','','This category code will be used to create Google OpenID Connect patrons.','Textarea'), ('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'), -('HideFieldsPatronAddForm','',NULL,'Hide these fields by default when adding a new patron. These fields can still be expanded.','Multiple'), ('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'), ('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'), ('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 8509b6e386..48bc763cc3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -1,23 +1,23 @@ Patrons: General: - - - When adding new patrons or editing existing patrons, hide the following fields from the full form (can still be expanded later) - - pref: HideFieldsPatronAddForm + - When adding new patrons or editing existing patrons, collapse the following fields from the full form (can still be expanded later) + - pref: CollapseFieldsPatronAddForm multiple: - identity: "a. Organization/Patron identity" - guarantor: "b. Guarantor information" - primary_address: "c. Main address" - primary_contact: "d. Contact information" - alt_address: "e. Alternate address" - alt_contact: "f. Alternate contact" - lib_mgmt: "g. Library management" - lib_setup: "h. Library setup" - login: "i. OPAC/Staff login" - flags: "j. Patron account flags (existing patrons)" - debarments: "k. Patron restrictions (existing patrons)" - housebound: "l. Housebound roles" - additional: "m. Additional attributes and identifiers" - messaging: "n. Patron messaging preferences" + identity: "Organization/Patron identity" + guarantor: "Guarantor information" + primary_address: "Main address" + primary_contact: "Contact information" + alt_address: "Alternate address" + alt_contact: "Alternate contact" + lib_mgmt: "Library management" + lib_setup: "Library setup" + login: "OPAC/Staff login" + flags: "Patron account flags (existing patrons)" + debarments: "Patron restrictions (existing patrons)" + housebound: "Housebound roles" + additional: "Additional attributes and identifiers" + messaging: "Patron messaging preferences" - - pref: AutoEmailOpacUser choices: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index d64eeaa91e..0f14efc3fb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -166,10 +166,10 @@ legend:hover { [% END %] - [% SET fieldstohide = Koha.Preference('HideFieldsPatronAddForm') %] - [% IF Koha.Preference('HideFieldsPatronAddForm') %][% UNLESS step %] + [% SET fieldstohide = Koha.Preference('CollapseFieldsPatronAddForm') %] + [% IF Koha.Preference('CollapseFieldsPatronAddForm') %][% UNLESS step %]

- Show hidden fields: + Show hidden fields: [% FOREACH field IN fieldstohide.split(',') %] [% SWITCH field %] [% CASE 'identity' %] Organization/Patron identity | @@ -1414,6 +1414,7 @@ legend:hover { [% IF show_guarantor || guarantor %] [% IF fieldstohide.match('guarantor') %] $("#memberentry_guarantor").find('legend').nextAll().toggle(); + $("#guarantor_template").toggle(); [% END %] [% END %] [% IF fieldstohide.match('primary_address') %] -- 2.39.5