From 3aef9a158ba866e2ce8a712e87ae9f2ae3b7ed40 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 23 Jul 2018 04:34:06 +0000 Subject: [PATCH] Bug 21121: Added new system preference to control hiding of personal patron information in the circulation page Libraries may want to hide personal patron data from the circulation page for privacy reasons this syspref introduces that ability for library staff to control the display of this data themselves without having to ask support vendors to hide it for them. Test plan: 1. View circulation page and input a patrons barcode or name 2. Notice if the patron has a phone number, email, street address and city set then these are displayed in the left hand side of the screen under the patrons name. Otherwise if all/any of these fields are not set for the patron then the text: "No stored." is displayed. 3. Apply this patch 4. Run ./updatedatabase.pl from the Koha shell to run the atomicupdate 5. Restart memcached and plack 6. Notice a new systempreference named 'HidePersonalPatronDetailOnCirculation' has been added, which has the default value 'Dont' 7. Without changing the default value notice the personal patron information is still displayed on the circulation page 8. Change the value of the syspref to 'Do' and now notice the phone number, email address, street address and city are now hidden in the circulation page Sponsored-By: Catalyst IT Signed-off-by: Owen Leonard Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens --- ...rsonal_patron_data_on_circulation_page.sql | 1 + .../prog/en/includes/circ-menu.inc | 66 ++++++++++--------- .../admin/preferences/circulation.pref | 6 ++ 3 files changed, 41 insertions(+), 32 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_21121_new_syspref_hide_personal_patron_data_on_circulation_page.sql diff --git a/installer/data/mysql/atomicupdate/bug_21121_new_syspref_hide_personal_patron_data_on_circulation_page.sql b/installer/data/mysql/atomicupdate/bug_21121_new_syspref_hide_personal_patron_data_on_circulation_page.sql new file mode 100644 index 0000000000..2f7fc39f8d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_21121_new_syspref_hide_personal_patron_data_on_circulation_page.sql @@ -0,0 +1 @@ +INSERT INTO systempreferences (variable, value, options, explanation) VALUES ('HidePersonalPatronDetailOnCirculation', 0, 'YesNo', 'Hide patrons phone number, email address, street address and city in the circulation page'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index fb56a01016..2d36462d69 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -17,43 +17,45 @@ [% END %] [% END %] - [% IF Koha.Preference( 'AddressFormat' ) %] - [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] - [% ELSE %] - [% INCLUDE 'member-display-address-style-us.inc' %] - [% END %] + [% IF !(Koha.Preference('HidePersonalPatronDetailOnCirculation')) %] + [% IF Koha.Preference( 'AddressFormat' ) %] + [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %] + [% ELSE %] + [% INCLUDE 'member-display-address-style-us.inc' %] + [% END %] - [% IF ( patron.phone || patron.mobile || patron.phonepro ) %]
  • - [% IF ( patron.phone ) %] - [% patron.phone | html %] - [% ELSE %] - [% IF ( patron.mobile ) %] - [% patron.mobile | html %] + [% IF ( patron.phone || patron.mobile || patron.phonepro ) %]
  • + [% IF ( patron.phone ) %] + [% patron.phone | html %] [% ELSE %] - [% IF ( patron.phonepro ) %] - [% patron.phonepro | html %] + [% IF ( patron.mobile ) %] + [% patron.mobile | html %] + [% ELSE %] + [% IF ( patron.phonepro ) %] + [% patron.phonepro | html %] + [% END %] + [% END %] + [% END %]
  • [% END %] + [% IF ( patron.email ) %] + + [% ELSE %] + [% IF ( patron.emailpro ) %] + [% END %] [% END %] - [% END %][% END %] - [% IF ( patron.email ) %] - - [% ELSE %] - [% IF ( patron.emailpro ) %] - - [% END %] - [% END %] - [% UNLESS ( patron.address or patron.address2 ) %] -
  • No address stored.
  • - [% END %] - [% UNLESS ( patron.city ) %] -
  • No city stored.
  • - [% END %] - [% UNLESS ( patron.phone or patron.mobile or patron.phonepro) %] -
  • No phone stored.
  • - [% END %] - [% UNLESS ( patron.email or patron.emailpro) %] -
  • No email stored.
  • + [% UNLESS ( patron.address or patron.address2 ) %] +
  • No address stored.
  • + [% END %] + [% UNLESS ( patron.city ) %] +
  • No city stored.
  • + [% END %] + [% UNLESS ( patron.phone or patron.mobile or patron.phonepro) %] +
  • No phone stored.
  • + [% END %] + [% UNLESS ( patron.email or patron.emailpro) %] +
  • No email stored.
  • + [% END %] [% END %] [% IF ( ExtendedPatronAttributes ) %][% FOREACH extendedattribute IN extendedattributes %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 8c66afee21..217f48d3a4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -509,6 +509,12 @@ Circulation: yes: Cumulate no: "Don't cumulate" - the restriction periods. + - + - pref: HidePersonalPatronDetailOnCirculation + choices: + yes: Do + no: "Don't" + - Hide patrons phone number, email address, street address and city in the circulation page Holds Policy: - - pref: AllowHoldItemTypeSelection -- 2.39.5