/** * Assign necessary Smarty variables and return a template name to * load in order to display the full record information on the Staff * View tab of the record view page. * * @access public * @return string Name of Smarty template file to display. */ public function getStaffView() { global $interface; if ($this->marcRecord) { $interface->assign('marcRecord', $this->marcRecord); } if ($this->eContentRecord->source == 'OverDrive') { //Load MetaData require_once ROOT_DIR . '/sys/OverDrive/OverDriveAPIProduct.php'; require_once ROOT_DIR . '/sys/OverDrive/OverDriveAPIProductMetaData.php'; $overDriveAPIProduct = new OverDriveAPIProduct(); $overDriveAPIProduct->overdriveId = strtolower($this->eContentRecord->externalId); $overDriveAPIProductMetaData = new OverDriveAPIProductMetaData(); $overDriveAPIProduct->joinAdd($overDriveAPIProductMetaData, 'INNER'); $overDriveAPIProduct->selectAdd(null); $overDriveAPIProduct->selectAdd("overdrive_api_products.rawData as productRaw"); $overDriveAPIProduct->selectAdd("overdrive_api_product_metadata.rawData as metaDataRaw"); if ($overDriveAPIProduct->find(true)) { $productRaw = json_decode($overDriveAPIProduct->productRaw); //Remove links to overdrive that could be used to get semi-sensitive data unset($productRaw->links); if (isset($productRaw->contentDetails) && isset($productRaw->contentDetails->account)) { unset($productRaw->contentDetails->account); } $interface->assign('overDriveProductRaw', $productRaw); $interface->assign('overDriveMetaDataRaw', json_decode($overDriveAPIProduct->metaDataRaw)); } } if (isset($this->fields)) { $solrRecord = $this->fields; ksort($solrRecord); $interface->assign('solrRecord', $solrRecord); } return 'RecordDrivers/Marc/staff.tpl'; }
/** * Assign necessary Smarty variables and return a template name to * load in order to display the full record information on the Staff * View tab of the record view page. * * @access public * @return string Name of Smarty template file to display. */ public function getStaffView() { global $interface; $overDriveAPIProduct = new OverDriveAPIProduct(); $overDriveAPIProduct->overdriveId = strtolower($this->id); $overDriveAPIProductMetaData = new OverDriveAPIProductMetaData(); $overDriveAPIProduct->joinAdd($overDriveAPIProductMetaData, 'INNER'); $overDriveAPIProduct->selectAdd(null); $overDriveAPIProduct->selectAdd("overdrive_api_products.rawData as productRaw"); $overDriveAPIProduct->selectAdd("overdrive_api_product_metadata.rawData as metaDataRaw"); if ($overDriveAPIProduct->find(true)) { $productRaw = json_decode($overDriveAPIProduct->productRaw); //Remove links to overdrive that could be used to get semi-sensitive data unset($productRaw->links); unset($productRaw->contentDetails->account); $interface->assign('overDriveProductRaw', $productRaw); $interface->assign('overDriveMetaDataRaw', json_decode($overDriveAPIProduct->metaDataRaw)); } return 'RecordDrivers/Marc/staff.tpl'; }