本文整理汇总了PHP中Library::getActiveLibrary方法的典型用法代码示例。如果您正苦于以下问题:PHP Library::getActiveLibrary方法的具体用法?PHP Library::getActiveLibrary怎么用?PHP Library::getActiveLibrary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library
的用法示例。
在下文中一共展示了Library::getActiveLibrary方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSearchSources
static function getSearchSources()
{
$activeLibrary = Library::getActiveLibrary();
if ($activeLibrary == null || count($activeLibrary->searchSources) == 0) {
$searchSources = SearchSources::getSearchSourcesDefault();
} else {
$searchSources = SearchSources::getSearchSourcesLibrary($activeLibrary);
}
return $searchSources;
}
示例2: __construct
public function __construct($searchObject, $params)
{
global $library;
global $configArray;
// Save the basic parameters:
$this->searchObject = $searchObject;
// Parse the additional parameters:
$params = explode(':', $params);
$section = empty($params[0]) ? 'ResultsTop' : $params[0];
$iniFile = isset($params[1]) ? $params[1] : 'facets';
// Load the desired facet information:
$searchLibrary = Library::getActiveLibrary();
$searchLocation = Location::getActiveLocation();
$config = getExtraConfigArray($iniFile);
if ($searchObject->getSearchType() == 'genealogy') {
$this->mainFacets = array();
} else {
$searchLibrary = Library::getActiveLibrary();
$searchLocation = Location::getActiveLocation();
$userLocation = Location::getUserHomeLocation();
$hasSearchLibraryFacets = $searchLibrary != null && count($searchLibrary->facets) > 0;
$hasSearchLocationFacets = $searchLocation != null && count($searchLocation->facets) > 0;
if ($hasSearchLocationFacets) {
$facets = $searchLocation->facets;
} elseif ($hasSearchLibraryFacets) {
$facets = $searchLibrary->facets;
} else {
$facets = Library::getDefaultFacets();
}
foreach ($facets as $facet) {
if ($facet->showAboveResults == 1) {
$facetName = $facet->facetName;
if (isset($searchLibrary)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $searchLibrary->subdomain;
}
}
if (isset($userLocation)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $userLocation->code;
}
}
if (isset($searchLocation)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $searchLocation->code;
}
}
$this->facets[$facetName] = $facet->displayName;
$this->facetSettings[$facetName] = $facet;
}
}
}
// Load other relevant settings:
$this->baseSettings = array('rows' => $config['Results_Settings']['top_rows'], 'cols' => $config['Results_Settings']['top_cols']);
}
示例3: __construct
public function __construct($searchObject, $params)
{
global $configArray;
// Save the basic parameters:
/** @var SearchObject_Solr|SearchObject_Base searchObject */
$this->searchObject = $searchObject;
// Parse the additional parameters:
$params = explode(':', $params);
$iniFile = isset($params[1]) ? $params[1] : 'facets';
// Load the desired facet information:
$config = getExtraConfigArray($iniFile);
if ($this->searchObject->getSearchType() == 'genealogy') {
$this->mainFacets = array();
} else {
$searchLibrary = Library::getActiveLibrary();
global $locationSingleton;
$searchLocation = $locationSingleton->getActiveLocation();
$userLocation = Location::getUserHomeLocation();
$hasSearchLibraryFacets = $searchLibrary != null && count($searchLibrary->facets) > 0;
$hasSearchLocationFacets = $searchLocation != null && count($searchLocation->facets) > 0;
if ($hasSearchLocationFacets) {
$facets = $searchLocation->facets;
} elseif ($hasSearchLibraryFacets) {
$facets = $searchLibrary->facets;
} else {
$facets = Library::getDefaultFacets();
}
global $solrScope;
foreach ($facets as $facet) {
if ($facet->showAboveResults == 1) {
$facetName = $facet->facetName;
if ($solrScope) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $solrScope;
} else {
if ($facet->facetName == 'format_category' && $configArray['Index']['enableDetailedFormats']) {
$facetName = 'format_category_' . $solrScope;
}
}
}
$this->facets[$facetName] = $facet->displayName;
$this->facetSettings[$facetName] = $facet;
if (!$solrScope && $facet->facetName == 'availability_toggle') {
//Don't do availability toggles in the global scope.
//TODO: Base this off the default scope (i.e. mercury/responsive).
unset($this->facets[$facetName]);
unset($this->facetSettings[$facetName]);
}
}
}
}
// Load other relevant settings:
$this->baseSettings = array('rows' => $config['Results_Settings']['top_rows'], 'cols' => $config['Results_Settings']['top_cols']);
}
示例4: saveSearch
function saveSearch($phrase, $type, $numResults)
{
if (!isset($numResults)) {
//This only happens if there is an error parsing the query.
return;
}
$activeLibrary = Library::getActiveLibrary();
$libraryId = -1;
if ($activeLibrary != null && $activeLibrary->useScope) {
$libraryId = $activeLibrary->libraryId;
}
/** @var $locationSingleton Location */
global $locationSingleton;
$locationId = -1;
$activeLocation = $locationSingleton->getActiveLocation();
if ($activeLocation != null && $activeLocation->useScope) {
$locationId = $activeLocation->locationId;
}
$searchStat = new SearchStat();
$searchStat->phrase = strtolower($phrase);
$searchStat->type = $type;
$searchStat->libraryId = $libraryId;
$searchStat->locationId = $locationId;
$searchStat->find();
$isNew = true;
if ($searchStat->N > 0) {
$searchStat->fetch();
$searchStat->numSearches++;
$isNew = false;
} else {
$searchStat->numSearches = 1;
}
$searchStat->numResults = $numResults;
$searchStat->lastSearch = time();
if ($isNew) {
$searchStat->insert();
} else {
$searchStat->update();
}
}
示例5: getLibraryScopingId
public function getLibraryScopingId()
{
//For econtent, we need to be more specific when restricting copies
//since patrons can't use copies that are only available to other libraries.
$searchLibrary = Library::getSearchLibrary();
$searchLocation = Location::getSearchLocation();
$activeLibrary = Library::getActiveLibrary();
$activeLocation = Location::getActiveLocation();
$homeLibrary = Library::getPatronHomeLibrary();
//Load the holding label for the branch where the user is physically.
if (!is_null($homeLibrary)) {
return $homeLibrary->includeOutOfSystemExternalLinks ? -1 : $homeLibrary->libraryId;
} else {
if (!is_null($activeLocation)) {
$activeLibrary = Library::getLibraryForLocation($activeLocation->locationId);
return $activeLibrary->includeOutOfSystemExternalLinks ? -1 : $activeLibrary->libraryId;
} else {
if (isset($activeLibrary)) {
return $activeLibrary->includeOutOfSystemExternalLinks ? -1 : $activeLibrary->libraryId;
} else {
if (!is_null($searchLocation)) {
$searchLibrary = Library::getLibraryForLocation($searchLibrary->locationId);
return $searchLibrary->includeOutOfSystemExternalLinks ? -1 : $searchLocation->libraryId;
} else {
if (isset($searchLibrary)) {
return $searchLibrary->includeOutOfSystemExternalLinks ? -1 : $searchLibrary->libraryId;
} else {
return -1;
}
}
}
}
}
}
示例6: placeHold
//.........这里部分代码省略.........
require_once ROOT_DIR . '/Drivers/marmot_inc/PType.php';
$maxHolds = -1;
//Determine if we should show a warning
$ptype = new PType();
$ptype->pType = $user->patronType;
if ($ptype->find(true)) {
$maxHolds = $ptype->maxHolds;
}
$currentHolds = $profile['numHolds'];
if ($maxHolds != -1 && $currentHolds + 1 > $maxHolds) {
$interface->assign('showOverHoldLimit', true);
$interface->assign('maxHolds', $maxHolds);
$interface->assign('currentHolds', $currentHolds);
}
global $locationSingleton;
//Get the list of pickup branch locations for display in the user interface.
$locations = $locationSingleton->getPickupBranches($profile, $profile['homeLocationId']);
$interface->assign('pickupLocations', $locations);
//set focus to the submit button if the user is logged in since the campus will be correct most of the time.
$interface->assign('focusElementId', 'submit');
} else {
//set focus to the username field by default.
$interface->assign('focusElementId', 'username');
}
global $library;
$patronHomeBranch = Library::getPatronHomeLibrary();
if ($patronHomeBranch != null) {
if ($patronHomeBranch->defaultNotNeededAfterDays > 0) {
$interface->assign('defaultNotNeededAfterDays', date('m/d/Y', time() + $patronHomeBranch->defaultNotNeededAfterDays * 60 * 60 * 24));
} else {
$interface->assign('defaultNotNeededAfterDays', '');
}
$interface->assign('showHoldCancelDate', $patronHomeBranch->showHoldCancelDate);
} else {
if ($library) {
//Show the hold cancellation date for now. It may be hidden later when the user logs in.
if ($library->defaultNotNeededAfterDays > 0) {
$interface->assign('defaultNotNeededAfterDays', date('m/d/Y', time() + $library->defaultNotNeededAfterDays * 60 * 60 * 24));
} else {
$interface->assign('defaultNotNeededAfterDays', '');
}
$interface->assign('showHoldCancelDate', $library->showHoldCancelDate);
} else {
//Show the hold cancellation date for now. It may be hidden later when the user logs in.
$interface->assign('showHoldCancelDate', 1);
$interface->assign('defaultNotNeededAfterDays', '');
}
}
$activeLibrary = Library::getActiveLibrary();
if ($activeLibrary != null) {
$interface->assign('holdDisclaimer', $activeLibrary->holdDisclaimer);
} else {
//Show the hold cancellation date for now. It may be hidden later when the user logs in.
$interface->assign('holdDisclaimer', '');
}
}
$record = RecordDriverFactory::initRecordDriverById('ils:' . $_GET['id']);
if ($record) {
$interface->assign('record', $record);
} else {
PEAR_Singleton::raiseError('Cannot find record ' . $_GET['id']);
}
$interface->assign('id', $_GET['id']);
if ($showMessage && isset($return)) {
$hold_message_data = array('successful' => $return['result'] == true ? 'all' : 'none', 'error' => isset($return['error']) ? $return['error'] : '', 'titles' => array($return), 'campus' => $_REQUEST['campus']);
//Check to see if there are item level holds that need follow-up by the user
if (isset($return['items']) && count($return['items']) > 0) {
$hold_message_data['showItemForm'] = true;
$hold_message_data['items'] = $return['items'];
}
$_SESSION['hold_message'] = $hold_message_data;
if (isset($_SESSION['hold_referrer'])) {
$logger->log('Hold Referrer is set, redirecting to there. location ' . $_SESSION['hold_referrer'], PEAR_LOG_INFO);
if ($_REQUEST['type'] != 'recall' && $_REQUEST['type'] != 'cancel' && $_REQUEST['type'] != 'update') {
header("Location: " . $_SESSION['hold_referrer']);
} else {
//Redirect for hold cancellation or update
$section = isset($_REQUEST['section']) ? $_REQUEST['section'] : 'unavailable';
header("Location: " . '/MyResearch/Holds?section=' . $section);
}
if (!isset($hold_message_data['showItemForm']) || $hold_message_data['showItemForm'] == false) {
unset($_SESSION['hold_referrer']);
if (isset($_SESSION['autologout'])) {
unset($_SESSION['autologout']);
UserAccount::softLogout();
}
}
} else {
$logger->log('No referrer set, but there is a message to show, go to the main holds page', PEAR_LOG_INFO);
header("Location: " . '/MyResearch/Holds');
die;
}
} else {
//$logger->log('placeHold finished, do not need to show a message', PEAR_LOG_INFO);
$interface->setPageTitle('Request an Item');
$interface->assign('subTemplate', 'hold.tpl');
$interface->setTemplate('hold.tpl');
$interface->display('layout.tpl', 'RecordHold' . $_GET['id']);
}
}
示例7: getBookStores
static function getBookStores()
{
$library = Library::getActiveLibrary();
if ($library) {
return NearbyBookStore::getBookStores($library->libraryId);
} else {
return NearbyBookStore::getDefaultBookStores();
}
}
示例8: __construct
public function __construct($searchObject, $params)
{
global $configArray;
// Save the passed-in SearchObject:
$this->searchObject = $searchObject;
// Parse the additional settings:
$params = explode(':', $params);
$mainSection = empty($params[0]) ? 'Results' : $params[0];
$checkboxSection = isset($params[1]) ? $params[1] : false;
$iniName = isset($params[2]) ? $params[2] : 'facets';
if ($searchObject->getSearchType() == 'genealogy') {
$config = getExtraConfigArray($iniName);
$this->mainFacets = isset($config[$mainSection]) ? $config[$mainSection] : array();
} else {
$searchLibrary = Library::getActiveLibrary();
global $locationSingleton;
$searchLocation = $locationSingleton->getActiveLocation();
$userLocation = Location::getUserHomeLocation();
$hasSearchLibraryFacets = $searchLibrary != null && count($searchLibrary->facets) > 0;
$hasSearchLocationFacets = $searchLocation != null && count($searchLocation->facets) > 0;
if ($hasSearchLocationFacets) {
$facets = $searchLocation->facets;
} elseif ($hasSearchLibraryFacets) {
$facets = $searchLibrary->facets;
} else {
$facets = Library::getDefaultFacets();
}
$this->facetSettings = array();
$this->mainFacets = array();
foreach ($facets as $facet) {
$facetName = $facet->facetName;
//Adjust facet name for local scoping
if (isset($searchLibrary)) {
if ($facet->facetName == 'time_since_added') {
$facetName = 'local_time_since_added_' . $searchLibrary->subdomain;
} elseif ($facet->facetName == 'itype') {
$facetName = 'itype_' . $searchLibrary->subdomain;
} elseif ($facet->facetName == 'detailed_location') {
$facetName = 'detailed_location_' . $searchLibrary->subdomain;
} elseif ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $searchLibrary->subdomain;
}
}
if (isset($userLocation)) {
if ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $userLocation->code;
}
}
if (isset($searchLocation)) {
if ($facet->facetName == 'time_since_added' && $searchLocation->restrictSearchByLocation) {
$facetName = 'local_time_since_added_' . $searchLocation->code;
} elseif ($facet->facetName == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$facetName = 'availability_toggle_' . $searchLocation->code;
}
}
//Figure out if the facet should be included
if ($mainSection == 'Results') {
if ($facet->showInResults == 1 && $facet->showAboveResults == 0) {
$this->facetSettings[$facetName] = $facet;
$this->mainFacets[$facetName] = $facet->displayName;
} elseif ($facet->showInAdvancedSearch == 1 && $facet->showAboveResults == 0) {
$this->facetSettings[$facetName] = $facet->displayName;
}
} elseif ($mainSection == 'Author') {
if ($facet->showInAuthorResults == 1 && $facet->showAboveResults == 0) {
$this->facetSettings[$facetName] = $facet;
$this->mainFacets[$facetName] = $facet->displayName;
}
}
}
}
$this->checkboxFacets = $checkboxSection && isset($config[$checkboxSection]) ? $config[$checkboxSection] : array();
}
示例9: getFacetList
/**
* Process facets from the results object
*
* @access public
* @param array $filter Array of field => on-screen description
* listing all of the desired facet fields;
* set to null to get all configured values.
* @param bool $expandingLinks If true, we will include expanding URLs
* (i.e. get all matches for a facet, not
* just a limit to the current search) in
* the return array.
* @return array Facets data arrays
*/
public function getFacetList($filter = null, $expandingLinks = false)
{
// If there is no filter, we'll use all facets as the filter:
if (is_null($filter)) {
$filter = $this->facetConfig;
}
// Start building the facet list:
$list = array();
// If we have no facets to process, give up now
if (!isset($this->indexResult['facet_counts'])) {
return $list;
} elseif (!is_array($this->indexResult['facet_counts']['facet_fields']) && !is_array($this->indexResult['facet_counts']['facet_dates'])) {
return $list;
}
// Loop through every field returned by the result set
$validFields = array_keys($filter);
global $locationSingleton;
/** @var Library $currentLibrary */
$currentLibrary = Library::getActiveLibrary();
$activeLocationFacet = null;
$activeLocation = $locationSingleton->getActiveLocation();
if (!is_null($activeLocation)) {
$activeLocationFacet = $activeLocation->facetLabel;
}
$relatedLocationFacets = null;
$relatedHomeLocationFacets = null;
if (!is_null($currentLibrary)) {
$relatedLocationFacets = $locationSingleton->getLocationsFacetsForLibrary($currentLibrary->libraryId);
}
$homeLibrary = Library::getPatronHomeLibrary();
if (!is_null($homeLibrary)) {
$relatedHomeLocationFacets = $locationSingleton->getLocationsFacetsForLibrary($homeLibrary->libraryId);
}
$allFacets = array_merge($this->indexResult['facet_counts']['facet_fields'], $this->indexResult['facet_counts']['facet_dates']);
foreach ($allFacets as $field => $data) {
// Skip filtered fields and empty arrays:
if (!in_array($field, $validFields) || count($data) < 1) {
continue;
}
// Initialize the settings for the current field
$list[$field] = array();
// Add the on-screen label
$list[$field]['label'] = $filter[$field];
// Build our array of values for this field
$list[$field]['list'] = array();
$foundInstitution = false;
$doInstitutionProcessing = false;
$foundBranch = false;
$doBranchProcessing = false;
//Marmot specific processing to do custom resorting of facets.
if ($field == 'institution' && isset($currentLibrary) && !is_null($currentLibrary)) {
$doInstitutionProcessing = true;
}
if ($field == 'building' && (!is_null($relatedLocationFacets) || !is_null($activeLocationFacet))) {
$doBranchProcessing = true;
} elseif ($field == 'available_at') {
$doBranchProcessing = true;
}
// Should we translate values for the current facet?
$translate = in_array($field, $this->translatedFacets);
$numValidRelatedLocations = 0;
$numValidLibraries = 0;
// Loop through values:
foreach ($data as $facet) {
// Initialize the array of data about the current facet:
$currentSettings = array();
$currentSettings['value'] = $facet[0];
$currentSettings['display'] = $translate ? translate($facet[0]) : $facet[0];
$currentSettings['count'] = $facet[1];
$currentSettings['isApplied'] = false;
$currentSettings['url'] = $this->renderLinkWithFilter("{$field}:" . $facet[0]);
// If we want to have expanding links (all values matching the facet)
// in addition to limiting links (filter current search with facet),
// do some extra work:
if ($expandingLinks) {
$currentSettings['expandUrl'] = $this->getExpandingFacetLink($field, $facet[0]);
}
// Is this field a current filter?
if (in_array($field, array_keys($this->filterList))) {
// and is this value a selected filter?
if (in_array($facet[0], $this->filterList[$field])) {
$currentSettings['isApplied'] = true;
$currentSettings['removalUrl'] = $this->renderLinkWithoutFilter("{$field}:{$facet[0]}");
}
}
//Setup the key to allow sorting alphabetically if needed.
$valueKey = $facet[0];
//.........这里部分代码省略.........
示例10: addFilter
/**
* Take a filter string and add it into the protected
* array checking for duplicates.
*
* @access public
* @param string $newFilter A filter string from url : "field:value"
*/
public function addFilter($newFilter)
{
global $configArray;
// Extract field and value from URL string:
list($field, $value) = $this->parseFilter($newFilter);
$searchLibrary = Library::getActiveLibrary();
global $locationSingleton;
$searchLocation = $locationSingleton->getActiveLocation();
$userLocation = Location::getUserHomeLocation();
global $solrScope;
// Check for duplicates -- if it's not in the array, we can add it
if (!$this->hasFilter($newFilter)) {
if ($field == 'literary-form') {
$field = 'literary_form';
} else {
if ($field == 'literary-form-full') {
$field = 'literary_form_full';
} else {
if ($field == 'target-audience') {
$field = 'target_audience';
} else {
if ($field == 'target-audience-full') {
$field = 'target_audience_full';
}
}
}
}
//See if the filter should be localized
if (isset($searchLibrary)) {
if ($field == 'time_since_added') {
$field = 'local_time_since_added_' . $searchLibrary->subdomain;
} elseif ($field == 'itype') {
$field = 'itype_' . $searchLibrary->subdomain;
} elseif ($field == 'detailed_location') {
$field = 'detailed_location_' . $searchLibrary->subdomain;
}
}
if ($solrScope) {
if ($field == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$field = 'availability_toggle_' . $solrScope;
} elseif ($field == 'format' && $configArray['Index']['enableDetailedFormats']) {
$field = 'format_' . $solrScope;
} elseif ($field == 'format_category' && $configArray['Index']['enableDetailedFormats']) {
$field = 'format_category_' . $solrScope;
} elseif ($field == 'econtent_source' && $configArray['Index']['enableDetailedEContentSources']) {
$field = 'econtent_source_' . $solrScope;
} elseif ($field == 'econtent_protection_type' && $configArray['Index']['enableDetailedEContentSources']) {
$field = 'econtent_protection_type_' . $solrScope;
}
}
if (isset($userLocation)) {
if ($field == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$field = 'availability_toggle_' . $userLocation->code;
}
}
if (isset($searchLocation)) {
if ($field == 'time_since_added' && $searchLocation->restrictSearchByLocation) {
$field = 'local_time_since_added_' . $searchLocation->code;
} elseif ($field == 'availability_toggle' && $configArray['Index']['enableDetailedAvailability']) {
$field = 'availability_toggle_' . $searchLocation->code;
}
}
$this->filterList[$field][] = $value;
}
}
示例11: placeHolds
//.........这里部分代码省略.........
}
if (!$atLeast1Successful) {
$hold_message_data['successful'] = 'none';
}
}
} else {
//Get the referrer so we can go back there.
if (isset($_SERVER['HTTP_REFERER'])) {
$referer = $_SERVER['HTTP_REFERER'];
$_SESSION['hold_referrer'] = $referer;
}
//Showing place hold form.
if ($user) {
$profile = $this->catalog->getMyProfile($user);
$interface->assign('profile', $profile);
//Get information to show a warning if the user does not have sufficient holds
require_once ROOT_DIR . '/Drivers/marmot_inc/PType.php';
$maxHolds = -1;
//Determine if we should show a warning
$ptype = new PType();
$ptype->pType = $user->patronType;
if ($ptype->find(true)) {
$maxHolds = $ptype->maxHolds;
}
$currentHolds = $profile['numHolds'];
if ($maxHolds != -1 && $currentHolds + count($selectedIds) > $maxHolds) {
$interface->assign('showOverHoldLimit', true);
$interface->assign('maxHolds', $maxHolds);
$interface->assign('currentHolds', $currentHolds);
}
global $locationSingleton;
//Get the list of pickup branch locations for display in the user interface.
$locations = $locationSingleton->getPickupBranches($profile, $profile['homeLocationId']);
$interface->assign('pickupLocations', $locations);
//set focus to the submit button if the user is logged in since the campus will be correct most of the time.
$interface->assign('focusElementId', 'submit');
} else {
//set focus to the username field by default.
$interface->assign('focusElementId', 'username');
}
global $library;
$patronHomeBranch = Library::getPatronHomeLibrary();
if ($patronHomeBranch != null) {
if ($patronHomeBranch->defaultNotNeededAfterDays > 0) {
$interface->assign('defaultNotNeededAfterDays', date('m/d/Y', time() + $patronHomeBranch->defaultNotNeededAfterDays * 60 * 60 * 24));
} else {
$interface->assign('defaultNotNeededAfterDays', '');
}
$interface->assign('showHoldCancelDate', $patronHomeBranch->showHoldCancelDate);
} else {
if ($library) {
//Show the hold cancellation date for now. It may be hidden later when the user logs in.
if ($library->defaultNotNeededAfterDays > 0) {
$interface->assign('defaultNotNeededAfterDays', date('m/d/Y', time() + $library->defaultNotNeededAfterDays * 60 * 60 * 24));
} else {
$interface->assign('defaultNotNeededAfterDays', '');
}
$interface->assign('showHoldCancelDate', $library->showHoldCancelDate);
} else {
//Show the hold cancellation date for now. It may be hidden later when the user logs in.
$interface->assign('showHoldCancelDate', 1);
$interface->assign('defaultNotNeededAfterDays', '');
}
}
$activeLibrary = Library::getActiveLibrary();
if ($activeLibrary != null) {
$interface->assign('holdDisclaimer', $activeLibrary->holdDisclaimer);
} else {
//Show the hold cancellation date for now. It may be hidden later when the user logs in.
$interface->assign('holdDisclaimer', '');
}
}
}
if ($showMessage) {
$hold_message_data['fromCart'] = isset($_REQUEST['fromCart']);
$_SESSION['hold_message'] = $hold_message_data;
if (isset($_SESSION['hold_referrer'])) {
if ($_REQUEST['type'] != 'recall' && $_REQUEST['type'] != 'cancel' && $_REQUEST['type'] != 'update') {
header("Location: " . $_SESSION['hold_referrer']);
} else {
//Redirect for hold cancellation or update
header("Location: " . $configArray['Site']['path'] . '/MyResearch/Holds');
}
if (!isset($hold_message_data['showItemForm']) || $hold_message_data['showItemForm'] == false) {
unset($_SESSION['hold_referrer']);
if (isset($_SESSION['autologout'])) {
unset($_SESSION['autologout']);
UserAccount::softLogout();
}
}
} else {
header("Location: " . $configArray['Site']['path'] . '/MyResearch/Holds');
}
} else {
$interface->assign('fromCart', isset($_REQUEST['fromCart']));
$interface->setPageTitle('Request Items');
$interface->setTemplate('holdMultiple.tpl');
$interface->display('layout.tpl', 'RecordHolds');
}
}