Recalls bug fixes

Fix some blocker and critical bugs found in the testing of the recalls feature, sponsored by Waikato Institute of Technology. 
The following bugs have been fixed: 
*Cancelling recalls in the OPAC does not work 
*Biblio-level recalls in the OPAC does not show a due date 
*When returning and confirming an item-level recall that needs a transfer, an internal server error occurs 
*Checking in a transferred recall at the pick-up branch does not appear to be setting the recall as waiting 
*There is no confirmation pop-up when checking in a transferred recall to the desired pick-up branch that it has been received and set to waiting 
*If the AutomaticItemReturn system preference is enabled, and a recalled item has a home branch different to the pick-up branch, it will automatically do a transfer, even if the item is being checked in at the pick-up branch 
*Biblio-level recalls do not check if the logged-in user has already checked out an item under that biblio 
*When checking in an item that has a recall and a reserve, both pop-ups show up. If the recall is confirmed, the reserve pop-up should not show. If the recall is not confirmed, the reserve pop-up should show
=== Getting started ===
We need three borrowers (Borrower A, Borrower B and Borrower C) and a biblio (Biblio A) with two items (Item A and Item B). We also need two branches (Branch A and Branch B). Borrower A should be YOU, as you'll be logging into the OPAC as this borrower. 
Enable the AutomaticItemReturn system preference. 
=== Test plan ===
#Check out Item A to Borrower B. 
#Log in to the OPAC as Borrower A and navigate to Item A. 
#Place a biblio-level recall on Item A. 
#Go to your recalls history (opac-recalls.pl) and confirm there is a due date under the Due Date column. 
#Cancel this recall - confirm this works as expected. 
#Go back to Item A and this time place an item-level recall, and change the pick-up location to Branch B. 
#In the staff side, go to Borrower A's account and check the recalls table (circ/circulation.pl). The recall should have a status of 'Requested'. Keep this tab open. 
#In another tab, check in Item A (circ/returns.pl). Confirm no internal server error occurs. 
#A pop-up should appear, asking you to confirm the recall and transfer it to the branch. Confirm and transfer, then check Borrower A's recalls table again. The recall should have a status of 'In transit'. 
#In the check-in tab, go to the dropdown in the top-right and choose 'Set library' to change the branch to Branch B (circ/selectbranchprinter.pl). 
#Check in Item A again. You should see a new pop-up, asking to confirm the recall as waiting. Confirm, then check Borrower A's recalls table again. The recall should now be ready for pickup at Branch B. 
#Try to check in Item A again to see if any errors are thrown. You should see a pop-up that says the recall is already waiting. 
#You should NOT be asked to transfer Item A back to Branch A. 
#Check out Item A to Borrower A. This should fulfill the recall. Set the branch back to Branch A. 
#Check out Item B to Borrower B. 
#Find Biblio A in the OPAC. You should NOT be able to recall this biblio because you have one of the items checked out. 
#Check in Item A. You should now be able to recall the biblio. 
#Place a reserve on Biblio A for Borrower C and place a recall on Biblio A for Borrower A. Item A should still be checked out to Borrower B. 
#Check in Item A. You should receive a pop-up asking to confirm the recall. Click ignore. 
#You should now see a pop-up asking to confirm the reserve. Click ignore. 
#Check in Item A again to trigger the pop-ups. This time, confirm the recall as waiting. You should not receive a pop-up to confirm the reserve this time. 
#Try other regular circulation actions to confirm that nothing has broken.
=== Other links ===
Go back to main recalls page