本文整理汇总了PHP中OJSPaymentManager::publicationEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP OJSPaymentManager::publicationEnabled方法的具体用法?PHP OJSPaymentManager::publicationEnabled怎么用?PHP OJSPaymentManager::publicationEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OJSPaymentManager
的用法示例。
在下文中一共展示了OJSPaymentManager::publicationEnabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetch
/**
* Fetch the HTML contents of the form.
* @param $request PKPRequest
* return string
*/
function fetch($request)
{
$context = $request->getContext();
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('submissionId', $this->getSubmission()->getId());
$templateMgr->assign('stageId', $this->getStageId());
$templateMgr->assign('formParams', $this->getFormParams());
$templateMgr->assign('context', $context);
$journalSettingsDao = DAORegistry::getDAO('JournalSettingsDAO');
$templateMgr->assign('issueOptions', $this->getIssueOptions($context));
$publishedArticle = $this->getPublishedArticle();
if ($publishedArticle) {
$templateMgr->assign('publishedArticle', $publishedArticle);
$issueDao = DAORegistry::getDAO('IssueDAO');
$issue = $issueDao->getById($publishedArticle->getIssueId());
if ($issue) {
$templateMgr->assign('issueAccess', $issue->getAccessStatus());
$templateMgr->assign('accessOptions', array(ARTICLE_ACCESS_ISSUE_DEFAULT => __('editor.issues.default'), ARTICLE_ACCESS_OPEN => __('editor.issues.open')));
}
}
// include payment information
// Set up required Payment Related Information
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($request);
$completedPaymentDao = DAORegistry::getDAO('OJSCompletedPaymentDAO');
$publicationFeeEnabled = $paymentManager->publicationEnabled();
$templateMgr->assign('publicationFeeEnabled', $publicationFeeEnabled);
if ($publicationFeeEnabled) {
$templateMgr->assign('publicationPayment', $completedPaymentDao->getPublicationCompletedPayment($context->getId(), $this->getSubission()->getId()));
}
$templateMgr->assign('submission', $this->getSubmission());
return parent::fetch($request);
}
示例2: display
/**
* Display the form.
*/
function display()
{
$journal =& $this->request->getJournal();
$user =& $this->request->getUser();
$templateMgr =& TemplateManager::getManager();
// Get article file for this article
$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
$articleFiles =& $articleFileDao->getArticleFilesByArticle($this->articleId);
$templateMgr->assign_by_ref('files', $articleFiles);
$templateMgr->assign_by_ref('journal', $journal);
// Set up required Payment Related Information
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($this->request);
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));
$templateMgr->assign('manualPayment', $journal->getSetting('paymentMethodPluginName') == 'ManualPayment');
}
if ($paymentManager->fastTrackEnabled()) {
$templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDao->getFastTrackCompletedPayment($journal->getId(), $articleId));
}
}
parent::display();
}
示例3: display
/**
* Display the form.
*/
function display()
{
$journal =& $this->request->getJournal();
$user =& $this->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->userHasRole($journal->getId(), $user->getId(), ROLE_ID_EDITOR) || $roleDao->userHasRole($journal->getId(), $user->getId(), ROLE_ID_SECTION_EDITOR);
$templateMgr->assign('sectionOptions', array('0' => __('author.submit.selectSection')) + $sectionDao->getSectionTitles($journal->getId(), !$isEditor));
// Set up required Payment Related Information
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($this->request);
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(AppLocale::getAllLocales()), $supportedSubmissionLocales)));
parent::display();
}
示例4: index
/**
* Display journal author index page.
* @param $args array
* @param $request PKPRequest
*/
function index($args, $request)
{
$this->validate($request);
$this->setupTemplate($request);
$journal =& $request->getJournal();
$user =& $request->getUser();
$rangeInfo =& $this->getRangeInfo('submissions');
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$page = array_shift($args);
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('lib.pkp.classes.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('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($request);
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('classes.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');
}
示例5: submissionEditing
/**
* View the submission editing page.
* @param $args array
* @param $request PKPRequest
*/
function submissionEditing($args, $request)
{
$articleId = isset($args[0]) ? (int) $args[0] : 0;
$this->validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
$journal =& $request->getJournal();
$submission =& $this->submission;
$this->setupTemplate(true, $articleId);
$useCopyeditors = $journal->getSetting('useCopyeditors');
$useLayoutEditors = $journal->getSetting('useLayoutEditors');
$useProofreaders = $journal->getSetting('useProofreaders');
// check if submission is accepted
$round = isset($args[1]) ? $args[1] : $submission->getCurrentRound();
$editorDecisions = $submission->getDecisions($round);
$lastDecision = count($editorDecisions) >= 1 ? $editorDecisions[count($editorDecisions) - 1]['decision'] : null;
$submissionAccepted = $lastDecision == SUBMISSION_EDITOR_DECISION_ACCEPT ? true : false;
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('submission', $submission);
$templateMgr->assign_by_ref('submissionFile', $submission->getSubmissionFile());
$templateMgr->assign_by_ref('copyeditFile', $submission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL'));
$templateMgr->assign_by_ref('initialCopyeditFile', $submission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL'));
$templateMgr->assign_by_ref('editorAuthorCopyeditFile', $submission->getFileBySignoffType('SIGNOFF_COPYEDITING_AUTHOR'));
$templateMgr->assign_by_ref('finalCopyeditFile', $submission->getFileBySignoffType('SIGNOFF_COPYEDITING_FINAL'));
$templateMgr->assign_by_ref('suppFiles', $submission->getSuppFiles());
$templateMgr->assign_by_ref('copyeditor', $submission->getUserBySignoffType('SIGNOFF_COPYEDITING_INITIAL'));
$roleDao =& DAORegistry::getDAO('RoleDAO');
$user =& Request::getUser();
$templateMgr->assign('isEditor', $roleDao->userHasRole($journal->getId(), $user->getId(), ROLE_ID_EDITOR));
import('classes.issue.IssueAction');
$templateMgr->assign('issueOptions', IssueAction::getIssueOptions());
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($submission->getId());
$templateMgr->assign_by_ref('publishedArticle', $publishedArticle);
$templateMgr->assign('useCopyeditors', $useCopyeditors);
$templateMgr->assign('useLayoutEditors', $useLayoutEditors);
$templateMgr->assign('useProofreaders', $useProofreaders);
$templateMgr->assign('submissionAccepted', $submissionAccepted);
$templateMgr->assign('templates', $journal->getSetting('templates'));
// Set up required Payment Related Information
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($request);
$completedPaymentDao =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
$publicationFeeEnabled = $paymentManager->publicationEnabled();
$templateMgr->assign('publicationFeeEnabled', $publicationFeeEnabled);
if ($publicationFeeEnabled) {
$templateMgr->assign_by_ref('publicationPayment', $completedPaymentDao->getPublicationCompletedPayment($journal->getId(), $articleId));
}
$templateMgr->assign('helpTopicId', 'editorial.sectionEditorsRole.editing');
$templateMgr->display('sectionEditor/submissionEditing.tpl');
}
示例6: submission
/**
* Display a summary of the status of an author's submission.
* @param $args array
* @param $request PKPRequest
*/
function submission($args, $request)
{
$journal =& $request->getJournal();
$user =& $request->getUser();
$articleId = (int) array_shift($args);
$this->validate($request, $articleId);
$submission =& $this->submission;
$this->setupTemplate($request, true, $articleId);
$journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
$journalSettings = $journalSettingsDao->getJournalSettings($journal->getId());
// Setting the round.
$round = (int) array_shift($args);
if (!$round) {
$round = $submission->getCurrentRound();
}
$templateMgr =& TemplateManager::getManager();
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($submission->getId());
if ($publishedArticle) {
$issueDao =& DAORegistry::getDAO('IssueDAO');
$issue =& $issueDao->getIssueById($publishedArticle->getIssueId());
$templateMgr->assign_by_ref('issue', $issue);
}
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$section =& $sectionDao->getSection($submission->getSectionId());
$templateMgr->assign_by_ref('section', $section);
$templateMgr->assign_by_ref('journalSettings', $journalSettings);
$templateMgr->assign_by_ref('submission', $submission);
$templateMgr->assign_by_ref('publishedArticle', $publishedArticle);
$templateMgr->assign_by_ref('reviewAssignments', $submission->getReviewAssignments($round));
$templateMgr->assign('round', $round);
$templateMgr->assign_by_ref('submissionFile', $submission->getSubmissionFile());
$templateMgr->assign_by_ref('revisedFile', $submission->getRevisedFile());
$templateMgr->assign_by_ref('suppFiles', $submission->getSuppFiles());
import('classes.submission.sectionEditor.SectionEditorSubmission');
$templateMgr->assign_by_ref('editorDecisionOptions', SectionEditorSubmission::getEditorDecisionOptions());
// Set up required Payment Related Information
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($request);
if ($paymentManager->submissionEnabled() || $paymentManager->fastTrackEnabled() || $paymentManager->publicationEnabled()) {
$templateMgr->assign('authorFees', true);
$completedPaymentDao =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
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));
}
if ($paymentManager->publicationEnabled()) {
$templateMgr->assign_by_ref('publicationPayment', $completedPaymentDao->getPublicationCompletedPayment($journal->getId(), $articleId));
}
}
$templateMgr->assign('helpTopicId', 'editorial.authorsRole');
$initialCopyeditSignoff = $submission->getSignoff('SIGNOFF_COPYEDITING_INITIAL');
$templateMgr->assign('canEditMetadata', !$initialCopyeditSignoff->getDateCompleted() && $submission->getStatus() != STATUS_PUBLISHED);
$templateMgr->display('author/submission.tpl');
}