Created attachment 148221 [details] [review] Bug 33236: Move NewSuggestion to Koha::Suggestion->store The NewSuggestion routine saved the suggestion to the DB and returned the id This patch moves the code to Koha::Suggestion->store and handles emailing upon creation, this adds that functionality to suggestions added via api To test: 1 - Apply patch 2 - Test adding a suggestion on the opac and staff client 3 - Confirm the suggestions are added correctly
Created attachment 149103 [details] [review] Bug 33236: Move NewSuggestion to Koha::Suggestion->store The NewSuggestion routine saved the suggestion to the DB and returned the id This patch moves the code to Koha::Suggestion->store and handles emailing upon creation, this adds that functionality to suggestions added via api To test: 1 - Apply patch 2 - Test adding a suggestion on the opac and staff client 3 - Confirm the suggestions are added correctly Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Tested on OPAC and Staff side on sandbox successfully. Suggestions functionality all works as it should. Only thing I couldn't verify was the actual sending of emails relating to suggestions.
Hi Nick, this looks quite good, but I think we need some more clean-up: 1) Serials C4/Serials.pm: if ( C4::Context->preference("RenewSerialAddsSuggestion") ) { require C4::Suggestions; C4::Suggestions::NewSuggestion( { 'suggestedby' => $user, 'title' => $subscription->{bibliotitle}, 'author' => $biblio->{author}, 'publishercode' => $biblio->{publishercode}, 'note' => $note, 'biblionumber' => $subscription->{biblionumber}, 'branchcode' => $branchcode, } ); } 2) Export list C4/Suggestions.pm: NewSuggestion Method is still in the list of exports. I would have fixed 2) but I think it would be better if you check on 1).
Created attachment 149679 [details] [review] Bug 33236: (follow-up) Handle new suggestion in ReNewSubscription
Created attachment 149680 [details] [review] Bug 33236: (follow-up) Remove export of NewSuggestion
Created attachment 149714 [details] [review] Bug 33236: Move NewSuggestion to Koha::Suggestion->store The NewSuggestion routine saved the suggestion to the DB and returned the id This patch moves the code to Koha::Suggestion->store and handles emailing upon creation, this adds that functionality to suggestions added via api To test: 1 - Apply patch 2 - Test adding a suggestion on the opac and staff client 3 - Confirm the suggestions are added correctly Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 149715 [details] [review] Bug 33236: (follow-up) Handle new suggestion in ReNewSubscription Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 149716 [details] [review] Bug 33236: (follow-up) Remove export of NewSuggestion Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
The only thing I am seeing here is that we are passing the suggestion to generate the letter without the one from the DB (we don't get_from_storage). For now the downside is that suggestion.date won't be filled in with the default timestamp, but that should not be a problem. No idea if it's better to add a fetch.
ha, you forgot the use statements for C4::Context and C4::Letters from Koha::Suggestion.
Created attachment 150510 [details] [review] Bug 33236: (follow-up) Add use statements
Pushed to master for 23.11. Nice work everyone, thanks!
Enhancement - not backporting to 22.11.x
Enhancement, not backporting to 23.05.x
(In reply to Fridolin Somers from comment #15) > Enhancement, not backporting to 23.05.x These commits are in 23.05.01. https://git.koha-community.org/Koha-community/Koha/commits/branch/23.05.x/search?q=33236 Should we edit the "Version released in"?
Indeed, I see it has been pushed in 23.05.x by Tomás on Jun 9 2023 My job has RMaint add not started yet. "Version released in" fixed
Thanks Frido!