Bugzilla – Attachment 164624 Details for
Bug 35980
Add message to patron needs permission check
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35980: Check for CAN_user_borrowers_edit_borrowers in more-member.tt
Bug-35980-Check-for-CANuserborrowerseditborrowers-.patch (text/plain), 13.25 KB, created by
Julian Maurice
on 2024-04-10 12:51:14 UTC
(
hide
)
Description:
Bug 35980: Check for CAN_user_borrowers_edit_borrowers in more-member.tt
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2024-04-10 12:51:14 UTC
Size:
13.25 KB
patch
obsolete
>From da88f9b4ef5d3b40dc69e4584b455e27b46514b6 Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Thu, 4 Apr 2024 17:22:08 +0000 >Subject: [PATCH] Bug 35980: Check for CAN_user_borrowers_edit_borrowers in > more-member.tt > >This patch removes edit buttons and add buttons from the more member page if the user does not have CAN_user_borrowers_edit_borrowers > >To test: >1. Log in with a user with only 'catalogue' and 'list_borrowers' permissions >2. Search for a patron >3. Notice there are edit and add (pecil and plus icon) buttons in the patron details page >4. You may have to enable some system prefereences like HouseboundModule to fully test >5. Test that things like Additional attributes and identifiers are still displayed >3. Apply patch, restart all, reload the page >4. Notice the edit and add buttons in the patron details page are gone > >Signed-off-by: Esther <esther@bywatersolutions.com> >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > .../prog/en/modules/members/moremember.tt | 50 +++++++++++++------ > 1 file changed, 36 insertions(+), 14 deletions(-) > >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 97a299d767..6d8ee98f69 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -116,10 +116,12 @@ > > <div class="patroninfo-heading"> > <h3>Contact information</h3> >- [% IF ( guarantor.borrowernumber ) %] >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=1&guarantorid=[% guarantor.borrowernumber | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >- [% ELSE %] >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=1"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ [% IF ( guarantor.borrowernumber ) %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=1&guarantorid=[% guarantor.borrowernumber | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% ELSE %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=1"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% END %] > [% END %] > </div> > >@@ -277,7 +279,9 @@ > [% IF ( housebound_role.housebound_chooser == 1 OR housebound_role.housebound_deliverer == 1 ) %] > <div class="patroninfo-heading"> > <h3>Housebound roles</h3> >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=7"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=7"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% END %] > </div> > <div class="rows"> > <ol> >@@ -302,7 +306,9 @@ > [% ELSE %] > <div class="patroninfo-heading"> > <h3>Housebound roles</h3> >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=7"><i class="fa fa-plus"></i> Add</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=7"><i class="fa fa-plus"></i> Add</a> >+ [% END %] > </div> > [% END %] > </div> [% #/ div#houseboundroles %] >@@ -314,7 +320,9 @@ > [% IF ( attributes_loop ) %] > <div class="patroninfo-heading"> > <h3>Additional attributes and identifiers</h3> >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=4"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=4"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% END %] > </div> > [% FOREACH attribute IN attributes_loop %] > [% IF attribute.class %] >@@ -338,7 +346,9 @@ > [% ELSE %] > <div class="patroninfo-heading"> > <h3>Additional attributes and identifiers</h3> >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=4"><i class="fa fa-plus"></i> Add</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=4"><i class="fa fa-plus"></i> Add</a> >+ [% END %] > </div> > [% END %] > </div> [% # /div#patron-extended-attributes %] >@@ -349,7 +359,9 @@ > <div id="patron-messaging-prefs" class="patroninfo-section"> > <div class="patroninfo-heading"> > <h3>Patron messaging preferences</h3> >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=5"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=5"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% END %] > </div> > [% INCLUDE 'messaging-preference-form.inc' %] > [% IF Koha.Preference('SMSSendDriver') %] >@@ -379,7 +391,9 @@ > <div id="patron-library-details" class="patroninfo-section"> > <div class="patroninfo-heading"> > <h3>Library use</h3> >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=3"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=3"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% END %] > </div> > <div class="rows"> > <ol> >@@ -529,7 +543,9 @@ > [% IF ( patron.B_phone || patron.B_email || patron.contactnote || patron.B_address || patron.B_address2 || patron.B_city || patron.B_zipcode || patron.B_country ) %] > <div class="patroninfo-heading"> > <h3>Alternate address</h3> >- <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> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <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> > <div class="address"> > <ul> >@@ -563,7 +579,9 @@ > [% ELSE %] > <div class="patroninfo-heading"> > <h3 class="inline">Alternate address</h3> >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=6"><i class="fa fa-plus"></i> Add</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=6"><i class="fa fa-plus"></i> Add</a> >+ [% END %] > </div> > [% END %] > </div> [% # /div#patron-alternate-address %] >@@ -572,7 +590,9 @@ > [% IF ( patron.altcontactsurname || patron.altcontactfirstname || patron.altcontactaddress1 || patron.altcontactaddress2 || patron.altcontactaddress3 || patron.altcontactstate || patron.altcontactzipcode || patron.altcontactcountry || patron.altcontactphone ) %] > <div class="patroninfo-heading"> > <h3>Alternative contact</h3> >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=2"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=2"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a> >+ [% END %] > </div> > <div class="rows"> > <ol> >@@ -636,7 +656,9 @@ > [% ELSE %] > <div class="patroninfo-heading"> > <h3>Alternative contact</h3> >- <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=2"><i class="fa fa-plus"></i> Add</a> >+ [% IF CAN_user_borrowers_edit_borrowers %] >+ <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&borrowernumber=[% patron.borrowernumber | html %]&step=2"><i class="fa fa-plus"></i> Add</a> >+ [% END %] > </div> > [% END %] > </div> [% # /div#patron-alternative-contact %] >-- >2.30.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 35980
:
164433
|
164434
|
164435
|
164488
|
164489
|
164623
| 164624 |
164625