@@ -, +, @@ --- ..._3137_-_add_HideFieldsAddPatronForm_syspref.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/patrons.pref | 18 ++++ .../prog/en/modules/members/memberentrygen.tt | 109 +++++++++++++++++++-- 4 files changed, 122 insertions(+), 7 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_3137_-_add_HideFieldsAddPatronForm_syspref.sql --- a/installer/data/mysql/atomicupdate/bug_3137_-_add_HideFieldsAddPatronForm_syspref.sql +++ a/installer/data/mysql/atomicupdate/bug_3137_-_add_HideFieldsAddPatronForm_syspref.sql @@ -0,0 +1, @@ +INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`) VALUES ('HideFieldsAddPatronForm', '', NULL, 'Hide these fields by default when adding new patron. These fields can still be expanded.', 'Multiple'); --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -174,6 +174,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('GoogleOAuth2ClientID', '', NULL, 'Client ID for the web app registered with Google', 'Free'), ('GoogleOAuth2ClientSecret', '', NULL, 'Client Secret for the web app registered with Google', 'Free'), ('GoogleOpenIDConnectDomain', '', NULL, 'Restrict Google OpenID Connect to this domain (or subdomains of this domain). Leave blank for all Google domains', 'Free'), +('HideFieldsAddPatronForm', '', NULL, 'Hide these fields by default when adding 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'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -1,6 +1,24 @@ Patrons: General: - + - When adding new patrons or editing existing patrons, hide the following fields from the form (can still be expanded later) + - pref: HideFieldsAddPatronForm + multiple: + identity: "Organization/Patron identity" + guarantor: Guarantor information + primary_address: Main address + primary_contact: Contact + alt_address: Alternate address + alt_contact: Alternate contact + lib_mgmt: Library management + lib_setup: Library set-up + 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: yes: Send --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -10,6 +10,17 @@ // [% END %] +[% SET fields_to_hide = Koha.Preference('HideFieldsAddPatronForm') %] + +[% IF Koha.Preference('HideFieldsAddPatronForm') %] +

+ Show hidden fields: + [% FOREACH field IN fields_to_hide.split(',') %] + [% SWITCH field %] + [% CASE 'identity' %] Organization/Patron identity | + [% CASE 'guarantor' %] Guarantor information | + [% CASE 'primary_address' %] Main address | + [% CASE 'primary_contact' %] Contact | + [% CASE 'alt_address' %] Alternate address | + [% CASE 'alt_contact' %] Alternate contact | + [% CASE 'lib_mgmt' %] Library management | + [% CASE 'lib_setup' %] Library set-up | + [% CASE 'login' %] OPAC/Staff login | + [% CASE 'flags' %] Patron account flags | + [% CASE 'debarments' %] Patron restrictions | + [% CASE 'housebound' %] Housebound roles | + [% CASE 'additional' %] Additional attributes and identifiers | + [% CASE 'messaging' %] Patron messaging preferences | + [% END %] + [% END %] +

+[% END %]
[% UNLESS ( check_member ) %] @@ -251,9 +287,13 @@ $(document).ready(function() { [% IF ( step_1 ) %] [%UNLESS notitle && nosurname && nofirstname && nodateofbirth && noinitials && noothernames &&nosex %] -
+[% IF fields_to_hide.search('identity') %] +
+[% ELSE %] +
+[% END %] [% IF ( I ) %]Organization [% ELSE %]Patron [% END %]identity -
    +
      [% UNLESS ( I ) %] [% UNLESS notitle %] [% IF Koha.Preference('BorrowersTitles') %] @@ -388,7 +428,11 @@ $(document).ready(function() { [% UNLESS step_6 %] [% END %] -
      + [% IF fields_to_hide.search('guarantor') %] +
      + [% ELSE %] +
      + [% END %] Guarantor information
        [% IF ( P ) %] @@ -484,15 +528,24 @@ $(document).ready(function() { [% END %] [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %] +[% IF fields_to_hide.search('primary_address') %] +
        +[% ELSE %] [% IF Koha.Preference( 'AddressFormat' ) %] [% INCLUDE "member-main-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] [% ELSE %] [% INCLUDE 'member-main-address-style-us.inc' %] [% END %] +[% END %] +[% IF fields_to_hide.search('primary_address') %]
        [% END %] [% END # nostreet && nocity etc group%] [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %] +[% IF fields_to_hide.search('primary_contact') %] +
        +[% ELSE %]
        +[% END %] Contact
          [% UNLESS nophone %]
        1. @@ -577,27 +630,41 @@ $(document).ready(function() { [% IF ( step_6 ) %] [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %] + [% IF fields_to_hide.search('alt_address') %] +
          + [% ELSE %] [% IF Koha.Preference( 'AddressFormat' ) %] [% INCLUDE "member-alt-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] [% ELSE %] [% INCLUDE 'member-alt-address-style-us.inc' %] [% END %] + [% END %] + [% IF fields_to_hide.search('alt_address') %]
          [% END %] [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %] [% END %] [% IF ( step_2 ) %] [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %] + [% IF fields_to_hide.search('alt_contact') %] +
          + [% ELSE %] [% IF Koha.Preference( 'AddressFormat' ) %] [% INCLUDE "member-alt-contact-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] [% ELSE %] [% INCLUDE 'member-alt-contact-style-us.inc' %] [% END %] + [% END %] + [% IF fields_to_hide.search('alt_contact') %]
          [% END %] [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %] [% END %] [% IF ( step_3 ) %] [% SET autoMemberNum = Koha.Preference('autoMemberNum') %] -
          + [% IF fields_to_hide.search('lib_mgmt') %] +
          + [% ELSE %] +
          + [% END %] Library management
            [% UNLESS nocardnumber %]
          1. @@ -723,7 +790,11 @@ $(document).ready(function() {
          [% UNLESS nodateenrolled && noopacnote && noborrowernotes %] -
          + [% IF fields_to_hide.search('lib_setup') %] +
          + [% ELSE %] +
          + [% END %] Library set-up
            [% UNLESS nodateenrolled %]
          1. @@ -802,7 +873,11 @@ $(document).ready(function() { [% END # hide fieldset %] [% UNLESS nouserid && nopassword %] -
            + [% IF fields_to_hide.search('login') %] +
            + [% ELSE %] +
            + [% END %] OPAC/Staff login
              [% UNLESS nouserid %]
            1. @@ -924,7 +999,11 @@ $(document).ready(function() { [% END # hide fieldset %][% END %] [% UNLESS ( opadd || opduplicate ) %] -
              + [% IF fields_to_hide.search('flags') %] +
              + [% ELSE %] +
              + [% END %] Patron account flags
                [% FOREACH flagloo IN flagloop %] @@ -957,7 +1036,11 @@ $(document).ready(function() {
              + [% IF fields_to_hide.search('restrictions') %] +
              + [% ELSE %]
              + [% END %] Patron restrictions [% IF ( debarments ) %] @@ -1021,7 +1104,11 @@ $(document).ready(function() { [% IF ( step_4 ) %] [% IF Koha.Preference('HouseboundModule') %] +[% IF fields_to_hide.search('housebound') %] +
              +[% ELSE %]
              +[% END %] Housebound roles
              1. @@ -1070,7 +1157,11 @@ $(document).ready(function() {
              [% END # hide fieldset %] [% IF ( ExtendedPatronAttributes ) %][% UNLESS ( no_patron_attribute_types ) %] +[% IF fields_to_hide.search('additional') %] +
              +[% ELSE %]
              +[% END %] Additional attributes and identifiers [% FOREACH pa_loo IN patron_attributes %] @@ -1114,7 +1205,11 @@ $(document).ready(function() { [% END %][% END %][% END %] [% IF ( step_5 ) %][% IF ( EnhancedMessagingPreferences ) %] +[% IF fields_to_hide.search('messaging') %] +
              +[% ELSE %]
              +[% END %] Patron messaging preferences [% IF ( opadd ) %]