]> git.koha-community.org Git - koha.git/commit
Bug 25294: Don't show deletion button if user can't delete suggestions
authorOwen Leonard <oleonard@myacpl.org>
Mon, 27 Apr 2020 15:21:30 +0000 (15:21 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 29 Apr 2020 16:16:14 +0000 (17:16 +0100)
commitafec0fb4997524cde1c2ac6ac0c0ab66f9c5d67b
treecc963b1040aea20781508c3ae7f16d82084881e6
parent9ea7fbcb30bf4b4879d4eb68c940316024c08760
Bug 25294: Don't show deletion button if user can't delete suggestions

This patch adds logic to the OPAC suggestions template so that when the
OPACViewOthersSuggestions system preference is enabled and the logged-in
user is viewing other users' suggestions, the "Delete selected" button
is only displayed when there are suggestions the user can delete.

To test you should have suggestions in your system from at least two
users.

- Set the OPACViewOthersSuggestions preference to "Show"
- Log in to the OPAC as a user who hasn't submitted any suggestions
- Go to the suggestions page (with "?suggested_by_anyone=1" appended to
  the URL if necessary, see Bug 22515).
- In the table of suggetions, there should be no titles with a checkbox
  in the first column.
- At the bottom of the table there should be no "Delete selected"
  button.

- Log in to the OPAC as a user with suggestions.
- Return to the suggestions page and view all suggestions.
- There should be titles with corresponding checkboxes and the "Delete
  selected" button should appear at the bottom.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt