当前位置: 首页>>代码示例>>PHP>>正文


PHP Resource::getRatingData方法代码示例

本文整理汇总了PHP中Resource::getRatingData方法的典型用法代码示例。如果您正苦于以下问题:PHP Resource::getRatingData方法的具体用法?PHP Resource::getRatingData怎么用?PHP Resource::getRatingData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Resource的用法示例。


在下文中一共展示了Resource::getRatingData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getBasicItemInfo

 function getBasicItemInfo()
 {
     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;
     $this->recordDriver = RecordDriverFactory::initRecordDriver($record);
     $timer->logTime('Initialized the Record Driver');
     // Process MARC Data
     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 {
             $itemData['isbn'] = $eContentRecord->getIsbn();
             $itemData['issn'] = $eContentRecord->getissn();
             $itemData['upc'] = $eContentRecord->getUpc();
             $itemData['issn'] = '';
             $itemData['title'] = $record['title'];
             $itemData['author'] = $eContentRecord->author;
             $itemData['publisher'] = $eContentRecord->publisher;
             $itemData['allIsbn'] = $eContentRecord->getPropertyArray('isbn');
             $itemData['allUpc'] = $eContentRecord->getPropertyArray('upc');
             $itemData['allIssn'] = $eContentRecord->getPropertyArray('issn');
             $itemData['format'] = $eContentRecord->format();
             $itemData['formatCategory'] = $eContentRecord->format_category();
             $itemData['language'] = $eContentRecord->language;
             $itemData['cover'] = $configArray['Site']['coverUrl'] . "/bookcover.php?id={$itemData['id']}&isbn={$itemData['isbn']}&issn={$itemData['issn']}&upc={$itemData['upc']}&category={$itemData['formatCategory']}&format={$itemData['format'][0]}&size=medium";
             $itemData['description'] = $eContentRecord->description;
             require_once ROOT_DIR . '/sys/eContent/EContentRating.php';
             $eContentRating = new EContentRating();
             $eContentRating->recordId = $eContentRecord->id;
             global $user;
             $itemData['ratingData'] = $eContentRating->getRatingData($user, false);
         }
     } else {
         require_once ROOT_DIR . '/sys/MarcLoader.php';
         $marcRecord = MarcLoader::loadMarcRecordFromRecord($record);
         if ($marcRecord) {
             $this->marcRecord = $marcRecord;
         } else {
             $itemData['error'] = 'Cannot Process MARC Record';
         }
         $timer->logTime('Processed the marc record');
         // Get ISBN for cover and review use
         if ($isbnFields = $this->marcRecord->getFields('020')) {
             //Use the first good ISBN we find.
             /** @var File_MARC_Data_Field $isbnField */
             foreach ($isbnFields as $isbnField) {
                 if ($isbnSubfield = $isbnField->getSubfield('a')) {
                     $this->isbn = trim($isbnSubfield->getData());
                     if ($pos = strpos($this->isbn, ' ')) {
                         $this->isbn = substr($this->isbn, 0, $pos);
                     }
                     if (strlen($this->isbn) < 10) {
                         $this->isbn = str_pad($this->isbn, 10, "0", STR_PAD_LEFT);
                     }
                     $itemData['isbn'] = $this->isbn;
                     break;
                 }
             }
         }
         /** @var File_MARC_Data_Field $upcField */
         if ($upcField = $this->marcRecord->getField('024')) {
             if ($upcSubField = $upcField->getSubfield('a')) {
                 $this->upc = trim($upcSubField->getData());
                 $itemData['upc'] = $this->upc;
             }
         }
         /** @var File_MARC_Data_Field $issnField */
         if ($issnField = $this->marcRecord->getField('022')) {
             if ($issnSubfield = $issnField->getSubfield('a')) {
                 $this->issn = trim($issnSubfield->getData());
                 if ($pos = strpos($this->issn, ' ')) {
                     $this->issn = substr($this->issn, 0, $pos);
                 }
                 $itemData['issn'] = $this->issn;
             }
         }
         $timer->logTime('Got UPC, ISBN, and ISSN');
         //Generate basic information from the marc file to make display easier.
         $itemData['title'] = $record['title'];
         $itemData['author'] = isset($record['author']) ? $record['author'] : (isset($record['author2']) ? $record['author2'][0] : '');
         $itemData['publisher'] = $record['publisher'];
//.........这里部分代码省略.........
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:101,代码来源:ItemAPI.php

示例2: loadNoveListTitle

 function loadNoveListTitle($originalIsbn, $item, &$titleList, &$titlesOwned, $seriesName = '')
 {
     global $user;
     $isbnList = array();
     /** @var SimpleXMLElement $titleItem */
     foreach ($item->TitleList->TitleItem as $titleItem) {
         $tmpIsbn = (string) $titleItem->attributes()->value;
         if (strlen($tmpIsbn) == 10 || strlen($tmpIsbn) == 13) {
             $isbnList[] = (string) $titleItem->attributes()->value;
         }
     }
     //If there is no ISBN, don't bother loading the title
     if (count($isbnList) == 0) {
         return;
     }
     //run a search to get the record id for the isbns.
     //TODO:  cache this info since it can take a really long time to load
     $searchObj = SearchObjectFactory::initSearchObject();
     $searchObj->setBasicQuery(implode(' OR ', $isbnList), 'ISN');
     $searchObj->disableScoping();
     //Add a filter to only include books and DVDs
     $searchObj->processSearch(false, false);
     $matchingRecords = $searchObj->getResultRecordSet();
     $isCurrent = in_array($originalIsbn, $isbnList);
     if (isset($seriesName)) {
         $series = $seriesName;
     } else {
         $series = null;
     }
     $volume = '';
     if ($item->Volume) {
         $volume = (string) $item->Volume;
     }
     if (count($matchingRecords) > 0) {
         $ownedRecord = $matchingRecords[0];
         if (strpos($ownedRecord['isbn'][0], ' ') > 0) {
             $isbnInfo = explode(' ', $ownedRecord['isbn'][0]);
             $isbn = $isbnInfo[0];
         } else {
             $isbn = $ownedRecord['isbn'][0];
         }
         $isbn13 = strlen($isbn) == 13 ? $isbn : ISBNConverter::convertISBN10to13($isbn);
         $isbn10 = strlen($isbn) == 10 ? $isbn : ISBNConverter::convertISBN13to10($isbn);
         if (!isset($series)) {
             if (isset($ownedRecord['series'])) {
                 $series = $ownedRecord['series'][0];
             }
         }
         //Load rating data
         if ($ownedRecord['recordtype'] == 'marc') {
             $resource = new Resource();
             $resource->source = 'VuFind';
             $resource->record_id = $ownedRecord['id'];
             $resource->find(true);
             $ratingData = $resource->getRatingData($user);
             $fullRecordLink = '/Record/' . $ownedRecord['id'] . '/Home';
         } else {
             require_once ROOT_DIR . '/sys/eContent/EContentRating.php';
             $shortId = str_replace('econtentRecord', '', $ownedRecord['id']);
             $econtentRating = new EContentRating();
             $econtentRating->recordId = $shortId;
             $ratingData = $econtentRating->getRatingData($user, false);
             $fullRecordLink = '/EcontentRecord/' . $shortId . '/Home';
         }
         //See if we can get the series title from the record
         $titleList[] = array('title' => $ownedRecord['title'], 'title_short' => isset($ownedRecord['title_short']) ? $ownedRecord['title_short'] : $ownedRecord['title'], 'author' => isset($ownedRecord['author']) ? $ownedRecord['author'] : '', 'publicationDate' => (string) $item->PublicationDate, 'isbn' => $isbn13, 'isbn10' => $isbn10, 'upc' => isset($ownedRecord['upc'][0]) ? $ownedRecord['upc'][0] : '', 'recordId' => $ownedRecord['id'], 'recordtype' => $ownedRecord['recordtype'], 'id' => $ownedRecord['id'], 'libraryOwned' => true, 'isCurrent' => $isCurrent, 'shortId' => substr($ownedRecord['id'], 1), 'format_category' => $ownedRecord['format_category'], 'format' => $ownedRecord['format'], 'series' => $series, 'volume' => $volume, 'ratingData' => $ratingData, 'fullRecordLink' => $fullRecordLink);
         $titlesOwned++;
     } else {
         $isbn = $isbnList[0];
         $isbn13 = strlen($isbn) == 13 ? $isbn : ISBNConverter::convertISBN10to13($isbn);
         $isbn10 = strlen($isbn) == 10 ? $isbn : ISBNConverter::convertISBN13to10($isbn);
         $titleList[] = array('title' => (string) $item->Name, 'author' => (string) $item->Author, 'publicationDate' => (string) $item->PublicationDate, 'isbn' => $isbn13, 'isbn10' => $isbn10, 'recordId' => -1, 'libraryOwned' => false, 'isCurrent' => $isCurrent, 'series' => $series, 'volume' => $volume);
     }
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:74,代码来源:Novelist.php

示例3: Resource


//.........这里部分代码省略.........
     }
     if (isset($record['lexile_score']) && $record['lexile_score'] > -1) {
         $lexileScore = $record['lexile_score'];
         if (isset($record['lexile_code'])) {
             $lexileScore = $record['lexile_code'] . $lexileScore;
         }
         $interface->assign('lexileScore', $lexileScore . 'L');
     }
     //Do actions needed if this is the main action.
     //$interface->caching = 1;
     $interface->assign('id', $this->id);
     if (substr($this->id, 0, 1) == '.') {
         $interface->assign('shortId', substr($this->id, 1));
     } else {
         $interface->assign('shortId', $this->id);
     }
     $interface->assign('addHeader', '<link rel="alternate" type="application/rdf+xml" title="RDF Representation" href="' . $configArray['Site']['path'] . '/Record/' . urlencode($this->id) . '/RDF" />');
     // Define Default Tab
     $tab = isset($_GET['action']) ? $_GET['action'] : 'Description';
     $interface->assign('tab', $tab);
     if (isset($_REQUEST['detail'])) {
         $detail = strip_tags($_REQUEST['detail']);
         $interface->assign('defaultDetailsTab', $detail);
     }
     // Define External Content Provider
     if ($this->marcRecord->getField('020')) {
         if (isset($configArray['Content']['reviews'])) {
             $interface->assign('hasReviews', true);
         }
         if (isset($configArray['Content']['excerpts'])) {
             $interface->assign('hasExcerpt', true);
         }
     }
     // Retrieve User Search History
     $interface->assign('lastsearch', isset($_SESSION['lastSearchURL']) ? $_SESSION['lastSearchURL'] : false);
     // Retrieve tags associated with the record
     $limit = 5;
     $resource = new Resource();
     $resource->record_id = $_GET['id'];
     $resource->source = 'VuFind';
     $resource->find(true);
     $tags = $resource->getTags($limit);
     $interface->assign('tagList', $tags);
     $timer->logTime('Got tag list');
     $this->cacheId = 'Record|' . $_GET['id'] . '|' . get_class($this);
     // Find Similar Records
     /** @var Memcache $memCache */
     global $memCache;
     $similar = $memCache->get('similar_titles_' . $this->id);
     if ($similar == false) {
         $similar = $this->db->getMoreLikeThis($this->id);
         // Send the similar items to the template; if there is only one, we need
         // to force it to be an array or things will not display correctly.
         if (isset($similar) && count($similar['response']['docs']) > 0) {
             $similar = $similar['response']['docs'];
         } else {
             $similar = array();
             $timer->logTime("Did not find any similar records");
         }
         $memCache->set('similar_titles_' . $this->id, $similar, 0, $configArray['Caching']['similar_titles']);
     }
     $this->similarTitles = $similar;
     $interface->assign('similarRecords', $similar);
     $timer->logTime('Loaded similar titles');
     // Find Other Editions
     if ($configArray['Content']['showOtherEditionsPopup'] == false) {
         $editions = OtherEditionHandler::getEditions($this->id, $this->isbn, isset($this->record['issn']) ? $this->record['issn'] : null);
         if (!PEAR_Singleton::isError($editions)) {
             $interface->assign('editions', $editions);
         } else {
             $timer->logTime("Did not find any other editions");
         }
         $timer->logTime('Got Other editions');
     }
     $interface->assign('showStrands', isset($configArray['Strands']['APID']) && strlen($configArray['Strands']['APID']) > 0);
     // Send down text for inclusion in breadcrumbs
     $interface->assign('breadcrumbText', $this->recordDriver->getBreadcrumb());
     // Send down OpenURL for COinS use:
     $interface->assign('openURL', $this->recordDriver->getOpenURL());
     // Send down legal export formats (if any):
     $interface->assign('exportFormats', $this->recordDriver->getExportFormats());
     // Set AddThis User
     $interface->assign('addThis', isset($configArray['AddThis']['key']) ? $configArray['AddThis']['key'] : false);
     // Set Proxy URL
     if (isset($configArray['EZproxy']['host'])) {
         $interface->assign('proxy', $configArray['EZproxy']['host']);
     }
     //setup 5 star ratings
     global $user;
     $ratingData = $resource->getRatingData($user);
     $interface->assign('ratingData', $ratingData);
     $timer->logTime('Got 5 star data');
     //Get Next/Previous Links
     $searchSource = isset($_REQUEST['searchSource']) ? $_REQUEST['searchSource'] : 'local';
     $searchObject = SearchObjectFactory::initSearchObject();
     $searchObject->init($searchSource);
     $searchObject->getNextPrevLinks();
     //Load Staff Details
     $interface->assign('staffDetails', $this->recordDriver->getStaffView());
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:101,代码来源:Record.php

示例4: launch

 function launch()
 {
     global $configArray;
     global $interface;
     global $user;
     global $timer;
     // Get My Transactions
     $oneOrMoreRenewableItems = false;
     if ($this->catalog->status) {
         if ($user->cat_username) {
             $patron = $this->catalog->patronLogin($user->cat_username, $user->cat_password);
             $timer->logTime("Logged in patron to get checked out items.");
             if (PEAR_Singleton::isError($patron)) {
                 PEAR_Singleton::raiseError($patron);
             }
             $patronResult = $this->catalog->getMyProfile($patron);
             if (!PEAR_Singleton::isError($patronResult)) {
                 $interface->assign('profile', $patronResult);
             }
             $timer->logTime("Got patron profile to get checked out items.");
             $libraryHoursMessage = Location::getLibraryHoursMessage($patronResult['homeLocationId']);
             $interface->assign('libraryHoursMessage', $libraryHoursMessage);
             // Define sorting options
             $sortOptions = array('title' => 'Title', 'author' => 'Author', 'dueDate' => 'Due Date', 'format' => 'Format', 'renewed' => 'Times Renewed', 'holdQueueLength' => 'Wish List');
             $interface->assign('sortOptions', $sortOptions);
             $selectedSortOption = isset($_REQUEST['accountSort']) ? $_REQUEST['accountSort'] : 'dueDate';
             $interface->assign('defaultSortOption', $selectedSortOption);
             $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
             $recordsPerPage = isset($_REQUEST['pagesize']) && is_numeric($_REQUEST['pagesize']) ? $_REQUEST['pagesize'] : 25;
             $interface->assign('recordsPerPage', $recordsPerPage);
             if (isset($_GET['exportToExcel'])) {
                 $recordsPerPage = -1;
                 $page = 1;
             }
             $result = $this->catalog->getMyTransactions($page, $recordsPerPage, $selectedSortOption);
             $timer->logTime("Loaded transactions from catalog.");
             if (!PEAR_Singleton::isError($result)) {
                 $link = $_SERVER['REQUEST_URI'];
                 if (preg_match('/[&?]page=/', $link)) {
                     $link = preg_replace("/page=\\d+/", "page=%d", $link);
                 } else {
                     if (strpos($link, "?") > 0) {
                         $link .= "&page=%d";
                     } else {
                         $link .= "?page=%d";
                     }
                 }
                 if ($recordsPerPage != '-1') {
                     $options = array('totalItems' => $result['numTransactions'], 'fileName' => $link, 'perPage' => $recordsPerPage, 'append' => false);
                     $pager = new VuFindPager($options);
                     $interface->assign('pageLinks', $pager->getLinks());
                 }
                 $interface->assign('showNotInterested', false);
                 foreach ($result['transactions'] as $i => $data) {
                     //Get Rating
                     $resource = new Resource();
                     $resource->source = 'VuFind';
                     $resource->record_id = $data['id'];
                     $resource->find(true);
                     $data['ratingData'] = $resource->getRatingData($user);
                     $result['transactions'][$i] = $data;
                     $itemBarcode = isset($data['barcode']) ? $data['barcode'] : null;
                     $itemId = isset($data['itemid']) ? $data['itemid'] : null;
                     if ($itemBarcode != null && isset($_SESSION['renew_message'][$itemBarcode])) {
                         $renewMessage = $_SESSION['renew_message'][$itemBarcode]['message'];
                         $renewResult = $_SESSION['renew_message'][$itemBarcode]['result'];
                         $data['renewMessage'] = $renewMessage;
                         $data['renewResult'] = $renewResult;
                         $result['transactions'][$i] = $data;
                         unset($_SESSION['renew_message'][$itemBarcode]);
                         //$logger->log("Found renewal message in session for $itemBarcode", PEAR_LOG_INFO);
                     } else {
                         if ($itemId != null && isset($_SESSION['renew_message'][$itemId])) {
                             $renewMessage = $_SESSION['renew_message'][$itemId]['message'];
                             $renewResult = $_SESSION['renew_message'][$itemId]['result'];
                             $data['renewMessage'] = $renewMessage;
                             $data['renewResult'] = $renewResult;
                             $result['transactions'][$i] = $data;
                             unset($_SESSION['renew_message'][$itemId]);
                             //$logger->log("Found renewal message in session for $itemBarcode", PEAR_LOG_INFO);
                         } else {
                             $renewMessage = null;
                             $renewResult = null;
                         }
                     }
                 }
                 $interface->assign('transList', $result['transactions']);
                 unset($_SESSION['renew_message']);
             }
         }
     }
     //Determine which columns to show
     $ils = $configArray['Catalog']['ils'];
     $showOut = $ils == 'Horizon';
     $showRenewed = $ils == 'Horizon' || $ils == 'Millennium';
     $showWaitList = $ils == 'Horizon';
     $interface->assign('showOut', $showOut);
     $interface->assign('showRenewed', $showRenewed);
     $interface->assign('showWaitList', $showWaitList);
     if (isset($_GET['exportToExcel'])) {
//.........这里部分代码省略.........
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:101,代码来源:CheckedOut.php

示例5: getMyHolds

 public function getMyHolds($patron = null, $page = 1, $recordsPerPage = -1, $sortOption = 'title')
 {
     global $timer;
     global $configArray;
     global $user;
     $patronDump = $this->driver->_getPatronDump($this->driver->_getBarcode());
     //Load the information from millennium using CURL
     $sResult = $this->driver->_fetchPatronInfoPage($patronDump, 'holds');
     $timer->logTime("Got holds page from Millennium");
     $holds = $this->parseHoldsPage($sResult);
     $timer->logTime("Parsed Holds page");
     //Get a list of all record id so we can load supplemental information
     $recordIds = array();
     foreach ($holds as $holdSections) {
         foreach ($holdSections as $hold) {
             $recordIds[] = "'" . $hold['shortId'] . "'";
         }
     }
     //Get records from resource table
     $resourceInfo = new Resource();
     if (count($recordIds) > 0) {
         $recordIdString = implode(",", $recordIds);
         mysql_select_db($configArray['Database']['database_vufind_dbname']);
         $resourceSql = "SELECT * FROM resource where source = 'VuFind' AND shortId in (" . $recordIdString . ")";
         $resourceInfo->query($resourceSql);
         $timer->logTime('Got records for all titles');
         //Load title author, etc. information
         while ($resourceInfo->fetch()) {
             foreach ($holds as $section => $holdSections) {
                 foreach ($holdSections as $key => $hold) {
                     $hold['recordId'] = $hold['id'];
                     if ($hold['shortId'] == $resourceInfo->shortId) {
                         $hold['recordId'] = $resourceInfo->record_id;
                         $hold['id'] = $resourceInfo->record_id;
                         $hold['shortId'] = $resourceInfo->shortId;
                         //Load title, author, and format information about the title
                         $hold['title'] = isset($resourceInfo->title) ? $resourceInfo->title : 'Unknown';
                         $hold['sortTitle'] = isset($resourceInfo->title_sort) ? $resourceInfo->title_sort : 'unknown';
                         $hold['author'] = isset($resourceInfo->author) ? $resourceInfo->author : null;
                         $hold['format'] = isset($resourceInfo->format) ? $resourceInfo->format : null;
                         $hold['isbn'] = isset($resourceInfo->isbn) ? $resourceInfo->isbn : '';
                         $hold['upc'] = isset($resourceInfo->upc) ? $resourceInfo->upc : '';
                         $hold['format_category'] = isset($resourceInfo->format_category) ? $resourceInfo->format_category : '';
                         //Load rating information
                         $hold['ratingData'] = $resourceInfo->getRatingData($user);
                         $holds[$section][$key] = $hold;
                     }
                 }
             }
         }
     }
     //Process sorting
     //echo ("<br/>\r\nSorting by $sortOption");
     foreach ($holds as $sectionName => $section) {
         $sortKeys = array();
         $i = 0;
         foreach ($section as $key => $hold) {
             $sortTitle = isset($hold['sortTitle']) ? $hold['sortTitle'] : (isset($hold['title']) ? $hold['title'] : "Unknown");
             if ($sectionName == 'available') {
                 $sortKeys[$key] = $sortTitle;
             } else {
                 if ($sortOption == 'title') {
                     $sortKeys[$key] = $sortTitle;
                 } elseif ($sortOption == 'author') {
                     $sortKeys[$key] = (isset($hold['author']) ? $hold['author'] : "Unknown") . '-' . $sortTitle;
                 } elseif ($sortOption == 'placed') {
                     $sortKeys[$key] = $hold['createTime'] . '-' . $sortTitle;
                 } elseif ($sortOption == 'format') {
                     $sortKeys[$key] = (isset($hold['format']) ? $hold['format'] : "Unknown") . '-' . $sortTitle;
                 } elseif ($sortOption == 'location') {
                     $sortKeys[$key] = (isset($hold['location']) ? $hold['location'] : "Unknown") . '-' . $sortTitle;
                 } elseif ($sortOption == 'holdQueueLength') {
                     $sortKeys[$key] = (isset($hold['holdQueueLength']) ? $hold['holdQueueLength'] : 0) . '-' . $sortTitle;
                 } elseif ($sortOption == 'position') {
                     $sortKeys[$key] = str_pad(isset($hold['position']) ? $hold['position'] : 1, 3, "0", STR_PAD_LEFT) . '-' . $sortTitle;
                 } elseif ($sortOption == 'status') {
                     $sortKeys[$key] = (isset($hold['status']) ? $hold['status'] : "Unknown") . '-' . (isset($hold['reactivateTime']) ? $hold['reactivateTime'] : "0") . '-' . $sortTitle;
                 } else {
                     $sortKeys[$key] = $sortTitle;
                 }
                 //echo ("<br/>\r\nSort Key for $key = {$sortKeys[$key]}");
             }
             $sortKeys[$key] = strtolower($sortKeys[$key] . '-' . $i++);
         }
         array_multisort($sortKeys, $section);
         $holds[$sectionName] = $section;
     }
     //Limit to a specific number of records
     if (isset($holds['unavailable'])) {
         $numUnavailableHolds = count($holds['unavailable']);
         if ($recordsPerPage != -1) {
             $startRecord = ($page - 1) * $recordsPerPage;
             $holds['unavailable'] = array_slice($holds['unavailable'], $startRecord, $recordsPerPage);
         }
     } else {
         $numUnavailableHolds = 0;
     }
     if (!isset($holds['available'])) {
         $holds['available'] = array();
     }
//.........这里部分代码省略.........
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:101,代码来源:MillenniumHolds.php

示例6: getSupplementalSearchResult

 public function getSupplementalSearchResult()
 {
     global $configArray;
     global $interface;
     global $user;
     $id = $this->getUniqueID();
     $interface->assign('summId', $id);
     if (substr($id, 0, 1) == '.') {
         $interface->assign('summShortId', substr($id, 1));
     } else {
         $interface->assign('summShortId', $id);
     }
     $formats = $this->getFormats();
     $interface->assign('summFormats', $formats);
     $formatCategories = $this->getFormatCategory();
     $interface->assign('summFormatCategory', $formatCategories);
     $interface->assign('summTitle', $this->getTitle());
     $interface->assign('summSubTitle', $this->getSubtitle());
     $interface->assign('summTitleStatement', $this->getTitleSection());
     $interface->assign('summAuthor', $this->getPrimaryAuthor());
     $publishers = $this->getPublishers();
     $pubDates = $this->getPublicationDates();
     $pubPlaces = $this->getPlacesOfPublication();
     $interface->assign('summPublicationDates', $pubDates);
     $interface->assign('summPublishers', $publishers);
     $interface->assign('summPublicationPlaces', $pubPlaces);
     $interface->assign('summDate', $this->getPublicationDates());
     $interface->assign('summISBN', $this->getCleanISBN());
     $issn = $this->getCleanISSN();
     $interface->assign('summISSN', $issn);
     $upc = $this->getCleanUPC();
     $interface->assign('summUPC', $upc);
     if ($configArray['System']['debugSolr'] == 1) {
         $interface->assign('summScore', $this->getScore());
         $interface->assign('summExplain', $this->getExplain());
     }
     $interface->assign('summPhysical', $this->getPhysicalDescriptions());
     $interface->assign('summEditions', $this->getEdition());
     // Obtain and assign snippet information:
     $snippet = $this->getHighlightedSnippet();
     $interface->assign('summSnippetCaption', $snippet ? $snippet['caption'] : false);
     $interface->assign('summSnippet', $snippet ? $snippet['snippet'] : false);
     //Get Rating
     $resource = new Resource();
     $resource->source = 'VuFind';
     $resource->record_id = $id;
     $resource->find(true);
     $ratingData = $resource->getRatingData($user);
     //print_r($ratingData);
     $interface->assign('summRating', $ratingData);
     //Determine the cover to use
     $isbn = $this->getCleanISBN();
     $formatCategory = isset($formatCategories[0]) ? $formatCategories[0] : '';
     $format = isset($formats[0]) ? $formats[0] : '';
     $interface->assign('bookCoverUrl', $this->getBookcoverUrl($id, $upc, $formatCategory, $format));
     // By default, do not display AJAX status; we won't assume that all
     // records exist in the ILS.  Child classes can override this setting
     // to turn on AJAX as needed:
     $interface->assign('summAjaxStatus', false);
     return 'RecordDrivers/Index/supplementalResult.tpl';
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:61,代码来源:IndexRecord.php


注:本文中的Resource::getRatingData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。