Пример #1
0
 function GetHoldingsInfo()
 {
     require_once 'Holdings.php';
     global $interface;
     global $configArray;
     $interface->assign('showOtherEditionsPopup', 0);
     $id = strip_tags($_REQUEST['id']);
     $interface->assign('id', $id);
     Record_Holdings::loadHoldings($id);
     return $interface->fetch('Record/ajax-holdings.tpl');
 }
Пример #2
0
 function getItemAvailability()
 {
     global $timer;
     global $configArray;
     $itemData = array();
     //Load basic information
     $this->id = $_GET['id'];
     $itemData['id'] = $this->id;
     // Setup Search Engine Connection
     $class = $configArray['Index']['engine'];
     $url = $configArray['Index']['url'];
     $this->db = new $class($url);
     if ($configArray['System']['debugSolr']) {
         $this->db->debug = true;
     }
     // Retrieve Full Marc Record
     if (!($record = $this->db->getRecord($this->id))) {
         PEAR_Singleton::raiseError(new PEAR_Error('Record Does Not Exist'));
     }
     $this->record = $record;
     if ($record['recordtype'] == 'econtentRecord') {
         require_once ROOT_DIR . '/sys/eContent/EContentRecord.php';
         $eContentRecord = new EContentRecord();
         $eContentRecord->id = substr($record['id'], strlen('econtentRecord'));
         if (!$eContentRecord->find(true)) {
             $itemData['error'] = 'Cannot load eContent Record for id ' . $record['id'];
         } else {
             require_once ROOT_DIR . '/Drivers/EContentDriver.php';
             $driver = new EContentDriver();
             $itemData['holdings'] = $driver->getHolding($eContentRecord->id);
         }
     } else {
         $this->recordDriver = RecordDriverFactory::initRecordDriver($record);
         $timer->logTime('Initialized the Record Driver');
         //Load Holdings
         $itemData['holdings'] = Record_Holdings::loadHoldings($this->id);
         $timer->logTime('Loaded Holdings');
     }
     return $itemData;
 }
Пример #3
0
 function getItemAvailability()
 {
     global $timer;
     global $configArray;
     $itemData = array();
     //Load basic information
     $this->id = $_GET['id'];
     $itemData['id'] = $this->id;
     // Setup Search Engine Connection
     $class = $configArray['Index']['engine'];
     $url = $configArray['Index']['url'];
     $this->db = new $class($url);
     // Retrieve Full Marc Record
     disableErrorHandler();
     $record = $this->db->getRecord($this->id);
     enableErrorHandler();
     if ($record == false) {
         $marcRecord = new MarcRecord($this->id);
         if ($marcRecord->isValid()) {
             $itemData['holdings'] = Record_Holdings::loadHoldings($this->id);
             $timer->logTime('Loaded Holdings');
         } else {
             $itemData['error'] = 'Cannot load Record for id ' . $record['id'];
         }
     } else {
         $this->record = $record;
         if ($record['recordtype'] == 'econtentRecord') {
             require_once ROOT_DIR . '/sys/eContent/EContentRecord.php';
             $eContentRecord = new EContentRecord();
             $eContentRecord->id = substr($record['id'], strlen('econtentRecord'));
             if (!$eContentRecord->find(true)) {
                 $itemData['error'] = 'Cannot load eContent Record for id ' . $record['id'];
             } else {
                 require_once ROOT_DIR . '/Drivers/EContentDriver.php';
                 $driver = new EContentDriver();
                 $itemData['holdings'] = $driver->getHolding($eContentRecord->id);
             }
         } else {
             $this->recordDriver = RecordDriverFactory::initRecordDriver($record);
             $timer->logTime('Initialized the Record Driver');
             //Load Holdings
             $itemData['holdings'] = Record_Holdings::loadHoldings($this->id);
             $timer->logTime('Loaded Holdings');
         }
     }
     return $itemData;
 }