예제 #1
0
 /**
  * Update ILS details with cancellation-specific information, if appropriate.
  *
  * @param \VuFind\ILS\Connection $catalog      ILS connection object
  * @param array                  $ilsDetails   Hold details from ILS driver's
  * getMyHolds() method
  * @param array                  $cancelStatus Cancel settings from ILS driver's
  * checkFunction() method
  *
  * @return array $ilsDetails with cancellation info added
  */
 public function addCancelDetails($catalog, $ilsDetails, $cancelStatus)
 {
     // Generate Form Details for cancelling Holds if Cancelling Holds
     // is enabled
     if ($cancelStatus) {
         if ($cancelStatus['function'] == "getCancelHoldLink") {
             // Build OPAC URL
             $ilsDetails['cancel_link'] = $catalog->getCancelHoldLink($ilsDetails);
         } else {
             // Form Details
             $ilsDetails['cancel_details'] = $catalog->getCancelHoldDetails($ilsDetails);
             $this->rememberValidId($ilsDetails['cancel_details']);
         }
     }
     return $ilsDetails;
 }
예제 #2
0
 /**
  * Update ILS details with cancellation-specific information, if appropriate.
  *
  * @param \VuFind\ILS\Connection $catalog      ILS connection object
  * @param array                  $ilsDetails   Hold details from ILS driver's
  * getMyHolds() method
  * @param array                  $cancelStatus Cancel settings from ILS driver's
  * checkFunction() method
  *
  * @return array $ilsDetails with cancellation info added
  */
 public function addCancelDetails($catalog, $ilsDetails, $cancelStatus)
 {
     // Generate Form Details for cancelling Holds if Cancelling Holds
     // is enabled
     if ($cancelStatus) {
         if ($cancelStatus['function'] == "getCancelHoldLink") {
             // 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 {
                 // 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;
 }