From c2014f2949f8352c3f3496e8316cb74640ea45b3 Mon Sep 17 00:00:00 2001 From: Brendan Lawlor 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 Signed-off-by: Julian Maurice Signed-off-by: Katrin Fischer (cherry picked from commit 33c7c8730bede4f84a9dc60a2c50170622295da9) Signed-off-by: Fridolin Somers --- .../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 83063aa30a..18ca249765 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 @@

Contact information

- [% IF ( guarantor.borrowernumber ) %] - Edit - [% ELSE %] - Edit + [% IF CAN_user_borrowers_edit_borrowers %] + [% IF ( guarantor.borrowernumber ) %] + Edit + [% ELSE %] + Edit + [% END %] [% END %]
@@ -277,7 +279,9 @@ [% IF ( housebound_role.housebound_chooser == 1 OR housebound_role.housebound_deliverer == 1 ) %]

Housebound roles

- Edit + [% IF CAN_user_borrowers_edit_borrowers %] + Edit + [% END %]
    @@ -302,7 +306,9 @@ [% ELSE %]

    Housebound roles

    - Add + [% IF CAN_user_borrowers_edit_borrowers %] + Add + [% END %]
    [% END %]
[% #/ div#houseboundroles %] @@ -314,7 +320,9 @@ [% IF ( attributes_loop ) %]

Additional attributes and identifiers

- Edit + [% IF CAN_user_borrowers_edit_borrowers %] + Edit + [% END %]
[% FOREACH attribute IN attributes_loop %] [% IF attribute.class %] @@ -338,7 +346,9 @@ [% ELSE %]

Additional attributes and identifiers

- Add + [% IF CAN_user_borrowers_edit_borrowers %] + Add + [% END %]
[% END %] [% # /div#patron-extended-attributes %] @@ -349,7 +359,9 @@

Patron messaging preferences

- Edit + [% IF CAN_user_borrowers_edit_borrowers %] + Edit + [% END %]
[% INCLUDE 'messaging-preference-form.inc' %] [% IF Koha.Preference('SMSSendDriver') %] @@ -379,7 +391,9 @@

Library use

- Edit + [% IF CAN_user_borrowers_edit_borrowers %] + Edit + [% END %]
    @@ -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 ) %]

    Alternate address

    - Edit + [% IF CAN_user_borrowers_edit_borrowers %] + Edit + [% END %]
      @@ -563,7 +579,9 @@ [% ELSE %]

      Alternate address

      - Add + [% IF CAN_user_borrowers_edit_borrowers %] + Add + [% END %]
      [% END %]
    [% # /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 ) %]

    Alternative contact

    - Edit + [% IF CAN_user_borrowers_edit_borrowers %] + Edit + [% END %]
      @@ -636,7 +656,9 @@ [% ELSE %]

      Alternative contact

      - Add + [% IF CAN_user_borrowers_edit_borrowers %] + Add + [% END %]
      [% END %]
    [% # /div#patron-alternative-contact %] -- 2.39.5