Skip to content
Snippets Groups Projects
Commit 5281f36e authored by Oliver Goldschmidt's avatar Oliver Goldschmidt Committed by Demian Katz
Browse files

Allow ILS driver to provide up-front cancel details (#740)

parent 00a6443a
Branches
Tags
No related merge requests found
......@@ -58,14 +58,29 @@ class Holds extends AbstractRequestBase
// Build OPAC URL
$ilsDetails['cancel_link']
= $catalog->getCancelHoldLink($ilsDetails);
} else if (isset($ilsDetails['cancel_details'])) {
// The ILS driver provided cancel details up front. If the
// details are an empty string (flagging lack of support), we
// should unset it to prevent confusion; otherwise, we'll leave it
// as-is.
if ('' === $ilsDetails['cancel_details']) {
unset($ilsDetails['cancel_details']);
} else {
$this->rememberValidId($ilsDetails['cancel_details']);
}
} else {
// Form Details
// Default case: ILS supports cancel but we need to look up
// details:
$cancelDetails = $catalog->getCancelHoldDetails($ilsDetails);
if ($cancelDetails !== '') {
$ilsDetails['cancel_details'] = $cancelDetails;
$this->rememberValidId($ilsDetails['cancel_details']);
}
}
} else {
// Cancelling holds disabled? Make sure no details get passed back:
unset($ilsDetails['cancel_link']);
unset($ilsDetails['cancel_details']);
}
return $ilsDetails;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment