From 2d4db8abbeeca3c7d8eddf338a6b506af1d26ebb Mon Sep 17 00:00:00 2001 From: Adrien Saurat Date: Fri, 4 Nov 2011 14:20:31 +0100 Subject: [PATCH] [SIGNED-OFF] Bug 6893 : Updates suggestions list when adding orders A suggestion added through addorder.pl now changes to the ORDERED status as initially intended (but so far it stayed as ACCEPTED). This fixes the list of potential suggestions to order, the ORDERED ones don't appear anymore. Bug 6893 : Follow-up: Disabled WHERE clause excluding ORDERED status In SearchSuggestions, a WHERE clause was excluding the ORDERED suggestions from the results. Now replaced with 1=1. (before 6893 correction, the WHERE clause was excluding the STATUS='CLAIMED' suggestions, but this status cannot be found anywhere else in the code... so I changed to STATUS='ORDERED' which seemed more accurate, but it had impacts on OPAC and some Admin tabs) Signed-off-by: Katrin Fischer Both patches applied cleanly, sqashed them together after testing. Tested: 1) Creating new suggestions - from OPAC, shows up in patron account as 'requested', pending in staff - from staff, shows up in list of pending suggestions Status in database is ASKED Note: suggestions made from staff for the same patron have suggestedby = 0 in the database, so are not showing up in the patron account. Is this by intention? (if not, I think this is a separate bug) 2) Accepting suggestions - from list - from edit page Status in database is ACCEPTED Patron account shows 'Accepted by the library (Bestseller)' Note: after changing the status from the list, bug 4068 kicks in and some tabs and even suggestions are hidden. Going back to the acq start page and going back to the suggestions page from there helps. 3) Rejecting suggestions - from list - from edit page Status in database is REJECTED Patron account in OPAC shows 'Suggestion declined' Note: bug 4068 again. 4) Ordering from suggestions - new basket - ordered 2 accepted suggestions SUCCESS! Great improvement: - Status in database is now ORDERED - Already ordered suggestions no longer show up on list of suggestions to order from. - Patron account shows 'Ordered by the library (Bestseller)' - Suggestion management page shows a new tab 'Ordered' - For the suggestion with a valid 'suggestedby' borrowernumber, a mail was generated. (bug 7094) 5) Receive ordered suggestions - received my ordered suggestions This is is not in the scope of this bug, but for documentation: - No message was generated to inform the patron - Status stays ORDERED - Patron account still shows item as ordered, no change to 4) Looking at the suggestion.tt I think there should be another status AVAILABLE. 216 [% ELSIF (suggestion.suggestiontypelabel == "Available") %]Available Signing off, fixes bug reported. Danke! --- C4/Suggestions.pm | 2 +- acqui/addorder.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 1a93f2e..ccc0c8e 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -113,7 +113,7 @@ sub SearchSuggestion { LEFT JOIN borrowers AS U2 ON managedby=U2.borrowernumber LEFT JOIN branches AS B2 ON B2.branchcode=U2.branchcode LEFT JOIN categories AS C2 ON C2.categorycode = U2.categorycode - WHERE STATUS NOT IN ('CLAIMED') + WHERE 1=1 } , map { if ( my $s = $suggestion->{$_} ) { push @sql_params,'%'.$s.'%'; diff --git a/acqui/addorder.pl b/acqui/addorder.pl index d7f7e96..121d20d 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -212,7 +212,7 @@ if ( $orderinfo->{quantity} ne '0' ) { my ($biblionumber,$bibitemnum) = AddBiblio($record,''); # change suggestion status if applicable if ($$orderinfo{suggestionid}) { - ModSuggestion( {suggestionid=>$$orderinfo{suggestionid}, status=>'ORDERED', biblionumber=>$biblionumber} ); + ModSuggestion( {suggestionid=>$$orderinfo{suggestionid}, STATUS=>'ORDERED', biblionumber=>$biblionumber} ); } $orderinfo->{biblioitemnumber}=$bibitemnum; $orderinfo->{biblionumber}=$biblionumber; -- 1.7.5.4