function launch() { global $interface; global $configArray; global $user; $recordId = $_REQUEST['id']; $quick = isset($_REQUEST['quick']) ? true : false; $eContentRecord = new EContentRecord(); $eContentRecord->id = $recordId; if ($eContentRecord->find(true)) { $ret = $eContentRecord->saveToSolr($quick); if ($ret) { echo json_encode(array("success" => true)); } else { echo json_encode(array("success" => false, "error" => "Could not update solr")); } } else { echo json_encode(array("success" => false, "error" => "Could not find a record with that id")); } }
function returnRecord($id) { global $user; global $logger; //Get the item information for the record require_once ROOT_DIR . '/sys/eContent/EContentCheckout.php'; $checkout = new EContentCheckout(); $checkout->userId = $user->id; $checkout->recordId = $id; $checkout->status = 'out'; $return = array(); //$trans->whereAdd('timeReturned = null'); if ($checkout->find(true)) { $output = array(); $checkout->dateReturned = time(); $checkout->status = 'returned'; $ret = $checkout->update(); if ($ret != 0) { $this->processHoldQueue($id); $eContentRecord = new EContentRecord(); $eContentRecord->id = $id; $eContentRecord->find(true); //Record that the title was checked in $this->recordEContentAction($id, "Checked In", $eContentRecord->accessType); $eContentRecord->saveToSolr(); $return = array('success' => true, 'message' => "The title was returned successfully."); } else { $return = array('success' => false, 'message' => "Could not return the item"); } $output['database-response'] = $ret; } else { $logger->log("Could not find a checked out item for that title in the database.", PEAR_LOG_INFO); $return = array('success' => false, 'message' => "Could not find a checked out item for that title in the database. It may have already been returned."); } return $return; }