本文整理汇总了PHP中Location::getLibraryHoursMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::getLibraryHoursMessage方法的具体用法?PHP Location::getLibraryHoursMessage怎么用?PHP Location::getLibraryHoursMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location::getLibraryHoursMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: launch
function launch()
{
global $configArray;
global $interface;
global $user;
global $timer;
$allCheckedOut = array();
if ($configArray['Catalog']['offline']) {
$interface->assign('offline', true);
} else {
$interface->assign('offline', false);
//Determine which columns to show
$ils = $configArray['Catalog']['ils'];
$showOut = $ils == 'Horizon';
$showRenewed = $ils == 'Horizon' || $ils == 'Millennium' || $ils == 'Sierra' || $ils == 'Koha';
$showWaitList = $ils == 'Horizon';
$interface->assign('showOut', $showOut);
$interface->assign('showRenewed', $showRenewed);
$interface->assign('showWaitList', $showWaitList);
// Define sorting options
$sortOptions = array('title' => 'Title', 'author' => 'Author', 'dueDate' => 'Due Date', 'format' => 'Format');
if ($showWaitList) {
$sortOptions['holdQueueLength'] = 'Wait List';
}
if ($showRenewed) {
$sortOptions['renewed'] = 'Times Renewed';
}
$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;
}
// Get My Transactions
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);
//Get checked out titles from the ILS
$catalogTransactions = $this->catalog->getMyTransactions(1, -1, $selectedSortOption);
$timer->logTime("Loaded transactions from catalog.");
//Get checked out titles from OverDrive
require_once ROOT_DIR . '/Drivers/OverDriveDriverFactory.php';
$overDriveDriver = OverDriveDriverFactory::getDriver();
$overDriveCheckedOutItems = $overDriveDriver->getOverDriveCheckedOutItems($user);
//Get a list of eContent that has been checked out
require_once ROOT_DIR . '/Drivers/EContentDriver.php';
$driver = new EContentDriver();
$eContentCheckedOut = $driver->getMyTransactions($user);
$allCheckedOut = array_merge($catalogTransactions['transactions'], $overDriveCheckedOutItems['items'], $eContentCheckedOut['transactions']);
if (!PEAR_Singleton::isError($catalogTransactions)) {
$interface->assign('showNotInterested', false);
foreach ($allCheckedOut as $i => $curTitle) {
$sortTitle = isset($curTitle['title_sort']) ? $curTitle['title_sort'] : $curTitle['title'];
$sortKey = $sortTitle;
if ($selectedSortOption == 'title') {
$sortKey = $sortTitle;
} elseif ($selectedSortOption == 'author') {
$sortKey = (isset($curTitle['author']) ? $curTitle['author'] : "Unknown") . '-' . $sortTitle;
} elseif ($selectedSortOption == 'dueDate') {
if (isset($curTitle['duedate'])) {
if (preg_match('/.*?(\\d{1,2})[-\\/](\\d{1,2})[-\\/](\\d{2,4}).*/', $curTitle['duedate'], $matches)) {
$sortKey = $matches[3] . '-' . $matches[1] . '-' . $matches[2] . '-' . $sortTitle;
} else {
$sortKey = $curTitle['duedate'] . '-' . $sortTitle;
}
}
} elseif ($selectedSortOption == 'format') {
$sortKey = (isset($curTitle['format']) ? $curTitle['format'] : "Unknown") . '-' . $sortTitle;
} elseif ($selectedSortOption == 'renewed') {
$sortKey = str_pad(isset($curTitle['renewCount']) ? $curTitle['renewCount'] : 0, 3, '0', STR_PAD_LEFT) . '-' . $sortTitle;
} elseif ($selectedSortOption == 'holdQueueLength') {
$sortKey = str_pad(isset($curTitle['holdQueueLength']) ? $curTitle['holdQueueLength'] : 0, 3, '0', STR_PAD_LEFT) . '-' . $sortTitle;
}
$itemBarcode = isset($curTitle['barcode']) ? $curTitle['barcode'] : null;
$itemId = isset($curTitle['itemid']) ? $curTitle['itemid'] : null;
if ($itemBarcode != null && isset($_SESSION['renew_message'][$itemBarcode])) {
$renewMessage = $_SESSION['renew_message'][$itemBarcode]['message'];
$renewResult = $_SESSION['renew_message'][$itemBarcode]['result'];
$curTitle['renewMessage'] = $renewMessage;
$curTitle['renewResult'] = $renewResult;
$allCheckedOut[$sortKey] = $curTitle;
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])) {
//.........这里部分代码省略.........
示例2: launch
function launch()
{
global $configArray;
global $interface;
global $user;
//these actions are being moved to MyAccount/AJAX.php
if (isset($_REQUEST['multiAction'])) {
$multiAction = $_REQUEST['multiAction'];
$locationId = isset($_REQUEST['location']) ? $_REQUEST['location'] : null;
$cancelId = array();
$type = 'update';
$freeze = '';
if ($multiAction == 'cancelSelected') {
$type = 'cancel';
// $freeze = ''; // same as default setting.
} elseif ($multiAction == 'freezeSelected') {
// $type = 'update'; // same as default setting.
$freeze = 'on';
} elseif ($multiAction == 'thawSelected') {
// $type = 'update'; // same as default setting.
$freeze = 'off';
}
// elseif ($multiAction == 'updateSelected'){ // same as default settings.
// $type = 'update';
// $freeze = '';
// }
$result = $this->catalog->driver->updateHoldDetailed($user->password, $type, '', null, $cancelId, $locationId, $freeze);
// $interface->assign('holdResult', $result);
//Redirect back here without the extra parameters.
$redirectUrl = $configArray['Site']['path'] . '/MyAccount/Holds?accountSort=' . ($selectedSortOption = isset($_REQUEST['accountSort']) ? $_REQUEST['accountSort'] : 'title');
header("Location: " . $redirectUrl);
die;
}
$interface->assign('allowFreezeHolds', true);
$ils = $configArray['Catalog']['ils'];
$showPosition = $ils == 'Horizon' || ($ils = 'Koha');
$showExpireTime = $ils == 'Horizon';
$suspendRequiresReactivationDate = $ils == 'Horizon';
$interface->assign('suspendRequiresReactivationDate', $suspendRequiresReactivationDate);
$canChangePickupLocation = $ils != 'Koha';
$interface->assign('canChangePickupLocation', $canChangePickupLocation);
// Define sorting options
$sortOptions = array('title' => 'Title', 'author' => 'Author', 'format' => 'Format', 'placed' => 'Date Placed', 'location' => 'Pickup Location', 'status' => 'Status');
if ($showPosition) {
$sortOptions['position'] = 'Position';
}
$interface->assign('sortOptions', $sortOptions);
$selectedSortOption = isset($_REQUEST['accountSort']) ? $_REQUEST['accountSort'] : 'title';
$interface->assign('defaultSortOption', $selectedSortOption);
$profile = $this->catalog->getMyProfile($user);
// TODO: getMyProfile called for second time. First time on index.php
$libraryHoursMessage = Location::getLibraryHoursMessage($profile['homeLocationId']);
$interface->assign('libraryHoursMessage', $libraryHoursMessage);
$allowChangeLocation = $ils == 'Millennium' || $ils == 'Sierra';
$interface->assign('allowChangeLocation', $allowChangeLocation);
//$showPlacedColumn = ($ils == 'Horizon');
//Horizon Web Services does not include data placed anymore
$showPlacedColumn = false;
$interface->assign('showPlacedColumn', $showPlacedColumn);
$showDateWhenSuspending = $ils == 'Horizon';
$interface->assign('showDateWhenSuspending', $showDateWhenSuspending);
$interface->assign('showPosition', $showPosition);
$interface->assign('showNotInterested', false);
// Get My Transactions
if ($configArray['Catalog']['offline']) {
$interface->assign('offline', true);
} else {
$patron = null;
if ($this->catalog->status) {
if ($user->cat_username) {
$patron = $this->catalog->patronLogin($user->cat_username, $user->cat_password);
$patronResult = $this->catalog->getMyProfile($patron);
// TODO: getMyProfile called above already. Is this call necessary?
if (!PEAR_Singleton::isError($patronResult)) {
$interface->assign('profile', $patronResult);
}
$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;
}
//Get Holds from the ILS
$ilsHolds = $this->catalog->getMyHolds($patron, 1, -1, $selectedSortOption);
if (PEAR_Singleton::isError($ilsHolds)) {
$ilsHolds = array();
}
//Get holds from OverDrive
require_once ROOT_DIR . '/Drivers/OverDriveDriverFactory.php';
$overDriveDriver = OverDriveDriverFactory::getDriver();
$overDriveHolds = $overDriveDriver->getOverDriveHolds($user);
//Get a list of eContent that has been checked out
require_once ROOT_DIR . '/Drivers/EContentDriver.php';
$driver = new EContentDriver();
$eContentHolds = $driver->getMyHolds($user);
$allHolds = array_merge_recursive($ilsHolds, $overDriveHolds, $eContentHolds);
//.........这里部分代码省略.........
示例3: launch
function launch()
{
global $configArray;
global $interface;
global $user;
global $timer;
if (isset($_REQUEST['multiAction'])) {
$multiAction = $_REQUEST['multiAction'];
$locationId = isset($_REQUEST['location']) ? $_REQUEST['location'] : null;
$cancelId = array();
$freeze = '';
$type = 'update';
if ($multiAction == 'cancelSelected') {
$type = 'cancel';
$freeze = '';
} elseif ($multiAction == 'freezeSelected') {
$type = 'update';
$freeze = 'on';
} elseif ($multiAction == 'thawSelected') {
$type = 'update';
$freeze = 'off';
} elseif ($multiAction == 'updateSelected') {
$type = 'update';
$freeze = '';
}
$result = $this->catalog->driver->updateHoldDetailed($user->password, $type, '', null, $cancelId, $locationId, $freeze);
$interface->assign('holdResult', $result);
//Redirect back here without the extra parameters.
$redirectUrl = $configArray['Site']['path'] . '/MyResearch/Holds?accountSort=' . ($selectedSortOption = isset($_REQUEST['accountSort']) ? $_REQUEST['accountSort'] : 'title');
if (isset($_REQUEST['section'])) {
$redirectUrl .= "§ion=" . $_REQUEST['section'];
}
header("Location: " . $redirectUrl);
die;
}
$interface->assign('allowFreezeHolds', true);
$ils = $configArray['Catalog']['ils'];
$showPosition = $ils == 'Horizon';
$showExpireTime = $ils == 'Horizon';
// Define sorting options
$sortOptions = array('title' => 'Title', 'author' => 'Author', 'format' => 'Format', 'placed' => 'Date Placed', 'location' => 'Pickup Location', 'status' => 'Status');
if ($showPosition) {
$sortOptions['position'] = 'Position';
}
$interface->assign('sortOptions', $sortOptions);
$selectedSortOption = isset($_REQUEST['accountSort']) ? $_REQUEST['accountSort'] : 'title';
$interface->assign('defaultSortOption', $selectedSortOption);
$profile = $this->catalog->getMyProfile($user);
$libraryHoursMessage = Location::getLibraryHoursMessage($profile['homeLocationId']);
$interface->assign('libraryHoursMessage', $libraryHoursMessage);
$allowChangeLocation = $ils == 'Millennium';
$interface->assign('allowChangeLocation', $allowChangeLocation);
$showPlacedColumn = $ils == 'Horizon';
$interface->assign('showPlacedColumn', $showPlacedColumn);
$showDateWhenSuspending = $ils == 'Horizon';
$interface->assign('showDateWhenSuspending', $showDateWhenSuspending);
$interface->assign('showPosition', $showPosition);
$interface->assign('showNotInterested', false);
// Get My Transactions
$patron = null;
if ($this->catalog->status) {
if ($user->cat_username) {
$patron = $this->catalog->patronLogin($user->cat_username, $user->cat_password);
$patronResult = $this->catalog->getMyProfile($patron);
if (!PEAR_Singleton::isError($patronResult)) {
$interface->assign('profile', $patronResult);
}
$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->getMyHolds($patron, $page, $recordsPerPage, $selectedSortOption);
if (!PEAR_Singleton::isError($result)) {
if (count($result) > 0) {
$location = new Location();
$pickupBranches = $location->getPickupBranches($patronResult, null);
$locationList = array();
foreach ($pickupBranches as $curLocation) {
$locationList[$curLocation->locationId] = $curLocation->displayName;
}
$interface->assign('pickupLocations', $locationList);
foreach ($result['holds'] as $sectionKey => $sectionData) {
if ($sectionKey == 'unavailable') {
$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') {
//.........这里部分代码省略.........
示例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'])) {
//.........这里部分代码省略.........