From a962935873d8332d138b58ba559e9d53c54cb9e3 Mon Sep 17 00:00:00 2001 From: Laura_Escamilla Date: Fri, 28 Jun 2024 17:28:17 +0000 Subject: [PATCH] Bug 37144 - Add a subpermission for hiding patron contact information --- installer/data/mysql/mandatory/userpermissions.sql | 1 + .../intranet-tmpl/prog/en/includes/circ-menu.inc | 1 + .../intranet-tmpl/prog/en/includes/patron-search.inc | 2 ++ .../intranet-tmpl/prog/en/includes/permissions.inc | 5 +++++ .../prog/en/includes/str/members-menu.inc | 1 + .../intranet-tmpl/prog/en/includes/waiting_holds.inc | 2 ++ .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 1 + .../intranet-tmpl/prog/en/modules/circ/returns.tt | 10 ++++++++++ .../prog/en/modules/circ/view_holdsqueue.tt | 2 +- .../prog/en/modules/members/moremember-brief.tt | 1 + .../prog/en/modules/members/moremember.tt | 11 +++++++++++ 11 files changed, 36 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql index 4b5c8ebe2c..3790de0abd 100644 --- a/installer/data/mysql/mandatory/userpermissions.sql +++ b/installer/data/mysql/mandatory/userpermissions.sql @@ -49,6 +49,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES ( 4, 'list_borrowers', 'Search, list and view patrons'), ( 4, 'send_messages_to_borrowers', 'Send messages to patrons'), ( 4, 'view_borrower_infos_from_any_libraries', 'View patron infos from any libraries'), + ( 4, 'view_contact_information', 'View patron contact information'), ( 6, 'place_holds', 'Place holds for patrons'), ( 6, 'modify_holds_priority', 'Modify holds priority'), ( 9, 'edit_catalogue', 'Edit catalog (Modify bibliographic/holdings data)'), 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 8c2592c037..5b7774377d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -65,6 +65,7 @@ [% IF patron.pronouns %]
  • ([% patron.pronouns | html %])
  • [% END %] + [% IF !(Koha.Preference('HidePersonalPatronDetailOnCirculation')) && CAN_user_borrowers_view_contact_information %] [% IF !(Koha.Preference('HidePersonalPatronDetailOnCirculation')) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index c8dd64c124..dd6eb5f214 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -505,12 +505,14 @@ r += $patron_to_html(row, { invert_name: 1 }); [% END %] r += '
    '; + [% IF CAN_borrowers_view_contact_information %] r += '
    ' return r; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc index b8f2c2b040..3c059ffdb9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc @@ -321,6 +321,11 @@ View patron infos from any libraries. If not set the logged in user could only access patron infos from its own library or group of libraries. + ([% name | html %]) + [%- CASE 'view_contact_information' -%] + + View patron contact information. + ([% name | html %]) [%- CASE 'send_messages_to_borrowers' -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc index 530e9bfb89..dd76703c25 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc @@ -12,6 +12,7 @@ var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers | html %]"; var CAN_user_borrowers_delete_borrowers = "[% CAN_user_borrowers_delete_borrowers | html %]"; + var CAN_user_borrowers_view_contact_information = "[% CAN_user_borrowers_view_contact_information | html %]"; var dateformat = "[% Koha.Preference('dateformat') | html %]"; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc index f654f50c29..1967300ad7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc @@ -53,11 +53,13 @@
    Barcode: [% reserveloo.item.barcode | html %] [% INCLUDE 'patron-title.inc' patron=reserveloo.borrower invert_name=1 no_title=1 %] + [% IF CAN_user_borrowers_view_contact_information %] [% IF ( reserveloo.borrower.phone ) %]
    [% reserveloo.borrower.phone | html %][% END %] [% IF ( reserveloo.borrower.notice_email_address ) %]
    [% reserveloo.borrower.notice_email_address | html %]
    [% END %] + [% END %] [% Branches.GetName( reserveloo.item.homebranch ) | html %] [% Branches.GetName( reserveloo.item.holdingbranch ) | html %][% IF (reserveloo.desk_id ) %], [% reserveloo.desk.desk_name | html %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index ff812fe5c1..470234693f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1013,6 +1013,7 @@ var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %]; var AllowRenewalOnHoldOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalOnHoldOverride') )? 1: 0 | html %]; var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %]; + var ViewContactInformation = [% (CAN_user_borrowers_view_contact_information)? 1 : 0 | html %]; var script = "circulation"; var relatives_borrowernumbers = new Array(); [% FOREACH b IN relatives_borrowernumbers %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 7091e5ef8e..556c3fb4e1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -81,6 +81,7 @@ - [% patron.category.description | html %] + [% IF CAN_user_view_contact_information %] [% INCLUDE display_holdpatron_address %] [% IF ( patron.phone ) %] @@ -96,6 +97,7 @@ [% END %] [% END %] + [% END %] [% UNLESS ( transfertodo) %] [% INCLUDE display_bormessagepref %] @@ -654,6 +656,7 @@ [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %] - [% patron.category.description | html %] + [% IF CAN_user_view_contact_information %] [% INCLUDE display_holdpatron_address %] [% IF ( patron.phone ) %]
  • [% patron.phone | html %]
  • @@ -662,6 +665,7 @@ [% IF ( patron.email ) %]
  • [% patron.email | html %]
  • [% END %] + [% END %] [% IF ( patron.is_debarred ) %]
  • Patron is RESTRICTED
  • @@ -837,6 +841,7 @@ - [% patron.category.description | html %] + [% IF CAN_user_view_contact_information %] [% INCLUDE display_holdpatron_address %] [% IF ( patron.phone ) %] @@ -852,6 +857,7 @@ [% END %] [% END %] + [% END %] [% UNLESS ( transfertodo) %] [% INCLUDE display_bormessagepref %] @@ -956,6 +962,7 @@ - [% recall.patron.category.description | html %] + [% IF CAN_user_view_contact_information %] [% INCLUDE display_holdpatron_address patron=recall.patron %] [% IF ( recall.patron.phone ) %] @@ -971,6 +978,7 @@ [% END %] [% END %] + [% END %] [% UNLESS ( transfertodo) %] [% INCLUDE display_bormessagepref %] @@ -1059,6 +1067,7 @@ - [% recall.patron.category.description | html %] + [% IF CAN_user_view_contact_information %] [% INCLUDE display_holdpatron_address patron=recall.patron %] [% IF ( recall.patron.phone ) %] @@ -1074,6 +1083,7 @@ [% END %] [% END %] + [% END %] [% UNLESS ( transfertodo) %] [% INCLUDE display_bormessagepref %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt index 3a88c14e87..2cfbcac9e7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt @@ -216,7 +216,7 @@

    [% INCLUDE 'patron-title.inc' invert_name=1 patron=itemsloo.patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]

    - [% UNLESS Koha.Preference('HidePatronName') %] + [% UNLESS Koha.Preference('HidePatronName') || !CAN_user_borrowers_view_contact_information %]

    [% itemsloo.patron.phone | html %]

    [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt index 4c07cbf432..f388882cf5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt @@ -22,6 +22,7 @@
    + [% IF CAN_user_borrowers_view_contact_information %]
    [% IF ( patron.othernames ) %]“[% patron.othernames | html %]”[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 4debd1abda..e0955774eb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -127,12 +127,15 @@ [% IF ( patron.othernames ) %]
    “[% patron.othernames | html %]”
    [% END %] + [% IF CAN_user_borrowers_view_contact_information %]
      [% PROCESS 'display-address-style' %]
    + [% END %] + [% IF CAN_user_borrowers_view_contact_information %]
      [% IF ( patron.phone ) %] @@ -272,6 +275,7 @@ [% END %]
    [% # /div.rows %] + [% END %]
    [% # /div#patron-information %] [% IF Koha.Preference('HouseboundModule') %] @@ -571,13 +575,16 @@ Edit [% END %]
    + [% IF CAN_user_borrowers_view_contact_information %]
      [% PROCESS 'display-alt-address-style' %]
    + [% END %]
      + [% IF CAN_user_borrowers_view_contact_information %] [% IF ( patron.B_phone ) %]
    1. Phone: @@ -598,6 +605,7 @@ [% patron.contactnote |html %]
    2. [% END %] + [% END %]
    [% ELSE %] @@ -620,6 +628,7 @@
      + [% IF CAN_user_borrowers_view_contact_information %] [% IF ( patron.altcontactsurname ) %]
    1. Surname: @@ -675,6 +684,7 @@ [% patron.altcontactphone | html %]
    2. [% END %] + [% END %]
    [% # /div.rows %] [% ELSE %] @@ -751,6 +761,7 @@ var branchcode = "[% Branches.GetLoggedInBranchcode() | html %]"; var exports_enabled = "[% Koha.Preference('ExportCircHistory') | html %]"; var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %]; + var ViewContactInformation = [% (CAN_user_borrowers_view_contact_information)? 1 : 0 | html %]; var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %]; var AllowRenewalOnHoldOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalOnHoldOverride') )? 1: 0 | html %]; var script = "moremember"; -- 2.39.2