Bug 25294 - Don't show deletion button if user can't delete suggestions
Summary: Don't show deletion button if user can't delete suggestions
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-27 15:18 UTC by Owen Leonard
Modified: 2020-11-30 21:49 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 25294: Don't show deletion button if user can't delete suggestions (3.42 KB, patch)
2020-04-27 15:29 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25294: Don't show deletion button if user can't delete suggestions (3.48 KB, patch)
2020-04-27 17:21 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 25294: Don't show deletion button if user can't delete suggestions (3.54 KB, patch)
2020-04-28 19:00 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2020-04-27 15:18:05 UTC
If OPACViewOthersSuggestions is enabled the logged-in user might be viewing a list of suggestions none of which they have permission to delete. If this is the case the "Delete suggested" button should not appear.
Comment 1 Owen Leonard 2020-04-27 15:29:49 UTC
Created attachment 103798 [details] [review]
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.
Comment 2 Lucas Gass 2020-04-27 17:21:11 UTC
Created attachment 103800 [details] [review]
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>
Comment 3 Katrin Fischer 2020-04-28 19:00:50 UTC
Created attachment 103880 [details] [review]
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>
Comment 4 Martin Renvoize 2020-04-29 16:36:33 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 5 Joy Nelson 2020-05-08 22:40:04 UTC
enhancement not backported to 19.11