Some libraries are finding that some patrons have a tendency to "spam" the purchase suggestions with dozens of requests at a time. It would be nice if we could limit the number of purchase suggestions a patron can place that are neither Accepted or Rejected. Idea: 1) Add new system preference "MaxOpenSuggestions" 2) Modify opac-suggestions.pl to count the number of suggesions the patron has that are not Accepted or Rejected 3) If that count has reached the number specified in MaxOpenSuggestions, deny the ability to place another suggestion with the message: "You have reached your limit of suggestions you can place at this time. Once the library has processed those suggestions you will be able to place more"
Created attachment 52452 [details] [review] Bug 15128 - Add ability to limit patrons open purchase suggestions To test: 1 - Define a number of MaxOpenSuggestions 2 - Add some suggestions for a patron 3 - Note they cannot add any more suggestions if limit is reached 4 - Delete a suggestion and note you can add another 5 - Add them to limit again 6 - Accept a suggestion in the staff client and note user can add more 7 - Repeat above with rejecting or deleting 8 - Sign off. Sponsored by: North Central Regional Library (http://ncrl.org/)
Works fine, I like this feature. Maybe the following could be improved: Let's say MaxOpenSuggestions is set to 2. From OPAC, I add a suggestion 'AAA'. I get the following: ---- Your suggestion has been submitted. There are no pending purchase suggestions. (Hmm, should be one?) New purchase suggestion (Link) ---- I add a 2nd suggestion 'BBB' ---- Your suggestion has been submitted. There are no pending purchase suggestions. (Hmm, should be two?) New purchase suggestion (Link) ---- Clicking the link results in a new screen with the message: "You cannot place any more suggestions" etc. Question: Couldn't the link be replaced by the message (like in the overview page)? That would be a nicer user experience. Then a minor typo on the overview page: The second sentence has no ending punctuation: ---- You have reached your limit of suggestions you can place at this time. Once the library has processed those suggestions you will be able to place more --- Ah, and it would be nice to have the maximum number in the user message.
*** Bug 14979 has been marked as a duplicate of this bug. ***
Created attachment 52502 [details] [review] Bug 15128 - Add ability to limit patrons open purchase suggestions To test: 1 - Define a number of MaxOpenSuggestions 2 - Add some suggestions for a patron 3 - Note they cannot add any more suggestions if limit is reached 4 - Delete a suggestion and note you can add another 5 - Add them to limit again 6 - Accept a suggestion in the staff client and note user can add more 7 - Repeat above with rejecting or deleting 8 - Sign off. Sponsored by: North Central Regional Library (http://ncrl.org/)
(In reply to Marc Véron from comment #2) > From OPAC, I add a suggestion 'AAA'. I get the following: > ---- > Your suggestion has been submitted. > There are no pending purchase suggestions. (Hmm, should be one?) > Clicking the link results in a new screen with the message: > "You cannot place any more suggestions" etc. > > Question: Couldn't the link be replaced by the message (like in the overview > page)? That would be a nicer user experience. The two above points are related and are related to existing functionality - I filed a new bug for those bug 16767 and will work on that there > Then a minor typo on the overview page: The second sentence has no ending > punctuation: Fixed > Ah, and it would be nice to have the maximum number in the user message. Fixed
(In reply to Nick Clemens from comment #5) > (In reply to Marc Véron from comment #2) > > From OPAC, I add a suggestion 'AAA'. I get the following: > > ---- > > Your suggestion has been submitted. > > There are no pending purchase suggestions. (Hmm, should be one?) > > > Clicking the link results in a new screen with the message: > > "You cannot place any more suggestions" etc. > > > > Question: Couldn't the link be replaced by the message (like in the overview > > page)? That would be a nicer user experience. > > The two above points are related and are related to existing functionality - > I filed a new bug for those bug 16767 and will work on that there I tested together with 16767, works OK > > Then a minor typo on the overview page: The second sentence has no ending > > punctuation: OK > Fixed > > Ah, and it would be nice to have the maximum number in the user message. > > Fixed There seems to be one more needed, line 258. Sorry, while testing I found a way to circumvent the restriction: - Add sussgestions until you reach the limit - Hit the browser back button - You are back on the entry form, fill it and submit - Purchase suggestion is submitted - Repeat as many times you want
I have tried to install it on a sandbox : Some problems occurred applying patches from bug 14752: <h1>Something went wrong !</h1>Applying: Bug 14752 - Add multiple copies to a basket at once Applying: Bug 14752 - (QA followup) Remove annoying modal, use dialog box instead Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging C4/Barcodes/hbyymmincr.pm CONFLICT (content): Merge conflict in C4/Barcodes/hbyymmincr.pm Failed to merge in the changes. Patch failed at 0001 Bug 14752 - (QA followup) Remove annoying modal, use dialog box instead When you have resolved this problem run git bz apply --continue. If you would prefer to skip this patch, instead run git bz apply --skip. To restore the original branch and stop patching run git bz apply --abort. Bug 14752 - Add multiple copies to a basket at once 51481 - Bug 14752 - Add multiple copies to a basket at once 52083 - Bug 14752 - (QA followup) Remove annoying modal, use dialog box instead Sonia
sorry wrong bug...
If this requires a change to the database, shouldn't there be an atomicupdate file? https://wiki.koha-community.org/wiki/Database_updates#New_workflow_since_bug_13068_has_been_pushed
Created attachment 52596 [details] [review] Bug 15128 - Add ability to limit patrons open purchase suggestions To test: 1 - Define a number of MaxOpenSuggestions 2 - Add some suggestions for a patron 3 - Note they cannot add any more suggestions if limit is reached 4 - Delete a suggestion and note you can add another 5 - Add them to limit again 6 - Accept a suggestion in the staff client and note user can add more 7 - Repeat above with rejecting or deleting 8 - Sign off. Sponsored by: North Central Regional Library (http://ncrl.org/)
(In reply to Marc Véron from comment #6) > Sorry, while testing I found a way to circumvent the restriction Limits now checked before adding (In reply to Owen Leonard from comment #9) > shouldn't there be an atomicupdate file? Atomic update file included now
Created attachment 52610 [details] [review] Bug 15128 - Add ability to limit patrons open purchase suggestions To test: 1 - Define a number of MaxOpenSuggestions 2 - Add some suggestions for a patron 3 - Note they cannot add any more suggestions if limit is reached 4 - Delete a suggestion and note you can add another 5 - Add them to limit again 6 - Accept a suggestion in the staff client and note user can add more 7 - Repeat above with rejecting or deleting 8 - Sign off. Sponsored by: North Central Regional Library (http://ncrl.org/)
Created attachment 52611 [details] [review] Bug 15128 [QA Followup] - Make suggestion display after being added Also fixes the issue that the add suggestion link would sometimes show even if the patron could not make an additional suggestion.
(In reply to Kyle M Hall from comment #13) > Created attachment 52611 [details] [review] [review] > Bug 15128 [QA Followup] - Make suggestion display after being added > > Also fixes the issue that the add suggestion link would sometimes > show even if the patron could not make an additional suggestion. This followup also tidys a chunk of very poorly formatted code. No changes in that part were made aside for tidying.
Created attachment 52623 [details] [review] Bug 15128 - Add ability to limit patrons open purchase suggestions To test: 1 - Define a number of MaxOpenSuggestions 2 - Add some suggestions for a patron 3 - Note they cannot add any more suggestions if limit is reached 4 - Delete a suggestion and note you can add another 5 - Add them to limit again 6 - Accept a suggestion in the staff client and note user can add more 7 - Repeat above with rejecting or deleting 8 - Sign off. Sponsored by: North Central Regional Library (http://ncrl.org/)
Created attachment 52624 [details] [review] Bug 15128 [QA Followup] - Make suggestion display after being added Also fixes the issue that the add suggestion link would sometimes show even if the patron could not make an additional suggestion.
Created attachment 52625 [details] [review] Bug 15128 [QA Followup 2] - Only count pending suggestions for the limit
Created attachment 52626 [details] [review] Bug 15128 - Followup Only check limit for signed in borrower Show all suggestions after a new one is added
No i can add as many suggestions as I want. It is related to: opac/opac-suggestions.pl line 117 my $patrons_pending_suggestions_count = scalar @{ SearchSuggestion( { suggestedby => $borrowernumber, STATUS => 'ASKED' } ) } ; 'my' should be removed
Created attachment 52715 [details] [review] Bug 15128 - Add ability to limit patrons open purchase suggestions To test: 1 - Define a number of MaxOpenSuggestions 2 - Add some suggestions for a patron 3 - Note they cannot add any more suggestions if limit is reached 4 - Delete a suggestion and note you can add another 5 - Add them to limit again 6 - Accept a suggestion in the staff client and note user can add more 7 - Repeat above with rejecting or deleting 8 - Sign off. Sponsored by: North Central Regional Library (http://ncrl.org/) Signed-off-by: Barbara Walters <bwalters@ncrl.org>
Created attachment 52716 [details] [review] Bug 15128 [QA Followup] - Make suggestion display after being added Also fixes the issue that the add suggestion link would sometimes show even if the patron could not make an additional suggestion. Signed-off-by: Barbara Walters <bwalters@ncrl.org>
Created attachment 52717 [details] [review] Bug 15128 [QA Followup 2] - Only count pending suggestions for the limit Signed-off-by: Barbara Walters <bwalters@ncrl.org>
Created attachment 52718 [details] [review] Bug 15128 - Followup Only check limit for signed in borrower Show all suggestions after a new one is added Signed-off-by: Barbara Walters <bwalters@ncrl.org>
Created attachment 52719 [details] [review] Bug 15128 - Add ability to limit patrons open purchase suggestions To test: 1 - Define a number of MaxOpenSuggestions 2 - Add some suggestions for a patron 3 - Note they cannot add any more suggestions if limit is reached 4 - Delete a suggestion and note you can add another 5 - Add them to limit again 6 - Accept a suggestion in the staff client and note user can add more 7 - Repeat above with rejecting or deleting 8 - Sign off. Sponsored by: North Central Regional Library (http://ncrl.org/) Signed-off-by: Barbara Walters <bwalters@ncrl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 52720 [details] [review] Bug 15128 [QA Followup] - Make suggestion display after being added Also fixes the issue that the add suggestion link would sometimes show even if the patron could not make an additional suggestion. Signed-off-by: Barbara Walters <bwalters@ncrl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 52721 [details] [review] Bug 15128 [QA Followup 2] - Only count pending suggestions for the limit Signed-off-by: Barbara Walters <bwalters@ncrl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 52722 [details] [review] Bug 15128 - Followup Only check limit for signed in borrower Show all suggestions after a new one is added Signed-off-by: Barbara Walters <bwalters@ncrl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This cannot be signed off, the patchset does not work at all, there is no limitation!
Code review: 1/ MaxOpenSuggestions = 0 will not work as expected 2/ If a patron tries to force the add, he will get "There are no pending purchase suggestions." even if there are.
Created attachment 52997 [details] [review] Bug 15128 (QA Followup) Display all purchase suggestions whether or not suggestion was added Correct enforcement of 0 limit
(In reply to Jonathan Druart from comment #28) > This cannot be signed off, the patchset does not work at all, there is no > limitation! Still valid... Nick, could you confirm that these patches have been tested correctly? They do not work for me.
Created attachment 53033 [details] [review] Bug 15128 - (QA Followup) Fix use of 'my' variable causing loss of data
Created attachment 53034 [details] [review] Bug 15128 - (QA Followup) Don't get patrons suggestions if limit not set
Created attachment 53037 [details] [review] Bug 15128 - Add ability to limit patrons open purchase suggestions To test: 1 - Define a number of MaxOpenSuggestions 2 - Add some suggestions for a patron 3 - Note they cannot add any more suggestions if limit is reached 4 - Delete a suggestion and note you can add another 5 - Add them to limit again 6 - Accept a suggestion in the staff client and note user can add more 7 - Repeat above with rejecting or deleting 8 - Sign off. Sponsored by: North Central Regional Library (http://ncrl.org/) Signed-off-by: Barbara Walters <bwalters@ncrl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53038 [details] [review] Bug 15128 [QA Followup] - Make suggestion display after being added Also fixes the issue that the add suggestion link would sometimes show even if the patron could not make an additional suggestion. Signed-off-by: Barbara Walters <bwalters@ncrl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53039 [details] [review] Bug 15128 [QA Followup 2] - Only count pending suggestions for the limit Signed-off-by: Barbara Walters <bwalters@ncrl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53040 [details] [review] Bug 15128 - Followup Only check limit for signed in borrower Show all suggestions after a new one is added Signed-off-by: Barbara Walters <bwalters@ncrl.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53041 [details] [review] Bug 15128 (QA Followup) Display all purchase suggestions whether or not suggestion was added Correct enforcement of 0 limit Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53042 [details] [review] Bug 15128 - (QA Followup) Fix use of 'my' variable causing loss of data Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53043 [details] [review] Bug 15128 - (QA Followup) Don't get patrons suggestions if limit not set Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53044 [details] [review] Bug 15128: Revert Display all purchase suggestions whether or not suggestion was added This does not work correctly and should be handle on another bug report. The behavior existed prior to this patchset. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53045 [details] [review] Bug 15128: Do not display "New suggestion" if limit has just been reached If limit is X and patrons has X-1 pending suggestions, when a new one is added, the "New suggestion" should not been added. to avoid another call to SearchSuggestions, we assume than the suggestion has been correctly added. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for 16.11, thanks Nick, Jonathan!