本文整理汇总了PHP中OJSPaymentManager::getManager方法的典型用法代码示例。如果您正苦于以下问题:PHP OJSPaymentManager::getManager方法的具体用法?PHP OJSPaymentManager::getManager怎么用?PHP OJSPaymentManager::getManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OJSPaymentManager
的用法示例。
在下文中一共展示了OJSPaymentManager::getManager方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Display the form.
*/
function display()
{
$journal =& Request::getJournal();
$user =& Request::getUser();
$templateMgr =& TemplateManager::getManager();
// Get sections for this journal
$sectionDao =& DAORegistry::getDAO('SectionDAO');
// If this user is a section editor or an editor, they are allowed
// to submit to sections flagged as "editor-only" for submissions.
// Otherwise, display only sections they are allowed to submit to.
$roleDao =& DAORegistry::getDAO('RoleDAO');
$isEditor = $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_EDITOR) || $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_SECTION_EDITOR);
// Set up required Payment Related Information
import('payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
if ($paymentManager->submissionEnabled() || $paymentManager->fastTrackEnabled() || $paymentManager->publicationEnabled()) {
$templateMgr->assign('authorFees', true);
$completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
$articleId = $this->articleId;
if ($paymentManager->submissionEnabled()) {
$templateMgr->assign_by_ref('submissionPayment', $completedPaymentDAO->getSubmissionCompletedPayment($journal->getId(), $articleId));
}
if ($paymentManager->fastTrackEnabled()) {
$templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDAO->getFastTrackCompletedPayment($journal->getId(), $articleId));
}
}
$templateMgr->assign('sectionOptions', array('0' => Locale::translate('author.submit.selectSection')) + $sectionDao->getSectionTitles($journal->getId(), !$isEditor));
parent::display();
}
示例2: validate
/**
* Validate the form
*/
function validate()
{
import('payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
if ($paymentManager->submissionEnabled()) {
if (!$this->isValid()) {
return false;
}
$journal =& Request::getJournal();
$journalId = $journal->getJournalId();
$articleId = $this->articleId;
$user =& Request::getUser();
$completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
if ($completedPaymentDAO->hasPaidSubmission($journalId, $articleId)) {
return parent::validate();
} elseif (Request::getUserVar('qualifyForWaiver') && Request::getUserVar('commentsToEditor') != '') {
return parent::validate();
} elseif (Request::getUserVar('paymentSent')) {
return parent::validate();
} else {
$queuedPayment =& $paymentManager->createQueuedPayment($journalId, PAYMENT_TYPE_SUBMISSION, $user->getUserId(), $articleId, $journal->getSetting('submissionFee'));
$queuedPaymentId = $paymentManager->queuePayment($queuedPayment);
$paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
exit;
}
} else {
return parent::validate();
}
}
示例3: getContents
function getContents(&$templateMgr)
{
$journal =& Request::getJournal();
if (!$journal) {
return '';
}
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$templateMgr->assign('donationEnabled', $paymentManager->donationEnabled());
return parent::getContents($templateMgr);
}
示例4: index
function index($args)
{
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$journal =& Request::getJournal();
if (!Validation::isLoggedIn()) {
Validation::redirectLogin("payment.loginRequired.forDonation");
}
$user =& Request::getUser();
$queuedPayment =& $paymentManager->createQueuedPayment($journal->getId(), PAYMENT_TYPE_DONATION, $user->getId(), 0, 0);
$queuedPaymentId = $paymentManager->queuePayment($queuedPayment);
$paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
}
示例5: index
/**
* Display journal author index page.
*/
function index($args)
{
list($journal) = AuthorHandler::validate();
AuthorHandler::setupTemplate();
$user =& Request::getUser();
$rangeInfo =& Handler::getRangeInfo('submissions');
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$page = isset($args[0]) ? $args[0] : '';
switch ($page) {
case 'completed':
$active = false;
break;
default:
$page = 'active';
$active = true;
}
$submissions = $authorSubmissionDao->getAuthorSubmissions($user->getUserId(), $journal->getJournalId(), $active, $rangeInfo);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('pageToDisplay', $page);
if (!$active) {
// Make view counts available if enabled.
$templateMgr->assign('statViews', $journal->getSetting('statViews'));
}
$templateMgr->assign_by_ref('submissions', $submissions);
// assign payment
import('payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
if ($paymentManager->isConfigured()) {
$templateMgr->assign('submissionEnabled', $paymentManager->submissionEnabled());
$templateMgr->assign('fastTrackEnabled', $paymentManager->fastTrackEnabled());
$templateMgr->assign('publicationEnabled', $paymentManager->publicationEnabled());
$completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
$templateMgr->assign_by_ref('completedPaymentDAO', $completedPaymentDAO);
}
/** Opatan Inc. **/
$journalPath = $journal->getPath();
$templateMgr->assign('journalTitle', $journalPath);
import('issue.IssueAction');
$issueAction =& new IssueAction();
$templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
$templateMgr->assign('helpTopicId', 'editorial.authorsRole.submissions');
$templateMgr->display('author/index.tpl');
}
示例6: getContents
/**
* Get the HTML contents for this block.
* @param $templateMgr object
* @return $string
*/
function getContents(&$templateMgr)
{
$journal =& Request::getJournal();
$journalId = $journal ? $journal->getId() : null;
if (!$journal) {
return '';
}
if ($journal->getSetting('publishingMode') != PUBLISHING_MODE_SUBSCRIPTION) {
return '';
}
$user =& Request::getUser();
$userId = $user ? $user->getId() : null;
$templateMgr->assign('userLoggedIn', isset($userId) ? true : false);
if (isset($userId)) {
$subscriptionDao =& DAORegistry::getDAO('IndividualSubscriptionDAO');
$individualSubscription =& $subscriptionDao->getSubscriptionByUserForJournal($userId, $journalId);
$templateMgr->assign_by_ref('individualSubscription', $individualSubscription);
}
// If no individual subscription or if not valid, check for institutional subscription
if (!isset($individualSubscription) || !$individualSubscription->isValid()) {
$IP = Request::getRemoteAddr();
$domain = Request::getRemoteDomain();
$subscriptionDao =& DAORegistry::getDAO('InstitutionalSubscriptionDAO');
$subscriptionId = $subscriptionDao->isValidInstitutionalSubscription($domain, $IP, $journalId);
if ($subscriptionId) {
$institutionalSubscription =& $subscriptionDao->getSubscription($subscriptionId);
$templateMgr->assign_by_ref('institutionalSubscription', $institutionalSubscription);
$templateMgr->assign('userIP', $IP);
}
}
if (isset($individualSubscription) || isset($institutionalSubscription)) {
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$acceptSubscriptionPayments = $paymentManager->acceptSubscriptionPayments();
$templateMgr->assign('acceptSubscriptionPayments', $acceptSubscriptionPayments);
}
return parent::getContents($templateMgr);
}
示例7: display
/**
* Display the form.
*/
function display()
{
$journal =& Request::getJournal();
$user =& Request::getUser();
$templateMgr =& TemplateManager::getManager();
// Get sections for this journal
$sectionDao =& DAORegistry::getDAO('SectionDAO');
// If this user is a section editor or an editor, they are
// allowed to submit to sections flagged as "editor-only" for
// submissions. Otherwise, display only sections they are
// allowed to submit to.
$roleDao =& DAORegistry::getDAO('RoleDAO');
$isEditor = $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_EDITOR) || $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_SECTION_EDITOR);
$templateMgr->assign('sectionOptions', array('0' => Locale::translate('author.submit.selectSection')) + $sectionDao->getSectionTitles($journal->getId(), !$isEditor));
// Set up required Payment Related Information
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
if ($paymentManager->submissionEnabled() || $paymentManager->fastTrackEnabled() || $paymentManager->publicationEnabled()) {
$templateMgr->assign('authorFees', true);
$completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
$articleId = $this->articleId;
if ($paymentManager->submissionEnabled()) {
$templateMgr->assign_by_ref('submissionPayment', $completedPaymentDAO->getSubmissionCompletedPayment($journal->getId(), $articleId));
}
if ($paymentManager->fastTrackEnabled()) {
$templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDAO->getFastTrackCompletedPayment($journal->getId(), $articleId));
}
}
// Provide available submission languages. (Convert the array
// of locale symbolic names xx_XX into an associative array
// of symbolic names => readable names.)
$supportedSubmissionLocales = $journal->getSetting('supportedSubmissionLocales');
if (empty($supportedSubmissionLocales)) {
$supportedSubmissionLocales = array($journal->getPrimaryLocale());
}
$templateMgr->assign('supportedSubmissionLocaleNames', array_flip(array_intersect(array_flip(Locale::getAllLocales()), $supportedSubmissionLocales)));
parent::display();
}
示例8: handle
/**
* Handle incoming requests/notifications
*/
function handle($args)
{
$journal =& Request::getJournal();
$templateMgr =& TemplateManager::getManager();
$user =& Request::getUser();
$op = isset($args[0]) ? $args[0] : null;
$queuedPaymentId = isset($args[1]) ? (int) $args[1] : 0;
import('classes.payment.ojs.OJSPaymentManager');
$ojsPaymentManager =& OJSPaymentManager::getManager();
$queuedPayment =& $ojsPaymentManager->getQueuedPayment($queuedPaymentId);
// if the queued payment doesn't exist, redirect away from payments
if (!$queuedPayment) {
Request::redirect(null, 'index');
}
switch ($op) {
case 'notify':
import('classes.mail.MailTemplate');
Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON));
$contactName = $journal->getSetting('contactName');
$contactEmail = $journal->getSetting('contactEmail');
$mail = new MailTemplate('MANUAL_PAYMENT_NOTIFICATION');
$mail->setFrom($contactEmail, $contactName);
$mail->addRecipient($contactEmail, $contactName);
$mail->assignParams(array('journalName' => $journal->getLocalizedTitle(), 'userFullName' => $user ? $user->getFullName() : '(' . Locale::translate('common.none') . ')', 'userName' => $user ? $user->getUsername() : '(' . Locale::translate('common.none') . ')', 'itemName' => $queuedPayment->getName(), 'itemCost' => $queuedPayment->getAmount(), 'itemCurrencyCode' => $queuedPayment->getCurrencyCode()));
$mail->send();
$templateMgr->assign(array('currentUrl' => Request::url(null, null, 'payment', 'plugin', array('notify', $queuedPaymentId)), 'pageTitle' => 'plugins.paymethod.manual.paymentNotification', 'message' => 'plugins.paymethod.manual.notificationSent', 'backLink' => $queuedPayment->getRequestUrl(), 'backLinkLabel' => 'common.continue'));
$templateMgr->display('common/message.tpl');
exit;
break;
}
parent::handle($args);
// Don't know what to do with it
}
示例9: memberships
/**
* Display subscriptions page.
*/
function memberships()
{
$this->addCheck(new HandlerValidatorJournal($this));
$this->validate();
$this->setupTemplate(true);
$journal =& Request::getJournal();
$journalId = $journal->getId();
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$membershipEnabled = $paymentManager->membershipEnabled();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('membershipEnabled', $membershipEnabled);
if ($membershipEnabled) {
$membershipFee = $journal->getSetting('membershipFee');
$membershipFeeName =& $journal->getLocalizedSetting('membershipFeeName');
$membershipFeeDescription =& $journal->getLocalizedSetting('membershipFeeDescription');
$currency = $journal->getSetting('currency');
$templateMgr->assign('membershipFee', $membershipFee);
$templateMgr->assign('currency', $currency);
$templateMgr->assign('membershipFeeName', $membershipFeeName);
$templateMgr->assign('membershipFeeDescription', $membershipFeeDescription);
$templateMgr->display('about/memberships.tpl');
return;
}
Request::redirect(null, 'about');
}
示例10: payMembership
function payMembership($args)
{
$this->validate();
$this->setupTemplate();
import('payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$journal =& Request::getJournal();
$user =& Request::getUser();
$queuedPayment =& $paymentManager->createQueuedPayment($journal->getId(), PAYMENT_TYPE_MEMBERSHIP, $user->getId(), null, $journal->getSetting('membershipFee'));
$queuedPaymentId = $paymentManager->queuePayment($queuedPayment);
$paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
}
示例11: saveSubscriptionPolicies
/**
* Save subscription policies for the current journal.
*/
function saveSubscriptionPolicies($args = array())
{
import('classes.subscription.form.SubscriptionPolicyForm');
$subscriptionPolicyForm = new SubscriptionPolicyForm();
$subscriptionPolicyForm->readInputData();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('helpTopicId', 'journal.managementPages.subscriptions');
if (Config::getVar('general', 'scheduled_tasks')) {
$templateMgr->assign('scheduledTasksEnabled', true);
}
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$templateMgr->assign('acceptSubscriptionPayments', $paymentManager->acceptSubscriptionPayments());
if ($subscriptionPolicyForm->validate()) {
$subscriptionPolicyForm->execute();
$templateMgr->assign('subscriptionPoliciesSaved', '1');
$subscriptionPolicyForm->display();
} else {
$subscriptionPolicyForm->display();
}
}
示例12: index
/**
* Display journal author index page.
*/
function index($args)
{
$this->validate();
$this->setupTemplate();
$journal =& Request::getJournal();
$user =& Request::getUser();
$rangeInfo =& Handler::getRangeInfo('submissions');
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$page = isset($args[0]) ? $args[0] : '';
switch ($page) {
case 'completed':
$active = false;
break;
default:
$page = 'active';
$active = true;
}
$sort = Request::getUserVar('sort');
$sort = isset($sort) ? $sort : 'title';
$sortDirection = Request::getUserVar('sortDirection');
$sortDirection = isset($sortDirection) && ($sortDirection == SORT_DIRECTION_ASC || $sortDirection == SORT_DIRECTION_DESC) ? $sortDirection : SORT_DIRECTION_ASC;
if ($sort == 'status') {
// FIXME Does not pass $rangeInfo else we only get partial results
$unsortedSubmissions = $authorSubmissionDao->getAuthorSubmissions($user->getId(), $journal->getId(), $active, null, $sort, $sortDirection);
// Sort all submissions by status, which is too complex to do in the DB
$submissionsArray = $unsortedSubmissions->toArray();
$compare = create_function('$s1, $s2', 'return strcmp($s1->getSubmissionStatus(), $s2->getSubmissionStatus());');
usort($submissionsArray, $compare);
if ($sortDirection == SORT_DIRECTION_DESC) {
$submissionsArray = array_reverse($submissionsArray);
}
// Convert submission array back to an ItemIterator class
import('core.ArrayItemIterator');
$submissions =& ArrayItemIterator::fromRangeInfo($submissionsArray, $rangeInfo);
} else {
$submissions = $authorSubmissionDao->getAuthorSubmissions($user->getId(), $journal->getId(), $active, $rangeInfo, $sort, $sortDirection);
}
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('pageToDisplay', $page);
if (!$active) {
// Make view counts available if enabled.
$templateMgr->assign('statViews', $journal->getSetting('statViews'));
}
$templateMgr->assign_by_ref('submissions', $submissions);
// assign payment
import('payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
if ($paymentManager->isConfigured()) {
$templateMgr->assign('submissionEnabled', $paymentManager->submissionEnabled());
$templateMgr->assign('fastTrackEnabled', $paymentManager->fastTrackEnabled());
$templateMgr->assign('publicationEnabled', $paymentManager->publicationEnabled());
$completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
$templateMgr->assign_by_ref('completedPaymentDAO', $completedPaymentDAO);
}
import('issue.IssueAction');
$issueAction = new IssueAction();
$templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
$templateMgr->assign('helpTopicId', 'editorial.authorsRole.submissions');
$templateMgr->assign('sort', $sort);
$templateMgr->assign('sortDirection', $sortDirection);
$templateMgr->display('author/index.tpl');
}
示例13: getContents
/**
* Get the HTML contents for this block.
* @param $templateMgr object
* @return $string
*/
function getContents(&$templateMgr)
{
$journal =& Request::getJournal();
$journalId = $journal ? $journal->getJournalId() : null;
if (!$journal) {
return '';
}
$user =& Request::getUser();
$userId = $user ? $user->getUserId() : null;
$domain = Request::getRemoteDomain();
$IP = Request::getRemoteAddr();
// This replicates the order of SubscriptionDAO::isValidSubscription
// Checks for valid Subscription and assigns vars accordingly for display
$subscriptionDao =& DAORegistry::getDAO('SubscriptionDAO');
$subscriptionId = false;
$userHasSubscription = false;
if ($userId != null) {
$subscriptionId = $subscriptionDao->isValidSubscriptionByUser($userId, $journalId);
$userHasSubscription = true;
}
if (!$userHasSubscription && $domain != null) {
$subscriptionId = $subscriptionDao->isValidSubscriptionByDomain($domain, $journalId);
}
if (!$userHasSubscription && $IP != null) {
$subscriptionId = $subscriptionDao->isValidSubscriptionByIP($IP, $journalId);
}
if ($subscriptionId !== false) {
$subscription =& $subscriptionDao->getSubscription($subscriptionId);
$templateMgr->assign('userHasSubscription', $userHasSubscription);
if ($userHasSubscription) {
import('payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$subscriptionEnabled = $paymentManager->acceptSubscriptionPayments();
$templateMgr->assign('subscriptionEnabled', $subscriptionEnabled);
}
$templateMgr->assign('subscriptionMembership', $subscription->getMembership());
$templateMgr->assign('subscriptionDateEnd', $subscription->getDateEnd());
$templateMgr->assign('subscriptionTypeName', $subscription->getSubscriptionTypeName());
$templateMgr->assign('userIP', $IP);
return parent::getContents($templateMgr);
}
return '';
}
示例14: TemplateManager
/**
* Constructor.
* Initialize template engine and assign basic template variables.
*/
function TemplateManager()
{
parent::PKPTemplateManager();
// Are we using implicit authentication?
$this->assign('implicitAuth', Config::getVar('security', 'implicit_auth'));
if (!defined('SESSION_DISABLE_INIT')) {
/**
* Kludge to make sure no code that tries to connect to
* the database is executed (e.g., when loading
* installer pages).
*/
$journal =& Request::getJournal();
$site =& Request::getSite();
$siteFilesDir = Request::getBaseUrl() . '/' . PublicFileManager::getSiteFilesPath();
$this->assign('sitePublicFilesDir', $siteFilesDir);
$this->assign('publicFilesDir', $siteFilesDir);
// May be overridden by journal
$siteStyleFilename = PublicFileManager::getSiteFilesPath() . '/' . $site->getSiteStyleFilename();
if (file_exists($siteStyleFilename)) {
$this->addStyleSheet(Request::getBaseUrl() . '/' . $siteStyleFilename);
}
if (isset($journal)) {
$this->assign_by_ref('currentJournal', $journal);
$journalTitle = $journal->getJournalTitle();
$this->assign('siteTitle', $journalTitle);
$this->assign('publicFilesDir', Request::getBaseUrl() . '/' . PublicFileManager::getJournalFilesPath($journal->getJournalId()));
$this->assign('primaryLocale', $journal->getPrimaryLocale());
$this->assign('alternateLocales', $journal->getSetting('alternateLocales'));
// Assign additional navigation bar items
$navMenuItems =& $journal->getLocalizedSetting('navItems');
$this->assign_by_ref('navMenuItems', $navMenuItems);
// Assign journal page header
$this->assign('displayPageHeaderTitle', $journal->getJournalPageHeaderTitle());
$this->assign('displayPageHeaderLogo', $journal->getJournalPageHeaderLogo());
$this->assign('alternatePageHeader', $journal->getLocalizedSetting('journalPageHeader'));
$this->assign('metaSearchDescription', $journal->getLocalizedSetting('searchDescription'));
$this->assign('metaSearchKeywords', $journal->getLocalizedSetting('searchKeywords'));
$this->assign('metaCustomHeaders', $journal->getLocalizedSetting('customHeaders'));
$this->assign('numPageLinks', $journal->getSetting('numPageLinks'));
$this->assign('itemsPerPage', $journal->getSetting('itemsPerPage'));
$this->assign('enableAnnouncements', $journal->getSetting('enableAnnouncements'));
// Load and apply theme plugin, if chosen
$themePluginPath = $journal->getSetting('journalTheme');
if (!empty($themePluginPath)) {
// Load and activate the theme
$themePlugin =& PluginRegistry::loadPlugin('themes', $themePluginPath);
if ($themePlugin) {
$themePlugin->activate($this);
}
}
// Assign stylesheets and footer
$journalStyleSheet = $journal->getSetting('journalStyleSheet');
if ($journalStyleSheet) {
$this->addStyleSheet(Request::getBaseUrl() . '/' . PublicFileManager::getJournalFilesPath($journal->getJournalId()) . '/' . $journalStyleSheet['uploadName']);
}
import('payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
$this->assign('journalPaymentsEnabled', $paymentManager->isConfigured());
$this->assign('pageFooter', $journal->getLocalizedSetting('journalPageFooter'));
} else {
// Add the site-wide logo, if set for this locale or the primary locale
$this->assign('displayPageHeaderTitle', $site->getSitePageHeaderTitle());
$this->assign('siteTitle', $site->getSiteTitle());
}
if (!$site->getRedirect()) {
$this->assign('hasOtherJournals', true);
}
}
}
示例15: setupIssueTemplate
/**
* Given an issue, set up the template with all the required variables for
* issues/view.tpl to function properly.
* @param $issue object The issue to display
* @param $showToc boolean iff false and a custom cover page exists,
* the cover page will be displayed. Otherwise table of contents
* will be displayed.
*/
function setupIssueTemplate(&$issue, $showToc = false)
{
$journal =& Request::getJournal();
$journalId = $journal->getId();
$templateMgr =& TemplateManager::getManager();
if (isset($issue) && ($issue->getPublished() || Validation::isEditor($journalId) || Validation::isLayoutEditor($journalId) || Validation::isProofreader($journalId)) && $issue->getJournalId() == $journalId) {
$issueHeadingTitle = $issue->getIssueIdentification(false, true);
$issueCrumbTitle = $issue->getIssueIdentification(false, true);
$locale = Locale::getLocale();
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$coverPagePath = Request::getBaseUrl() . '/';
$coverPagePath .= $publicFileManager->getJournalFilesPath($journalId) . '/';
$templateMgr->assign('coverPagePath', $coverPagePath);
$templateMgr->assign('locale', $locale);
if ($issue->getFileName($locale) && $issue->getShowCoverPage($locale) && !$issue->getHideCoverPageCover($locale)) {
//%LP% show thumbnail version rather than full-size front cover
$filename = $issue->getThumbFileName($issue->getFileName($locale));
$templateMgr->assign('fileName', $filename);
$templateMgr->assign('coverPageAltText', $issue->getCoverPageAltText($locale));
$templateMgr->assign('originalFileName', $issue->getOriginalFileName($locale));
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticles =& $publishedArticleDao->getPublishedArticlesInSections($issue->getId(), true);
$publicFileManager = new PublicFileManager();
$templateMgr->assign('publishedArticles', $publishedArticles);
}
$templateMgr->assign('showToc', $showToc);
$templateMgr->assign('issueId', $issue->getBestIssueId());
$templateMgr->assign('issue', $issue);
// Subscription Access
import('classes.issue.IssueAction');
$subscriptionRequired = IssueAction::subscriptionRequired($issue);
$subscribedUser = IssueAction::subscribedUser($journal);
$subscribedDomain = IssueAction::subscribedDomain($journal);
$subscriptionExpiryPartial = $journal->getSetting('subscriptionExpiryPartial');
if ($showToc && $subscriptionRequired && !$subscribedUser && !$subscribedDomain && $subscriptionExpiryPartial) {
$templateMgr->assign('subscriptionExpiryPartial', true);
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticlesTemp =& $publishedArticleDao->getPublishedArticles($issue->getId());
$articleExpiryPartial = array();
foreach ($publishedArticlesTemp as $publishedArticle) {
$partial = IssueAction::subscribedUser($journal, $issue->getId(), $publishedArticle->getId());
if (!$partial) {
IssueAction::subscribedDomain($journal, $issue->getId(), $publishedArticle->getId());
}
$articleExpiryPartial[$publishedArticle->getId()] = $partial;
}
$templateMgr->assign_by_ref('articleExpiryPartial', $articleExpiryPartial);
}
$templateMgr->assign('subscriptionRequired', $subscriptionRequired);
$templateMgr->assign('subscribedUser', $subscribedUser);
$templateMgr->assign('subscribedDomain', $subscribedDomain);
$templateMgr->assign('showGalleyLinks', $journal->getSetting('showGalleyLinks'));
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager =& OJSPaymentManager::getManager();
if ($paymentManager->onlyPdfEnabled()) {
$templateMgr->assign('restrictOnlyPdf', true);
}
if ($paymentManager->purchaseArticleEnabled()) {
$templateMgr->assign('purchaseArticleEnabled', true);
}
} else {
$issueCrumbTitle = Locale::translate('archive.issueUnavailable');
$issueHeadingTitle = Locale::translate('archive.issueUnavailable');
}
if ($styleFileName = $issue->getStyleFileName()) {
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$templateMgr->addStyleSheet(Request::getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journalId) . '/' . $styleFileName);
}
$articleDao =& DAORegistry::getDAO('ArticleDAO');
$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
//%CBP% get repository object information for download links
$CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');
$issueObject = $CBPPlatformDao->getFedoraIssueObjectInformation($issue->getIssueId());
$objectPid = $issueObject['fedora_namespace'] . ":" . $issueObject['fedora_pid'];
$objectDsid = $issueObject['fedora_dsid'];
$templateMgr->assign_by_ref('repositoryObjectPid', $objectPid);
$templateMgr->assign_by_ref('repositoryObjectDsid', $objectDsid);
$locale = Config::getVar('i18n', 'locale');
//%LP% show associated artefacts (supplementary files) related to the submission
foreach ($publishedArticles as $section) {
foreach ($section['articles'] as $article) {
$supplementaryFilesTemp[] = $article->getSuppFiles();
}
}
foreach ($supplementaryFilesTemp as $supplementaryFile) {
if ($supplementaryFile[0]) {
$suppFile = $supplementaryFile[0];
$article = $articleDao->getArticle($suppFile->getArticleId());
$title = $suppFile->getTitle();
if (stristr($title['en_US'], "Author Biography") == false) {
//.........这里部分代码省略.........