Bugzilla – Attachment 168284 Details for
Bug 37144
Add a subpermission for hiding patron contact information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37144 - Add a subpermission for hiding patron contact information
Bug-37144---Add-a-subpermission-for-hiding-patron-.patch (text/plain), 20.98 KB, created by
Laura Escamilla
on 2024-06-28 17:38:35 UTC
(
hide
)
Description:
Bug 37144 - Add a subpermission for hiding patron contact information
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2024-06-28 17:38:35 UTC
Size:
20.98 KB
patch
obsolete
>From 60fe73b95d4dfff7d2d193d3466a4491c431f1fb Mon Sep 17 00:00:00 2001 >From: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >Date: Fri, 28 Jun 2024 17:28:17 +0000 >Subject: [PATCH] Bug 37144 - Add a subpermission for hiding patron contact > information > >--- > .../data/mysql/mandatory/userpermissions.sql | 1 + > .../intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- > .../prog/en/includes/patron-search.inc | 4 +++- > .../prog/en/includes/permissions.inc | 5 +++++ > .../prog/en/includes/str/members-menu.inc | 1 + > .../prog/en/includes/waiting_holds.inc | 2 ++ > .../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 +++++++++++ > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 15 ++++++++------- > 12 files changed, 45 insertions(+), 10 deletions(-) > >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 b54aa71d6e..53dbd0b2a6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -62,7 +62,7 @@ > <li class="patronpronouns">([% patron.pronouns | html %])</li> > [% END %] > >- [% IF !(Koha.Preference('HidePersonalPatronDetailOnCirculation')) %] >+ [% IF !(Koha.Preference('HidePersonalPatronDetailOnCirculation')) && CAN_user_borrowers_view_contact_information %] > > [% PROCESS 'display-address-style' %] > >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..3b8dbfbee4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -505,14 +505,16 @@ > r += $patron_to_html(row, { invert_name: 1 }); > [% END %] > r += '<br/>'; >+ [% IF CAN_borrowers_view_contact_information %] > r += '<div class="address"><ul>'; > r += $format_address(row, { no_line_break: true, include_li: true }); > > if ( row.email ) { > r += "<li class=\"patron_email\">" + _("Email: ") + "<a href='mailto:" + encodeURIComponent(row.email) + "'>" + escape_str(row.email) + "</a></li>"; > } >+ [% END %] > r += '</ul></div>' >- >+ > 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 @@ > <span class="sub_permission view_borrower_infos_from_any_libraries_subpermission"> > 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. > </span> >+ <span class="permissioncode">([% name | html %]) >+ [%- CASE 'view_contact_information' -%] >+ <span class="sub_permission view_contact_information"> >+ View patron contact information. >+ </span> > <span class="permissioncode">([% name | html %])</span> > [%- CASE 'send_messages_to_borrowers' -%] > <span class="sub_permission send_messages_to_borrowers_subpermission"> >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 @@ > <br />Barcode: [% reserveloo.item.barcode | html %] > </td> > <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrower.borrowernumber | uri %]">[% INCLUDE 'patron-title.inc' patron=reserveloo.borrower invert_name=1 no_title=1 %]</a> >+ [% IF CAN_user_borrowers_view_contact_information %] > [% IF ( reserveloo.borrower.phone ) %]<br /><span class="patron_phone">[% reserveloo.borrower.phone | html %]</span>[% END %] > [% IF ( reserveloo.borrower.notice_email_address ) %] > <span class="patron_email"><br /><a href="mailto:[% reserveloo.borrower.notice_email_address | uri %]?subject=[% "Hold waiting: " | uri %][% reserveloo.biblio.title | uri %]"> > [% reserveloo.borrower.notice_email_address | html %]</a></span> > [% END %] >+ [% END %] > </td> > <td>[% Branches.GetName( reserveloo.item.homebranch ) | html %]</td> > <td>[% Branches.GetName( reserveloo.item.holdingbranch ) | html %][% IF (reserveloo.desk_id ) %], [% reserveloo.desk.desk_name | html %][% END %]</td> >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 c124dcb6cf..b383252763 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -1012,6 +1012,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 474a3e6473..fcf9c7194a 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 @@ > <span class="patron-category"> - [% patron.category.description | html %]</span> > </li> > >+ [% IF CAN_user_view_contact_information %] > [% INCLUDE display_holdpatron_address %] > > [% IF ( patron.phone ) %] >@@ -96,6 +97,7 @@ > [% END %] > </li> > [% END %] >+ [% END %] > > [% UNLESS ( transfertodo) %] > [% INCLUDE display_bormessagepref %] >@@ -651,6 +653,7 @@ > [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %] > <span class="patron-category"> - [% patron.category.description | html %]</span> > </li> >+ [% IF CAN_user_view_contact_information %] > [% INCLUDE display_holdpatron_address %] > [% IF ( patron.phone ) %] > <li> [% patron.phone | html %]</li> >@@ -659,6 +662,7 @@ > [% IF ( patron.email ) %] > <li><a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a></li> > [% END %] >+ [% END %] > > [% IF ( patron.is_debarred ) %] > <li class="error">Patron is RESTRICTED</li> >@@ -832,6 +836,7 @@ > <span class="patron-category"> - [% patron.category.description | html %]</span> > </li> > >+ [% IF CAN_user_view_contact_information %] > [% INCLUDE display_holdpatron_address %] > > [% IF ( patron.phone ) %] >@@ -847,6 +852,7 @@ > [% END %] > </li> > [% END %] >+ [% END %] > > [% UNLESS ( transfertodo) %] > [% INCLUDE display_bormessagepref %] >@@ -950,6 +956,7 @@ > <span class="patron-category"> - [% recall.patron.category.description | html %]</span> > </li> > >+ [% IF CAN_user_view_contact_information %] > [% INCLUDE display_holdpatron_address patron=recall.patron %] > > [% IF ( recall.patron.phone ) %] >@@ -965,6 +972,7 @@ > [% END %] > </li> > [% END %] >+ [% END %] > > [% UNLESS ( transfertodo) %] > [% INCLUDE display_bormessagepref %] >@@ -1053,6 +1061,7 @@ > <span class="patron-category"> - [% recall.patron.category.description | html %]</span> > </li> > >+ [% IF CAN_user_view_contact_information %] > [% INCLUDE display_holdpatron_address patron=recall.patron %] > > [% IF ( recall.patron.phone ) %] >@@ -1068,6 +1077,7 @@ > [% END %] > </li> > [% 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 49f2342125..7b49d4d143 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 >@@ -209,7 +209,7 @@ > <p> > [% INCLUDE 'patron-title.inc' invert_name=1 patron=itemsloo.patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %] > </p> >- [% UNLESS Koha.Preference('HidePatronName') %] >+ [% UNLESS Koha.Preference('HidePatronName') || !CAN_user_borrowers_view_contact_information %] > <p>[% itemsloo.patron.phone | html %]</p> > [% END %] > </td> >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 @@ > </div> > <div class="row"> > <div class="col-xs-6"> >+ [% IF CAN_user_borrowers_view_contact_information %] > <div id="patron-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 e00506ab50..4c05987ca9 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 ) %]<div>“[% patron.othernames | html %]”</div>[% END %] > >+ [% IF CAN_user_borrowers_view_contact_information %] > <div class="address"> > <ul> > [% PROCESS 'display-address-style' %] > </ul> > </div> >+ [% END %] > >+ [% IF CAN_user_borrowers_view_contact_information %] > <div class="rows"> > <ol> > [% IF ( patron.phone ) %] >@@ -272,6 +275,7 @@ > [% END %] > </ol> > </div> [% # /div.rows %] >+ [% END %] > </div> [% # /div#patron-information %] > > [% IF Koha.Preference('HouseboundModule') %] >@@ -571,13 +575,16 @@ > <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=6"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> > [% END %] > </div> >+ [% IF CAN_user_borrowers_view_contact_information %] > <div class="address"> > <ul> > [% PROCESS 'display-alt-address-style' %] > </ul> > </div> >+ [% END %] > <div class="rows"> > <ol> >+ [% IF CAN_user_borrowers_view_contact_information %] > [% IF ( patron.B_phone ) %] > <li id="patron-bphone"> > <span class="label">Phone: </span> >@@ -598,6 +605,7 @@ > [% patron.contactnote |html %] > </li> > [% END %] >+ [% END %] > </ol> > </div> > [% ELSE %] >@@ -620,6 +628,7 @@ > </div> > <div class="rows"> > <ol> >+ [% IF CAN_user_borrowers_view_contact_information %] > [% IF ( patron.altcontactsurname ) %] > <li id="patron-altcontactsurname"> > <span class="label">Surname: </span> >@@ -675,6 +684,7 @@ > <a href="tel:[% patron.altcontactphone | url %]">[% patron.altcontactphone | html %]</a> > </li> > [% END %] >+ [% END %] > </ol> > </div> [% # /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"; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index ceaf8b8d57..6347aac1a3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -672,6 +672,7 @@ function patron_autocomplete(node, options) { > } else { > loggedInClass = ""; > } >+ > return $("<li></li>") > .addClass(loggedInClass) > .data("ui-autocomplete-item", item) >@@ -695,12 +696,12 @@ function patron_autocomplete(node, options) { > __("years") + > ")</span>," > : "") + >- " " + >- $format_address(item, { >+ " "+ >+ $format_address(item, { > no_line_break: true, > include_li: false, >- }) + >- " " + >+ }) >+ " " + > (!singleBranchMode > ? '<span class="ac-library">' + > item.library.name.escapeHtml() + >@@ -708,10 +709,10 @@ function patron_autocomplete(node, options) { > : "") + > "</small>" + > "</a>" >- ) >+ ) > .appendTo(ul); >- }); >-} >+ }); >+ } > > function expandPatronSearchFields(search_fields) { > switch (search_fields) { >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37144
:
168282
|
168283
|
168284
|
168387
|
168388
|
168389
|
168390
|
168391
|
168392
|
168393
|
168394
|
168460
|
168463
|
169320
|
169321
|
169322
|
169323
|
169324
|
169325
|
169326
|
169327
|
169328
|
169329
|
169330
|
169331
|
169332
|
169333
|
169334