+1 Having a direct link from suggestion to order would be great.
Created attachment 141028 [details] [review] Bug 31632: Add missing suggestion statuses to API
Created attachment 141029 [details] [review] Bug 31632: Add ability to link orders to suggestions when adding to basket from a file This patch adds a new include for suggestions searching, and adds JS on the addorderiso2907 page to allow linking new orders to suggestions while importing into a basket To test: 1 - Export or find a file of bibs 2 - Stage the file using Tools->Stage MARC for Import 3 - Find or create an open basket in acquisitions 4 - Add to basket from the staged file 5 - Select/check a record 6 - Note new 'Suggestions' area 7 - Click 'Link suggestions' 8 - Search for suggestions - click 'Select' 9 - Select button is gone 10 - Dismiss modal 11 - Suggestion is listed for this record 12 - Click 'Link suggestions' 13 - Confirm the suggestion cannot be chosen again 14 - Add another 15 - Dismiss the modal 16 - Click 'Remove' on the first suggestion 17 - Confirm it is removed 18 - Confirm you can now link it again 19 - Select budget etc and submit 20 - Confirm record linked to suggestions
Created attachment 141030 [details] [review] Bug 31632: Display multiple suggestions for record in basket In case suggestions are duplicated, allow several to be attached and display them all To test: 1 - Follow plan in previous patch to attach 2 suggestions when adding order 2 - Confirm both suggestions display after record added to basket
(In reply to Katrin Fischer from comment #1) > +1 Having a direct link from suggestion to order would be great. This is really 'link to biblio' during ordering - maybe another bug to add suggestion_id to aqorders table? Still need to cleanup and add to neworderempty - but attaching WIP to clarify
(In reply to Nick Clemens from comment #5) > (In reply to Katrin Fischer from comment #1) > > +1 Having a direct link from suggestion to order would be great. > > This is really 'link to biblio' during ordering - maybe another bug to add > suggestion_id to aqorders table? I think it already exists, but couldn't find it. The current approach is problematic, because you might end up emailing the 'wrong' users. Also: We'd need suggestions.ordernumber, because you might have several people suggesting the same popular item at the same time, less likely to have multiple orders for one suggestion.
Is this a (partial) duplicate of bug 19358?
(In reply to Katrin Fischer from comment #7) > Is this a (partial) duplicate of bug 19358? It's a step towards that one, adding depends/blocks
*** Bug 35367 has been marked as a duplicate of this bug. ***
Created attachment 169391 [details] [review] Bug 31632: Link a suggestion to an existing order This enhancement allows library staff to link an order (in an unclosed basket, or a standing order) to an accepted suggestion. To test: 1) In the staff interface, go to Suggestions and create at least two suggestions. 2) Mark at least two suggestions as Accepted. 3) Go to Acquisitions, create a vendor if you don't have one already. 4) Have or create two baskets - one should be standing, and one not standing (normal). 5) In the normal basket (not standing), add an order from any source but NOT from a suggestion. 6) When you save the order, there should be a new link in the Modify column of the Orders table - "Search for suggestion to link". Click this. 7) Choose one of your suggestions to link to the order. 8) You should be redirected back to the basket. Confirm your order has been correctly linked to the suggestion. Confirm there is no link to "Search for suggestion to link" for this order now that a suggestion has already been linked. 9) Add another order to this basket from any source but NOT from a suggestion. 10) Close the basket. Confirm there is no link to "Search for suggestion to link" because the basket is closed, but you could reopen the basket to link the order if you wanted to. 11) Go to Baskets in the left navigation so you can find your standing basket. 12) Add an order to your standing basket from any source but NOT from a suggestion. 13) Go to the vendor and Receive shipments. Receive your standing order and finish receiving. 14) Go to the standing basket. There should be a new unreceived standing order for the record you just received, with a link to "Search for suggestion to link". Click this. 15) Choose a suggestion to link to the order. 16) You should be redirected back to the basket. Confirm your orders for this record have been correctly linked to the suggestion. Sponsored-by: Pymble Ladies' College
Created attachment 170147 [details] [review] Bug 31632: Link a suggestion to an existing order This enhancement allows library staff to link an order (in an unclosed basket, or a standing order) to an accepted suggestion. To test: 1) In the staff interface, go to Suggestions and create at least two suggestions. 2) Mark at least two suggestions as Accepted. 3) Go to Acquisitions, create a vendor if you don't have one already. 4) Have or create two baskets - one should be standing, and one not standing (normal). 5) In the normal basket (not standing), add an order from any source but NOT from a suggestion. 6) When you save the order, there should be a new link in the Modify column of the Orders table - "Search for suggestion to link". Click this. 7) Choose one of your suggestions to link to the order. 8) You should be redirected back to the basket. Confirm your order has been correctly linked to the suggestion. Confirm there is no link to "Search for suggestion to link" for this order now that a suggestion has already been linked. 9) Add another order to this basket from any source but NOT from a suggestion. 10) Close the basket. Confirm there is no link to "Search for suggestion to link" because the basket is closed, but you could reopen the basket to link the order if you wanted to. 11) Go to Baskets in the left navigation so you can find your standing basket. 12) Add an order to your standing basket from any source but NOT from a suggestion. 13) Go to the vendor and Receive shipments. Receive your standing order and finish receiving. 14) Go to the standing basket. There should be a new unreceived standing order for the record you just received, with a link to "Search for suggestion to link". Click this. 15) Choose a suggestion to link to the order. 16) You should be redirected back to the basket. Confirm your orders for this record have been correctly linked to the suggestion. Sponsored-by: Pymble Ladies' College Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 170148 [details] [review] Bug 31632: (follow-up) Simplify link text Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The behavior matches the description and seems correct. QA scripts happy. I would only change the link text to simplify it. Feel free to obsolete if disagree.
(In reply to Tomás Cohen Arazi from comment #13) > The behavior matches the description and seems correct. QA scripts happy. > I would only change the link text to simplify it. Feel free to obsolete if > disagree. Naming things is the hardest part! Happy with your amendment :)
(In reply to Aleisha Amohia from comment #14) > (In reply to Tomás Cohen Arazi from comment #13) > > The behavior matches the description and seems correct. QA scripts happy. > > I would only change the link text to simplify it. Feel free to obsolete if > > disagree. > > Naming things is the hardest part! Happy with your amendment :) Not a blocker, but I wonder what you didn't like about Nick's modal. And if we could reintroduce it (here or on a follow-up).
(In reply to Tomás Cohen Arazi from comment #15) > Not a blocker, but I wonder what you didn't like about Nick's modal. And if > we could reintroduce it (here or on a follow-up). I honestly didn't look at it! I just saw that the patches were a couple of years old and figured it would've needed some reworking just because of that. I also had an approved plan by the sponsoring library, which is how my patch took its shape.
This is a really nice workflow! Just one thing - The link_order op needs to follow the CSRF protection coding guidelines, since it triggers an update action. Seems like a good use case for the form submission pattern in https://wiki.koha-community.org/wiki/Coding_Guidelines#JS16:_JavaScript_form_submission_via_links
Created attachment 170953 [details] [review] Bug 31632: (follow-up) CSRF protection for linking order to suggestion
There are already bug 28844 and bug 31632. Can you explain the direction of this one please?
(In reply to Jonathan Druart from comment #19) > There are already bug 28844 and bug 31632. Can you explain the direction of > this one please? This enhancement allows a library to link an order to a suggestion after the order is created. Useful if: - the librarian forgot to link to an existing suggestion - the librarian didn't know there was a suggestion at the time of creating the order and discovered it after - a user made a suggestion, not knowing the record was already on order It's just another way to have an order linked to a suggestion. I don't see it clashing with Bug 35717 at all. My patch wasn't intended to allow linking multiple suggestions to one order - Nick's might have been that, but mine went in a different direction. Hope that explains.
Created attachment 174393 [details] [review] Bug 31632: Link a suggestion to an existing order This enhancement allows library staff to link an order (in an unclosed basket, or a standing order) to an accepted suggestion. To test: 1) In the staff interface, go to Suggestions and create at least two suggestions. 2) Mark at least two suggestions as Accepted. 3) Go to Acquisitions, create a vendor if you don't have one already. 4) Have or create two baskets - one should be standing, and one not standing (normal). 5) In the normal basket (not standing), add an order from any source but NOT from a suggestion. 6) When you save the order, there should be a new link in the Modify column of the Orders table - "Search for suggestion to link". Click this. 7) Choose one of your suggestions to link to the order. 8) You should be redirected back to the basket. Confirm your order has been correctly linked to the suggestion. Confirm there is no link to "Search for suggestion to link" for this order now that a suggestion has already been linked. 9) Add another order to this basket from any source but NOT from a suggestion. 10) Close the basket. Confirm there is no link to "Search for suggestion to link" because the basket is closed, but you could reopen the basket to link the order if you wanted to. 11) Go to Baskets in the left navigation so you can find your standing basket. 12) Add an order to your standing basket from any source but NOT from a suggestion. 13) Go to the vendor and Receive shipments. Receive your standing order and finish receiving. 14) Go to the standing basket. There should be a new unreceived standing order for the record you just received, with a link to "Search for suggestion to link". Click this. 15) Choose a suggestion to link to the order. 16) You should be redirected back to the basket. Confirm your orders for this record have been correctly linked to the suggestion. Sponsored-by: Pymble Ladies' College Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 174394 [details] [review] Bug 31632: (follow-up) Simplify link text Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 174395 [details] [review] Bug 31632: (follow-up) CSRF protection for linking order to suggestion
Created attachment 174415 [details] [review] Bug 31632: Link a suggestion to an existing order This enhancement allows library staff to link an order (in an unclosed basket, or a standing order) to an accepted suggestion. To test: 1) In the staff interface, go to Suggestions and create at least two suggestions. 2) Mark at least two suggestions as Accepted. 3) Go to Acquisitions, create a vendor if you don't have one already. 4) Have or create two baskets - one should be standing, and one not standing (normal). 5) In the normal basket (not standing), add an order from any source but NOT from a suggestion. 6) When you save the order, there should be a new link in the Modify column of the Orders table - "Search for suggestion to link". Click this. 7) Choose one of your suggestions to link to the order. 8) You should be redirected back to the basket. Confirm your order has been correctly linked to the suggestion. Confirm there is no link to "Search for suggestion to link" for this order now that a suggestion has already been linked. 9) Add another order to this basket from any source but NOT from a suggestion. 10) Close the basket. Confirm there is no link to "Search for suggestion to link" because the basket is closed, but you could reopen the basket to link the order if you wanted to. 11) Go to Baskets in the left navigation so you can find your standing basket. 12) Add an order to your standing basket from any source but NOT from a suggestion. 13) Go to the vendor and Receive shipments. Receive your standing order and finish receiving. 14) Go to the standing basket. There should be a new unreceived standing order for the record you just received, with a link to "Search for suggestion to link". Click this. 15) Choose a suggestion to link to the order. 16) You should be redirected back to the basket. Confirm your orders for this record have been correctly linked to the suggestion. Sponsored-by: Pymble Ladies' College Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Created attachment 174416 [details] [review] Bug 31632: (follow-up) Simplify link text Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Created attachment 174417 [details] [review] Bug 31632: (follow-up) CSRF protection for linking order to suggestion Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>