Description
Liz Rea
2017-10-25 23:27:56 UTC
Created attachment 68569 [details] [review] Bug 19532: Database updates Adding the recalls table and the old_recalls table. Sponsored-by: Catalyst IT Created attachment 68570 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Created attachment 68571 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Created attachment 68572 [details] [review] Bug 19532: Module files for Recall and OldRecall Koha/Recall.pm Koha/Recalls.pm Koha/Old/Recall.pm Koha/Old/Recalls.pm and the schema files for Recall and OldRecall. (In reply to Liz Rea from comment #0) > Current implementation notes: > > * DB: recalls table > • DB: old_recalls table Regarding the number of critical issues we had the last few months, I do not think it is a good idea to reuse this pattern. We should not move data from one table to another but add a deleted/old flag instead. Created attachment 68642 [details] [review] Bug 19532: Some DB fixes Removing the old_recalls table, as suggested in Comment 5 Renaming 'found' column to 'status' Adding 'old' column Created attachment 68643 [details] [review] Bug 19532: Some DB fixes Removing the old_recalls table, as suggested in Comment 5 Renaming 'found' column to 'status' Adding 'old' column Created attachment 68644 [details] [review] Bug 19532: Some DB fixes Removing the old_recalls table, as suggested in Comment 5 Renaming 'found' column to 'status' Adding 'old' column Created attachment 68645 [details] [review] Bug 19532: Some module fixes Removing files related to OldRecall Created attachment 68653 [details] [review] Bug 19532: Circulation rules Adding 3 new rules and columns to issuingrules - recall_due_date_interval - recall_overdue_fine - recall_shelf_time Created attachment 69100 [details] [review] Bug 19532: Recall an item in OPAC This patch: - adds the 'Recall' button to the item on it's detail page - adds ability to place a recall - the recall is stored in the recalls table - the due date for the checkout is updated to whatever has been set in the issuing rule under recall_due_date_interval - error messages for if the user isn't logged in, the user tries to place a recall on an item they have already recalled, or if storing the recall in the db fails for any reason Created attachment 69102 [details] [review] Bug 19532: Cancel recall and see recalls in OPAC This patch adds ability for user to cancel a recall They can also see their recalls in the user summary Created attachment 69147 [details] [review] Bug 19532: Show recalls on intranet side This patch - adds Recall tab to the Check out section of member account, and to the Details section of member account - Functionality to cancel recalls on staff side - Fixing cancel on OPAC side (before I was deleting the whole recall instead of cancelling) - Fixing validation when checking whether a recall can be placed on an item that has been recalled by this borrower before. If the old recall is expired or cancelled then they can make a recall again. Created attachment 69148 [details] [review] Bug 19532: Fixing broken OPAC recalls table Forgot to add <tr> Created attachment 69149 [details] [review] Bug 19532: recalls history this patch - adds recalls history (similar to holds history) to OPAC and intranet - edits the tables in opac-user.pl (OPAC), moremember.pl and circulation.pl (staff) so that it only shows active recalls (recalls that have been requested or are waiting) - some extra datatables fixes Created attachment 69170 [details] [review] Bug 19532: Recalls queue This patch adds a recalls queue page to the circulation reports You can see all recalls made in the system, who requested them, their status and other relevant info. you can cancel individual or multiple recalls. Created attachment 69172 [details] [review] Bug 19532: Overdue recalls report Created attachment 69221 [details] [review] Bug 19532: Recalls awaiting pickup report this patch adds reports for all recalls awaiting pickup, and recalls that have been waiting more than X days. a syspref, RecallsMaxPickUpDelay, is added to give a general max shelf time for recalls Created attachment 69222 [details] [review] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Created attachment 69223 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Created attachment 69322 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Created attachment 69353 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Created attachment 69354 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Created attachment 69405 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Created attachment 69409 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Created attachment 69410 [details] [review] Bug 19532: Tests for Koha/Recalls Created attachment 69411 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history I believe that this feature is now ready to test. I'll be away for the next couple of weeks, but feel free to test and leave any feedback/comments/questions/ideas that I can come back to when I return. Note: when testing, it will be very helpful to keep the OPAC and the Staff Client open in 2 separate tabs or browsers. you will also need 2 borrowers, where at least one has superlibrarian privileges. TEST PLAN: 1. Enable the UseRecalls syspref 2. Go to Circulation and Fines Rules. Put some numbers in the recalls fields (recall due date interval, recall overdue fine amount, recall pickup period) 3. Put a number in the RecallsMaxPickUpDelay syspref. This will be the default number of days used if the recall pickup period isn't set in Step 2 4. Check out an item to a patron 5. Go to that item's detail page in the OPAC. Notice the holdings table says 'Checked out' 6. Log in to the OPAC with another patron and go back to that detail page. The holdings table should now have a Recall link next to the 'Checked out' text 7. Click the Recall button and confirm the Recall 8. Go to the user's opac summary and confirm there is now a Recalls tab, with the correct number of recalls (should be 1). 9. Test cancelling the recall by clicking Cancel. Confirm the recall has been cancelled. Repeat steps 6 and 7. 10. In the left navigation, there will also be a 'recalls history' tab. Click it. There should be a log, similar to reading history, with the cancelled recall and the new recall in it. Confirm all information is correct 11. Again, test cancelling the recall. Repeat steps 6 and 7. 12. In the staff interface, go to the logged in user's checkouts. Confirm you can see a new Recalls tab, with the active (not cancelled) recall in the table. Should be the same for the details tab also. 13. Test cancelling works for both of these again, and making new recalls again. 14. Check in the recalled item. You should see a pop up, asking to confirm the recall as waiting. Click confirm. 15. Go to the Circulation main page. You should see 3 new reports: recalls queue, overdue recalls and recalls awaiting pickup 16. Go to the recalls queue, confirm you can see an entire history of recalls at your library. Confirm cancel works when selecting checkboxes and clicking the multiple button. If you do this, you'll need to place the recall again and check the item in again 17. Go to recalls awaiting pickup. You should see the recall under the recalls waiting tab 18. in Mysql, set the waitingdate for your recall to be more than 'recall pickup period' days before today's date 19. Refresh the recalls awaiting pickup page. You should see the recall under the recalls waiting tab, and the recalls waiting more than X days tab. 20. expire the recall. confirm this is expired by checking the recalls queue 21. place another recall, but do not check it in 22. in mysql, set the date_due of the checkout (issues table) to be at least 'recall due date interval' number of days before today's date 23. run the overdue_notices.pl cronjob 24. go to the overdue recalls circ report and confirm your recall shows there 25. try cancelling the recall here also 26. in mysql, check the message_queue and confirm there have been the appropriate number of RETURN_RECALLED_ITEM and PICKUP_RECALLED_ITEM notices sent with the correct to and from addresses and other content 27. test t/db_dependent/Koha/Recalls.t Quick comment: Given the troubles we have with duplicate primary keys in old/deleted tables, would't it be better to drop the old_recalls table, and keep it in one table, with a flag denoting if the recall is deleted or not? (In reply to Petter Goksøyr Åsen from comment #29) > Quick comment: > Given the troubles we have with duplicate primary keys in old/deleted > tables, would't it be better to drop the old_recalls table, and keep it in > one table, with a flag denoting if the recall is deleted or not? Yes, see comment 5 as well. Aleisha, did you consider this alternative? (In reply to Jonathan Druart from comment #30) > (In reply to Petter Goksøyr Åsen from comment #29) > > Quick comment: > > Given the troubles we have with duplicate primary keys in old/deleted > > tables, would't it be better to drop the old_recalls table, and keep it in > > one table, with a flag denoting if the recall is deleted or not? > > Yes, see comment 5 as well. > Aleisha, did you consider this alternative? We did, but the reason old_issues exists, is because keeping it one massive table becomes really slow quite fast. With recalls this probably will take longer to be a problem, but having circulation stuff slowed down (specifically returns) by having millions of rows to check through was the reason the issues table was split in the first place. I don't believe one table that grows forever for circulation is a viable fix. Fair enough, but optimizing by allowing for potential data corruption seems the wrong way to optimize to me :) Isn't data integrity is more important? (In reply to Petter Goksøyr Åsen from comment #32) > Fair enough, but optimizing by allowing for potential data corruption seems > the wrong way to optimize to me :) > > Isn't data integrity is more important? It was fine for 15 years, until mysql changed things. And after that we didn't have any data loss until we rushed a fix. A combined table is not a valid fix, you can have all the data integrity you want if the system is too slow to use. We should come up with an actual solution. Yeah, this probably needs a broader discussion, best handeled elsewhere. I'll leave it for now and let this bug be about recalls :) Comment on attachment 68572 [details] [review] Bug 19532: Module files for Recall and OldRecall >Koha/Recall.pm >Koha/Recalls.pm >Koha/Old/Recall.pm >Koha/Old/Recalls.pm >and the schema files for Recall and OldRecall. I agree we should avoid old_*, probably index definitions are relevant for performance (speed, because they will eat more hard disk space of course). >+=head2 Class Methods This are usually labeled 'Internal methods', to distinguish them from public 'Class methods'. Fix the case. >+=head3 type >+ >+=cut >+ >+sub type { >+ return 'OldRecall'; >+} This should be called '_type'. Look at Koha/Object.pm:260, a sample place it is used. If it is not well documented, please file a bug for it! >+=head2 found >+ >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 1 Please use tinyint(1) for booleans. While it is not a real type (it is an integer with a mask), it clearly denotes its use. If you plan to expose this through the api, having it be VARCHAR will make our stack consider it a string. If you set it a numeric type, then we can add: __PACKAGE_->add_columns({ '+found' => { is_boolean => 1 } }); to the schema file, and thus it is considered a Boolean when rendering on the API. Comment on attachment 69102 [details] [review] Bug 19532: Cancel recall and see recalls in OPAC >+=head3 branch >+ >+Returns the related Koha::Library object for this Hold >+ >+=cut >+ >+sub branch { >+ my ($self) = @_; >+ >+ $self->{_branch} ||= Koha::Libraries->find( $self->branchcode() ); >+ >+ return $self->{_branch}; >+} Please call this method 'library' instead, and 'patron' instead of 'borrower' on the followup. These are functionality notes for Aleisha OPAC client view: We probably want to show the borrower when the book is now expected to be returned by on /cgi-bin/koha/opac-recalls.pl Staff views: - syspref needs to be defaulted to off please :) /cgi-bin/koha/circ/recalls_queue.pl - probably want to see the new due date here as well /cgi-bin/koha/catalogue/detail.pl?biblionumber=16 - do we want to see what the old due date was here? (to think about, not required) - Probably want to show somewhere in the item table that there is a recall, and for whom (kinda like we do with holds) - do we want a tab on the detail page that shows all of the recalls for this biblio, and who they are for? General questions: - If we add an item with the same item type to a biblio that has a recall, should checking in this newly available item trigger the recall to be filled? I'm out of time for this run at it, but honestly what a great first whack at it. I can't get this to apply! Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 19532: Database updates Applying: Bug 19532: Notices for recalls Applying: Bug 19532: Module files for Recall and OldRecall Applying: Bug 19532: Some DB fixes Applying: Bug 19532: Some module fixes Applying: Bug 19532: Circulation rules fatal: sha1 information is lacking or useless (Koha/Schema/Result/Issuingrule.pm). Repository lacks necessary blobs to fall back on 3-way merge. Hi Owen, This patch: Bug 19532: Circulation rules (8.52 KB, patch) Is out of band and doesn't work properly. We did some heroics at Catalyst because we needed to do some testing on this bug, but that patch will need to be fixed by Aleisha. Cheers, Liz (Basically, if you skip that one, the rest will apply. Then you just have to sort out what the bad patch was trying to do, and add that back in.) > We did, but the reason old_issues exists, is because keeping it one massive
> table becomes really slow quite fast.
I think maybe we need to check our assumptions. We may have be running on best practices that are out of date. I think that happens to us all from time to time.
MySQL is capable of dealing with tens or even hundreds of millions of rows very speedily, as long as the correct indexes are in place.
For example, I picked out a database to test with from a Koha consortium. They have 1,456,666 old_issues rows, and 50122 issues rows.
Searching on a column with no index ( such as issuedate ) returned a single record from almost 1.5 million records in 1.04 seconds. Not terrible, but definitely not great. However, searching for the same row using an indexed column took less time than mysql could measure! It reported back taking 0.00 seconds ; )
I've done some digging and it appears that many people are using mysql for tables with tens to hundreds of millions of rows with no adverse effects.
Perhaps that was an issue during the early years of Koha, when MySQL was much less mature, but I don't think it is anymore.
(In reply to Kyle M Hall from comment #41) > > We did, but the reason old_issues exists, is because keeping it one massive > > table becomes really slow quite fast. > > I think maybe we need to check our assumptions. We may have be running on > best practices that are out of date. I think that happens to us all from > time to time. > > MySQL is capable of dealing with tens or even hundreds of millions of rows > very speedily, as long as the correct indexes are in place. > > For example, I picked out a database to test with from a Koha consortium. > They have 1,456,666 old_issues rows, and 50122 issues rows. > > Searching on a column with no index ( such as issuedate ) returned a single > record from almost 1.5 million records in 1.04 seconds. Not terrible, but > definitely not great. However, searching for the same row using an indexed > column took less time than mysql could measure! It reported back taking 0.00 > seconds ; ) > > I've done some digging and it appears that many people are using mysql for > tables with tens to hundreds of millions of rows with no adverse effects. > > Perhaps that was an issue during the early years of Koha, when MySQL was > much less mature, but I don't think it is anymore. I think this was introduced at some point to ease the use of TRUNCATE as opposed to DELETE when wiping old data. There are other ways to deal with fragmentation already (OPTIMIZE?), so I'd suggest the tables are joined and a proper use of tinyint for the flags. Hi all, sorry for the delay in getting back to you, I've been away. I removed the old_recalls table and added an 'old' flag to the recalls table in the 'Some DB fixes' patch. I'll now get on to fixing all of the other comments. Created attachment 69841 [details] [review] Bug 19532: Fixing merge conflicts etc Created attachment 69872 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Created attachment 69873 [details] [review] Bug 19532: Circulation rules Adding 3 new rules and columns to issuingrules - recall_due_date_interval - recall_overdue_fine - recall_shelf_time Created attachment 69874 [details] [review] Bug 19532: Recall an item in OPAC This patch: - adds the 'Recall' button to the item on it's detail page - adds ability to place a recall - the recall is stored in the recalls table - the due date for the checkout is updated to whatever has been set in the issuing rule under recall_due_date_interval - error messages for if the user isn't logged in, the user tries to place a recall on an item they have already recalled, or if storing the recall in the db fails for any reason Created attachment 69875 [details] [review] Bug 19532: Cancel recall and see recalls in OPAC This patch adds ability for user to cancel a recall They can also see their recalls in the user summary Created attachment 69876 [details] [review] Bug 19532: Show recalls on intranet side This patch - adds Recall tab to the Check out section of member account, and to the Details section of member account - Functionality to cancel recalls on staff side - Fixing cancel on OPAC side (before I was deleting the whole recall instead of cancelling) - Fixing validation when checking whether a recall can be placed on an item that has been recalled by this borrower before. If the old recall is expired or cancelled then they can make a recall again. Created attachment 69877 [details] [review] Bug 19532: Fixing broken OPAC recalls table Forgot to add <tr> Created attachment 69878 [details] [review] Bug 19532: recalls history this patch - adds recalls history (similar to holds history) to OPAC and intranet - edits the tables in opac-user.pl (OPAC), moremember.pl and circulation.pl (staff) so that it only shows active recalls (recalls that have been requested or are waiting) - some extra datatables fixes Created attachment 69879 [details] [review] Bug 19532: Recalls queue This patch adds a recalls queue page to the circulation reports You can see all recalls made in the system, who requested them, their status and other relevant info. you can cancel individual or multiple recalls. Created attachment 69880 [details] [review] Bug 19532: Overdue recalls report Created attachment 69881 [details] [review] Bug 19532: Recalls awaiting pickup report this patch adds reports for all recalls awaiting pickup, and recalls that have been waiting more than X days. a syspref, RecallsMaxPickUpDelay, is added to give a general max shelf time for recalls Created attachment 69882 [details] [review] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Created attachment 69883 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Created attachment 69884 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Created attachment 69885 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Created attachment 69886 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Created attachment 69887 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Created attachment 69888 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Created attachment 69889 [details] [review] Bug 19532: Tests for Koha/Recalls Created attachment 69890 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Sorry for the gazillions of emails! This should now apply cleanly on master. I should've added in the original test plan to update the database and the schema after applying patches, so make sure you do that first! Here's the test plan again. TEST PLAN: 0. Update database and schema 1. Enable the UseRecalls syspref 2. Go to Circulation and Fines Rules. Put some numbers in the recalls fields (recall due date interval, recall overdue fine amount, recall pickup period) 3. Put a number in the RecallsMaxPickUpDelay syspref. This will be the default number of days used if the recall pickup period isn't set in Step 2 4. Check out an item to a patron 5. Go to that item's detail page in the OPAC. Notice the holdings table says 'Checked out' 6. Log in to the OPAC with another patron and go back to that detail page. The holdings table should now have a Recall link next to the 'Checked out' text 7. Click the Recall button and confirm the Recall 8. Go to the user's opac summary and confirm there is now a Recalls tab, with the correct number of recalls (should be 1). 9. Test cancelling the recall by clicking Cancel. Confirm the recall has been cancelled. Repeat steps 6 and 7. 10. In the left navigation, there will also be a 'recalls history' tab. Click it. There should be a log, similar to reading history, with the cancelled recall and the new recall in it. Confirm all information is correct 11. Again, test cancelling the recall. Repeat steps 6 and 7. 12. In the staff interface, go to the logged in user's checkouts. Confirm you can see a new Recalls tab, with the active (not cancelled) recall in the table. Should be the same for the details tab also. 13. Test cancelling works for both of these again, and making new recalls again. 14. Check in the recalled item. You should see a pop up, asking to confirm the recall as waiting. Click confirm. 15. Go to the Circulation main page. You should see 3 new reports: recalls queue, overdue recalls and recalls awaiting pickup 16. Go to the recalls queue, confirm you can see an entire history of recalls at your library. Confirm cancel works when selecting checkboxes and clicking the multiple button. If you do this, you'll need to place the recall again and check the item in again 17. Go to recalls awaiting pickup. You should see the recall under the recalls waiting tab 18. in Mysql, set the waitingdate for your recall to be more than 'recall pickup period' days before today's date 19. Refresh the recalls awaiting pickup page. You should see the recall under the recalls waiting tab, and the recalls waiting more than X days tab. 20. expire the recall. confirm this is expired by checking the recalls queue 21. place another recall, but do not check it in 22. in mysql, set the date_due of the checkout (issues table) to be at least 'recall due date interval' number of days before today's date 23. run the overdue_notices.pl cronjob 24. go to the overdue recalls circ report and confirm your recall shows there 25. try cancelling the recall here also 26. in mysql, check the message_queue and confirm there have been the appropriate number of RETURN_RECALLED_ITEM and PICKUP_RECALLED_ITEM notices sent with the correct to and from addresses and other content 27. test t/db_dependent/Koha/Recalls.t Created attachment 69986 [details] [review] Bug 19532: POD fix, renaming methods Tomas's comments: - renaming 'Class methods' to 'internal methods' - renaming 'borrower' and 'branch' methods to 'patron' and 'library' other comments are out of date with current patches and do not need to be actioned when testing, confirm all data still shows as expected and nothing is broken Created attachment 70093 [details] [review] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl (In reply to Liz Rea from comment #37) > These are functionality notes for Aleisha > > OPAC client view: > > We probably want to show the borrower when the book is now expected to be > returned by on /cgi-bin/koha/opac-recalls.pl done > > Staff views: > > - syspref needs to be defaulted to off please :) done > > /cgi-bin/koha/circ/recalls_queue.pl > - probably want to see the new due date here as well done > > /cgi-bin/koha/catalogue/detail.pl?biblionumber=16 > - do we want to see what the old due date was here? (to think about, not > required) i think having the old and the new due date might cause some confusion > - Probably want to show somewhere in the item table that there is a recall, > and for whom (kinda like we do with holds) done > - do we want a tab on the detail page that shows all of the recalls for this > biblio, and who they are for? done > > General questions: > > - If we add an item with the same item type to a biblio that has a recall, > should checking in this newly available item trigger the recall to be filled? i'm not too sure about this. recalls are item-level not record-level so i haven't quite thought about how other available items could fill the recall. perhaps a future cronjob? maybe after this base feature gets through? > > I'm out of time for this run at it, but honestly what a great first whack at > it. i've now implemented all of the discussed comments etc and i believe this is ready to test Hi Aleisha, Overall things work well and are pretty intuitive. Can you squash some of the patches to ease readability? (e.e. the removed old_recalls stuff) Couple errors: The db uppdate tries to insert after 'notes' in issuing rules, but this doesn't exist When placing recall I always get a warning: <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> Cancelling recall from 'Recall history tab' doesn't work If patron has no recalls there is 'Patron has no current recalls' message at bottom of tabs on checkout and details tabs for patron When confirming a recall if the item is from another branch I get a transfer generated as well as confirming hold for recall On recalls awaiting pickup: need to update recall.borrower to recall.patron - causing internal server error When placing a recall - if I hit 'back' after confirming and confirm again I get a second recall on the same item Recalls queue should have waiting date information Recalls queue should have a way to hide cancelled, I would expect closed recalls to be hidden by default Could overdue recalls be a tab/filter on the recalls queue? When viewing a patrons account in the staff side we should see that a checkout has an active recall Checking out the recall doesn't seem to close the recall Question - should canceling a recall extend the due date? or notify patron somehow? is calendar used to calculate new due date for recall? I think it should be I think circ rules should include 'number of open recalls' to (optionally) limit how many a patron can have Is it valid for two patrons to recall the second item? I would think the second one not be a hold? -Nick Created attachment 71409 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Hi Aleihsa, please keep in mind that the notices need to be added to all the translated installers as well. It's ok to add them in English, but they should be there to ease translation and don't have different behaviour. Created attachment 71574 [details] [review] Bug 19532: Show recalls on intranet side This patch - adds Recall tab to the Check out section of member account, and to the Details section of member account - Functionality to cancel recalls on staff side - Fixing cancel on OPAC side (before I was deleting the whole recall instead of cancelling) - Fixing validation when checking whether a recall can be placed on an item that has been recalled by this borrower before. If the old recall is expired or cancelled then they can make a recall again. Created attachment 71575 [details] [review] Bug 19532: Fixing broken OPAC recalls table Forgot to add <tr> Created attachment 71576 [details] [review] Bug 19532: recalls history this patch - adds recalls history (similar to holds history) to OPAC and intranet - edits the tables in opac-user.pl (OPAC), moremember.pl and circulation.pl (staff) so that it only shows active recalls (recalls that have been requested or are waiting) - some extra datatables fixes Created attachment 71577 [details] [review] Bug 19532: Recalls queue This patch adds a recalls queue page to the circulation reports You can see all recalls made in the system, who requested them, their status and other relevant info. you can cancel individual or multiple recalls. Created attachment 71578 [details] [review] Bug 19532: Overdue recalls report Created attachment 71579 [details] [review] Bug 19532: Recalls awaiting pickup report this patch adds reports for all recalls awaiting pickup, and recalls that have been waiting more than X days. a syspref, RecallsMaxPickUpDelay, is added to give a general max shelf time for recalls Created attachment 71580 [details] [review] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Created attachment 71581 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Created attachment 71582 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Created attachment 71583 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Created attachment 71584 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Created attachment 71585 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Created attachment 71586 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Created attachment 71587 [details] [review] Bug 19532: Tests for Koha/Recalls Created attachment 71588 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Created attachment 71589 [details] [review] Bug 19532: POD fix, renaming methods Tomas's comments: - renaming 'Class methods' to 'internal methods' - renaming 'borrower' and 'branch' methods to 'patron' and 'library' other comments are out of date with current patches and do not need to be actioned when testing, confirm all data still shows as expected and nothing is broken Created attachment 71590 [details] [review] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl Created attachment 71591 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Created attachment 71592 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Added notices to translated installers https://bugs.koha-community.org/show_bug.cgi?id=19523 These two messages in recalls.js don't seem to be translatable: message = "The recall may have already been cancelled. Please refresh the page."; message = "Cancelled" Is this ready for testing? (In reply to Nick Clemens from comment #91) > Is this ready for testing? Not yet, still working on fixes from Comment 68. Been having some trouble with my devbox but the patch is coming! Any update on this one? Created attachment 72244 [details] [review] Bug 19532: Extra fixes from Comment 68 This patch fixes the following: The db uppdate tries to insert after 'notes' in issuing rules, but this doesn't exist When placing recall I always get a warning: <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> Cancelling recall from 'Recall history tab' doesn't work If patron has no recalls there is 'Patron has no current recalls' message at bottom of tabs on checkout and details tabs for patron When confirming a recall if the item is from another branch I get a transfer generated as well as confirming hold for recall Feature now checks if the recall branch is the same as the item holding branch when checking in item to determine if transfer is required On recalls awaiting pickup: need to update recall.borrower to recall.patron - causing internal server error When placing a recall - if I hit 'back' after confirming and confirm again I get a second recall on the same item Recalls queue should have waiting date information Recalls queue should have a way to hide cancelled, I would expect closed recalls to be hidden by default Recalls queue now hides old (cancelled/expired/finished) recalls by default and has a checkbox to toggle this When viewing a patrons account in the staff side we should see that a checkout has an active recall Checking out the recall doesn't seem to close the recall Added an 'F' status for finished/closed recalls (In reply to Nick Clemens from comment #68) ... > Can you squash some of the patches to ease readability? (e.e. the removed > old_recalls stuff) Will do after fixes ... > Could overdue recalls be a tab/filter on the recalls queue? I already have overdue recalls as a separate report page, do you mean moving this to a tab on the recalls queue page or having both the separate report and the tab on the recalls queue? ... > > Question - > should canceling a recall extend the due date? or notify patron somehow? > is calendar used to calculate new due date for recall? I think it should > be > I think circ rules should include 'number of open recalls' to > (optionally) limit how many a patron can have > Is it valid for two patrons to recall the second item? I would think the > second one not be a hold? All very good points but with all due respect I'd love to get this base feature through, then we can start thinking about these additional things. Created attachment 72311 [details] [review] Bug 19532: Database updates Adding the recalls table and the old_recalls table. Sponsored-by: Catalyst IT Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72312 [details] [review] Bug 19532: Module files for Recall and OldRecall Koha/Recall.pm Koha/Recalls.pm Koha/Old/Recall.pm Koha/Old/Recalls.pm and the schema files for Recall and OldRecall. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72313 [details] [review] Bug 19532: Some DB fixes Removing the old_recalls table, as suggested in Comment 5 Renaming 'found' column to 'status' Adding 'old' column Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72314 [details] [review] Bug 19532: Some module fixes Removing files related to OldRecall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72315 [details] [review] Bug 19532: Circulation rules Adding 3 new rules and columns to issuingrules - recall_due_date_interval - recall_overdue_fine - recall_shelf_time Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72316 [details] [review] Bug 19532: Recall an item in OPAC This patch: - adds the 'Recall' button to the item on it's detail page - adds ability to place a recall - the recall is stored in the recalls table - the due date for the checkout is updated to whatever has been set in the issuing rule under recall_due_date_interval - error messages for if the user isn't logged in, the user tries to place a recall on an item they have already recalled, or if storing the recall in the db fails for any reason Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72317 [details] [review] Bug 19532: Cancel recall and see recalls in OPAC This patch adds ability for user to cancel a recall They can also see their recalls in the user summary Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72318 [details] [review] Bug 19532: Show recalls on intranet side This patch - adds Recall tab to the Check out section of member account, and to the Details section of member account - Functionality to cancel recalls on staff side - Fixing cancel on OPAC side (before I was deleting the whole recall instead of cancelling) - Fixing validation when checking whether a recall can be placed on an item that has been recalled by this borrower before. If the old recall is expired or cancelled then they can make a recall again. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72319 [details] [review] Bug 19532: Fixing broken OPAC recalls table Forgot to add <tr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72320 [details] [review] Bug 19532: recalls history this patch - adds recalls history (similar to holds history) to OPAC and intranet - edits the tables in opac-user.pl (OPAC), moremember.pl and circulation.pl (staff) so that it only shows active recalls (recalls that have been requested or are waiting) - some extra datatables fixes Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72321 [details] [review] Bug 19532: Recalls queue This patch adds a recalls queue page to the circulation reports You can see all recalls made in the system, who requested them, their status and other relevant info. you can cancel individual or multiple recalls. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72322 [details] [review] Bug 19532: Overdue recalls report Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72323 [details] [review] Bug 19532: Recalls awaiting pickup report this patch adds reports for all recalls awaiting pickup, and recalls that have been waiting more than X days. a syspref, RecallsMaxPickUpDelay, is added to give a general max shelf time for recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72324 [details] [review] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72325 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72326 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72327 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72328 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72329 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72330 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72331 [details] [review] Bug 19532: Tests for Koha/Recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72332 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72333 [details] [review] Bug 19532: POD fix, renaming methods Tomas's comments: - renaming 'Class methods' to 'internal methods' - renaming 'borrower' and 'branch' methods to 'patron' and 'library' other comments are out of date with current patches and do not need to be actioned when testing, confirm all data still shows as expected and nothing is broken Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72334 [details] [review] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72335 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Added notices to translated installers https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72336 [details] [review] Bug 19532: Extra fixes from Comment 68 This patch fixes the following: The db uppdate tries to insert after 'notes' in issuing rules, but this doesn't exist When placing recall I always get a warning: <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> Cancelling recall from 'Recall history tab' doesn't work If patron has no recalls there is 'Patron has no current recalls' message at bottom of tabs on checkout and details tabs for patron When confirming a recall if the item is from another branch I get a transfer generated as well as confirming hold for recall Feature now checks if the recall branch is the same as the item holding branch when checking in item to determine if transfer is required On recalls awaiting pickup: need to update recall.borrower to recall.patron - causing internal server error When placing a recall - if I hit 'back' after confirming and confirm again I get a second recall on the same item Recalls queue should have waiting date information Recalls queue should have a way to hide cancelled, I would expect closed recalls to be hidden by default Recalls queue now hides old (cancelled/expired/finished) recalls by default and has a checkbox to toggle this When viewing a patrons account in the staff side we should see that a checkout has an active recall Checking out the recall doesn't seem to close the recall Added an 'F' status for finished/closed recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72337 [details] [review] Bug 19532 (follow-up) Update characterset for recalls table Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 72338 [details] [review] Bug 19532 - Improve and refine recalls functionality Only allow 1 recall per item When checking in only check for holds if no reserves found Add a T/transferring status for recalls, only confirm them once arrived Improve message when checking in recall Fix clashing ids on recall-history Check if patron can hold item before allowing recall Prevent multiple recalls when pressing back button Select/fill only active recall when issuing To test: 1 - Repeat major test plan - verify all points 2 - Attempt to place multiple recallsusing back button, should fail 3 - Set all item level holds to not allowed, should not be able to place recall 4 - Check-in recall at branch other than destination, should be in transit 5 - Confirm at correct branch, should send message and get expiration date etc. 6 - Return to another branch, should eb in transit again 7 - Play with circ rules and verify only allowed patrons can place recall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Rebased, tested and added some follow-ups to refine the functionality here - Aleisha can you sign off on my patch? This implements basic recall functionality and leaves room for improvements, this is a good starting point and I think can be QAed with an eye toward building refinement and extending functionality in future patchsets. Created attachment 72527 [details] [review] Bug 19532 - Improve and refine recalls functionality Only allow 1 recall per item When checking in only check for holds if no reserves found Add a T/transferring status for recalls, only confirm them once arrived Improve message when checking in recall Fix clashing ids on recall-history Check if patron can hold item before allowing recall Prevent multiple recalls when pressing back button Select/fill only active recall when issuing To test: 1 - Repeat major test plan - verify all points 2 - Attempt to place multiple recallsusing back button, should fail 3 - Set all item level holds to not allowed, should not be able to place recall 4 - Check-in recall at branch other than destination, should be in transit 5 - Confirm at correct branch, should send message and get expiration date etc. 6 - Return to another branch, should eb in transit again 7 - Play with circ rules and verify only allowed patrons can place recall Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> This sounds like a great feature! Just wondering about 'recall due date interval'. Will there be an option to not change the due date at all? i.e. we just want to recall the item to cataloguing maintenance when it's returned (and cut the queue if there are holds on the title/item), but we're not in a huge hurry. Hi All, Has there been any updated ETA or target release date for this holds recall development? Thanks, Alain Aleisha has been away on holiday, but this patch looks to be signed off and just waiting for QA? We are in hard feature freeze now, so it won't make it into 18.05 (only a few days left to release), but maybe 18.11 We talked about this one a lot at hackfest and have been working on recall functionality for one of our partners. While I agree on the strategy of starting small and avoiding scope creep I do think that we need a path forward and would really like to see an RFC that provides a roadmap to the final feature ensuring that this base allows for work towards that end. Hi All, I agree that an RFC would be ideal. It would be great for this feature to be put in production in Koha 18.11 Thanks, Alain I actually find this incredibly disappointing. We could have had a working feature in 18.05 except for people consistently trying to scope creep it. Now we won't until at least 18.11 and it will probably be over specced, over ambitious and fragile. This has to stop. It was too later for 18.05 anyway. We are in feature freeze for a week already. Yes, because of the months of stuff before. (In reply to Chris Cormack from comment #132) > I actually find this incredibly disappointing. We could have had a working > feature in 18.05 except for people consistently trying to scope creep it. > Now we won't until at least 18.11 and it will probably be over specced, over > ambitious and fragile. > This has to stop. I have to throw in my $0.02 here: we just implemented recall notices on reservations using simple cron script: https://github.com/dpavlin/Koha/blob/koha_ffzg/ffzg/recall_notices.pl I would love to replace hard-coded values in it with circulation rules, but currently this bug doesn't apply, and squashing some of fixes into more manageable chunks would be great first step. Due to our library circulation rules, OPAC parts of this patch are not interesting to us, but I would love to have intranet part in upstream Koha so that I can contribute cron script similar to ours. Does it make sense to split this bug into two halfs opac and intranet? While reserves might work for one use case, they won't for others. So instead of people turning this set of patches into the mess they've made it. There should have just been 2 different features. We (Catalyst) are unlikely to put any more work into rebasing these for the 400th time until people figure out what they actually want. Even though we have the feature in production already Hi everyone on the CC list Just a heads up that you will be receiving a lot of emails while I obsolete and attach newly rebased patches onto this bug report. I have rebased the rebase patches against master (as of 11 July 2018). As we are already using recalls in production we have been able to identify several bugs in the recalls which had not been previously found, and I have written patches to fix these bugs which I am also attaching to this bug report: * Transfer recall modal always appears upon the return of a recalled item even if it is being returned to the library where it is to be picked up from. * When recall fields in the circulation rules are empty when a patron tries to confirm a recall on the OPAC an 'Internal Server Error' is thrown. i.e. There are no default values for the recall circ fields. * At present if recalls and course reserves are both enabled then if you try to view the opac-course-details.pl page for a course with a currently issued course reserve then an 'Internal Server Error' is thrown. The root cause of this is: Koha::Item->avail_for_recall does not have tests. avail_for_recall is used in the item-status.inc used by both opac-course-details.pl and opac-detail.pl and the error is caused by course reserves not handing back an avail_for_recall value as opac-detail.pl does. Hopefully with rebased recalls patches + new bug fix patches we can action this recalls feature along and get it into 18.11 release. Cheers, Alex Created attachment 76817 [details] [review] Bug 19532: Database updates Adding the recalls table and the old_recalls table. Sponsored-by: Catalyst IT Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76818 [details] [review] Bug 19532: Module files for Recall and OldRecall Koha/Recall.pm Koha/Recalls.pm Koha/Old/Recall.pm Koha/Old/Recalls.pm and the schema files for Recall and OldRecall. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76819 [details] [review] Bug 19532: Some DB fixes Removing the old_recalls table, as suggested in Comment 5 Renaming 'found' column to 'status' Adding 'old' column Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76820 [details] [review] Bug 19532: Some module fixes Removing files related to OldRecall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76821 [details] [review] Bug 19532: Circulation rules Adding 3 new rules and columns to issuingrules - recall_due_date_interval - recall_overdue_fine - recall_shelf_time Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76822 [details] [review] Bug 19532: Recall an item in OPAC This patch: - adds the 'Recall' button to the item on it's detail page - adds ability to place a recall - the recall is stored in the recalls table - the due date for the checkout is updated to whatever has been set in the issuing rule under recall_due_date_interval - error messages for if the user isn't logged in, the user tries to place a recall on an item they have already recalled, or if storing the recall in the db fails for any reason Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76823 [details] [review] Bug 19532: Cancel recall and see recalls in OPAC This patch adds ability for user to cancel a recall They can also see their recalls in the user summary Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76824 [details] [review] Bug 19532: Show recalls on intranet side This patch - adds Recall tab to the Check out section of member account, and to the Details section of member account - Functionality to cancel recalls on staff side - Fixing cancel on OPAC side (before I was deleting the whole recall instead of cancelling) - Fixing validation when checking whether a recall can be placed on an item that has been recalled by this borrower before. If the old recall is expired or cancelled then they can make a recall again. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76825 [details] [review] Bug 19532: Fixing broken OPAC recalls table Forgot to add <tr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76826 [details] [review] Bug 19532: recalls history this patch - adds recalls history (similar to holds history) to OPAC and intranet - edits the tables in opac-user.pl (OPAC), moremember.pl and circulation.pl (staff) so that it only shows active recalls (recalls that have been requested or are waiting) - some extra datatables fixes Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76827 [details] [review] Bug 19532: Recalls queue This patch adds a recalls queue page to the circulation reports You can see all recalls made in the system, who requested them, their status and other relevant info. you can cancel individual or multiple recalls. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76828 [details] [review] Bug 19532: Overdue recalls report Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76829 [details] [review] Bug 19532: Recalls awaiting pickup report this patch adds reports for all recalls awaiting pickup, and recalls that have been waiting more than X days. a syspref, RecallsMaxPickUpDelay, is added to give a general max shelf time for recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76830 [details] [review] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76831 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76832 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76833 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76834 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76835 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76836 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76837 [details] [review] Bug 19532: Tests for Koha/Recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76838 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76839 [details] [review] Bug 19532: POD fix, renaming methods Tomas's comments: - renaming 'Class methods' to 'internal methods' - renaming 'borrower' and 'branch' methods to 'patron' and 'library' other comments are out of date with current patches and do not need to be actioned when testing, confirm all data still shows as expected and nothing is broken Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76840 [details] [review] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76841 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Added notices to translated installers https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76842 [details] [review] Bug 19532: Extra fixes from Comment 68 This patch fixes the following: The db uppdate tries to insert after 'notes' in issuing rules, but this doesn't exist When placing recall I always get a warning: <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> Cancelling recall from 'Recall history tab' doesn't work If patron has no recalls there is 'Patron has no current recalls' message at bottom of tabs on checkout and details tabs for patron When confirming a recall if the item is from another branch I get a transfer generated as well as confirming hold for recall Feature now checks if the recall branch is the same as the item holding branch when checking in item to determine if transfer is required On recalls awaiting pickup: need to update recall.borrower to recall.patron - causing internal server error When placing a recall - if I hit 'back' after confirming and confirm again I get a second recall on the same item Recalls queue should have waiting date information Recalls queue should have a way to hide cancelled, I would expect closed recalls to be hidden by default Recalls queue now hides old (cancelled/expired/finished) recalls by default and has a checkbox to toggle this When viewing a patrons account in the staff side we should see that a checkout has an active recall Checking out the recall doesn't seem to close the recall Added an 'F' status for finished/closed recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Conflicts: Koha/Schema/Result/Borrower.pm Created attachment 76843 [details] [review] Bug 19532 (follow-up) Update characterset for recalls table Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 76844 [details] [review] Bug 19532 - Improve and refine recalls functionality Only allow 1 recall per item When checking in only check for holds if no reserves found Add a T/transferring status for recalls, only confirm them once arrived Improve message when checking in recall Fix clashing ids on recall-history Check if patron can hold item before allowing recall Prevent multiple recalls when pressing back button Select/fill only active recall when issuing To test: 1 - Repeat major test plan - verify all points 2 - Attempt to place multiple recallsusing back button, should fail 3 - Set all item level holds to not allowed, should not be able to place recall 4 - Check-in recall at branch other than destination, should be in transit 5 - Confirm at correct branch, should send message and get expiration date etc. 6 - Return to another branch, should eb in transit again 7 - Play with circ rules and verify only allowed patrons can place recall Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Created attachment 76845 [details] [review] Bug 19532 - Fixes to stop transfer recall modal from being displayed incorrectly Created attachment 76846 [details] [review] Bug 19532 - Recalls for Course Reserves. This ptach fixes the 'Template process error Koha::Item->avail_for_recall' which is thrown when loading a Course pgae in opac-course-details.pl with course reserves which are currently issued. It also allows recalls to be placed from Course reserves Sponsored-By: Catalyst IT Created attachment 76847 [details] [review] Bug 19532 - Fix for recall OPAC confirmation failing when recall circ rule is empty Sponsored-BY: Catalyst IT All of my rebased patches + additional fixes are attached now. I just double checked applying all of the patches on this bug report to master as of 11 July 2018 and they all apply correctly. I am setting this bug report to 'Needs signoff' to try and get it moving now it can be tested more easily as it applies on master. Created attachment 77177 [details] [review] Bug 19532 - Stopping an recalled item currently awaiting pickup from being able to be checked out to patrons other than the recall requester. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item and confirm the recall 5. In the staff client go to Circulation->Recalls queue, notice the recall has a status of 'Ready for pickup' 6. Try issuing the item to patron 3 and notice without this patch applied you can issue a recall awaiting pickup to a patron who did not place the recall. 7. Apply patch 8. Restart memcached and plack 9. Using a new item repeat steps 1,2,3,4,5,6 and notice you get a yellow message displayed stating: 'This item is awaiting pickup by another patron who recalled it.' The issuing has not taken place to a patron who is not the patron who placed the recall as the item is awaiting pickup by the recall requester. 10. Issue the item to patron 2 and notice the issuing takes place successfully Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 77178 [details] [review] Bug 19532 - Make the Recall confirmation popup appear everytime a recalled item is put through returns until it is checked out to recall requester Previously the confirm recall popup was only displayed the first time the recalled item was out through returns. However it is useful for the Confirm recall popup to appear if the item is put through the returns multiple times due to library staff being interrupted. This ensures library staff are informed that the item has been recalled. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item and notice the 'Confirm recall' popup appears. Click confirm 5. Now check the item in again and notice the popup is not displayed this time. 6. Apply this patch 7. Restart memcached and plack 8. Using a new item repeat steps 2,3,4,5 and notice in step 5 the 'Confirm recall' popup is displayed this time. Click 'Confirm' 9. Check the item out to patron 2 10. Return the item and notice no popup is displayed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 77179 [details] [review] Bug 19532 - New RECALL_REQUESTER_DET notice and print option on confirm recall popup This patch adds a new notice RECALL_REQUESTER_DET which like HOLD_SLIP outlines borrower and item information so the item can be put aside for the requester. This patch also adds a 'Print and confirm' button to the 'Confirm recall' popup that appears when returning a recalled item. This functionality works the same as the 'Print and confirm' functionality for the Hold slip: A print modal popup will appear for the user to choose print settings, and choose to print or cancel. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item in the staff client 5. Notice there are only two buttons on the 'Confirm recall' popup which appears: 'Confirm' and 'Cancel' 6. Apply patch, run updatedatabase.pl (as there is a SQL atomicupdate file to be run), and restart memcached and plack 7. Using a new item repeat steps 2,3 8. In a new tab, in the staff client go to Circulation->Recalls queue, and notice the recall has a status of 'Requested' 8. Back in your first tab return the item and notice that a new button 'Print and confirm' is on the 'Confirm recall' popup. Select this button and notice two new popup windows appear: Browsers print window, and a window showing what the notice to be print looks like. 9. If you have a printer available print the notice. Otherwise you can look at what the notice would look like in the notice window, observing the notice outlines the following information: * Current date and time * Recall pickup branch * Borrowers first name and surname * Borrowers cardnumber, phonenumber, address, address2, city, zipcode, email * Recalled item title, author, barcode, callnumber. * Recall waiting date, and recall notes Some of these values will not be displayed on the notice if they are not set. For example the patron may not have set an address, or email. 10. After either printing the notice, or selecting 'Cancel' in the print window. Go back to your second tab and refresh the page and notice the status of the recall has changed to 'Ready for pickup' this shows the 'Print and confirm' button does actually confirm the recall. 11. Making sure the changes implemented in the previous commit (Bug 19532 - Make the Recall confirmation popup appear everytime a recalled item is put through returns) still work. Try returning the item again and notice the 'Confirm recall' popup with the 'Print and confirm' button is displayed again and you can choose to print the notice again if you want. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand I'm trying to test this and running into trouble: Other comments: The changes to sample_notices.sql don't apply cleanly, but that can wait for a rebase. Easy to ignore at this stage of testing. I get this error in the staff client: Missing right curly or square bracket at /home/vagrant/kohaclone/C4/Circulation.pm line 4144, at end of line It looks like there is a missing curly bracket at line 2064, so I added that before continuing. Then: Checked-out items in the OPAC don't show a "recall" link on the detail page. I'm logged in as a different user than the one who has it checked out. Is there more I need to do to make something "available" for recall? Or was my correction to Circulation.pm incorrect, causing some other problems? Applying: Bug 19532: recalls history error: sha1 information is lacking or useless (koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt). error: could not build fake ancestor Patch failed at 0001 Bug 19532: recalls history I can't get past this one sorry Alex, can you try a rebase please Created attachment 78755 [details] [review] Bug 19532: Database updates Adding the recalls table and the old_recalls table. Sponsored-by: Catalyst IT Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78757 [details] [review] Bug 19532: Module files for Recall and OldRecall Koha/Recall.pm Koha/Recalls.pm Koha/Old/Recall.pm Koha/Old/Recalls.pm and the schema files for Recall and OldRecall. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78759 [details] [review] Bug 19532: Some DB fixes Removing the old_recalls table, as suggested in Comment 5 Renaming 'found' column to 'status' Adding 'old' column Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78761 [details] [review] Bug 19532: Some module fixes Removing files related to OldRecall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78763 [details] [review] Bug 19532: Circulation rules Adding 3 new rules and columns to issuingrules - recall_due_date_interval - recall_overdue_fine - recall_shelf_time Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78765 [details] [review] Bug 19532: Recall an item in OPAC This patch: - adds the 'Recall' button to the item on it's detail page - adds ability to place a recall - the recall is stored in the recalls table - the due date for the checkout is updated to whatever has been set in the issuing rule under recall_due_date_interval - error messages for if the user isn't logged in, the user tries to place a recall on an item they have already recalled, or if storing the recall in the db fails for any reason Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78766 [details] [review] Bug 19532: Cancel recall and see recalls in OPAC This patch adds ability for user to cancel a recall They can also see their recalls in the user summary Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78768 [details] [review] Bug 19532: Show recalls on intranet side This patch - adds Recall tab to the Check out section of member account, and to the Details section of member account - Functionality to cancel recalls on staff side - Fixing cancel on OPAC side (before I was deleting the whole recall instead of cancelling) - Fixing validation when checking whether a recall can be placed on an item that has been recalled by this borrower before. If the old recall is expired or cancelled then they can make a recall again. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78770 [details] [review] Bug 19532: Fixing broken OPAC recalls table Forgot to add <tr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78772 [details] [review] Bug 19532: recalls history this patch - adds recalls history (similar to holds history) to OPAC and intranet - edits the tables in opac-user.pl (OPAC), moremember.pl and circulation.pl (staff) so that it only shows active recalls (recalls that have been requested or are waiting) - some extra datatables fixes Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78773 [details] [review] Bug 19532: Recalls queue This patch adds a recalls queue page to the circulation reports You can see all recalls made in the system, who requested them, their status and other relevant info. you can cancel individual or multiple recalls. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78774 [details] [review] Bug 19532: Overdue recalls report Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78775 [details] [review] Bug 19532: Recalls awaiting pickup report this patch adds reports for all recalls awaiting pickup, and recalls that have been waiting more than X days. a syspref, RecallsMaxPickUpDelay, is added to give a general max shelf time for recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78776 [details] [review] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78777 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78778 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78780 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78782 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78785 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78787 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78789 [details] [review] Bug 19532: Tests for Koha/Recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78790 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78792 [details] [review] Bug 19532: POD fix, renaming methods Tomas's comments: - renaming 'Class methods' to 'internal methods' - renaming 'borrower' and 'branch' methods to 'patron' and 'library' other comments are out of date with current patches and do not need to be actioned when testing, confirm all data still shows as expected and nothing is broken Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78794 [details] [review] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78797 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Added notices to translated installers https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78800 [details] [review] Bug 19532: Extra fixes from Comment 68 This patch fixes the following: The db uppdate tries to insert after 'notes' in issuing rules, but this doesn't exist When placing recall I always get a warning: <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> Cancelling recall from 'Recall history tab' doesn't work If patron has no recalls there is 'Patron has no current recalls' message at bottom of tabs on checkout and details tabs for patron When confirming a recall if the item is from another branch I get a transfer generated as well as confirming hold for recall Feature now checks if the recall branch is the same as the item holding branch when checking in item to determine if transfer is required On recalls awaiting pickup: need to update recall.borrower to recall.patron - causing internal server error When placing a recall - if I hit 'back' after confirming and confirm again I get a second recall on the same item Recalls queue should have waiting date information Recalls queue should have a way to hide cancelled, I would expect closed recalls to be hidden by default Recalls queue now hides old (cancelled/expired/finished) recalls by default and has a checkbox to toggle this When viewing a patrons account in the staff side we should see that a checkout has an active recall Checking out the recall doesn't seem to close the recall Added an 'F' status for finished/closed recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Conflicts: Koha/Schema/Result/Borrower.pm Created attachment 78801 [details] [review] Bug 19532 (follow-up) Update characterset for recalls table Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 78802 [details] [review] Bug 19532 - Improve and refine recalls functionality Only allow 1 recall per item When checking in only check for holds if no reserves found Add a T/transferring status for recalls, only confirm them once arrived Improve message when checking in recall Fix clashing ids on recall-history Check if patron can hold item before allowing recall Prevent multiple recalls when pressing back button Select/fill only active recall when issuing To test: 1 - Repeat major test plan - verify all points 2 - Attempt to place multiple recallsusing back button, should fail 3 - Set all item level holds to not allowed, should not be able to place recall 4 - Check-in recall at branch other than destination, should be in transit 5 - Confirm at correct branch, should send message and get expiration date etc. 6 - Return to another branch, should eb in transit again 7 - Play with circ rules and verify only allowed patrons can place recall Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Created attachment 78803 [details] [review] Bug 19532 - Fixes to stop transfer recall modal from being displayed incorrectly Created attachment 78804 [details] [review] Bug 19532 - Recalls for Course Reserves. This ptach fixes the 'Template process error Koha::Item->avail_for_recall' which is thrown when loading a Course pgae in opac-course-details.pl with course reserves which are currently issued. It also allows recalls to be placed from Course reserves Sponsored-By: Catalyst IT Created attachment 78805 [details] [review] Bug 19532 - Fix for recall OPAC confirmation failing when recall circ rule is empty Sponsored-BY: Catalyst IT Created attachment 78806 [details] [review] Bug 19532 - Stopping an recalled item currently awaiting pickup from being able to be checked out to patrons other than the recall requester. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item and confirm the recall 5. In the staff client go to Circulation->Recalls queue, notice the recall has a status of 'Ready for pickup' 6. Try issuing the item to patron 3 and notice without this patch applied you can issue a recall awaiting pickup to a patron who did not place the recall. 7. Apply patch 8. Restart memcached and plack 9. Using a new item repeat steps 1,2,3,4,5,6 and notice you get a yellow message displayed stating: 'This item is awaiting pickup by another patron who recalled it.' The issuing has not taken place to a patron who is not the patron who placed the recall as the item is awaiting pickup by the recall requester. 10. Issue the item to patron 2 and notice the issuing takes place successfully Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 78807 [details] [review] Bug 19532 - Make the Recall confirmation popup appear everytime a recalled item is put through returns until it is checked out to recall requester Previously the confirm recall popup was only displayed the first time the recalled item was out through returns. However it is useful for the Confirm recall popup to appear if the item is put through the returns multiple times due to library staff being interrupted. This ensures library staff are informed that the item has been recalled. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item and notice the 'Confirm recall' popup appears. Click confirm 5. Now check the item in again and notice the popup is not displayed this time. 6. Apply this patch 7. Restart memcached and plack 8. Using a new item repeat steps 2,3,4,5 and notice in step 5 the 'Confirm recall' popup is displayed this time. Click 'Confirm' 9. Check the item out to patron 2 10. Return the item and notice no popup is displayed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 78808 [details] [review] Bug 19532 - New RECALL_REQUESTER_DET notice and print option on confirm recall popup This patch adds a new notice RECALL_REQUESTER_DET which like HOLD_SLIP outlines borrower and item information so the item can be put aside for the requester. This patch also adds a 'Print and confirm' button to the 'Confirm recall' popup that appears when returning a recalled item. This functionality works the same as the 'Print and confirm' functionality for the Hold slip: A print modal popup will appear for the user to choose print settings, and choose to print or cancel. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item in the staff client 5. Notice there are only two buttons on the 'Confirm recall' popup which appears: 'Confirm' and 'Cancel' 6. Apply patch, run updatedatabase.pl (as there is a SQL atomicupdate file to be run), and restart memcached and plack 7. Using a new item repeat steps 2,3 8. In a new tab, in the staff client go to Circulation->Recalls queue, and notice the recall has a status of 'Requested' 8. Back in your first tab return the item and notice that a new button 'Print and confirm' is on the 'Confirm recall' popup. Select this button and notice two new popup windows appear: Browsers print window, and a window showing what the notice to be print looks like. 9. If you have a printer available print the notice. Otherwise you can look at what the notice would look like in the notice window, observing the notice outlines the following information: * Current date and time * Recall pickup branch * Borrowers first name and surname * Borrowers cardnumber, phonenumber, address, address2, city, zipcode, email * Recalled item title, author, barcode, callnumber. * Recall waiting date, and recall notes Some of these values will not be displayed on the notice if they are not set. For example the patron may not have set an address, or email. 10. After either printing the notice, or selecting 'Cancel' in the print window. Go back to your second tab and refresh the page and notice the status of the recall has changed to 'Ready for pickup' this shows the 'Print and confirm' button does actually confirm the recall. 11. Making sure the changes implemented in the previous commit (Bug 19532 - Make the Recall confirmation popup appear everytime a recalled item is put through returns) still work. Try returning the item again and notice the 'Confirm recall' popup with the 'Print and confirm' button is displayed again and you can choose to print the notice again if you want. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Sorry, this doesn't apply anymore. I had begun testing just before master changed and was getting an error in Circulation.pm which I'm thinking may have been a merge error? Missing right curly or square bracket at /home/vagrant/kohaclone/C4/Circulation.pm line 4147, at end of line Hi all I have gone through and fixed the conflicts when applying these patches, and will attach the fixed patches. Apologies for the email deluge. Cheers, Alex Created attachment 80763 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80764 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80765 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80766 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80767 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80768 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80769 [details] [review] Bug 19532: Tests for Koha/Recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80770 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80771 [details] [review] Bug 19532: POD fix, renaming methods Tomas's comments: - renaming 'Class methods' to 'internal methods' - renaming 'borrower' and 'branch' methods to 'patron' and 'library' other comments are out of date with current patches and do not need to be actioned when testing, confirm all data still shows as expected and nothing is broken Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80772 [details] [review] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80773 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Added notices to translated installers https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80774 [details] [review] Bug 19532: Extra fixes from Comment 68 This patch fixes the following: The db uppdate tries to insert after 'notes' in issuing rules, but this doesn't exist When placing recall I always get a warning: <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> Cancelling recall from 'Recall history tab' doesn't work If patron has no recalls there is 'Patron has no current recalls' message at bottom of tabs on checkout and details tabs for patron When confirming a recall if the item is from another branch I get a transfer generated as well as confirming hold for recall Feature now checks if the recall branch is the same as the item holding branch when checking in item to determine if transfer is required On recalls awaiting pickup: need to update recall.borrower to recall.patron - causing internal server error When placing a recall - if I hit 'back' after confirming and confirm again I get a second recall on the same item Recalls queue should have waiting date information Recalls queue should have a way to hide cancelled, I would expect closed recalls to be hidden by default Recalls queue now hides old (cancelled/expired/finished) recalls by default and has a checkbox to toggle this When viewing a patrons account in the staff side we should see that a checkout has an active recall Checking out the recall doesn't seem to close the recall Added an 'F' status for finished/closed recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Conflicts: Koha/Schema/Result/Borrower.pm Created attachment 80775 [details] [review] Bug 19532 (follow-up) Update characterset for recalls table Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 80776 [details] [review] Bug 19532 - Improve and refine recalls functionality Only allow 1 recall per item When checking in only check for holds if no reserves found Add a T/transferring status for recalls, only confirm them once arrived Improve message when checking in recall Fix clashing ids on recall-history Check if patron can hold item before allowing recall Prevent multiple recalls when pressing back button Select/fill only active recall when issuing To test: 1 - Repeat major test plan - verify all points 2 - Attempt to place multiple recallsusing back button, should fail 3 - Set all item level holds to not allowed, should not be able to place recall 4 - Check-in recall at branch other than destination, should be in transit 5 - Confirm at correct branch, should send message and get expiration date etc. 6 - Return to another branch, should eb in transit again 7 - Play with circ rules and verify only allowed patrons can place recall Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Created attachment 80777 [details] [review] Bug 19532 - Fixes to stop transfer recall modal from being displayed incorrectly Created attachment 80778 [details] [review] Bug 19532 - Recalls for Course Reserves. This ptach fixes the 'Template process error Koha::Item->avail_for_recall' which is thrown when loading a Course pgae in opac-course-details.pl with course reserves which are currently issued. It also allows recalls to be placed from Course reserves Sponsored-By: Catalyst IT Created attachment 80779 [details] [review] Bug 19532 - Fix for recall OPAC confirmation failing when recall circ rule is empty Sponsored-BY: Catalyst IT Created attachment 80780 [details] [review] Bug 19532 - Stopping an recalled item currently awaiting pickup from being able to be checked out to patrons other than the recall requester. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item and confirm the recall 5. In the staff client go to Circulation->Recalls queue, notice the recall has a status of 'Ready for pickup' 6. Try issuing the item to patron 3 and notice without this patch applied you can issue a recall awaiting pickup to a patron who did not place the recall. 7. Apply patch 8. Restart memcached and plack 9. Using a new item repeat steps 1,2,3,4,5,6 and notice you get a yellow message displayed stating: 'This item is awaiting pickup by another patron who recalled it.' The issuing has not taken place to a patron who is not the patron who placed the recall as the item is awaiting pickup by the recall requester. 10. Issue the item to patron 2 and notice the issuing takes place successfully Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 80781 [details] [review] Bug 19532 - Make the Recall confirmation popup appear everytime a recalled item is put through returns until it is checked out to recall requester Previously the confirm recall popup was only displayed the first time the recalled item was out through returns. However it is useful for the Confirm recall popup to appear if the item is put through the returns multiple times due to library staff being interrupted. This ensures library staff are informed that the item has been recalled. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item and notice the 'Confirm recall' popup appears. Click confirm 5. Now check the item in again and notice the popup is not displayed this time. 6. Apply this patch 7. Restart memcached and plack 8. Using a new item repeat steps 2,3,4,5 and notice in step 5 the 'Confirm recall' popup is displayed this time. Click 'Confirm' 9. Check the item out to patron 2 10. Return the item and notice no popup is displayed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 80782 [details] [review] Bug 19532 - New RECALL_REQUESTER_DET notice and print option on confirm recall popup This patch adds a new notice RECALL_REQUESTER_DET which like HOLD_SLIP outlines borrower and item information so the item can be put aside for the requester. This patch also adds a 'Print and confirm' button to the 'Confirm recall' popup that appears when returning a recalled item. This functionality works the same as the 'Print and confirm' functionality for the Hold slip: A print modal popup will appear for the user to choose print settings, and choose to print or cancel. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item in the staff client 5. Notice there are only two buttons on the 'Confirm recall' popup which appears: 'Confirm' and 'Cancel' 6. Apply patch, run updatedatabase.pl (as there is a SQL atomicupdate file to be run), and restart memcached and plack 7. Using a new item repeat steps 2,3 8. In a new tab, in the staff client go to Circulation->Recalls queue, and notice the recall has a status of 'Requested' 8. Back in your first tab return the item and notice that a new button 'Print and confirm' is on the 'Confirm recall' popup. Select this button and notice two new popup windows appear: Browsers print window, and a window showing what the notice to be print looks like. 9. If you have a printer available print the notice. Otherwise you can look at what the notice would look like in the notice window, observing the notice outlines the following information: * Current date and time * Recall pickup branch * Borrowers first name and surname * Borrowers cardnumber, phonenumber, address, address2, city, zipcode, email * Recalled item title, author, barcode, callnumber. * Recall waiting date, and recall notes Some of these values will not be displayed on the notice if they are not set. For example the patron may not have set an address, or email. 10. After either printing the notice, or selecting 'Cancel' in the print window. Go back to your second tab and refresh the page and notice the status of the recall has changed to 'Ready for pickup' this shows the 'Print and confirm' button does actually confirm the recall. 11. Making sure the changes implemented in the previous commit (Bug 19532 - Make the Recall confirmation popup appear everytime a recalled item is put through returns) still work. Try returning the item again and notice the 'Confirm recall' popup with the 'Print and confirm' button is displayed again and you can choose to print the notice again if you want. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand All attached. I just tested and all commits apply cleanly on master as of 18 oct 2018. Just a note that I will be attaching a few more additional patches to this bug report in the next hour or so. Created attachment 80783 [details] [review] Bug 19532: Fixing Internal Server Error thrown on C4/Circulation.pm Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 80784 [details] [review] Bug 19532: Implemented check if recall status equals 'R' before recall popup is shown This stops the 'confirm recall' popup message being displayed upon item return when the item has a recall with any status other than 'R' (recalled). Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 80785 [details] [review] Bug 19532: Added conditional to check the recall has a status = 'W' before setting it to closed This solves a bug I found that if the same borrower number and itemnumber combination occur more than once in the recalls database table then when the item is checked out to the patron who recalled the item then the recall is not updated to have a status of closed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 80786 [details] [review] Bug 19532: Fixed display of recall buttons on opac-course-details.pl Recall button now displayed on items in opac-course-details.pl which are issued to another user. No internal server error being thrown on courses with issued course reserves. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 80787 [details] [review] Bug 19532: Stopping recalls awaiting pickup to be issued to patrons other than the patron who recalled. Also fixed the display of item status in the holdings table on detail.pl on staff client so it doesn't say an item has been recalled when the recall has the status of 'F' (fulfilled) or 'C' (cancelled) Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 80788 [details] [review] Bug 19532: Amended the detail.pl call to retrieve recalls so now it retrieves recalls with the status of 'R' or 'W' This means the 'Item recalled by' text is displayed in the holdings table in detail.pl for items with a recall with the status of recalled or waiting. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 80789 [details] [review] Bug 19532: Stopping recalled items (recall status='R') from being renewed Test plan: 1. Check out an item to a borrower and note the due date 2. Recall the item and note the updated due date 3. Try renewing the item and notice you can't. A message appears telling you the item has been recalled and cannot be renewed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 80793 [details] [review] Bug 19532: Fixed Internal Server error thrown upon returning recalled item Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Hi all I've added the additional patches now. All patches apply cleanly on master as of 18th of Oct 2018. I am setting this to 'Needs signoff'. Just a note I have noticed some DB errors (e.g. when paying fees on paycollect.pl, and upon returning items). I found from using git bisect these errors were being caused by the regressions introduced by one of the patches on bug 20521: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=73683&action=diff You may have also seen the emails regarding bug 20521 in the Koha-devel mailing list. I've filed another bug report for the DB error on paycollect.pl - Bug 21593 (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21593) - which Nick Clements has just attached a fix for. So in short if you experience DB errors during testing they may be due to 20521, not neccessarily recalls. Cheers, Alex Created attachment 80878 [details] [review] Bug 19532: Fix t/db_dependent/Koha/Recalls.t Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Hi all I have gone through and rebased again and will be attaching the rebased patches now. I will also be adding further enhancement patches. Apologies for the email deluge. Cheers, Alex Created attachment 81204 [details] [review] Bug 19532: Circulation rules Adding 3 new rules and columns to issuingrules - recall_due_date_interval - recall_overdue_fine - recall_shelf_time Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81205 [details] [review] Bug 19532: Recall an item in OPAC This patch: - adds the 'Recall' button to the item on it's detail page - adds ability to place a recall - the recall is stored in the recalls table - the due date for the checkout is updated to whatever has been set in the issuing rule under recall_due_date_interval - error messages for if the user isn't logged in, the user tries to place a recall on an item they have already recalled, or if storing the recall in the db fails for any reason Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81206 [details] [review] Bug 19532: Cancel recall and see recalls in OPAC This patch adds ability for user to cancel a recall They can also see their recalls in the user summary Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81207 [details] [review] Bug 19532: Show recalls on intranet side This patch - adds Recall tab to the Check out section of member account, and to the Details section of member account - Functionality to cancel recalls on staff side - Fixing cancel on OPAC side (before I was deleting the whole recall instead of cancelling) - Fixing validation when checking whether a recall can be placed on an item that has been recalled by this borrower before. If the old recall is expired or cancelled then they can make a recall again. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81208 [details] [review] Bug 19532: Fixing broken OPAC recalls table Forgot to add <tr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81209 [details] [review] Bug 19532: recalls history this patch - adds recalls history (similar to holds history) to OPAC and intranet - edits the tables in opac-user.pl (OPAC), moremember.pl and circulation.pl (staff) so that it only shows active recalls (recalls that have been requested or are waiting) - some extra datatables fixes Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81210 [details] [review] Bug 19532: Recalls queue This patch adds a recalls queue page to the circulation reports You can see all recalls made in the system, who requested them, their status and other relevant info. you can cancel individual or multiple recalls. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81211 [details] [review] Bug 19532: Overdue recalls report Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81212 [details] [review] Bug 19532: Recalls awaiting pickup report this patch adds reports for all recalls awaiting pickup, and recalls that have been waiting more than X days. a syspref, RecallsMaxPickUpDelay, is added to give a general max shelf time for recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81213 [details] [review] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81214 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81215 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81216 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81217 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81218 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81219 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81220 [details] [review] Bug 19532: Tests for Koha/Recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81221 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81222 [details] [review] Bug 19532: POD fix, renaming methods Tomas's comments: - renaming 'Class methods' to 'internal methods' - renaming 'borrower' and 'branch' methods to 'patron' and 'library' other comments are out of date with current patches and do not need to be actioned when testing, confirm all data still shows as expected and nothing is broken Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81223 [details] [review] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81224 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Added notices to translated installers https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81225 [details] [review] Bug 19532: Extra fixes from Comment 68 This patch fixes the following: The db uppdate tries to insert after 'notes' in issuing rules, but this doesn't exist When placing recall I always get a warning: <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> Cancelling recall from 'Recall history tab' doesn't work If patron has no recalls there is 'Patron has no current recalls' message at bottom of tabs on checkout and details tabs for patron When confirming a recall if the item is from another branch I get a transfer generated as well as confirming hold for recall Feature now checks if the recall branch is the same as the item holding branch when checking in item to determine if transfer is required On recalls awaiting pickup: need to update recall.borrower to recall.patron - causing internal server error When placing a recall - if I hit 'back' after confirming and confirm again I get a second recall on the same item Recalls queue should have waiting date information Recalls queue should have a way to hide cancelled, I would expect closed recalls to be hidden by default Recalls queue now hides old (cancelled/expired/finished) recalls by default and has a checkbox to toggle this When viewing a patrons account in the staff side we should see that a checkout has an active recall Checking out the recall doesn't seem to close the recall Added an 'F' status for finished/closed recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Conflicts: Koha/Schema/Result/Borrower.pm Created attachment 81226 [details] [review] Bug 19532 (follow-up) Update characterset for recalls table Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81227 [details] [review] Bug 19532 - Improve and refine recalls functionality Only allow 1 recall per item When checking in only check for holds if no reserves found Add a T/transferring status for recalls, only confirm them once arrived Improve message when checking in recall Fix clashing ids on recall-history Check if patron can hold item before allowing recall Prevent multiple recalls when pressing back button Select/fill only active recall when issuing To test: 1 - Repeat major test plan - verify all points 2 - Attempt to place multiple recallsusing back button, should fail 3 - Set all item level holds to not allowed, should not be able to place recall 4 - Check-in recall at branch other than destination, should be in transit 5 - Confirm at correct branch, should send message and get expiration date etc. 6 - Return to another branch, should eb in transit again 7 - Play with circ rules and verify only allowed patrons can place recall Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Created attachment 81228 [details] [review] Bug 19532 - Fixes to stop transfer recall modal from being displayed incorrectly Created attachment 81229 [details] [review] Bug 19532 - Recalls for Course Reserves. This ptach fixes the 'Template process error Koha::Item->avail_for_recall' which is thrown when loading a Course pgae in opac-course-details.pl with course reserves which are currently issued. It also allows recalls to be placed from Course reserves Sponsored-By: Catalyst IT Created attachment 81230 [details] [review] Bug 19532 - Fix for recall OPAC confirmation failing when recall circ rule is empty Sponsored-BY: Catalyst IT Created attachment 81231 [details] [review] Bug 19532 - Stopping an recalled item currently awaiting pickup from being able to be checked out to patrons other than the recall requester. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item and confirm the recall 5. In the staff client go to Circulation->Recalls queue, notice the recall has a status of 'Ready for pickup' 6. Try issuing the item to patron 3 and notice without this patch applied you can issue a recall awaiting pickup to a patron who did not place the recall. 7. Apply patch 8. Restart memcached and plack 9. Using a new item repeat steps 1,2,3,4,5,6 and notice you get a yellow message displayed stating: 'This item is awaiting pickup by another patron who recalled it.' The issuing has not taken place to a patron who is not the patron who placed the recall as the item is awaiting pickup by the recall requester. 10. Issue the item to patron 2 and notice the issuing takes place successfully Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81232 [details] [review] Bug 19532 - Make the Recall confirmation popup appear everytime a recalled item is put through returns until it is checked out to recall requester Previously the confirm recall popup was only displayed the first time the recalled item was out through returns. However it is useful for the Confirm recall popup to appear if the item is put through the returns multiple times due to library staff being interrupted. This ensures library staff are informed that the item has been recalled. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item and notice the 'Confirm recall' popup appears. Click confirm 5. Now check the item in again and notice the popup is not displayed this time. 6. Apply this patch 7. Restart memcached and plack 8. Using a new item repeat steps 2,3,4,5 and notice in step 5 the 'Confirm recall' popup is displayed this time. Click 'Confirm' 9. Check the item out to patron 2 10. Return the item and notice no popup is displayed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81233 [details] [review] Bug 19532 - New RECALL_REQUESTER_DET notice and print option on confirm recall popup This patch adds a new notice RECALL_REQUESTER_DET which like HOLD_SLIP outlines borrower and item information so the item can be put aside for the requester. This patch also adds a 'Print and confirm' button to the 'Confirm recall' popup that appears when returning a recalled item. This functionality works the same as the 'Print and confirm' functionality for the Hold slip: A print modal popup will appear for the user to choose print settings, and choose to print or cancel. Test plan: 1. Ensure 'UseRecalls' sypref is enabled and you have inputted values for recalls fields in the circulation rules (Administration->Circulation and fines rules) 2. Check item out to patron 1 3. Log into the OPAC as patron 2 and place a recall on the checked out item 4. Return the item in the staff client 5. Notice there are only two buttons on the 'Confirm recall' popup which appears: 'Confirm' and 'Cancel' 6. Apply patch, run updatedatabase.pl (as there is a SQL atomicupdate file to be run), and restart memcached and plack 7. Using a new item repeat steps 2,3 8. In a new tab, in the staff client go to Circulation->Recalls queue, and notice the recall has a status of 'Requested' 8. Back in your first tab return the item and notice that a new button 'Print and confirm' is on the 'Confirm recall' popup. Select this button and notice two new popup windows appear: Browsers print window, and a window showing what the notice to be print looks like. 9. If you have a printer available print the notice. Otherwise you can look at what the notice would look like in the notice window, observing the notice outlines the following information: * Current date and time * Recall pickup branch * Borrowers first name and surname * Borrowers cardnumber, phonenumber, address, address2, city, zipcode, email * Recalled item title, author, barcode, callnumber. * Recall waiting date, and recall notes Some of these values will not be displayed on the notice if they are not set. For example the patron may not have set an address, or email. 10. After either printing the notice, or selecting 'Cancel' in the print window. Go back to your second tab and refresh the page and notice the status of the recall has changed to 'Ready for pickup' this shows the 'Print and confirm' button does actually confirm the recall. 11. Making sure the changes implemented in the previous commit (Bug 19532 - Make the Recall confirmation popup appear everytime a recalled item is put through returns) still work. Try returning the item again and notice the 'Confirm recall' popup with the 'Print and confirm' button is displayed again and you can choose to print the notice again if you want. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81234 [details] [review] Bug 19532: Fixing Internal Server Error thrown on C4/Circulation.pm Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81235 [details] [review] Bug 19532: Implemented check if recall status equals 'R' before recall popup is shown This stops the 'confirm recall' popup message being displayed upon item return when the item has a recall with any status other than 'R' (recalled). Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81236 [details] [review] Bug 19532: Added conditional to check the recall has a status = 'W' before setting it to closed This solves a bug I found that if the same borrower number and itemnumber combination occur more than once in the recalls database table then when the item is checked out to the patron who recalled the item then the recall is not updated to have a status of closed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81237 [details] [review] Bug 19532: Fixed display of recall buttons on opac-course-details.pl Recall button now displayed on items in opac-course-details.pl which are issued to another user. No internal server error being thrown on courses with issued course reserves. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81238 [details] [review] Bug 19532: Stopping recalls awaiting pickup to be issued to patrons other than the patron who recalled. Also fixed the display of item status in the holdings table on detail.pl on staff client so it doesn't say an item has been recalled when the recall has the status of 'F' (fulfilled) or 'C' (cancelled) Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81239 [details] [review] Bug 19532: Amended the detail.pl call to retrieve recalls so now it retrieves recalls with the status of 'R' or 'W' This means the 'Item recalled by' text is displayed in the holdings table in detail.pl for items with a recall with the status of recalled or waiting. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81240 [details] [review] Bug 19532: Stopping recalled items (recall status='R') from being renewed Test plan: 1. Check out an item to a borrower and note the due date 2. Recall the item and note the updated due date 3. Try renewing the item and notice you can't. A message appears telling you the item has been recalled and cannot be renewed. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81241 [details] [review] Bug 19532: Fixed Internal Server error thrown upon returning recalled item Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81242 [details] [review] Bug 19532: Fix t/db_dependent/Koha/Recalls.t Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81243 [details] [review] Bug 19532: Stop item status='Available' for waiting recalls This patch alters the display of the item status in the staff client and OPAC so items which are waiting recalls are not shown in these interfaces with the status of 'available'. Waiting recalls are not available they are only available to the patron who recalled them. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81244 [details] [review] Bug 19532: Amended C4/Circulation->CanBookBeIssued() This function now checks for waiting recalls before checking for reserves on an item. If a recall record does exist and it was placed by the same borrower who is trying to check out the item then no check for reserves takes place because the waiting recall takes precedence. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81245 [details] [review] Bug 19532: Fixed missing variable declaration error Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81246 [details] [review] Bug 19532: Added missing conditional check so now item availability for recalled items on OPAC search results page is corrected On the OPAC now if an item is a waiting recall then it is shown as 'On reserve' rather than available. Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81247 [details] [review] Bug 19532: Added ability to set Recall due date interval, and Recall pickup period to hours Previously you could only set a number of days a recalled item has to be returned (Recall due date interval (days)) and a number of days available for a recalled item to be picked up. For academic libraries which often loan high-demand items out by a certain number of hours being able to set the number of hours a borrower has to return a recalled item and for the recaller to pickup the waiting recall is important. This patch implement a check in C4::Overdue->CalcFine() if item is recalled. If the item has been recalled and is past the due date then use the recall_overdue_fine to calculate the appropriate fine to charge the patron, otherwise use the fines value in the issuingrules table Also implemented atomicupdate to change recalls waitingdate and expirationdate to datetime datatypes with associated template changes in the recalls reports to display the date and time of these recall values. Test plan: 1. Apply all other patches on bug 19532 (except this patch) 2. Set a fine charge interval period (if you do not have this field set in the circ rule then the fine will not be applied). 3. Set the 'Unit' of the circ rule to 'hours', 'Recall due date interval' = 1, recall overdue fune amount= 1, recall pickup period=1 4. Check out an item to borrower A and recall it in the OPAC by borrower B 5. In the database manually change the issues.date_due to 1 hour before the current time 6. From the Koha shell run './misc/cronjobs/fines.pl' 7. Notice the fine of 1 has been applied to the borrower for being 1 hour late in returning the recall 8. Return the item and confirm the recall. Manually change the waiting date to more than 1 hour before the current time and repeat step 6 running overdue_notices.pl 9. Notice the recall is overdue now Sponsored-By: Toi Ohomai Institute of Technology, New Zealand All done, and I have attached 6 additional patches fixing a few bugs and introducing new features such as the ability to set the Recall due date interval and Recall pickup period in the unit of hours (previously these fields were only in days). sha1 conflicts half way through applying.. then when attempting a patch -p1 I get patch ends i middle of file. Created attachment 81547 [details] [review] Bug 19532: Database updates Adding the recalls table and the old_recalls table. Sponsored-by: Catalyst IT Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81548 [details] [review] Bug 19532: Module files for Recall and OldRecall Koha/Recall.pm Koha/Recalls.pm Koha/Old/Recall.pm Koha/Old/Recalls.pm and the schema files for Recall and OldRecall. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81549 [details] [review] Bug 19532: Some DB fixes Removing the old_recalls table, as suggested in Comment 5 Renaming 'found' column to 'status' Adding 'old' column Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81550 [details] [review] Bug 19532: Some module fixes Removing files related to OldRecall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81551 [details] [review] Bug 19532: Circulation rules Adding 3 new rules and columns to issuingrules - recall_due_date_interval - recall_overdue_fine - recall_shelf_time Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81552 [details] [review] Bug 19532: Recall an item in OPAC This patch: - adds the 'Recall' button to the item on it's detail page - adds ability to place a recall - the recall is stored in the recalls table - the due date for the checkout is updated to whatever has been set in the issuing rule under recall_due_date_interval - error messages for if the user isn't logged in, the user tries to place a recall on an item they have already recalled, or if storing the recall in the db fails for any reason Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81553 [details] [review] Bug 19532: Cancel recall and see recalls in OPAC This patch adds ability for user to cancel a recall They can also see their recalls in the user summary Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81554 [details] [review] Bug 19532: Show recalls on intranet side This patch - adds Recall tab to the Check out section of member account, and to the Details section of member account - Functionality to cancel recalls on staff side - Fixing cancel on OPAC side (before I was deleting the whole recall instead of cancelling) - Fixing validation when checking whether a recall can be placed on an item that has been recalled by this borrower before. If the old recall is expired or cancelled then they can make a recall again. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81555 [details] [review] Bug 19532: Fixing broken OPAC recalls table Forgot to add <tr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81556 [details] [review] Bug 19532: recalls history this patch - adds recalls history (similar to holds history) to OPAC and intranet - edits the tables in opac-user.pl (OPAC), moremember.pl and circulation.pl (staff) so that it only shows active recalls (recalls that have been requested or are waiting) - some extra datatables fixes Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81557 [details] [review] Bug 19532: Recalls queue This patch adds a recalls queue page to the circulation reports You can see all recalls made in the system, who requested them, their status and other relevant info. you can cancel individual or multiple recalls. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81558 [details] [review] Bug 19532: Overdue recalls report Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81559 [details] [review] Bug 19532: Recalls awaiting pickup report this patch adds reports for all recalls awaiting pickup, and recalls that have been waiting more than X days. a syspref, RecallsMaxPickUpDelay, is added to give a general max shelf time for recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81560 [details] [review] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81561 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81562 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81563 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81564 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81565 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81566 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81567 [details] [review] Bug 19532: Tests for Koha/Recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81568 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81569 [details] [review] Bug 19532: POD fix, renaming methods Tomas's comments: - renaming 'Class methods' to 'internal methods' - renaming 'borrower' and 'branch' methods to 'patron' and 'library' other comments are out of date with current patches and do not need to be actioned when testing, confirm all data still shows as expected and nothing is broken Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81583 [details] [review] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81584 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Added notices to translated installers https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81585 [details] [review] Bug 19532: Extra fixes from Comment 68 This patch fixes the following: The db uppdate tries to insert after 'notes' in issuing rules, but this doesn't exist When placing recall I always get a warning: <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> Cancelling recall from 'Recall history tab' doesn't work If patron has no recalls there is 'Patron has no current recalls' message at bottom of tabs on checkout and details tabs for patron When confirming a recall if the item is from another branch I get a transfer generated as well as confirming hold for recall Feature now checks if the recall branch is the same as the item holding branch when checking in item to determine if transfer is required On recalls awaiting pickup: need to update recall.borrower to recall.patron - causing internal server error When placing a recall - if I hit 'back' after confirming and confirm again I get a second recall on the same item Recalls queue should have waiting date information Recalls queue should have a way to hide cancelled, I would expect closed recalls to be hidden by default Recalls queue now hides old (cancelled/expired/finished) recalls by default and has a checkbox to toggle this When viewing a patrons account in the staff side we should see that a checkout has an active recall Checking out the recall doesn't seem to close the recall Added an 'F' status for finished/closed recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Conflicts: Koha/Schema/Result/Borrower.pm Created attachment 81586 [details] [review] Bug 19532 (follow-up) Update characterset for recalls table Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81587 [details] [review] Bug 19532 - Improve and refine recalls functionality Only allow 1 recall per item When checking in only check for holds if no reserves found Add a T/transferring status for recalls, only confirm them once arrived Improve message when checking in recall Fix clashing ids on recall-history Check if patron can hold item before allowing recall Prevent multiple recalls when pressing back button Select/fill only active recall when issuing To test: 1 - Repeat major test plan - verify all points 2 - Attempt to place multiple recallsusing back button, should fail 3 - Set all item level holds to not allowed, should not be able to place recall 4 - Check-in recall at branch other than destination, should be in transit 5 - Confirm at correct branch, should send message and get expiration date etc. 6 - Return to another branch, should eb in transit again 7 - Play with circ rules and verify only allowed patrons can place recall Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Created attachment 81588 [details] [review] Bug 19532: Fixes and enhancements to recalls This implements the following fixes and enhancements: 1. Stopping a waiting recall from being able to be checked out to patrons other than the patron who placed the recall 2. Make the Recall confirmation popup appear everytime a recalled item is put through returns until it is checked out to recall requester 3. Introduce a new notice RECALL_REQUESTER_DET which outlines borrower and item information so the item can be put aside 4. Stop recalled items from being renewed 5. Stop display of 'Available' for waiting recalls 6. Check if recalls exist on an item before checking for reserves 7. Added ability to set Recall due date interval, and Recall pickup period in hours 8. Fix the 'Template process error Koha::Item->avail_for_recall' thrown on course page where a course reserve is currently issued Test plan: 1. Enable the UseRecalls syspref 2. Go to Circulation and Fines Rules. Put some numbers in the recalls fields (recall due date interval, recall overdue fine amount, recall pickup period) - the unit of recall due date interval and recall pickup period is either days or hours as set in the circ rule 'unit' field 3. Put a number in the RecallsMaxPickUpDelay syspref. This will be the default number of days or hours used if the recall pickup period isn't set in Step 2 4. Check out an item to a patron 5. Go to that item's detail page in the OPAC. Notice the holdings table says 'Checked out' 6. Log in to the OPAC with another patron and go back to that detail page. The holdings table should now have a Recall link next to the 'Checked out' text 7. Click the Recall button and confirm the Recall 8. Go to the user's opac summary and confirm there is now a Recalls tab, with the correct number of recalls (should be 1). 9. Test cancelling the recall by clicking Cancel. Confirm the recall has been cancelled. Repeat steps 6 and 7. 10. In the left navigation, there will also be a 'recalls history' tab. Click it. There should be a log, similar to reading history, with the cancelled recall and the new recall in it. Confirm all information is correct 11. Again, test cancelling the recall. Repeat steps 6 and 7. 12. In the staff interface, go to the logged in user's checkouts. Confirm you can see a new Recalls tab, with the active (not cancelled) recall in the table. Should be the same for the details tab also. 13. Test cancelling works for both of these again, and making new recalls again. 14. Check in the recalled item. You should see a pop up, asking to confirm the recall as waiting. Click confirm. 15. Go to the Circulation main page. You should see 3 new reports: recalls queue, overdue recalls and recalls awaiting pickup 16. Go to the recalls queue, confirm you can see an entire history of recalls at your library. Confirm cancel works when selecting checkboxes and clicking the multiple button. If you do this, you'll need to place the recall again and check the item in again 17. Go to recalls awaiting pickup. You should see the recall under the recalls waiting tab 18. in Mysql, set the waitingdate for your recall to be more than 'recall pickup period' days or hours (depends on what is set in the circ rule (unit) field) before present 19. Refresh the recalls awaiting pickup page. You should see the recall under the recalls waiting tab, and the recalls waiting more than X days/hours tab. 20. expire the recall. confirm this is expired by checking the recalls queue 21. place another recall, but do not check it in 22. in mysql, set the date_due of the checkout (issues table) to be at least 'recall due date interval' number of days or hours before today's date 23. run the overdue_notices.pl cronjob 24. go to the overdue recalls circ report and confirm your recall shows there 25. try cancelling the recall here also 26. in mysql, check the message_queue and confirm there have been the appropriate number of RETURN_RECALLED_ITEM and PICKUP_RECALLED_ITEM notices sent with the correct to and from addresses and other content 27. test t/db_dependent/Koha/Recalls.t 28. place another recall and check it in 29. Try checking the recall out to a different patron and confirm you are not able to check out a waiting recall to a different patron - This tests point #1 above 30. Check the same item in again and observe that the recall modal is displayed again and is displayed every time the item is checked in until the item is checked out to the patron who placed the recall - This tests point #2 above 31. Check the item in again and select the 'Print slip and confirm' and confirm the RECALL_REQUESTER_DET notice can be printed - This tests point #3 above 32. place a recall on an item and try to renew the item and confirm you are unable to renew recalled items - This tests point #4 above 33. Return the same item and confirm in the OPAC and staff client that the item is not shown as available - This tests point #5 above 34. Place a recall to one borrower then reserve the same item to a different borrower. Check the item in and confirm the recall modal is displayed not the reserve modal as recalls take precedence - This tests point #6 above 35. In circ and fine rules set a rules 'Fine charge interval period'=1 36. Set the 'Unit' of the circ rule to 'hours', 'Recall due date interval' = 1, 'Recall overdue fine amount'=1, 'Recall pickup period'=1 37. Check out an item to borrower A and recall it in the OPAC by borrower B 38. In the database manually change the issues.date_due to 1 hour before the current time 39. From the Koha shell run './misc/cronjobs/fines.pl' 40. Notice the fine of 1 has been applied to the borrower for being 1 hour late in returning the recall 41. Return the item and confirm the recall. Manually change the waiting date to more than 1 hour before the current time and run ./misc/cronjobs/overdue_notices.pl 42. Notice the recall is overdue now - Steps 35-42 test point #7 above 43. Enable 'UseCourseReserves' syspref 44. Check out a course reserve item to a borrower 45. In the OPAC navigate to the course page containing the issued course reserve and confirm the page loads successfully 46. Recall a course reserve and confirm the recall is successfully placed 47. Check in the recalled course reserve and confirm the recall - This tests point #8 above Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Rebased and re-attached to this bug report. Can you please re-test? Created attachment 81595 [details] [review] Bug 19532: Fixes and enhancements to recalls This implements the following fixes and enhancements: * Stopping a waiting recall from being able to be checked out to patrons other than the patron who placed the recall * Make the Recall confirmation popup appear everytime a recalled item is put through returns until it is checked out to recall requester * Introduce a new notice RECALL_REQUESTER_DET which outlines borrower and item information so the item can be put aside * Stop recalled items from being renewed * Stop display of 'Available' for waiting recalls * Check if recalls exist on an item before checking for reserves * Added ability to set Recall due date interval, and Recall pickup period in hours * Fix the 'Template process error Koha::Item->avail_for_recall' thrown on course page where a course reserve is currently issued Test plan: 1. Repeat major test plan - verify all points 2. Place another recall and check it in 3. Try checking the recall out to a different patron and confirm you are not able to check out a waiting recall to a different patron 4. Check the same item in again and observe that the recall modal is displayed again and is displayed every time the item is checked in until the item is checked out to the patron who placed the recall 5. Check the item in again and select the 'Print slip and confirm' and confirm the RECALL_REQUESTER_DET notice can be printed 6. Place a recall on an item and try to renew the item and confirm you are unable to renew recalled items 7. Return the same item and confirm in the OPAC and staff client that the item is not shown as available 8. Place a recall to one borrower then reserve the same item to a different borrower. Check the item in and confirm the recall modal is displayed not the reserve modal as recalls take precedence 9. In circ and fine rules set a rules 'Fine charge interval period'=1 10. Set the 'Unit' of the circ rule to 'hours', 'Recall due date interval' = 1, 'Recall overdue fine amount'=1, 'Recall pickup period'=1 11. Check out an item to borrower A and recall it in the OPAC by borrower B 12. In the database manually change the issues.date_due to 1 hour before the current time 13. From the Koha shell run './misc/cronjobs/fines.pl' 14. Notice the fine of 1 has been applied to the borrower for being 1 hour late in returning the recall 15. Return the item and confirm the recall. Manually change the waiting date to more than 1 hour before the current time and run ./misc/cronjobs/overdue_notices.pl 16. Notice the recall is overdue now - Steps 9-16 test point #7 above 17. Enable 'UseCourseReserves' syspref 18. Check out a course reserve item to a borrower 19. In the OPAC navigate to the course page containing the issued course reserve and confirm the page loads successfully 20. Recall a course reserve and confirm recalls works for course reserves Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Applies now, thanks. Created attachment 81618 [details] [review] Bug 19532: (QA followup) Add missing TT filters I'm working on a number of QA followups.. to save the email spamming I'll upload the final set at the end of my work.. I'll be keeping a github branch updated with my work: https://github.com/colinsc/koha/compare/master...PTFS-Europe:bug_19532_recalls#diff-932a11a39c3f8c7127afb9c9a44318e7R349 Thanks Martin. I have added release notes to the bug report. Created attachment 81652 [details] [review] Bug 19532: Database updates Adding the recalls table and the old_recalls table. Sponsored-by: Catalyst IT Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81653 [details] [review] Bug 19532: Module files for Recall and OldRecall Koha/Recall.pm Koha/Recalls.pm Koha/Old/Recall.pm Koha/Old/Recalls.pm and the schema files for Recall and OldRecall. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81654 [details] [review] Bug 19532: Some DB fixes Removing the old_recalls table, as suggested in Comment 5 Renaming 'found' column to 'status' Adding 'old' column Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81655 [details] [review] Bug 19532: Some module fixes Removing files related to OldRecall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81656 [details] [review] Bug 19532: Circulation rules Adding 3 new rules and columns to issuingrules - recall_due_date_interval - recall_overdue_fine - recall_shelf_time Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81657 [details] [review] Bug 19532: Recall an item in OPAC This patch: - adds the 'Recall' button to the item on it's detail page - adds ability to place a recall - the recall is stored in the recalls table - the due date for the checkout is updated to whatever has been set in the issuing rule under recall_due_date_interval - error messages for if the user isn't logged in, the user tries to place a recall on an item they have already recalled, or if storing the recall in the db fails for any reason Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81658 [details] [review] Bug 19532: Cancel recall and see recalls in OPAC This patch adds ability for user to cancel a recall They can also see their recalls in the user summary Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81659 [details] [review] Bug 19532: Show recalls on intranet side This patch - adds Recall tab to the Check out section of member account, and to the Details section of member account - Functionality to cancel recalls on staff side - Fixing cancel on OPAC side (before I was deleting the whole recall instead of cancelling) - Fixing validation when checking whether a recall can be placed on an item that has been recalled by this borrower before. If the old recall is expired or cancelled then they can make a recall again. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81660 [details] [review] Bug 19532: Fixing broken OPAC recalls table Forgot to add <tr> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81661 [details] [review] Bug 19532: recalls history this patch - adds recalls history (similar to holds history) to OPAC and intranet - edits the tables in opac-user.pl (OPAC), moremember.pl and circulation.pl (staff) so that it only shows active recalls (recalls that have been requested or are waiting) - some extra datatables fixes Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81662 [details] [review] Bug 19532: Recalls queue This patch adds a recalls queue page to the circulation reports You can see all recalls made in the system, who requested them, their status and other relevant info. you can cancel individual or multiple recalls. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81663 [details] [review] Bug 19532: Overdue recalls report Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81664 [details] [review] Bug 19532: Recalls awaiting pickup report this patch adds reports for all recalls awaiting pickup, and recalls that have been waiting more than X days. a syspref, RecallsMaxPickUpDelay, is added to give a general max shelf time for recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81665 [details] [review] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81666 [details] [review] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81667 [details] [review] Bug 19532: Recall pop up when checking in an item When checking in an item on the staff side, the staff member will see a pop up if there is a recall attached to that item. From here, they can confirm the recall, setting the status to 'Waiting' and updating the waitingdate. The item will still be checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81668 [details] [review] Bug 19532: Send notice to user to return a recalled item When the recall is placed in the OPAC, a RETURN_RECALLED_ITEM notice is sent to the user who has the item checked out, with the updated due date. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81669 [details] [review] Bug 19532: Send notice to user to pickup recalled returned item Send a PICKUP_RECALLED_ITEM notice to the user who requested a recall when the item is checked in. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81670 [details] [review] Bug 19532: Flagging recall as 'old' when expired or cancelled Set 'old' flag to 1 if cancelling or expiring a recall Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81671 [details] [review] Bug 19532: Cronjob to check for overdue recalls This patch adds a check to the overdue_notices cronjob, so if any of the overdue issues are also recalls, the status will be set to O (overdue) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81672 [details] [review] Bug 19532: Tests for Koha/Recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81673 [details] [review] Bug 19532: Nice message if no recalls for opac recalls history https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81674 [details] [review] Bug 19532: POD fix, renaming methods Tomas's comments: - renaming 'Class methods' to 'internal methods' - renaming 'borrower' and 'branch' methods to 'patron' and 'library' other comments are out of date with current patches and do not need to be actioned when testing, confirm all data still shows as expected and nothing is broken Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81675 [details] [review] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81676 [details] [review] Bug 19532: Notices for recalls The notices: -RETURN_RECALLED_ITEM -PICKUP_RECALLED_ITEM have been created and added to sample_notices.sql Changed tools/letter.pl to use recalls table Added notices to translated installers https://bugs.koha-community.org/show_bug.cgi?id=19523 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81677 [details] [review] Bug 19532: Extra fixes from Comment 68 This patch fixes the following: The db uppdate tries to insert after 'notes' in issuing rules, but this doesn't exist When placing recall I always get a warning: <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> Cancelling recall from 'Recall history tab' doesn't work If patron has no recalls there is 'Patron has no current recalls' message at bottom of tabs on checkout and details tabs for patron When confirming a recall if the item is from another branch I get a transfer generated as well as confirming hold for recall Feature now checks if the recall branch is the same as the item holding branch when checking in item to determine if transfer is required On recalls awaiting pickup: need to update recall.borrower to recall.patron - causing internal server error When placing a recall - if I hit 'back' after confirming and confirm again I get a second recall on the same item Recalls queue should have waiting date information Recalls queue should have a way to hide cancelled, I would expect closed recalls to be hidden by default Recalls queue now hides old (cancelled/expired/finished) recalls by default and has a checkbox to toggle this When viewing a patrons account in the staff side we should see that a checkout has an active recall Checking out the recall doesn't seem to close the recall Added an 'F' status for finished/closed recalls Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Conflicts: Koha/Schema/Result/Borrower.pm Created attachment 81678 [details] [review] Bug 19532: (follow-up) Update characterset for recalls table Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 81679 [details] [review] Bug 19532: Improve and refine recalls functionality Only allow 1 recall per item When checking in only check for holds if no reserves found Add a T/transferring status for recalls, only confirm them once arrived Improve message when checking in recall Fix clashing ids on recall-history Check if patron can hold item before allowing recall Prevent multiple recalls when pressing back button Select/fill only active recall when issuing To test: 1 - Repeat major test plan - verify all points 2 - Attempt to place multiple recallsusing back button, should fail 3 - Set all item level holds to not allowed, should not be able to place recall 4 - Check-in recall at branch other than destination, should be in transit 5 - Confirm at correct branch, should send message and get expiration date etc. 6 - Return to another branch, should eb in transit again 7 - Play with circ rules and verify only allowed patrons can place recall Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Created attachment 81680 [details] [review] Bug 19532: Fixes and enhancements to recalls This implements the following fixes and enhancements: * Stopping a waiting recall from being able to be checked out to patrons other than the patron who placed the recall * Make the Recall confirmation popup appear everytime a recalled item is put through returns until it is checked out to recall requester * Introduce a new notice RECALL_REQUESTER_DET which outlines borrower and item information so the item can be put aside * Stop recalled items from being renewed * Stop display of 'Available' for waiting recalls * Check if recalls exist on an item before checking for reserves * Added ability to set Recall due date interval, and Recall pickup period in hours * Fix the 'Template process error Koha::Item->avail_for_recall' thrown on course page where a course reserve is currently issued Test plan: 1. Repeat major test plan - verify all points 2. Place another recall and check it in 3. Try checking the recall out to a different patron and confirm you are not able to check out a waiting recall to a different patron 4. Check the same item in again and observe that the recall modal is displayed again and is displayed every time the item is checked in until the item is checked out to the patron who placed the recall 5. Check the item in again and select the 'Print slip and confirm' and confirm the RECALL_REQUESTER_DET notice can be printed 6. Place a recall on an item and try to renew the item and confirm you are unable to renew recalled items 7. Return the same item and confirm in the OPAC and staff client that the item is not shown as available 8. Place a recall to one borrower then reserve the same item to a different borrower. Check the item in and confirm the recall modal is displayed not the reserve modal as recalls take precedence 9. In circ and fine rules set a rules 'Fine charge interval period'=1 10. Set the 'Unit' of the circ rule to 'hours', 'Recall due date interval' = 1, 'Recall overdue fine amount'=1, 'Recall pickup period'=1 11. Check out an item to borrower A and recall it in the OPAC by borrower B 12. In the database manually change the issues.date_due to 1 hour before the current time 13. From the Koha shell run './misc/cronjobs/fines.pl' 14. Notice the fine of 1 has been applied to the borrower for being 1 hour late in returning the recall 15. Return the item and confirm the recall. Manually change the waiting date to more than 1 hour before the current time and run ./misc/cronjobs/overdue_notices.pl 16. Notice the recall is overdue now - Steps 9-16 test point #7 above 17. Enable 'UseCourseReserves' syspref 18. Check out a course reserve item to a borrower 19. In the OPAC navigate to the course page containing the issued course reserve and confirm the page loads successfully 20. Recall a course reserve and confirm recalls works for course reserves Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Created attachment 81681 [details] [review] Bug 19532: (QA follow-up) Add missing TT filters Created attachment 81682 [details] [review] Bug 19532: (QA follow-up) Use Asset plugin for css Created attachment 81683 [details] [review] Bug 19532: (QA follow-up) Fix collation in kohastructure.sql I've uploaded an updated patchset with some simple followups added. However, I've got a few code review comments, and I've not got to the full testing of the feature itself yet. I don't think this is likely to be ready for 18.11 personally, but it would be good to get the groundwork done to get it in at the beginning of the next cycle. Review: This really feels like it should be built atop the existing Holds/Reserves system. Everyone I've spoken to, to date, has been really surprised that it appears to be an entirely distinct feature. It also feels like allot of code was borrowed from reserves, leading to repetition. Putting that aside for now, however: 1) Please update the POD for C4::Circulation::transferbook to state how the functionality has changed 2) There is commented out code in the above routine which looks as though it needs more thought 3) Shouldn't the librarian be able to override a recalls at checkout the same way they can override a reserve (based on sysprefs I believe) 4) Please document the recalls status codes somewhere 5) C4::Circulation::AddReturn - There are superfluous DB calls here I believe 6) Reserves/Holds take precedence over Recalls during renewal, is that deliberate (everywhere else it seems to be the opposite way around) 7) Superfluous `use Data::Dumper` in C4::Letters 8) I couldn't work out from the code how this affects fines.. only that is does 9) I don't understand why you've changed Koha/Patron.pm 10) Superfluous `use Data::Dumper` in catalogue/detail.pl 11) Why 3 distinct DB hits in catalogue/detail.pl 12) circ/recall-pickup-slip.pl appears to contain unused imports 13) circ/recalls_overdue.pl, circ/recalls_queue.pl, circ/recalls_waiting all have references to Fast Cataloguing.. not sure why 14) Why the mix of filenames with underscores and hyphens? 15) circ/returns.pl has commented out code, leaving the feeling that it needs further thought 16) atomicupdate .sql files should be converted to .perl and use the template. 17) Rebase issue has resulted in SR_SLIP being contained within many of the sql files 18) All JS should be pushed to the bottom of the file now as per recent(ish) guidelines.. I think this has partially been done, but some cases have been missed. Lots of little things.. now I need to fully test the feature to really get to grips with why it's entirely distinct from Reserves. I wish there was a full RFC we could see and a Work In Progress branch for updating the manual. I'm struggling to pick out the whole modus operandi of this patch as it's not what anyone here understands 'recalls' to be. Hopefully, we can keep this moving along.. sorry it's not all good news, but I am keen to help get it moving again. I work with a few sites that are very eager to be able to recall items. I wanted to check if there was any chance of some movement on this bug or if there is anything I can do to help with it? Hi Holly We have a few libraries that are using this recalls feature, plus many enhancements developed since. I will work on rebasing this throughout the year and catching master up to where our clients are at. Aleisha I will be working on this patch now. The current patches will be made obselete and fresh patches will be added over the next few weeks. A heads up - there will likely be lots of emails. Created attachment 103887 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls Created attachment 103888 [details] [review] Bug 19532: Updated schema files Including boolean attribute for recalls.old flag and recalls.item_level_recall flag Created attachment 103890 [details] [review] Bug 19532: Updated schema files Including boolean attribute for recalls.old flag and recalls.item_level_recall flag Created attachment 103899 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 103900 [details] [review] Bug 19532: Updated schema files Including boolean attribute for recalls.old flag and recalls.item_level_recall flag Created attachment 103901 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 103999 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104000 [details] [review] Bug 19532: Updated schema files Created attachment 104001 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104002 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104005 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104006 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104007 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104066 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104067 [details] [review] Bug 19532: Updated schema files Created attachment 104068 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104069 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104070 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104071 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104246 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104247 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104248 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104249 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls Recalls work with course reserves Created attachment 104250 [details] [review] Bug 19532: Recalls on intranet Created attachment 104322 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104323 [details] [review] Bug 19532: Updated schema files Created attachment 104324 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104325 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104326 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104327 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104328 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104329 [details] [review] Bug 19532: Recalls on intranet Created attachment 104330 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104331 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104332 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104333 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104334 [details] [review] Bug 19532: Recalls on intranet Created attachment 104335 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104336 [details] [review] Bug 19532: Recalls on intranet Created attachment 104391 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104392 [details] [review] Bug 19532: Updated schema files Created attachment 104393 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104394 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104395 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104396 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104397 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104398 [details] [review] Bug 19532: Recalls on intranet Created attachment 104474 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104475 [details] [review] Bug 19532: Updated schema files Created attachment 104476 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104477 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104478 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104479 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104480 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104481 [details] [review] Bug 19532: Recalls on intranet Created attachment 104545 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104546 [details] [review] Bug 19532: Updated schema files Created attachment 104547 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104548 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104549 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104550 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104551 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104552 [details] [review] Bug 19532: Recalls on intranet Created attachment 104646 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104647 [details] [review] Bug 19532: Updated schema files Created attachment 104648 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104649 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104650 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104651 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104652 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104653 [details] [review] Bug 19532: Recalls on intranet Created attachment 104722 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104723 [details] [review] Bug 19532: Updated schema files Created attachment 104724 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104725 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104726 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104727 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104728 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104729 [details] [review] Bug 19532: Recalls on intranet Created attachment 104806 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104807 [details] [review] Bug 19532: Updated schema files Created attachment 104808 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104809 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104810 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104811 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104812 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104813 [details] [review] Bug 19532: Recalls on intranet Created attachment 104814 [details] [review] Bug 19532: Database and installer stuff - recalls table - circulation rules: recalls allowed (total), recalls per record (count), on shelf recalls allowed, recall due date interval (day), recall overdue fine, recall shelf time/pickup period (day) - sysprefs: useRecalls, RecallsMaxPickUpDelay, RecallsLog - email notices: RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM, RECALL_REQUESTER_DET - user permission: recalls, manage_recalls - Recall and CancelRecall reasons for branch transfers Created attachment 104815 [details] [review] Bug 19532: Updated schema files Created attachment 104816 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104817 [details] [review] Bug 19532: Recalls objects and tests Getter and setter methods and other object methods for Koha Recalls, plus tests for these Created attachment 104818 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation plus tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104819 [details] [review] Bug 19532: Other objects used in recalls feature * biblio->recalls * biblio->can_be_recalled * item->recall * item->can_be_recalled * item->can_set_waiting_recall * patron->recalls * tests Created attachment 104820 [details] [review] Bug 19532: Recalls on OPAC Placing an item-level or biblio-level recall Viewing current and past recalls for logged-in patron Recall course reserve items Created attachment 104821 [details] [review] Bug 19532: Recalls on intranet Created attachment 104863 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 104864 [details] [review] Bug 19532: Updated schema files Created attachment 104865 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104866 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 104867 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104868 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 104869 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 104870 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, check in and set waiting, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, check in and set waiting, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, check in and set waiting, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, check in and set waiting, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, check in and set waiting, revert waiting status, mark overdue - log viewer and the general circulation of recalls Created attachment 104902 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Created attachment 104903 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 104904 [details] [review] Bug 19532: Updated schema files Created attachment 104905 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104906 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 104907 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104908 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 104909 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 104910 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Created attachment 104913 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 104914 [details] [review] Bug 19532: Updated schema files Created attachment 104915 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 104916 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 104917 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104918 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 104919 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 104920 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show that the status is revert to Requested without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Created attachment 104988 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 104989 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 104990 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 104991 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 104992 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Created attachment 106268 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 106269 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Created attachment 106371 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 106372 [details] [review] Bug 19532: Updated schema files Created attachment 106373 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 106374 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 106375 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 106376 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 106377 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 106378 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. I ran into a problem at step 70, checking in a recalled item which requires a transfer and clicking "confirm recall and transfer." The dialog disappears as expected but then I'm shown another modal, the regular transfer dialog which is shown when an item is checked in at the wrong branch. (In reply to Owen Leonard from comment #498) > I ran into a problem at step 70, checking in a recalled item which requires > a transfer and clicking "confirm recall and transfer." The dialog disappears > as expected but then I'm shown another modal, the regular transfer dialog > which is shown when an item is checked in at the wrong branch. Hey Owen, I am seeing this problem too but for some reason I'm really struggling with not getting that second dialog to pop up, and to hide to 'Item not checked out' alert box behind the modals. Do you have any ideas? All the code to look at is in C4/Circulation.pm in AddReturn, or in circ/returns.pl. Created attachment 106810 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 106811 [details] [review] Bug 19532: Updated schema files Created attachment 106812 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 106813 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 106814 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 106815 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 106816 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 106817 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. Created attachment 106857 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. (In reply to Owen Leonard from comment #498) > I ran into a problem at step 70, checking in a recalled item which requires > a transfer and clicking "confirm recall and transfer." The dialog disappears > as expected but then I'm shown another modal, the regular transfer dialog > which is shown when an item is checked in at the wrong branch. Believe I've fixed this, should be good to test. Okay, I've made it through the whole test plan (whew!) and ran into a couple more issues: 1. Checking in an item which has a recall, I click "confirm." Check it in again, click "confirm," and I get an error: Can't call method "itemnumber" on an undefined value at /kohadevbox/koha/Koha/Recall.pm line 348 2. I picked a title with two items and checked each one out to different patrons. I then placed a couple of holds on bibliographic record. Then I requested a biblio-level recall on the title. When I check in one of the items and confirm the recall I get an error: Can't call method "unblessed" on an undefined value at /kohadevbox/koha/Koha/Recall.pm line 266. If I check it in again I get two modal dialogs: One for the recall and one for the hold. Created attachment 107198 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 107199 [details] [review] Bug 19532: Updated schema files Created attachment 107200 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 107201 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 107202 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 107203 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 107204 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 107205 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. (In reply to Owen Leonard from comment #510) > Okay, I've made it through the whole test plan (whew!) and ran into a couple > more issues: > > 1. Checking in an item which has a recall, I click "confirm." Check it in > again, click "confirm," and I get an error: > > Can't call method "itemnumber" on an undefined value > at /kohadevbox/koha/Koha/Recall.pm line 348 > > 2. I picked a title with two items and checked each one out to different > patrons. I then placed a couple of holds on bibliographic record. Then I > requested a biblio-level recall on the title. When I check in one of the > items and confirm the recall I get an error: > > Can't call method "unblessed" on an undefined value at > /kohadevbox/koha/Koha/Recall.pm line 266. > > If I check it in again I get two modal dialogs: One for the recall and one > for the hold. Thank you for testing Owen, I've now fixed these problems. Ready to test. Created attachment 107807 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 107808 [details] [review] Bug 19532: Updated schema files Created attachment 107809 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 107810 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 107811 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 107812 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 107813 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 107814 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. Some work should be done according to QA tools: C4/Circulation.pm FAIL critic # Variables::ProhibitConditionalDeclarations: Got 2 violation(s). C4/Overdues.pm FAIL critic # Variables::ProhibitConditionalDeclarations: Got 1 violation(s). koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.ttforbidden pattern: Attribute type should not be used for script tags (bug 20053) (line 158) koha-tmpl/intranet-tmpl/prog/js/recalls.js Untranslatable string found (Are you sure you want to remove this recall?) - See coding guideline JS5 Untranslatable string found (The recall may have already been cancelled. Please refresh the page.) - See coding guideline JS5 Untranslatable string found (Cancelled) - See coding guideline JS5 Untranslatable string found (Are you sure you want to expire this recall?) - See coding guideline JS5 Untranslatable string found (The recall may have already been expired. Please refresh the page.) - See coding guideline JS5 Untranslatable string found (Expired) - See coding guideline JS5 Untranslatable string found (Are you sure you want to revert the waiting status of this recall?) - See coding guideline JS5 Untranslatable string found (The recall waiting status may have already been reverted. Please refresh the page.) - See coding guideline JS5 Untranslatable string found (Status updated) - See coding guideline JS5 Untranslatable string found (Are you sure you want to mark this recall as overdue?) - See coding guideline JS5 Untranslatable string found (The recall may have already been marked as overdue. Please refresh the page.) - See coding guideline JS5 Untranslatable string found (Marked overdue) - See coding guideline JS5 Untranslatable string found (Are you sure you want to remove this recall and return the item to it's home library?) - See coding guideline JS5 Untranslatable string found (The recall may have already been removed. Please refresh the page.) - See coding guideline JS5 Untranslatable string found (Cancelled) - See coding guideline JS5 Untranslatable string found (Are you sure you want to remove the selected recall(s)?) - See coding guideline JS5 Untranslatable string found (Please make a selection.) - See coding guideline JS5 misc/cronjobs/recalls/expire_recalls.pl Code before strictures are enabled at line 20, column 1. See page 429 of PBP. misc/cronjobs/recalls/overdue_recalls.pl Code before strictures are enabled at line 20, column 1. See page 429 of PBP. svc/checkouts # Variables::ProhibitConditionalDeclarations: Got 1 violation(s). Created attachment 107918 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 107919 [details] [review] Bug 19532: Updated schema files Created attachment 107920 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 107921 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 107922 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 107923 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 107924 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 107925 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. (In reply to Marcel de Rooy from comment #528) > Some work should be done according to QA tools: Believe these are all fixed. Ready to test. Created attachment 108222 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 108223 [details] [review] Bug 19532: Updated schema files Created attachment 108224 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 108225 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 108226 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 108227 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 108228 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 108229 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. Created attachment 108980 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 108981 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 108982 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. Rebased "Other objects used in recalls feature" t/db_dependent/Koha/Recall.t .. Variable "@items" is not imported at /usr/share/koha/Koha/Biblio.pm line 856. (Did you mean &items instead?) Global symbol "@items" requires explicit package name (did you forget to declare "my @items"?) at /usr/share/koha/Koha/Biblio.pm line 856. Same for t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t Well etc. Created attachment 109306 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 109307 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 109308 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 109309 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 109310 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. Created attachment 109311 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 109312 [details] [review] Bug 19532: Updated schema files Created attachment 109313 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 109314 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 109315 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 109316 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 109317 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 109318 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. This did not apply for me. :( Created attachment 109463 [details] [review] Bug 19532: Updated schema files Created attachment 109464 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 109465 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 109466 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 109467 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 109468 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 109469 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. I get an error when I click "Print slip and confirm" on a checked-in recall. The URL in the location bar is: /cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id= The error is: Can't call method "itemnumber" on an undefined value at /kohadevbox/koha/recalls/recall_pickup_slip.pl line 42 When I check out the recalled item to the patron who requested it the recall is not cleared. It still shows up under the "Recalls" tab on the patrons account, saying "Ready for pickup." When I run "perl misc/cronjobs/recalls/expire_recalls.pl" it doesn't seem to do anything :( Created attachment 109775 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 109776 [details] [review] Bug 19532: Updated schema files Created attachment 109777 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 109778 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 109779 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 109780 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 109781 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 109782 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. Created attachment 109783 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 109784 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 109785 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. (In reply to Owen Leonard from comment #573) > I get an error when I click "Print slip and confirm" on a checked-in recall. > The URL in the location bar is: > > /cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id= > > The error is: > > Can't call method "itemnumber" on an undefined value at > /kohadevbox/koha/recalls/recall_pickup_slip.pl line 42 > > When I check out the recalled item to the patron who requested it the recall > is not cleared. It still shows up under the "Recalls" tab on the patrons > account, saying "Ready for pickup." > > When I run "perl misc/cronjobs/recalls/expire_recalls.pl" it doesn't seem to > do anything :( Hi Owen, thanks for testing. I have fixed the first two errors, however the expire_recalls.pl cronjob seems to work as expected for me. Perhaps check that the expiration date is set to before today (you'll need to adjust in the db manually) and try running? I believe this is good to test. Hi Aleisha, this is a really exciting feature that I'm looking forward to testing! I think there must have been some changes to the schema recently because I'm getting a merge conflict when I try and apply the Updated schema files patch. Applying: Bug 19532: Updated schema files Using index info to reconstruct a base tree... M Koha/Schema/Result/Branch.pm M Koha/Schema/Result/Item.pm Falling back to patching base and 3-way merge... Auto-merging Koha/Schema/Result/Item.pm CONFLICT (content): Merge conflict in Koha/Schema/Result/Item.pm Auto-merging Koha/Schema/Result/Branch.pm CONFLICT (content): Merge conflict in Koha/Schema/Result/Branch.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 19532: Updated schema files Created attachment 111199 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 111200 [details] [review] Bug 19532: Updated schema files Created attachment 111201 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 111202 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 111203 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 111204 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 111205 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 111206 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. After applying the patches, I'm getting an error trace page when viewing some patron pages: "The method Koha::Patron->recalls is not covered by tests!" This happens when I navigate to a patron on cgi-bin/koha/members/moremember.pl and cgi-bin/koha/circ/circulation.pl I thought this was possibly something I'd set up incorrectly in Koha Testing docker but I'm getting the same error with the sandboxes. On KTD the value for Confirm RecallsMaxPickUpDelay was empty rather than 7 but on the sandboxes it was set to 7 by default as expected. When I ran the tests on KTD I also got some errors: FAIL Koha/Schema/Result/Recall.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 FAIL koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc FAIL forbidden patterns forbidden pattern: Font Awesome icons need the aria-hidden attribute for accessibility purpose (see bug 25166) (line 15) There were also several instances of this error: FAIL forbidden patterns forbidden pattern: Script permissions is authnotrequired => 0, it could be correct for an OPAC script if it is was you really want error (bug 24663) (line 30) Created attachment 112316 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 112317 [details] [review] Bug 19532: Updated schema files Created attachment 112321 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 112322 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 112323 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 112324 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 112325 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 112326 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. Created attachment 112346 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Created attachment 112472 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Created attachment 112491 [details] Screenshots - Your account screens display issues for recalls (2020-10-26) Hi Aleisha. I've got to the end of step 65 so far, and here are the two items I've noticed: 1. In the OPAC under your account, the your recalls history pages don't display correctly. The menu options under your account take up the whole width of the screen, and the your recalls history lists, forms and messages appear at the bottom of the page. I've attached screenshots so you can see what Imean. 2. When setting up an item for a course reserve (steps 33-36) an error occurs when listing items for a course reserve in the staff interface. I've created bug 26819 for this as it occurs on master before the recalls patches are applied, but does not occur on 20.05.x. An item is actually added to the course reserve, and you can view it in the OPAC to successfully complete these steps. The good news is that all the tests now pass (apart from the one false positive when running the qa scripts). David Created attachment 112540 [details]
Error trace - step 84 - circulation - recalls to pull
Hi Aleisha.
I'm now up to step 136, and here are two additional things noted:
- Step 84: Circulation > Recalls to pull - get error trace when I try to access the page (file with error trace attached)
- Step 118: had to use UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; (using MariaDb, so not sure if this makes a difference).
- I can't seem to get Circulation to work as expected (steps 137-149). I will have another go.
. Step 143: the item is not renewable, but I can't see a "Recalled link".
. Step 145: recall is not cancelled, and remains checked out.
David
Created attachment 112612 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 112613 [details] [review] Bug 19532: Updated schema files Created attachment 112614 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 112615 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 112616 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 112617 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 112618 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 112619 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls Test plan in Comment 482. Created attachment 112620 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Created attachment 112621 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Created attachment 112622 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Thanks so much for your detailed comments David! (In reply to David Nind from comment #606) > 1. In the OPAC under your account, the your recalls history pages don't > display correctly. The menu options under your account take up the whole > width of the screen, and the your recalls history lists, forms and messages > appear at the bottom of the page. I've attached screenshots so you can see > what Imean. fixed > > 2. When setting up an item for a course reserve (steps 33-36) an error > occurs when listing items for a course reserve in the staff interface. I've > created bug 26819 for this as it occurs on master before the recalls patches > are applied, but does not occur on 20.05.x. An item is actually added to the > course reserve, and you can view it in the OPAC to successfully complete > these steps. I couldn't reproduce this problem but even so, I guess this is not a problem with Bug 19532 and there's nothing for me to do here. > - Step 84: Circulation > Recalls to pull - get error trace when I try to > access the page (file with error trace attached) fixed > > - Step 118: had to use UPDATE recalls SET waitingdate = NOW() - interval 5 > day WHERE recall_id = X; (using MariaDb, so not sure if this makes a > difference). yes good catch, the query I provided in the test plan doesn't work. please use this one instead! > > - I can't seem to get Circulation to work as expected (steps 137-149). I > will have another go. > . Step 143: the item is not renewable, but I can't see a "Recalled link". > . Step 145: recall is not cancelled, and remains checked out. both fixed Thanks Aleisha! I haven't gone through the whole test plan again, but this seems to have resolved things. However, when retesting BIBLIO-LEVEL RECALL, TRANSFER REQUIRED (steps 66-89) I can't seem to get the basic recall working properly - after checking out to Borrower A it is still showing as ready for pickup on the recall tab: 1. Check out Item A to Borrower B. 2. Log in to the OPAC as Borrower A. 3. Find Biblio A and place a biblio-level recall. 4. Item A checked in and recall confirmed - shows as ready for pickup. 5. After checking out Item A to Borrower A to fullfill the recall it is showing as: - OPAC for biblio: Checked out + On hold for Item A - your summary - checked out tab: message showing "The item has been recalled. Please return by the new due date." - your summary - recalls tab: showing as Ready for pickup - staff interface > patron account for Borrower A: item checked out to Borrower A under checkouts tab, recall showing as ready for pickup under recalls tab - still shows as ready for pickup under recalls queue and recalls awaiting pickup David > 2. Run database updates, update schema files and confirm everything applies cleanly
"update schema files" => the dbic command right?
No diff after running, is that expected?
Since last master pushes, patches don't applies anymore.
That's right - run the dbic command (if using koha-testing-docker). There were changes. Created attachment 113195 [details] [review] Bug 19532: Updated schema files Created attachment 113196 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 113197 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 113198 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 113199 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 113200 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 113201 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show that the status is revert to Requested without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Created attachment 113202 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Created attachment 113203 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Created attachment 113204 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Created attachment 113205 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Thanks David and Victor, I have rebased and fixed the bug that David mentioned, ready again for testing Hi Aleisha. I went through the test plan again, ran the tests, and ran the qa scripts. 1. Test plan: there is only one minor item that isn't working as expected - I noted previously, but didn't report it. I think it is pretty minor, so could wait. Step 58. Need to refresh the page to see the change in status (from ready for pickup TO Requested). 2. Tests: one test fails for prove -v t/db_dependent/Koha/Recalls.t not ok 19 - Recall fulfilled with move_recall # Failed test 'Recall fulfilled with move_recall' # at t/db_dependent/Koha/Recalls.t line 173. # Looks like you failed 1 test of 19. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/19 subtests Test Summary Report ------------------- t/db_dependent/Koha/Recalls.t (Wstat: 256 Tests: 19 Failed: 1) Failed test: 19 Non-zero exit status: 1 Files=1, Tests=19, 3 wallclock secs ( 0.02 usr 0.01 sys + 2.75 cusr 0.26 csys = 3.04 CPU) Result: FAIL 3. QA scripts: I ran the qa scripts (not something I normally do) I've put the output from the test fail and qa output here: http://paste.koha-community.org/26033 David Created attachment 113286 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Created attachment 113287 [details] [review] Bug 19532: Updated schema files Created attachment 113288 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Created attachment 113289 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Created attachment 113290 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Created attachment 113291 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Created attachment 113292 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Created attachment 113293 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Created attachment 113294 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Created attachment 113295 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Created attachment 113296 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Created attachment 113297 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Created attachment 113298 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer I am sorry Aleisha, this one missed the line for 20.11. Hi Aleisha. I was too slow 8-(... Hopefully 21.05! All the tests now pass! However, when I go to Administration > Patrons and circulation > Circulation and fines rules (after applying the patches, database update, dbic, and restart_all) I now get a trace error, which starts with: Could not compile /kohadevbox/koha/admin/smart-rules.pl: syntax error at /kohadevbox/koha/admin/smart-rules.pl line 343, near ">>" Global symbol "$bor" requires explicit package name (did you forget to declare "my $bor"?) at /kohadevbox/koha/admin/smart-rules.pl line 348. Global symbol "$bor" requires explicit package name (did you forget to declare "my $bor"?) at /kohadevbox/koha/admin/smart-rules.pl line 348. Global symbol "$itemtype" requires explicit package name (did you forget to declare "my $itemtype"?) at /kohadevbox/koha/admin/smart-rules.pl line 349. Global symbol "$itemtype" requires explicit package name (did you forget to declare "my $itemtype"?) at /kohadevbox/koha/admin/smart-rules.pl line 349. Global symbol "$br" requires explicit package name (did you forget to declare "my $br"?) at /kohadevbox/koha/admin/smart-rules.pl line 350. Global symbol "$br" requires explicit package name (did you forget to declare "my $br"?) at /kohadevbox/koha/admin/smart-rules.pl line 350. Global symbol "$rules" requires explicit package name (did you forget to declare "my $rules"?) at /kohadevbox/koha/admin/smart-rules.pl line 351. syntax error at /kohadevbox/koha/admin/smart-rules.pl line 356, near "elsif" Can't redeclare "my" in "my" at /kohadevbox/koha/admin/smart-rules.pl line 358, near "" /kohadevbox/koha/admin/smart-rules.pl has too many errors. at /usr/share/perl5/CGI/Compile.pm line 132 in CGI::Compile::compile at /usr/share/perl5/CGI/Compile.pm line 132 129: my $code = $self->_eval($eval); 130: my $exception = $@; 131: 132: die "Could not compile $script: $exception" if $exception; 133: 134: sub { 135: my @args = @_; There is also a QA fail: ... OK Makefile.PL FAIL admin/smart-rules.pl FAIL valid Number found where operator expected (Do you need to predeclare Bug?) "my" variable $input masks earlier declaration in same scope syntax error Global symbol "$bor" requires explicit package name (did you forget to declare "my $bor"?) Global symbol "$bor" requires explicit package name (did you forget to declare "my $bor"?) Global symbol "$itemtype" requires explicit package name (did you forget to declare "my $itemtype"?) Global symbol "$itemtype" requires explicit package name (did you forget to declare "my $itemtype"?) Global symbol "$br" requires explicit package name (did you forget to declare "my $br"?) Global symbol "$br" requires explicit package name (did you forget to declare "my $br"?) Global symbol "$rules" requires explicit package name (did you forget to declare "my $rules"?) syntax error Can't redeclare "my" in "my" admin/smart-rules.pl has too many errors. OK catalogue/detail.pl ... David Created attachment 113335 [details] [review] Bug 19532: (follow-up) Remove bad merge conflict markers Created attachment 113351 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Created attachment 113352 [details] [review] Bug 19532: Updated schema files Signed-off-by: David Nind <david@davidnind.com> Created attachment 113353 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 113354 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Created attachment 113355 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 113356 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 113357 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Created attachment 113358 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Created attachment 113359 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Created attachment 113361 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Created attachment 113362 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Created attachment 113363 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 113364 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Created attachment 113365 [details] [review] Bug 19532: (follow-up) Remove bad merge conflict markers Signed-off-by: David Nind <david@davidnind.com> My notes from testing. Tests and qa script ~~~~~~~~~~~~~~~~~~~ All tests pass! prove t/db_dependent/Koha/Recall.t prove t/db_dependent/Koha/Recalls.t prove t/db_dependent/Stats.t prove t/db_dependent/Koha/Item.t prove t/db_dependent/Koha/Biblio.t prove t/db_dependent/Koha/Patron.t prove t/db_dependent/XSLT.t prove t/db_dependent/Search.t prove t/db_dependent/Holds.t prove t/db_dependent/Circulation/transferbook.t prove t/db_dependent/Circulation.t prove t/db_dependent/Circulation/CalcFine.t The only QA script error (qa -v 2) is a false positive accoriding to kidclamp: http://irc.koha-community.org/koha/2020-10-24#i_2300062 FAIL Koha/Schema/Result/Recall.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 Accounts and records used ~~~~~~~~~~~~~~~~~~~~~~~~~ Borrower A (created as new): My Name, 12345, myname, Policy10 Borrower B (login and password changed for Henry): henry, Policy10 Biblio A: - Record with two items - Effective perl programming (139, items 296 (Item A) and 297 (Item C)) - Barcodes: Item A 39999000005776 and Item B 39999000005790 Biblio B: - Record with at least one item - Lady Susan ; The Watsons ; Sanditon (283, item 627 (Item C)) - Barcode: Item C 39999000012392 Branch A: Centerville Branch B: Midway Clarification/notes for specific steps of the test plan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ See Comment #659 for the full test plan. 33-36. Note that when placing a course reserve you get an error when listing items for a course in the staff interface - bug 26819 was created, this problem existed on master before the recalls patches were applied but does not occur on 20.05.x. 45. Clarification: need to check Item C out to a patron before placing the recall. 111: UPDATE recalls SET expirationdate = NOW() - interval 2 day WHERE recall_id = X; 127: UPDATE recalls SET waitingdate = NOW() - interval 2 day WHERE recall_id = X; 133: UPDATE issues SET date_due = NOW() - interval 2 day WHERE issue_id = X; 134: Script path should be recalls (not recall): perl misc/cronjobs/recalls/overdue_recalls.pl 150: UPDATE issues SET date_due = NOW() - interval 2 day WHERE issue_id = X; Thank you so much for such thorough testing, David! Created attachment 113430 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Created attachment 113431 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Created attachment 113432 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Created attachment 113433 [details] [review] Bug 19532: Updated schema files Signed-off-by: David Nind <david@davidnind.com> Created attachment 113434 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 113435 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Created attachment 113436 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 113437 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 113438 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Created attachment 113439 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Created attachment 113440 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Created attachment 113441 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Created attachment 113442 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Created attachment 113443 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 113444 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Created attachment 113445 [details] [review] Bug 19532: (follow-up) Remove bad merge conflict markers Signed-off-by: David Nind <david@davidnind.com> Rebase done for running the test suite passes, it passes :) This must be very frustrating, but PNA Created attachment 116121 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Created attachment 116122 [details] [review] Bug 19532: Updated schema files Created attachment 116123 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 116124 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Created attachment 116125 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 116126 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 116127 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Created attachment 116128 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Created attachment 116129 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Created attachment 116130 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Created attachment 116131 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Created attachment 116132 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 116133 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Created attachment 116134 [details] [review] Bug 19532: (follow-up) Remove bad merge conflict markers Signed-off-by: David Nind <david@davidnind.com> Switching back to Signed Off as was the status before recent rebasing. Created attachment 118267 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Created attachment 118268 [details] [review] Bug 19532: Updated schema files Created attachment 118269 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 118270 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Created attachment 118271 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 118272 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 118273 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Created attachment 118274 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Created attachment 118275 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Created attachment 118276 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Created attachment 118277 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Created attachment 118278 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 118279 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Created attachment 118280 [details] [review] Bug 19532: (follow-up) Remove bad merge conflict markers Signed-off-by: David Nind <david@davidnind.com> Notices and DB update conflicts Created attachment 122993 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Created attachment 122994 [details] [review] Bug 19532: Updated schema files Created attachment 122995 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 122996 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Created attachment 122997 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 122998 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 122999 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Created attachment 123000 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Created attachment 123001 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Created attachment 123002 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Created attachment 123003 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Created attachment 123004 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 123005 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Hi Aleisha. Patches no longer apply 8-(... Note: I will make it a priority for me to review and sign-off once it applies again. It would be nice to get all your hard work into master (finally!). Applying: Bug 19532: Database and installer stuff Using index info to reconstruct a base tree... M C4/Auth.pm M Koha/CirculationRules.pm M Makefile.PL M admin/smart-rules.pl M installer/data/mysql/en/mandatory/sample_notices.yml A installer/data/mysql/fr-CA/obligatoire/sample_notices.sql M installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql M installer/data/mysql/kohastructure.sql M installer/data/mysql/mandatory/sysprefs.sql M installer/data/mysql/mandatory/userpermissions.sql A installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql M koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc M koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref M koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref M koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc CONFLICT (modify/delete): installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql deleted in HEAD and modified in Bug 19532: Database and installer stuff. Version Bug 19532: Database and installer stuff of installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql left in tree. Auto-merging installer/data/mysql/mandatory/userpermissions.sql Auto-merging installer/data/mysql/mandatory/sysprefs.sql Auto-merging installer/data/mysql/kohastructure.sql Auto-merging installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql CONFLICT (content): Merge conflict in installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql CONFLICT (modify/delete): installer/data/mysql/fr-CA/obligatoire/sample_notices.sql deleted in HEAD and modified in Bug 19532: Database and installer stuff. Version Bug 19532: Database and installer stuff of installer/data/mysql/fr-CA/obligatoire/sample_notices.sql left in tree. Auto-merging installer/data/mysql/en/mandatory/sample_notices.yml Auto-merging admin/smart-rules.pl Auto-merging Makefile.PL Auto-merging Koha/CirculationRules.pm Auto-merging C4/Auth.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 19532: Database and installer stuff Created attachment 126244 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Created attachment 126245 [details] [review] Bug 19532: Updated schema files Created attachment 126246 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 126247 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Created attachment 126248 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 126249 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Created attachment 126250 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Created attachment 126251 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Created attachment 126252 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Created attachment 126253 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Created attachment 126254 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Created attachment 126255 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 126256 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Created attachment 126257 [details] [review] Bug 19532: (follow-up) Fix calls and syspref settings Hi Aleisha. I started around Friday, but didn't get very far... From what I can recall (pun intended!), these tests failed: prove t/db_dependent/Koha/Recall.t prove t/db_dependent/Koha/Recalls.t Today (Monday), the patch no longer applies: Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 19532: Database and installer stuff Applying: Bug 19532: Updated schema files Applying: Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Applying: Bug 19532: Recalls objects and tests Applying: Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation Applying: Bug 19532: Other objects used in recalls feature Applying: Bug 19532: Recalls on OPAC Applying: Bug 19532: Recalls on intranet Using index info to reconstruct a base tree... M circ/circulation.pl M koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt Auto-merging circ/circulation.pl error: Failed to merge in the changes. Patch failed at 0001 Bug 19532: Recalls on intranet Created attachment 126453 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Created attachment 126454 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Created attachment 126455 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Created attachment 126456 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Created attachment 126457 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Created attachment 126458 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Created attachment 126459 [details] [review] Bug 19532: (follow-up) Fix calls and syspref settings Created attachment 126460 [details] [review] Bug 19532: (follow-up) Fixing tests Thanks Aleisha! Patches now apply and tests all pass - on with going through the test plan.... David Fingers crossed! Created attachment 126469 [details] [review] Bug 19532: (follow-up) Fixing tests and can_be_recalled checks Created attachment 126470 [details] [review] Bug 19532: (follow-up) Fixing tests and can_be_recalled checks Hi Aleisha, I finally finished running through the test plan! Two items where I had issues: 1. Steps 61 + 100: I get an error trace when accessing Circulation > Recalls awaiting pickup (http://127.0.0.1:8081/cgi-bin/koha/recalls/recalls_waiting.pl), see partial details below. 2. Error when running expiry cronjob (perl misc/cronjobs/recalls/expire_recalls.pl): . Step 112: - Undefined subroutine &main::dt_from_string called at misc/cronjobs/recalls/expire_recalls.pl line 42. - Recall not expired - still showing as 'Requested' . Step 118: - Undefined subroutine &main::dt_from_string called at misc/cronjobs/recalls/expire_recalls.pl line 53. - Recall not expired - still showing as 'Ready for pickup' . Step 128: - Undefined subroutine &main::dt_from_string called at misc/cronjobs/recalls/expire_recalls.pl line 53. - Recall not expired - still showing as 'Ready for pickup' David Error trace - recalls_waiting.pl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_recalls_recalls_waiting_2epl::dt_from_string called at /kohadevbox/koha/recalls/recalls_waiting.pl line 58 in (eval) at /kohadevbox/koha/recalls/recalls_waiting.pl line 58 55: my $borrower = Koha::Patrons->find( $loggedinuser ); 56: my @over; 57: my $maxdelay = C4::Context->preference('RecallsMaxPickUpDelay') || 7; 58: my $today = dt_from_string(); 59: foreach my $r ( @recalls ){ 60: my $lastwaitingday = dt_from_string( $r->waitingdate )->add( days => $maxdelay ); 61: if ( $today > $lastwaitingday ){ in CGI::Compile::ROOT::kohadevbox_koha_recalls_recalls_waiting_2epl::__ANON__ at /kohadevbox/koha/recalls/recalls_waiting.pl line 2 1: #!/usr/bin/perl 2: 3: # Copyright 2020 Aleisha Amohia <aleisha@catalyst.net.nz> 4: # 5: # This file is part of Koha. Show function arguments in CGI::Compile::ROOT::kohadevbox_koha_recalls_recalls_waiting_2epl::recalls_waiting_2epl at /usr/share/perl5/CGI/Compile.pm line 151 148: # this is necessary for MSWin32 149: my $orig_warn = $SIG{__WARN__} || sub { warn(@_) }; 150: local $SIG{__WARN__} = sub { $orig_warn->(@_) unless $_[0] =~ /^No such signal/ }; 151: $code->($self, $data, $path, $dir, \@args) 152: }; 153: }; 154: in CGI::Emulate::PSGI::__ANON__ at /usr/share/perl5/CGI/Emulate/PSGI.pm line 30 27: local *STDOUT = $stdout; 28: local *STDERR = $env->{'psgi.errors'}; 29: 30: $code->(); 31: } 32: } 33: .... Notes for myself - SQL queries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Step 111: SQL should be: UPDATE recalls SET expirationdate = NOW() - interval 2 day WHERE recall_id = X; - Step 127: SQL should be: UPDATE recalls SET waitingdate = NOW() - interval 2 day WHERE recall_id = X; - Step 133: SQL should be: UPDATE issues SET date_due = NOW() - interval 2 day WHERE issue_id = X; - Step 134: Script path should be recalls (not recall): perl misc/cronjobs/recalls/overdue_recalls.pl - Step 150: SQL should be: UPDATE issues SET date_due = NOW() - interval 2 day WHERE issue_id = X; Created attachment 126565 [details] [review] Bug 19532: (follow-up) Fix calls, tests, syspref settings, checks (In reply to David Nind from comment #757) > Hi Aleisha, I finally finished running through the test plan! > > Two items where I had issues: > Thanks David, I've attached a commit that hopefully fixes these! Created attachment 126566 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126568 [details] [review] Bug 19532: Updated schema files Signed-off-by: David Nind <david@davidnind.com> Created attachment 126569 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126570 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126571 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126572 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126573 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126574 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126575 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126576 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126577 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126578 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126579 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 126580 [details] [review] Bug 19532: (follow-up) Fix calls, tests, syspref settings, checks Signed-off-by: David Nind <david@davidnind.com> The many-to-many relationship 'ordernumbers' is trying to create a utility method called set_ordernumbers. This will completely overwrite one such already existing method on class Koha::Schema::Result::Borrower. FAIL C4/InstallAuth.pm FAIL pod *** WARNING: line containing nothing but whitespace in paragraph in file C4/InstallAuth.pm Having (serious) doubts if we should add these methods to the plural object: + my ( $recall, $due_interval, $due_date ) = Koha::Recalls->add_recall({ + patron => $patron_object, + biblio => $biblio_object, + branchcode => $branchcode, + item => $item_object, + expirationdate => $expirationdate, + interface => 'OPAC', + }); +=head3 move_recall + + my $message = Koha::Recalls->move_recall({ + recall_id = $recall_id, + action => $action, + itemnumber => $itemnumber, + borrowernumber => $borrowernumber, + }); Koha/Recall.pm | 476 ++++++++++++++++++++++++++++++++++ Koha/Recalls.pm | 212 +++++++++++++++ Koha/Schema/Result/Recall.pm | 38 +++ Dont put Schema files in a regular patch please! Forbidden! XSLT module + if ( $recalls->count ) { + # recalls take priority over holds + $status = 'Waiting'; + } Hmm. Are we lifting here on a hold status and report things like that in the opac results ? FAIL Koha/Recall.pm FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use Koha/Recall.pm had compilation errors. FAIL Koha/Recalls.pm FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use Compilation failed in require FAIL t/db_dependent/Koha/Recall.t FAIL file permissions File must have the exec flag FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use t/db_dependent/Koha/Recall.t had compilation errors. FAIL t/db_dependent/Koha/Recalls.t FAIL file permissions File must have the exec flag FAIL C4/Overdues.pm FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use FAIL misc/cronjobs/recalls/expire_recalls.pl FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use Compilation failed in require Compilation failed in require BEGIN failed--compilation aborted FAIL misc/cronjobs/recalls/overdue_recalls.pl FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use FAIL t/db_dependent/Circulation/CalcFine.t FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use FAIL koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc FAIL forbidden patterns forbidden pattern: Font Awesome icons need the aria-hidden attribute for accessibility purpose (see bug 25166) (line 15) FAIL valid_template Attempt to reload Koha/Template/Plugin/Biblio.pm aborted. Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.28/Template/Plugins.pm line 206. FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt OK filters FAIL forbidden patterns forbidden pattern: Don't use the title-string class for sorting (bug 27934) (line 33) FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt OK filters FAIL forbidden patterns forbidden pattern: Don't use the title-string class for sorting (bug 27934) (line 777) FAIL opac/opac-recall.pl FAIL critic Subroutine "new" called using indirect syntax at line 26, column 13. See page 349 of PBP. FAIL forbidden patterns forbidden pattern: Script permissions is authnotrequired => 0, it could be correct for an OPAC script if it is was you really want error (bug 24663) (line 32) FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use I planned to run qa tools on every patch. But I would recommend that you would have done the same. It is just too much.. So just pasting the last few, and leaving it there. FAIL svc/recall FAIL critic Subroutine "new" called using indirect syntax at line 30, column 13. See page 349 of PBP. OK file permissions OK forbidden patterns OK git manipulation OK pod SKIP spelling FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use FAIL recalls/request.pl OK critic OK file permissions FAIL forbidden patterns forbidden pattern: Script permissions is authnotrequired => 0, it could be correct for an OPAC script if it is was you really want error (bug 24663) (line 33) OK git manipulation OK pod SKIP spelling FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use FAIL recalls/recalls_waiting.pl FAIL critic Subroutine "new" called using indirect syntax at line 28, column 13. See page 349 of PBP. OK file permissions FAIL forbidden patterns forbidden pattern: Script permissions is authnotrequired => 0, it could be correct for an OPAC script if it is was you really want error (bug 24663) (line 34) OK git manipulation OK pod SKIP spelling FAIL valid Bareword "dt_from_string" not allowed while "strict subs" in use Bareword "dt_from_string" not allowed while "strict subs" in use + $.ajax({ + url: '/cgi-bin/koha/svc/recall', + type: 'POST', + dataType: 'json', + data: ajaxData, + }) This is the old way of things. (Ok, historical patches.) No API ? All appreciation for your hard work and perseverance. This feature will be welcomed by many libraries. So it is great that you share it. I am just stumbling over its size. It might be a reason why this patch set takes so long too. Just picking the largest patches: 7 files changed, 1093 insertions(+), 1 deletion(-) 16 files changed, 1153 insertions(+), 12 deletions(-) 15 files changed, 665 insertions(+), 4 deletions(-) 44 files changed, 2090 insertions(+), 12 deletions(-) We're adding over 5000 lines here on one report. Clearly, this report should have broken down in several reports under an omnibus (imho). Certainly, making a good split is (much) more work for you. But how much time did you spend on rebasing the whole thing over and over again? How should we do a good QA job when adding so much code. I did a "diagonal" QA now. Few comments, asked a few questions now. Most looks good to me. But I cant do a full QA in some hours on such large patches. My intuition tells me that there will be quite a few bugs coming in now. And at a bad time, since we are close to release date.. Note that I am not asking you to split it up now. But perhaps we should define some guidelines on handling this kind of larger developments, making it easier to push well split portions and allowing still 'unused' code to go in already when there is a community commitment to finish the job? Since we need more people to test this code, I am putting the status back to Needs Signoff. I understand where you're coming from, I know the size is massive, but honestly it's a bit frustrating to pick that apart now. If you look back, I first attached a much simpler iteration of recalls, but everyone scope creeped it while the clients we developed it for were happily using it and sponsoring further enhancements. This would have been avoided if it had been accepted in it's simpler state by the community, when it was a lot easier to QA. It's obviously since grown to become a fully fledged feature. I can't reasonably keep maintaining it for our clients for years while upstream requires me to rebase it every few weeks and it still won't get pushed to main. At this point I would prefer if the QA team just gave me guidance on what I need to do to get this in to upstream Koha. (In reply to Aleisha Amohia from comment #784) > I understand where you're coming from, I know the size is massive, but > honestly it's a bit frustrating to pick that apart now. Agreed, and thats certainly not what I was saying. > I can't reasonably keep maintaining it for our clients for years while > upstream requires me to rebase it every few weeks and it still won't get > pushed to main. Very clear. What you did already, is amazing. You cant go on like this. > At this point I would prefer if the QA team just gave me guidance on what I > need to do to get this in to upstream Koha. We do need some coordination to get a patch of this size in. Note also that as e.g. comment358 shows the fundamentals of this design were questioned by Martin and maybe others. I understand that this remark was too late in the process. But this implies convincing (part of) the QA team also. If we do, it seems already too late to push this into 21.11. So it should be done early after that release (imho). I am putting this on the development meeting agenda for Oct 27 14 UTC (bad for NZL). Will also ask the QA manager for coordination. Cant do much more as single QAer ;) (In reply to Marcel de Rooy from comment #781) > I planned to run qa tools on every patch. But I would recommend that you > would have done the same. It is just too much.. wouldn't this raise errors fixed in followup? You mean for each commit, checkout on it, run the qa tool on last commit, right? (In reply to Victor Grousset/tuxayo from comment #786) > (In reply to Marcel de Rooy from comment #781) > > I planned to run qa tools on every patch. But I would recommend that you > > would have done the same. It is just too much.. > > wouldn't this raise errors fixed in followup? You mean for each commit, > checkout on it, run the qa tool on last commit, right? Surely. Whats fixed, is fixed. Hi all How did the meeting go and what was decided for this bug? Thanks Aleisha (In reply to Aleisha Amohia from comment #788) > How did the meeting go and what was decided for this bug? Here a few important remarks from IRC: 14:37 Joubu it's too late for 21.11 and we have plenty of things to focus on 14:37 cait1 it doesn't quite work as academics expect it 14:41 cait1 so maybe we could agree on making this a priority after release? 14:42 cait1 #agreed marcelr, fridolin and cait to look at recalls for QA after 21.11 release 14:44 cait1 i think they are moderated [recalls] 14:44 cait1 what we are looking for later might be unmoderated 14:45 ashimema either way.. lets attack it as a group at the beginning of the next cycle. So we had consensus about proceeding on recalls in its current form in view of time elapsed shortly after release. I have a recalls branch now too, might be fixing a few things too already. The moderated/unmoderated got a bit confusing (my fault), but the summary about us teaming up on this once 21.11 is out the door is correct. I've developed this further for a university library so I have patches that would possibly help it to work more in the way that academic libraries might expect? I'll contact you all about progressing with this. (In reply to Aleisha Amohia from comment #791) > I've developed this further for a university library so I have patches that > would possibly help it to work more in the way that academic libraries might > expect? > > I'll contact you all about progressing with this. Hi Aleisha, I volunteered to work on this at the beginning of this cycle, but have to admit, I still have to start digging into it. Any additional information is very welcome :) Created attachment 129305 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129306 [details] [review] Bug 19532: Updated schema files Signed-off-by: David Nind <david@davidnind.com> Created attachment 129307 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129308 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129309 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129310 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129311 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129312 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129313 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129314 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129315 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129316 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129317 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 129318 [details] [review] Bug 19532: (follow-up) Fix calls, tests, syspref settings, checks Signed-off-by: David Nind <david@davidnind.com> Created attachment 129319 [details] [review] Bug 19532: (QA follow-up) Enable XSLT statuses translation I rebased what we had. Didnt check yet. Katrin, Fridolin, Aleisha, David, Victor: When can we work on this patch set this month? Would be handy to plan our actions now. (In reply to Marcel de Rooy from comment #808) > I rebased what we had. Didnt check yet. > > Katrin, Fridolin, Aleisha, David, Victor: When can we work on this patch set > this month? Would be handy to plan our actions now. +1 Time is sparse, but I'll try to make it work. (In reply to Katrin Fischer from comment #809) > (In reply to Marcel de Rooy from comment #808) > > I rebased what we had. Didnt check yet. > > > > Katrin, Fridolin, Aleisha, David, Victor: When can we work on this patch set > > this month? Would be handy to plan our actions now. > > +1 > > Time is sparse, but I'll try to make it work. Thanks Katrin. And the others? Sure, I'm in. At first look code looks pretty mature. I'll listen to QA team. I started rewriting before Christmas but couldn't get it sorted in time. Will try to pick up again this week or next. Trying to work out the best way to split everything out. (In reply to Aleisha Amohia from comment #812) > I started rewriting before Christmas but couldn't get it sorted in time. > Will try to pick up again this week or next. Trying to work out the best way > to split everything out. Thanks for responding. In order to prevent misunderstandings, are you talking about the current patches or development on top of this patch set? If you are talking about the current set, it would be useless for us to work further on it when you will be rewriting it. Please confirm! I am talking about the current patchset. My understanding was that as the patches currently are, they are too big and daunting to effectively test and QA. (In reply to Aleisha Amohia from comment #814) > I am talking about the current patchset. My understanding was that as the > patches currently are, they are too big and daunting to effectively test and > QA. Thanks for your quick response! We seem to have some kind of misunderstanding here. Note that I do not oppose your breaking it up but it will take you time once again. In view of the patch history I wrote earlier in comment783: "Note that I am not asking you to split it up now." So I was thinking about handling the current set and especially stressing that we would appreciate future submissions in another form. See also comment785. "We do need some coordination to get a patch of this size in." Comment789: "So we had consensus about proceeding on recalls in its current form in view of time elapsed shortly after release." So perhaps you understand now the track that I was on? I see. In the email chain we had discussed reformatting but clearly there was some misunderstanding. I had started rewriting things before Christmas but it was proving to be very difficult to split the patches out into different 'stages' of development. My preference would be to rebase what is on here and bring it up to main, as long as the QA team is happy to coordinate in getting it through. Should I do that then? (In reply to Aleisha Amohia from comment #816) > I see. In the email chain we had discussed reformatting but clearly there > was some misunderstanding. > > I had started rewriting things before Christmas but it was proving to be > very difficult to split the patches out into different 'stages' of > development. > > My preference would be to rebase what is on here and bring it up to main, as > long as the QA team is happy to coordinate in getting it through. > > Should I do that then? Yes please check my latest rebase (Jan 11). I understand the difficulties of splitting it up now, so totally ok working with the rebased patch set. Thx Marcel and Aleisha for clearing things up! Created attachment 130641 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130642 [details] [review] Bug 19532: Updated schema files Signed-off-by: David Nind <david@davidnind.com> Created attachment 130643 [details] [review] Bug 19532: Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130644 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130645 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130646 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130647 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130648 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130649 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130650 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130651 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130652 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130653 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 130654 [details] [review] Bug 19532: (follow-up) Fix calls, tests, syspref settings, checks Signed-off-by: David Nind <david@davidnind.com> Created attachment 130655 [details] [review] Bug 19532: (QA follow-up) Enable XSLT statuses translation Created attachment 130656 [details] [review] Bug 19532: (follow-up) Fixes along recall workflow Still applied on current master (more or less: minor conflicts) commit 4cc3c0a760df4ddd96cd7bdadc4a766343f0a103 Will be spending some time on it now and next week, and hoping that the other volunteers will be able to do so too.. Some intermediate observations. Will continue next week. TODO FAIL t/db_dependent/Circulation/CalcFine.t * The method Koha::Recalls->item_level_recall is not covered by tests! => Error in sub CalcFine (Overdues.pm) => This is related to the recent wantarray change in Koha: you do no longer receive individual results, but a result set TODO t/db_dependent/Koha/Biblio.t # Failed test 'Recalls tests' => Related to the wantarray thing again Example: # got: 'Koha::Recalls=HASH(0x55e97949bf68)' # expected: '3' TODO t/db_dependent/Circulation.t # Subtest: CanBookBeRenewed tests # Looks like you planned 97 tests but ran 24. The method Koha::Recalls->item_level_recall is not covered by tests! Trace begun at /usr/share/koha/Koha/Objects.pm line 572 Koha::Objects::AUTOLOAD('Koha::Recalls=HASH(0x5566928b68a0)') called at /usr/share/koha/C4/Overdues.pm line 267 C4::Overdues::CalcFine('HASH(0x556692872ac0)', 'v1HCIX_4rK', 'u4RykAzG', 'DateTime=HASH(0x5566928c98a0)', 'DateTime=HASH(0x556692855198)') called at t/db_dependent/Circulation.t line 700 => Looks like the same problem: wantarray trouble again QA tools is quite happy, here are two items: TODO koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt * forbidden pattern: Don't use the title-string class for sorting (bug 27934) (line 39) TODO koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt * forbidden pattern: Don't use the title-string class for sorting (bug 27934) (line 760) See the referenced bug for pointers to resolve it. Created attachment 131108 [details] [review] Bug 19532: (QA follow-up) Fixing unit tests (Trivial:) Number of tests in Koha/Item.t Added a $patron object to resolve warnings like: * Global symbol "$patron" requires explicit package name (did you forget to declare "my $patron"?) at t/db_dependent/Koha/Patron.t line 1064. Fixed CanItemBeReserved call in Holds.t, number of tests adjusted Created attachment 131156 [details] [review] Bug 19532: (follow-up) Fix calls, tests, syspref settings, checks Signed-off-by: David Nind <david@davidnind.com> Created attachment 131157 [details] [review] Bug 19532: (QA follow-up) Enable XSLT statuses translation Created attachment 131158 [details] [review] Bug 19532: (follow-up) Fixes along recall workflow Created attachment 131159 [details] [review] Bug 19532: (QA follow-up) Fixing unit tests (Trivial:) Number of tests in Koha/Item.t Added a $patron object to resolve warnings like: * Global symbol "$patron" requires explicit package name (did you forget to declare "my $patron"?) at t/db_dependent/Koha/Patron.t line 1064. Fixed CanItemBeReserved call in Holds.t, number of tests adjusted Created attachment 131160 [details] [review] Bug 19532: (follow-up) Fix for wantarray change and title-string (In reply to Marcel de Rooy from comment #835) > Still applied on current master (more or less: minor conflicts) > commit 4cc3c0a760df4ddd96cd7bdadc4a766343f0a103 > > Will be spending some time on it now and next week, and hoping that the > other volunteers will be able to do so too.. Have fixed the merge conflict and the failing tests and qa tests mentioned above. (In reply to Aleisha Amohia from comment #844) > (In reply to Marcel de Rooy from comment #835) > > Still applied on current master (more or less: minor conflicts) > > commit 4cc3c0a760df4ddd96cd7bdadc4a766343f0a103 > > > > Will be spending some time on it now and next week, and hoping that the > > other volunteers will be able to do so too.. > > Have fixed the merge conflict and the failing tests and qa tests mentioned > above. Thx for doing that quickly. Resuming here now. Created attachment 131193 [details] [review] Bug 19532: (QA follow-up) Fix few Koha::Recalls->search occurrences Due to the wantarray change, we should fix this call in list context. We should either use an iterator now or append as_list. Saw this warning in QA tools: FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt FAIL valid_template Attempt to reload Koha/Template/Plugin/KohaPlugins.pm aborted. Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.28/Template/Plugins.pm line 206. SAME for koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt The reload aborted on Template plugins I have seen incidentally on a few other reports, where we did spend quite some time to resolve it to no avail. Eventually they were ignored. This report does not do anything with the KohaPlugins template plugin. So I think we can discard it. From code glancing: Unfinished business? + } elsif ( $code eq 'RecallFound' ) { + ; + } elsif ( $code eq 'RecallNeedsTransfer' ) { + ; + } elsif ( $code eq 'TransferredRecall' ) { + ; Created attachment 131213 [details] [review] Bug 19532: (follow-up) Removing unnecessary code Cool I will ignore that warning about KohaPlugins then. (In reply to Marcel de Rooy from comment #848) > From code glancing: > Unfinished business? > > + } elsif ( $code eq 'RecallFound' ) { > + ; > + } elsif ( $code eq 'RecallNeedsTransfer' ) { > + ; > + } elsif ( $code eq 'TransferredRecall' ) { > + ; Not unfinished business, I was just copying the similar code above, but I have removed in latest follow-up. (In reply to Aleisha Amohia from comment #850) > Not unfinished business, I was just copying the similar code above, but I > have removed in latest follow-up. Are you really really sure about that :) ? Look here, read the else comment too ! elsif ( $code eq 'ReturnClaims' ) { $template->param( ReturnClaims => $messages->{ReturnClaims} ); - } elsif ( $code eq 'RecallFound' ) { - ; - } elsif ( $code eq 'RecallNeedsTransfer' ) { - ; - } elsif ( $code eq 'TransferredRecall' ) { - ; } else { die "Unknown error code $code"; # note we need all the (empty) elsif's above, or we die. # This forces the issue of staying in sync w/ Circulation.pm In conclusion: We dont wanna die here, but as for ReturnClaims we could send a code to the template allowing to return something meaningful to the user? Obsoleting the last patch now. Correct me when I am wrong. (In reply to Marcel de Rooy from comment #851) > In conclusion: We dont wanna die here, but as for ReturnClaims we could send > a code to the template allowing to return something meaningful to the user? > Obsoleting the last patch now. Correct me when I am wrong. And looking in context, I indeed see stuff like: elsif ( $code eq 'WrongTransfer' ) { ; # FIXME... anything to do here? } elsif ( $code eq 'WrongTransferItem' ) { ; # FIXME... anything to do here? } So lets just leave as-is now. FAIL C4/Circulation.pm FAIL pod coverage POD is missing for AddOfflineOperation POD is missing for CheckValidBarcode POD is missing for DeleteOfflineOperation POD is missing for GetOfflineOperation POD is missing for GetOfflineOperations POD is missing for GetRenewCount POD is missing for GetTopIssues POD is missing for ProcessOfflineIssue POD is missing for ProcessOfflineOperation POD is missing for ProcessOfflinePayment POD is missing for ProcessOfflineReturn POD is missing for ReturnLostItem POD is missing for TooMany POD is missing for checkHighHolds C4::Circulation has a Pod::Coverage rating of 0.702127659574468 The following are uncovered: AddOfflineOperation, CheckValidBarcode, DeleteOfflineOperation, GetOfflineOperation, GetOfflineOperations, GetRenewCount, GetTopIssues, ProcessOfflineIssue, ProcessOfflineOperation, ProcessOfflinePayment, ProcessOfflineReturn, ReturnLostItem, TooMany, checkHighHolds This can be safely ignored: we dont add subs here, just some changes. Same remark for: FAIL C4/Overdues.pm FAIL pod coverage POD is missing for 'GetWdayFromItemnumber' and FAIL C4/XSLT.pm FAIL pod coverage POD is missing for get_xsl_filename POD is missing for get_xslt_sysprefs I remember to have posted this before, but these lines show me that Recalls does not support itemtype notforloan: + return 0 if ( $self->notforloan != 0 ); OR + my @items = Koha::Items->search({ biblionumber => $self->biblionumber, itemlost => 0, withdrawn => 0, notforloan => 0 })->as_list; OR + [% IF ( item.notforloan ) %] The only check for notforloan in the new code is made only on the item, not on the itemtype. Dont think that we need to fix it here now. No blocker. I am wondering btw: If we can only recall something checked out, when would notforloan come into play actually? Seems to be an edge case like item was checked out, notforloan was activated after that, etc. Created attachment 131257 [details] [review] Bug 19532: (QA follow-up) Fix fine calculation by inserting biblionumber The fines cron job uses Getoverdues to pass issue info to CalcFine. It took me a while to realize that the overdue hash does not contain a biblionumber. When testing CalcFine, we pass an item hash that does include one. So what happened? $item->{biblionumber} is undefined when it comes from Getoverdues and no recall overdue fine is calculated, only a regular one. Simple fix (without any impact): Add a biblionumber to Getoverdues. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested with fines.pl: recall fine applied now. Ran some Circulation and Overdues unit tests. (In reply to Marcel de Rooy from comment #856) > Created attachment 131257 [details] [review] [review] > Bug 19532: (QA follow-up) Fix fine calculation by inserting biblionumber > > The fines cron job uses Getoverdues to pass issue info to CalcFine. > It took me a while to realize that the overdue hash does not contain > a biblionumber. When testing CalcFine, we pass an item hash that > does include one. > > So what happened? $item->{biblionumber} is undefined when it comes from > Getoverdues and no recall overdue fine is calculated, only a regular one. > > Simple fix (without any impact): Add a biblionumber to Getoverdues. > > Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > Tested with fines.pl: recall fine applied now. > Ran some Circulation and Overdues unit tests. This was a serious bug! The fines cron job would never ever calculate the correct recalls fine when you relied on Getoverdues without biblionumber.. I didnt see any reference to testing this process in the large test plan btw ;) TODO We need to add two new cronjobs to the cron files (debian side and example file somewhere in etc folder) misc/cronjobs/recalls/expire_recalls.pl misc/cronjobs/recalls/overdue_recalls.pl They both do a recalls search. If one has not activated recalls, no records are found. Early exit. All fine. Note the following: "check if item has been recalled. recall should have been marked Overdue by cronjob, so only look at overdue recalls" => So we need to run overdue_recalls BEFORE fines (CalcFine) Created attachment 131260 [details] [review] Bug 19532: (QA follow-up) Move as_list to iterator based loop Adjusting both new cron jobs. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131261 [details] [review] Bug 19532: Database and installer stuff - Add recalls table - Add recalls circulation rules - recalls allowed, recalls per record, on shelf recalls, recall due date interval, recall overdue fine, recall shelf time - Add system preferences - useRecalls, RecallsMaxPickUpDelay, RecallsLog - Add email notices (RETURN_RECALLED_ITEM, PICKUP_RECALLED_ITEM) - Add print notice (RECALL_REQUESTER_DET) - Add user permission - recalls, manage_recalls - Add Recall and CancelRecall enum options for branchtransfers reason Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131262 [details] [review] Bug 19532: [DBIx] Updated schema files Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131263 [details] [review] Bug 19532: [DBIx] Add boolean flags to recalls.old and recalls.item_level_recall Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131264 [details] [review] Bug 19532: [DBIx] Schema change for Recalls Separated from the "Recalls-objects-and-tests" patch Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131265 [details] [review] Bug 19532: Recalls objects and tests Koha/Recall.pm - biblio - item - patron - library - checkout - requested - waiting - overdue - in_transit - expired - cancelled - finished - calc_expirationdate - start_transfer - revert_transfer - set_waiting - revert_waiting - set_overdue - set_expired - set_cancelled - set_finished - should_be_overdue Koha/Recalls.pm - add_recall - move_recall and relevant tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131266 [details] [review] Bug 19532: Expiry and overdue cronjobs, and overdue fine calculation - misc/cronjobs/recalls/expire_recalls.pl - misc/cronjobs/recalls/overdue_recalls.pl - tests for overdue fines in t/db_dependent/Circulation/CalcFine.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131267 [details] [review] Bug 19532: Other objects used in recalls feature - biblio->recalls - biblio->can_be_recalled - item->recall - item->can_be_recalled - item->can_set_waiting_recall - item->check_recalls - patron->recalls - Biblio.RecallsCount and relevant tests - t/db_dependent/Stats.t - t/db_dependent/Koha/Item.t - t/db_dependent/Koha/Biblio.t - t/db_dependent/Koha/Patron.t - t/db_dependent/XSLT.t - t/db_dependent/Search.t - t/db_dependent/Holds.t - t/db_dependent/Circulation/transferbook.t - t/db_dependent/Circulation.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131268 [details] [review] Bug 19532: Recalls on OPAC - place a biblio-level or item-level recall via the biblio detail page, OPAC search results, or course reserves - view or cancel your active recalls from 'your summary' recalls tab - view all active and inactive (and cancel active) recalls from 'your recall history' - stopped from placing a reserve on an item that the patron has already recalled Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131269 [details] [review] Bug 19532: Recalls on intranet See recalls on Intranet - old recalls (all inactive recalls) - recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue - recalls to pull (available but not yet waiting) - cancel - recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status - overdue recalls (overdue to be returned) - cancel, multiple cancel - biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue - patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue - log viewer and the general circulation of recalls == TEST PLAN FOR RECALLS == ADMINISTRATION 1. Apply all patches 2. Run database updates, update schema files and confirm everything applies cleanly 3. Run tests and confirm everything passes: t/db_dependent/Koha/Recall.t t/db_dependent/Koha/Recalls.t t/db_dependent/Stats.t t/db_dependent/Circulation/CalcFine.t t/db_dependent/Koha/Item.t t/db_dependent/Koha/Biblio.t t/db_dependent/Koha/Patron.t t/db_dependent/XSLT.t t/db_dependent/Search.t t/db_dependent/Holds.t t/db_dependent/Circulation/transferbook.t t/db_dependent/Circulation.t 4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default. 5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing. 6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal. 7. Go to Administration -> system preferences. Enable the UseRecalls system preference. 8. Go to Administration -> circulation rules. Set the following rules: Recalls allowed (count) = 0 Recalls per record (count) = 0 On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable Recall due date interval (days) = 3 Recall overdue fine amount = (something different to your normal fine amount) Recall pickup period (days) = 1 Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing. 9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked. 10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access. 11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules). PLACING A RECALL 12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A. 13. Click on Biblio A. 14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available. 15. Check out Item A to another borrower (Borrower B). 16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0. 17. Edit the circulation rules to have the following values: Recalls allowed (count) = 1 Recalls per record (count) = 1 18. Refresh the 'Place recall' page. You will now see the form to place a recall. BIBLIO-LEVEL RECALL, NO TRANSFER 19. Place a biblio-level recall. Pickup location: Branch A, the set branch when you are logged into the staff client Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule) 21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice. 22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted. 23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled. 24. Log out of the OPAC and log back in as Borrower A. 25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1. 26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears. 27. Do a catalogue search with a term that will return multiple results, including Biblio A. 28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button. 29. Notice you are redirected straight to the form to place a recall. 30. Place a biblio-level recall again, following the steps in Step 19. 31. Go to your recalls history tab. Notice your first cancelled recall shows here. 32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab. 33. In the staff client, enable the UseCourseReserves system preference. 34. Go to the main menu, click Course Reserves. 35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.) 36. Add Item A as a reserve to this course. 37. View Course Reserves in the OPAC. Click the course you just created. 38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button. 39. Place a biblio-level recall again, following the steps in Step 19. 40. Click the 'Place recall' link in the breadcrumbs. 41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1. 42. Edit the circulation rules to have the following values: Recalls allowed (count) = 10 Recalls per record (count) = 5 43. Refresh the 'Place recall' page. You will now see the form to place a recall. 44. Create another test record (Biblio B) with at least one item (Item C). 45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19. 46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls. 47. Go to Circulation -> Recalls queue. Your current recalls should show here. 48. Use the 'Select all' checkbox to select all recalls. 49. Cancel the recalls using the 'Cancel selected recalls' button. 50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19. 51. In the staff client, check in Item A, which should still be checked out to Borrower B. 52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore. 53. Click the link to go view Biblio A's details in the catalogue. 54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting). 55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button. 56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup". 57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup". 58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading. 59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button. 60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct. 61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list. (You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box). 62. Go to Borrower A's checkouts. Check out Item B. 63. Confirm the checkout is successful and the recall is removed from the Recalls tab. 64. Go to Circulation -> Old recalls. The fulfilled recall should show. 65. Check in Item B. BIBLIO-LEVEL RECALL, TRANSFER REQUIRED 66. Check out Item A to Borrower B. 67. Log in to the OPAC as Borrower A. 68. Find Biblio A and place a biblio-level recall. Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall next available item' Click confirm 69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required. 70. Click "confirm recall and transfer" and confirm the transfer. 71. Go to your account and click the Recalls tab. 72. Confirm the recall status now shows the item is in transit to Branch B. 73. In the drop-down top-right of your window, select 'Set library'. 74. Set your library to Branch B. 75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here. 76. Click 'Cancel transfer'. 77. Go to Circulation -> Recalls queue 78. Confirm the recall status has been reverted to Requested. 79. Set your library back to Branch A. 80. Check in Item A and trigger the transfer. 81. Set your library back to Branch B. 82. Check in Item A at Branch B. 83. When the 'Recall found' box pops up, click Ignore. 84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A" 85. Click the button to cancel the recall. 86. Repeat Steps 66-70. 87. Check in Item A at Branch B. Confirm the recall as waiting. 88. Check out Item A to Borrower A to fulfill the recall. 89. Set your library back to Branch A and check in Item A. ITEM-LEVEL RECALL, NO TRANSFER 90. Go to Administration -> circulation rules. Set the following rules: On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable 91. Check out Item A to Borrower B. 92. Log in to the OPAC as Borrower A and go to Biblio A. 93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available. 94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status. 95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall. 96. Place an item-level recall. Pickup location: Branch A. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 97. In the staff client, edit Item B and remove the lost or missing status. 98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall. 99. Check in Item A. Confirm the recall as waiting. 100. Go to Circulation -> Recalls awaiting pickup 101. Expire the recall. Confirm it expires as expected. ITEM-LEVEL RECALL, TRANSFER REQUIRED 102. Repeat steps 91 to 95. 103. Place an item-level recall. Pickup location: Branch B, we will require a transfer. Recall not needed after (expiration date): whatever you want Select 'recall a specific item' Item B will not be selectable, and Item A should be selected by default. Click confirm 104. In the staff client, check in Item A. Confirm the recall and trigger the transfer. 105. Set your library to Branch B and check in Item A. 106. Confirm the recall as waiting. 107. Check out Item A to Borrower A and fulfill the recall. 108. Set your library back to Branch A and check in Item A. CRONJOBS: EXPIRING RECALL 109. Check out Item A to Borrower B. 110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 111. In your terminal, enter mysql and edit the expiration date of your recall to be before today UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X; 112. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 113. Go to Borrower A's account and go to the Recalls history tab 114. Confirm the recall has been expired because the current date surpassed the specified expiration date 115. Check out Item A to Borrower B. 116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 117. In the staff client, check in Item A and confirm the recall as waiting. 118. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X; 119. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 120. Go to Borrower A's account and go to the Recalls history tab 121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period 122. Go to Administration -> circulation rules. Set the following rules: Recall pickup period (days) = 0 123. Set the RecallsMaxPickUpDelay system preference = 1. 124. Check out Item A to Borrower B. 125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 126. In the staff client, check in Item A and confirm the recall as waiting. 127. In your terminal, enter mysql and edit the waiting date of your recall to be before today UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X; 128. Run the expiry cronjob from within your shell perl misc/cronjobs/recalls/expire_recalls.pl 129. Go to Borrower A's account and go to the Recalls history tab 130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref CRONJOBS: OVERDUE RECALL 131. Check out Item A to Borrower B 132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 134. Run the overdue cronjob from within your shell perl misc/cronjobs/recall/overdue_recalls.pl 135. Go to Circulation -> Overdue recalls 136. Confirm your recall is showing here now as the recall has been marked Overdue CIRCULATION 137. Check in Item A. 138. When the recall box pops up, click Ignore. 139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out. 140. Click "No don't check out" and confirm the item isn't checked out and the recall remains. 141. Repeat Step 139. 142. Click "Yes check out" and confirm the item is checked out and the recall remains. 143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio. 144. Repeat Steps 137-139. 145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled. 146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A. 147. Check in Item A. Confirm the recall as waiting. 148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out. 149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested. OTHER 150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X; 151. Go to Borrower A's recalls and click the Actions dropdown. 152. Click "Mark as overdue" and confirm the recall is marked as overdue manually. 153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit. 154. Confirm all of the recalls actions that have been made are correctly logged. Note: recalls messaging preferences are introduced in Bug 23781. The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131270 [details] [review] Bug 19532: (follow-up) aria-hidden attr on OPAC, and more - removing authnotrequired flag from scripts - fixing opac buttons - chmod +x for recalls test files Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131271 [details] [review] Bug 19532: (follow-up) Fixing failing CalcFine.t test Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131272 [details] [review] Bug 19532: (follow-up) Fixing OPAC display and staff client errors - fixes the displays of opac-recalls.pl and opac-recall.pl - fix the error on Recalls to pull page - fix JS error preventing Recalled link from showing in checkouts table - fix cancelling of recall when checking out item Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131273 [details] [review] Bug 19532: (follow-up) Fix undef recall_id preventing fulfillment of recall Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131274 [details] [review] Bug 19532: (follow-up) Fixing tests and QA tools And making reverted ajax message clearer Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131275 [details] [review] Bug 19532: (follow-up) Fix calls, tests, syspref settings, checks Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131276 [details] [review] Bug 19532: (QA follow-up) Enable XSLT statuses translation Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131277 [details] [review] Bug 19532: (follow-up) Fixes along recall workflow Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131278 [details] [review] Bug 19532: (QA follow-up) Fixing unit tests (Trivial:) Number of tests in Koha/Item.t Added a $patron object to resolve warnings like: * Global symbol "$patron" requires explicit package name (did you forget to declare "my $patron"?) at t/db_dependent/Koha/Patron.t line 1064. Fixed CanItemBeReserved call in Holds.t, number of tests adjusted Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131279 [details] [review] Bug 19532: (follow-up) Fix for wantarray change and title-string Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131280 [details] [review] Bug 19532: (QA follow-up) Fix few Koha::Recalls->search occurrences Due to the wantarray change, we should fix this call in list context. We should either use an iterator now or append as_list. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 131281 [details] [review] Bug 19532: (QA follow-up) Fix fine calculation by inserting biblionumber The fines cron job uses Getoverdues to pass issue info to CalcFine. It took me a while to realize that the overdue hash does not contain a biblionumber. When testing CalcFine, we pass an item hash that does include one. So what happened? $item->{biblionumber} is undefined when it comes from Getoverdues and no recall overdue fine is calculated, only a regular one. Simple fix (without any impact): Add a biblionumber to Getoverdues. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Tested with fines.pl: recall fine applied now. Ran some Circulation and Overdues unit tests. Created attachment 131282 [details] [review] Bug 19532: (QA follow-up) Move as_list to iterator based loop Adjusting both new cron jobs. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Aleisha: Note that I added an extra patch in the beginning too to extract DBIx stuff out of a regular patch. It's looking good Marcel! Thanks for your help. Created attachment 131330 [details] [review] Bug 19532: (QA follow-up) Add the cron jobs to the cron files Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> I hope to finish up tomorrow which actually does not mean that I could QA this huge patch set just on my own [impossible; see earlier comments], but I have spent a considerable amount of time on it and my time is limited too. It looks quite good to me considering elapsed time etc. And yes, there is a serious overlap with holds and code doing similar things. But thinking about that, the alternative of injecting this into holds might be even worse. So I would welcome the other people that stepped forward to help, to especially test things in the coming week. (David or Katrin, feel free to switch to Signed Off.) Based on their findings, I would propose to pass QA on Friday 11. And let Fridolin push it soon after that. Allowing all to find the remaining bugs ;) What do you think? Thanks Marcel, I appreciate you helping me get this over the line. If there are bits I can look at, let me know, I have a bit of capacity at the moment. Pass QA on Friday 11 sounds like a great plan to me. Any additional QA team help in between would be awesome! Still posting two observations from a functional view without any need to address them here btw. Functionally, it is a bit confusing that the recall overdue fine amount is so close in the interface to the number of recalls allowed, due date interval, etc. Because it is actually a fine that will not be placed on the person doing the recall but on the patron that loaned the book (and might be in another patron category). So when you enable recalls for a category and you want to have a non-regular overdue fine, you should fill all recall fines on the other categories as well. Maybe something for documentation ? Another functional remark is that the recalls feature currently does not support policies like we have for holds (e.g. you cannot place recalls on items of another branch etc.). Certainly not meant as a blocker at this moment. But I feel that the need to refine circulation rules at that level will be felt soon by multiple branch libraries. You cannot really introduce recalls for one branch now, since the members of that branch can place recalls on books of the other branches. This may need further thought on follow-up reports. Final comment for now. Aleisha has done a really amazing job in keeping this development alive from 2017 onwards. It is a very brave effort on itself to insert this feature into Koha's circulation core; we know that the existing code with all its holds preferences and policies is a minefield. What I saw, looks good and connects with Koha coding practices within the last 5 years. An important step that still needs to be made, is REST API support on follow-up reports. As to functionality, a lot of things have been said and can be said. But this provides us a good base to build and improve further. Today is Pass QA Day! What do I need to do to satisfy the QA team? (In reply to Aleisha Amohia from comment #889) > Today is Pass QA Day! What do I need to do to satisfy the QA team? As promised, I am going to pass QA now on this patch set. See former comments. We did not receive any visible responses from QA team or others that stepped in to help, so that should be a positive sign also: no problems encountered. The diligent work of David Nind still counts as a signoff. The attention of Katrin, Victor and myself counts for a QA stamp. Fridolin: go ahead now and don't wait too long ! Late to the party (as always) :) I am sorry I didn't get to spend time on this as promised last week, we are in the middle of a big migration and brain power is limited. But I trust Marcel's dilligent QA work on this and am sure that we can fix any issues that might turn up on separate bugs once the ground work has gone in. Looking here. Will propose some small changes and file follow-up bugs for remaining concerns so this can finally get pushed and worked through. Created attachment 131629 [details] [review] Bug 19532: (QA follow-up) Better relationship names This patch makes the relationship names be ready for future API developments for recalls, by making their names match the method names. To test: 1. Apply this patch 2. Run the tests => SUCCESS: No change 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 131630 [details] [review] Bug 19532: Make recalls.status an ENUM This patch makes the status attribute an ENUM, setting the default value as 'requested' as well. The chosen names are easier to read than single letters. Also, renamed F into fulfilled (this impacts methods names as well). This is because 'finished' or 'completed' is more a synonym for old => 1... Created attachment 131631 [details] [review] Bug 19532: (QA follow-up) Simplify resultset accessors This patch makes the different ->recalls accessors implemented on this bug be more standard. This means: - They don't do special things like default sorting or stripping out special parameters. That's all left to the caller and the methods are clean: they just return the related objects - Useful filtering methods for Koha::Recalls resultsets are added. The only used one (in the end) was ->filter_by_current. It seems like a better approach, because it gives devs more control on how they want to chain things, and there's a single place in which to maintain the criteria of what is 'current' or 'finished'. This clearly makes the 'old' column obsolete IMHO, at least in the use cases I found. This is covered by tests as well. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Ok, I added my two cents. Some doubts remain for me: - Shouldn't we have the checkout_id link to the issues table? It seems to me that Koha::Recall->checkout is trying to guess something we know when the recall is generated. Or maybe it is just that I'm not understanding the biblio-level recall workflow/use case. - I'd remove the 'old' attribute. - Column names... If we are introducing a new table, I suggest we do better there. See bug 25260 for column names... Couldn't finish testing, but wanted to leave my notes. Thanks for your thoughts Tomas but respectfully we had already agreed to Pass QA and get this pushed so we can continue the work on follow-ups. It's because of extra thoughts like this that our work here has been blocked continuously since 2017 :) Can you please make some follow-up bugs for your comments so that this can get pushed? I've been wondering too if it might be better to move Tomas' patches to separate bugs and work on them there. I'd feel more comfortable with that approach as some of the patches like the second follow-up for the ENUM touch a lot of the code. It all looks good, but some things like the change to update_dbix_class_files.pl I was wondering about (but don't want to add to the almost 900 comments here) As the ENUM patch already includes an atomic update file it should be really just a matter of moving them without having to change the patches themselves. I think it will keep us from having to do more rebases that can also create issues on big patch sets and then take on any further enhancements incrementally. Sounds good to me. (In reply to Aleisha Amohia from comment #897) > Thanks for your thoughts Tomas but respectfully we had already agreed to > Pass QA and get this pushed so we can continue the work on follow-ups. It's > because of extra thoughts like this that our work here has been blocked > continuously since 2017 :) Can you please make some follow-up bugs for your > comments so that this can get pushed? Hi, I wasn't aware of any decision about this bug (my fault). Just saw Marcel did a QA effort and wanted to help. My feeling was that, besides functionality debate, some things should be pushed together, hence why I spent some hours trying to tidy things for future enhancements. I can certainly do it on separate bugs. (In reply to Tomás Cohen Arazi from comment #900) > functionality debate, some things should be pushed together Renaming the column names, for example. Tomas changes makes sens, I've started validating with them. Found a few trivial fixes. misc/devel/update_dbix_class_files.pl change my $force = 1 This must be a mistake. I can accept such a change in this bug. I will revert when pushing. (In reply to Fridolin Somers from comment #902) > Tomas changes makes sens, I've started validating with them. > Found a few trivial fixes. > > misc/devel/update_dbix_class_files.pl change my $force = 1 > This must be a mistake. > I can accept such a change in this bug. > I will revert when pushing. Remove it inline. Koha/Biblio.pm | 2 +- Koha/Recall.pm | 18 +++++++++++------- Koha/Schema/Result/Recall.pm | 4 ++-- Dont do this Tomas Created attachment 131664 [details] [review] Bug 19532: Make recalls.status an ENUM This patch makes the status attribute an ENUM, setting the default value as 'requested' as well. The chosen names are easier to read than single letters. Also, renamed F into fulfilled (this impacts methods names as well). This is because 'finished' or 'completed' is more a synonym for old => 1... Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 131665 [details] [review] Bug 19532: (QA follow-up) Simplify resultset accessors This patch makes the different ->recalls accessors implemented on this bug be more standard. This means: - They don't do special things like default sorting or stripping out special parameters. That's all left to the caller and the methods are clean: they just return the related objects - Useful filtering methods for Koha::Recalls resultsets are added. The only used one (in the end) was ->filter_by_current. It seems like a better approach, because it gives devs more control on how they want to chain things, and there's a single place in which to maintain the criteria of what is 'current' or 'finished'. This clearly makes the 'old' column obsolete IMHO, at least in the use cases I found. This is covered by tests as well. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 131666 [details] [review] Bug 19532: (QA follow-up) POD and import fixes This fixes some library imports and POD. To test: 1. Apply this patch 2. Run the tests => SUCCESS: No change 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Ok, I removed the schema updates and hence the force=1 I added by mistake. This will need to be done by the RM as usual. I also removed the changes to the relationship names... Created attachment 131701 [details] [review] Bug 19532: (QA follow-up) Fixing typo Introduced by: Bug 19532: (QA follow-up) Simplify resultset accessors Pushed to master for 22.05, thanks to everybody involved 🦄 Here it is !!! I've added several patches during push : 975f52a4cf Bug 19532: (RM follow-up) Fix recalls.old is default 0 a0a72c9653 Bug 19532: (RM follow-up) More use of system preference 3838ac82f2 Bug 19532: (RM follow-up) Adapt also UNIMARC XSLT b2dc45a47d Bug 19532: (RM follow-up) Fix status finished renamed fulfilled 9cb2ff97d2 Bug 19532: DBRev 21.12.00.018 0e35ab911c Bug 19532: (RM follow-up) Update DBIC Schema Mainly more use of system preference in order to avoid impact on installs not using this feature. Also one can imagine turning it on, playing with some recalls, turning it off. We must avoid fetching DB datas when it is off. Also recalls.old has been changed in "Make recalls.status an ENUM" to 0/1 boolean instead of undef/1. This makes sens, it is this way in several other places. Great thanks to all for your work and energy. This may be 22.05 must-have feature ;) Some wiki pages need to be adapted, like : https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls#Statuses About the "old" column, on bug 20271 we decided (after a long discussion) to use "is_current". (In reply to Jonathan Druart from comment #913) > About the "old" column, on bug 20271 we decided (after a long discussion) to > use "is_current". I propose to just remove it as part of revisiting the column names. That's why I added filter_by_current and filter_by_finished. But that's swinging to discuss on another bug. Also, new notice templates should use the TT syntax. I was sure we agreed on that but I didn't find a coding guidelines however. Exciting! Thanks everyone for your help. Ah some recalls tests are failing in D9 : https://jenkins.koha-community.org/view/master/job/Koha_Master_D9/1896/ (In reply to Fridolin Somers from comment #917) > Ah some recalls tests are failing in D9 : > https://jenkins.koha-community.org/view/master/job/Koha_Master_D9/1896/ Random failures due to server load (i.e. there's a one second difference) Failures appears on several runs : https://jenkins.koha-community.org/view/master/job/Koha_Master_U21/115/ I think it comes from DT comparison : my $expected_due_date = dt_from_string->add( days => 3 ); is( dt_from_string( $recall->checkout->date_due ), $expected_due_date, "Checkout due date has correctly been extended by recall_due_date_interval days" ); is( $due_date, $expected_due_date, "Due date correctly returned" ); $recall->checkout->date_due is a date in ISO string, compare to a DateTime object. How is it in other places ? (In reply to Fridolin Somers from comment #919) > Failures appears on several runs : > https://jenkins.koha-community.org/view/master/job/Koha_Master_U21/115/ > > I think it comes from DT comparison : > > my $expected_due_date = dt_from_string->add( days => 3 ); > is( dt_from_string( $recall->checkout->date_due ), $expected_due_date, > "Checkout due date has correctly been extended by recall_due_date_interval > days" ); > is( $due_date, $expected_due_date, "Due date correctly returned" ); > > $recall->checkout->date_due is a date in ISO string, compare to a DateTime > object. > > How is it in other places ? The error is: 23:08:40 koha_1 | # got: '2022-03-20T22:08:39' 23:13:07 koha_1 | # expected: '2022-03-20T22:08:40' You need to compare dates using t::lib::Dates::compare Ah super, thanks a lot. I've pushed a fix on test suite to master : Bug 19532: (RM follow-up) Fix dates compare in recalls tests Arf DBIx schema is not correct on recalls.old. Pushed to master : Bug 19532: (RM follow-up) Fix DBIx schema on old I've controled also on an install with v21.11.00 + updatedatabase. No differences in generated DBIx schema. Created attachment 132332 [details] [review] fix installation data for Unimarc fixed installation data for unimarc Patch "fix installation data for Unimarc" pushed to master Two critical bugs found in the last day: bug 30876 and bug 30885. They make the feature unusable. Please provide a patch for bug 30885. From misc/cronjobs/recalls/expire_recalls.pl and misc/cronjobs/recalls/overdue_recalls.pl: +BEGIN { + # find Koha's Perl modules + # test carefully before changing this + use FindBin; + eval { require "$FindBin::Bin/../kohalib.pl" }; +} Since bug 28617 you should not do that anymore. (In reply to Jonathan Druart from comment #926) > From misc/cronjobs/recalls/expire_recalls.pl and > misc/cronjobs/recalls/overdue_recalls.pl: > > +BEGIN { > + # find Koha's Perl modules > + # test carefully before changing this > + use FindBin; > + eval { require "$FindBin::Bin/../kohalib.pl" }; > +} > > Since bug 28617 you should not do that anymore. Moved to a new bug: Bug 32202 - Remove kohalib.pl from recall cronjobs koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt - <td>[% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %]</td> + <td>[% INCLUDE 'item-status.inc' item=cr.course_item issue=cr.issue %]</td> I don't understand this change, and I am going to revert it. I think it broke the availability display. Can you clarify on bug 32445 please? (In reply to Jonathan Druart from comment #928) > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt > > - <td>[% INCLUDE 'item-status.inc' > item=cr.item issue=cr.issue %]</td> > + <td>[% INCLUDE 'item-status.inc' > item=cr.course_item issue=cr.issue %]</td> > > I don't understand this change, and I am going to revert it. I think it > broke the availability display. Can you clarify on bug 32445 please? Likely leftover from old upstream requirements. Your fix on Bug 32445 is good. Regarding circulation rules: "Holds allowed (total)" vs "Recalls allowed (total)" For holds an empty value means unlimited, for recalls it is "not allowed". Is that expected to have two different behaviours for the same config of two very similar features? (In reply to Jonathan Druart from comment #930) > Regarding circulation rules: "Holds allowed (total)" vs "Recalls allowed > (total)" > > For holds an empty value means unlimited, for recalls it is "not allowed". > > Is that expected to have two different behaviours for the same config of two > very similar features? I think it would be beneficial to make this consistent. The checkouts allowed also has empty = unlimited. So that seems to be the majority. |