• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP IssueAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: display

 /**
  * Display the form.
  */
 function display()
 {
     $request = $this->request;
     $templateMgr = TemplateManager::getManager($request);
     $user = $request->getUser();
     $journal = $request->getJournal();
     $formLocale = $this->getFormLocale();
     $templateMgr->assign('journal', $journal);
     $sectionDao = DAORegistry::getDAO('SectionDAO');
     $sections = $sectionDao->getByJournalId($journal->getId());
     $sectionTitles = $sectionAbstractsRequired = array();
     while ($section = $sections->next()) {
         $sectionTitles[$section->getId()] = $section->getLocalizedTitle();
         $sectionAbstractsRequired[(int) $section->getId()] = (int) (!$section->getAbstractsNotRequired());
         unset($section);
     }
     $templateMgr->assign('sectionOptions', array('0' => __('author.submit.selectSection')) + $sectionTitles);
     $templateMgr->assign('sectionAbstractsRequired', $sectionAbstractsRequired);
     $countryDao = DAORegistry::getDAO('CountryDAO');
     $templateMgr->assign('countries', $countryDao->getCountries());
     import('classes.issue.IssueAction');
     $issueAction = new IssueAction();
     $templateMgr->assign('issueOptions', $issueAction->getIssueOptions());
     import('lib.pkp.classes.file.TemporaryFileManager');
     $temporaryFileManager = new TemporaryFileManager();
     $tempFileId = $this->getData('tempFileId');
     if (isset($tempFileId[$formLocale]) && $tempFileId[$formLocale] > 0) {
         $submissionFile = $temporaryFileManager->getFile($tempFileId[$formLocale], $user->getId());
         $templateMgr->assign('submissionFile', $submissionFile);
     }
     if ($request->getUserVar('addAuthor') || $request->getUserVar('delAuthor') || $request->getUserVar('moveAuthor')) {
         $templateMgr->assign('scrollToAuthor', true);
     }
     if ($request->getUserVar('destination') == 'queue') {
         $templateMgr->assign('publishToIssue', false);
     } else {
         $templateMgr->assign('issueNumber', $request->getUserVar('issueId'));
         $templateMgr->assign('publishToIssue', true);
     }
     $templateMgr->assign('enablePageNumber', $journal->getSetting('enablePageNumber'));
     parent::display();
 }
开发者ID:jalperin,项目名称:ojs,代码行数:45,代码来源:QuickSubmitForm.inc.php


示例2: 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');
     $enablePublicArticleId = $journalSettingsDao->getSetting($context->getId(), 'enablePublicArticleId');
     $templateMgr->assign('enablePublicArticleId', $enablePublicArticleId);
     $enablePageNumber = $journalSettingsDao->getSetting($context->getId(), 'enablePageNumber');
     $templateMgr->assign('enablePageNumber', $enablePageNumber);
     // include issue possibilities
     import('classes.issue.IssueAction');
     $issueAction = new IssueAction();
     $templateMgr->assign('issueOptions', $issueAction->getIssueOptions());
     $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(), $subission->getId()));
     }
     return parent::fetch($request);
 }
开发者ID:jalperin,项目名称:ojs,代码行数:44,代码来源:IssueEntryPublicationMetadataForm.inc.php


示例3: display

 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $request =& $this->request;
     $user =& $request->getUser();
     $journal =& $request->getJournal();
     $formLocale = $this->getFormLocale();
     $templateMgr->assign('journal', $journal);
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $sections =& $sectionDao->getJournalSections($journal->getId());
     $sectionTitles = $sectionAbstractsRequired = array();
     while ($section =& $sections->next()) {
         $sectionTitles[$section->getId()] = $section->getTitle($journal->getPrimaryLocale());
         $sectionAbstractsRequired[(int) $section->getId()] = (int) (!$section->getAbstractsNotRequired());
         unset($section);
     }
     $templateMgr->assign('sectionOptions', array('0' => __('author.submit.selectSection')) + $sectionTitles);
     $templateMgr->assign('sectionAbstractsRequired', $sectionAbstractsRequired);
     $countryDao =& DAORegistry::getDAO('CountryDAO');
     $countries =& $countryDao->getCountries();
     $templateMgr->assign_by_ref('countries', $countries);
     import('classes.issue.IssueAction');
     $templateMgr->assign('issueOptions', IssueAction::getIssueOptions());
     import('classes.file.TemporaryFileManager');
     $temporaryFileManager = new TemporaryFileManager();
     $tempFileId = $this->getData('tempFileId');
     if (isset($tempFileId[$formLocale]) && $tempFileId[$formLocale] > 0) {
         $submissionFile = $temporaryFileManager->getFile($tempFileId[$formLocale], $user->getId());
         $templateMgr->assign_by_ref('submissionFile', $submissionFile);
     }
     if ($request->getUserVar('addAuthor') || $request->getUserVar('delAuthor') || $request->getUserVar('moveAuthor')) {
         $templateMgr->assign('scrollToAuthor', true);
     }
     if ($request->getUserVar('destination') == 'queue') {
         $templateMgr->assign('publishToIssue', false);
     } else {
         $templateMgr->assign('issueNumber', $request->getUserVar('issueId'));
         $templateMgr->assign('publishToIssue', true);
     }
     $templateMgr->assign('enablePageNumber', $journal->getSetting('enablePageNumber'));
     // 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();
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:53,代码来源:QuickSubmitForm.inc.php


示例4: display

 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $user =& Request::getUser();
     $journal =& Request::getJournal();
     $formLocale = $this->getFormLocale();
     $templateMgr->assign('journal', $journal);
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $templateMgr->assign('sectionOptions', array('0' => Locale::translate('author.submit.selectSection')) + $sectionDao->getSectionTitles($journal->getId()));
     $countryDao =& DAORegistry::getDAO('CountryDAO');
     $countries =& $countryDao->getCountries();
     $templateMgr->assign_by_ref('countries', $countries);
     import('issue.IssueAction');
     $templateMgr->assign('issueOptions', IssueAction::getIssueOptions());
     import('file.TemporaryFileManager');
     $temporaryFileManager = new TemporaryFileManager();
     $tempFileId = $this->getData('tempFileId');
     if ($tempFileId[$formLocale] > 0) {
         $submissionFile = $temporaryFileManager->getFile($tempFileId[$formLocale], $user->getId());
         $templateMgr->assign_by_ref('submissionFile', $submissionFile);
     }
     if (Request::getUserVar('addAuthor') || Request::getUserVar('delAuthor') || Request::getUserVar('moveAuthor')) {
         $templateMgr->assign('scrollToAuthor', true);
     }
     $jqueryPlugin =& PluginRegistry::getPlugin('generic', 'JQueryPlugin');
     if ($jqueryPlugin->isJQueryInstalled()) {
         $templateMgr->assign('jqueryPath', $jqueryPlugin->getScriptPath());
         $templateMgr->assign('addAuthorUrl', $jqueryPlugin->getScriptPath());
     }
     if (Request::getUserVar('destination') == 'queue') {
         $templateMgr->assign('publishToIssue', false);
     } else {
         $templateMgr->assign('issueNumber', Request::getUserVar('issueId'));
         $templateMgr->assign('publishToIssue', true);
     }
     parent::display();
 }
开发者ID:philschatz,项目名称:ojs,代码行数:40,代码来源:QuickSubmitForm.inc.php


示例5: toXml


//.........这里部分代码省略.........
     // Include abstract(s)
     $abstract = htmlspecialchars(Core::cleanVar(strip_tags($article->getLocalizedAbstract())));
     if (!empty($abstract)) {
         $abstract = "<p>{$abstract}</p>";
         // $abstract = '<p>' . PKPString::regexp_replace('/\n+/', '</p><p>', $abstract) . '</p>';
         $response .= "\t\t\t<abstract xml:lang=\"" . strtoupper(substr($primaryLocale, 0, 2)) . "\">{$abstract}</abstract>\n";
     }
     if (is_array($article->getAbstract(null))) {
         foreach ($article->getAbstract(null) as $locale => $abstract) {
             if ($locale == $primaryLocale || empty($abstract)) {
                 continue;
             }
             $abstract = htmlspecialchars(Core::cleanVar(strip_tags($abstract)));
             if (empty($abstract)) {
                 continue;
             }
             $abstract = "<p>{$abstract}</p>";
             //$abstract = '<p>' . PKPString::regexp_replace('/\n+/', '</p><p>', $abstract) . '</p>';
             $response .= "\t\t\t<abstract-trans xml:lang=\"" . strtoupper(substr($locale, 0, 2)) . "\">{$abstract}</abstract-trans>\n";
         }
     }
     $subjects = array();
     if (is_array($article->getSubject(null))) {
         foreach ($article->getSubject(null) as $locale => $subject) {
             $s = array_map('trim', explode(';', Core::cleanVar($subject)));
             if (!empty($s)) {
                 $subjects[$locale] = $s;
             }
         }
     }
     if (!empty($subjects)) {
         foreach ($subjects as $locale => $s) {
             $response .= "\t\t\t<kwd-group xml:lang=\"" . strtoupper(substr($locale, 0, 2)) . "\">\n";
             foreach ($s as $subject) {
                 $response .= "\t\t\t\t<kwd>" . htmlspecialchars($subject) . "</kwd>\n";
             }
             $response .= "\t\t\t</kwd-group>\n";
         }
     }
     $response .= (isset($pageCount) ? "\t\t\t<counts><page-count count=\"" . (int) $pageCount . "\" /></counts>\n" : '') . "\t\t</article-meta>\n" . "\t</front>\n";
     // Include body text (for search indexing only)
     import('classes.search.ArticleSearchIndex');
     $text = '';
     $galleys = $article->getGalleys();
     // Give precedence to HTML galleys, as they're quickest to parse
     usort($galleys, create_function('$a, $b', 'return $a->getFileType()==\'text/html\')?-1:1;'));
     // Determine any access limitations. If there are, do not
     // provide the full-text.
     import('classes.issue.IssueAction');
     $issueAction = new IssueAction();
     $subscriptionRequired = $issueAction->subscriptionRequired($issue);
     $isSubscribedDomain = $issueAction->subscribedDomain($journal, $issue->getId(), $article->getId());
     if (!$subscriptionRequired || $isSubscribedDomain) {
         foreach ($galleys as $galley) {
             $parser =& SearchFileParser::fromFile($galley);
             if ($parser && $parser->open()) {
                 while (($s = $parser->read()) !== false) {
                     $text .= $s;
                 }
                 $parser->close();
             }
             if ($galley->getFileType() == 'text/html') {
                 $text = strip_tags($text);
             }
             unset($galley);
             // Use the first parseable galley.
             if (!empty($text)) {
                 break;
             }
         }
     }
     if (!empty($text)) {
         $response .= "\t<body><p>" . htmlspecialchars(Core::cleanVar(Core::cleanVar($text))) . "</p></body>\n";
     }
     // Add NLM citation info
     $filterDao = DAORegistry::getDAO('FilterDAO');
     /* @var $filterDao FilterDAO */
     $nlmFilters = $filterDao->getObjectsByGroup('submission=>nlm23-article-xml');
     assert(count($nlmFilters) == 1);
     $nlmFilter = array_pop($nlmFilters);
     $nlmXmlDom = new DOMDocument();
     $nlmXmlDom->loadXML($nlmFilter->execute($article));
     $documentElement =& $nlmXmlDom->documentElement;
     // Work-around for hasChildNodes being stupid about whitespace.
     $hasChildren = false;
     if (isset($documentElement->childNodes)) {
         foreach ($documentElement->childNodes as $c) {
             if ($c->nodeType == XML_ELEMENT_NODE) {
                 $hasChildren = true;
             }
         }
     }
     // If there were any citations, include them.
     if ($hasChildren) {
         $innerXml = $nlmXmlDom->saveXML($documentElement);
         $response .= "<back>{$innerXml}</back>\n";
     }
     $response .= "</article>";
     return $response;
 }
开发者ID:selwyntcy,项目名称:ojs,代码行数:101,代码来源:OAIMetadataFormat_NLM.inc.php


示例6: authors

 /**
  * Show index of published articles by author.
  * @param $args array
  * @param $request PKPRequest
  */
 function authors($args, &$request)
 {
     $this->validate();
     $this->setupTemplate($request, true);
     $journal =& $request->getJournal();
     $authorDao =& DAORegistry::getDAO('AuthorDAO');
     if (isset($args[0]) && $args[0] == 'view') {
         // View a specific author
         $firstName = $request->getUserVar('firstName');
         $middleName = $request->getUserVar('middleName');
         $lastName = $request->getUserVar('lastName');
         $affiliation = $request->getUserVar('affiliation');
         $country = $request->getUserVar('country');
         $publishedArticles = $authorDao->getPublishedArticlesForAuthor($journal ? $journal->getId() : null, $firstName, $middleName, $lastName, $affiliation, $country);
         // Load information associated with each article.
         $journals = array();
         $issues = array();
         $sections = array();
         $issuesUnavailable = array();
         $issueDao =& DAORegistry::getDAO('IssueDAO');
         $sectionDao =& DAORegistry::getDAO('SectionDAO');
         $journalDao =& DAORegistry::getDAO('JournalDAO');
         foreach ($publishedArticles as $article) {
             $articleId = $article->getId();
             $issueId = $article->getIssueId();
             $sectionId = $article->getSectionId();
             $journalId = $article->getJournalId();
             if (!isset($issues[$issueId])) {
                 import('classes.issue.IssueAction');
                 $issue =& $issueDao->getIssueById($issueId);
                 $issues[$issueId] =& $issue;
                 $issuesUnavailable[$issueId] = IssueAction::subscriptionRequired($issue) && (!IssueAction::subscribedUser($journal, $issueId, $articleId) && !IssueAction::subscribedDomain($journal, $issueId, $articleId));
             }
             if (!isset($journals[$journalId])) {
                 $journals[$journalId] =& $journalDao->getById($journalId);
             }
             if (!isset($sections[$sectionId])) {
                 $sections[$sectionId] =& $sectionDao->getSection($sectionId, $journalId, true);
             }
         }
         if (empty($publishedArticles)) {
             $request->redirect(null, $request->getRequestedPage());
         }
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign_by_ref('publishedArticles', $publishedArticles);
         $templateMgr->assign_by_ref('issues', $issues);
         $templateMgr->assign('issuesUnavailable', $issuesUnavailable);
         $templateMgr->assign_by_ref('sections', $sections);
         $templateMgr->assign_by_ref('journals', $journals);
         $templateMgr->assign('firstName', $firstName);
         $templateMgr->assign('middleName', $middleName);
         $templateMgr->assign('lastName', $lastName);
         $templateMgr->assign('affiliation', $affiliation);
         $countryDao =& DAORegistry::getDAO('CountryDAO');
         $country = $countryDao->getCountry($country);
         $templateMgr->assign('country', $country);
         $templateMgr->display('search/authorDetails.tpl');
     } else {
         // Show the author index
         $searchInitial = $request->getUserVar('searchInitial');
         $rangeInfo = $this->getRangeInfo('authors');
         $authors =& $authorDao->getAuthorsAlphabetizedByJournal(isset($journal) ? $journal->getId() : null, $searchInitial, $rangeInfo);
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('searchInitial', $request->getUserVar('searchInitial'));
         $templateMgr->assign('alphaList', explode(' ', __('common.alphaList')));
         $templateMgr->assign_by_ref('authors', $authors);
         $templateMgr->display('search/authorIndex.tpl');
     }
 }
开发者ID:reconciler,项目名称:ojs,代码行数:74,代码来源:SearchHandler.inc.php


示例7: issueToc

 /**
  * Display the table of contents
  */
 function issueToc($args, $request)
 {
     $issueId = (int) array_shift($args);
     $this->validate($issueId, true);
     $issue =& $this->issue;
     $this->setupTemplate(EDITOR_SECTION_ISSUES);
     $templateMgr =& TemplateManager::getManager();
     $journal =& $request->getJournal();
     $journalId = $journal->getId();
     $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $enablePublicArticleId = $journalSettingsDao->getSetting($journalId, 'enablePublicArticleId');
     $templateMgr->assign('enablePublicArticleId', $enablePublicArticleId);
     $enablePageNumber = $journalSettingsDao->getSetting($journalId, 'enablePageNumber');
     $templateMgr->assign('enablePageNumber', $enablePageNumber);
     $templateMgr->assign('customSectionOrderingExists', $customSectionOrderingExists = $sectionDao->customSectionOrderingExists($issueId));
     $templateMgr->assign('issueId', $issueId);
     $templateMgr->assign_by_ref('issue', $issue);
     $templateMgr->assign('unpublished', !$issue->getPublished());
     $templateMgr->assign('issueAccess', $issue->getAccessStatus());
     // get issue sections and articles
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticles = $publishedArticleDao->getPublishedArticles($issueId);
     $layoutEditorSubmissionDao =& DAORegistry::getDAO('LayoutEditorSubmissionDAO');
     $proofedArticleIds = $layoutEditorSubmissionDao->getProofedArticlesByIssueId($issueId);
     $templateMgr->assign('proofedArticleIds', $proofedArticleIds);
     $currSection = 0;
     $counter = 0;
     $sections = array();
     $sectionCount = 0;
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     foreach ($publishedArticles as $article) {
         $sectionId = $article->getSectionId();
         if ($currSection != $sectionId) {
             $lastSectionId = $currSection;
             $sectionCount++;
             if ($lastSectionId !== 0) {
                 $sections[$lastSectionId][5] = $customSectionOrderingExists ? $sectionDao->getCustomSectionOrder($issueId, $sectionId) : $sectionCount;
             }
             // Store next custom order
             $currSection = $sectionId;
             $counter++;
             $sections[$sectionId] = array($sectionId, $article->getSectionTitle(), array($article), $counter, $customSectionOrderingExists ? $sectionDao->getCustomSectionOrder($issueId, $lastSectionId) : $sectionCount - 1, null);
         } else {
             $sections[$article->getSectionId()][2][] = $article;
         }
     }
     $templateMgr->assign_by_ref('sections', $sections);
     $templateMgr->assign('accessOptions', array(ARTICLE_ACCESS_ISSUE_DEFAULT => AppLocale::Translate('editor.issues.default'), ARTICLE_ACCESS_OPEN => AppLocale::Translate('editor.issues.open')));
     import('classes.issue.IssueAction');
     $templateMgr->assign('issueOptions', IssueAction::getIssueOptions());
     $templateMgr->assign('helpTopicId', 'publishing.tableOfContents');
     $templateMgr->addJavaScript('lib/pkp/js/lib/jquery/plugins/jquery.tablednd.js');
     $templateMgr->addJavaScript('lib/pkp/js/functions/tablednd.js');
     $templateMgr->display('editor/issues/issueToc.tpl');
 }
开发者ID:reconciler,项目名称:ojs,代码行数:59,代码来源:IssueManagementHandler.inc.php


示例8: _isArticleAccessAuthorized

 /**
  * Check whether access to the given article
  * is authorized to the requesting party (i.e. the
  * Solr server).
  *
  * @param $article Article
  * @return boolean True if authorized, otherwise false.
  */
 function _isArticleAccessAuthorized(&$article)
 {
     // Did we get a published article?
     if (!is_a($article, 'PublishedArticle')) {
         return false;
     }
     // Get the article's journal.
     $journal = $this->_getJournal($article->getJournalId());
     if (!is_a($journal, 'Journal')) {
         return false;
     }
     // Get the article's issue.
     $issue = $this->_getIssue($article->getIssueId(), $journal->getId());
     if (!is_a($issue, 'Issue')) {
         return false;
     }
     // Only index published articles.
     if (!$issue->getPublished() || $article->getStatus() != STATUS_PUBLISHED) {
         return false;
     }
     // Make sure the requesting party is authorized to acces the article/issue.
     import('classes.issue.IssueAction');
     $issueAction = new IssueAction();
     $subscriptionRequired = $issueAction->subscriptionRequired($issue, $journal);
     if ($subscriptionRequired) {
         $isSubscribedDomain = $issueAction->subscribedDomain($journal, $issue->getId(), $article->getId());
         if (!$isSubscribedDomain) {
             return false;
         }
     }
     // All checks passed successfully - allow access.
     return true;
 }
开发者ID:mosvits,项目名称:ojs,代码行数:41,代码来源:SolrWebService.inc.php


示例9: formatResults

 /**
  * See SubmissionSearch::formatResults()
  *
  * @return array An array with the articles, published articles,
  *  issue, journal, section and the issue availability.
  */
 static function formatResults(&$results)
 {
     $articleDao = DAORegistry::getDAO('ArticleDAO');
     $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
     $issueDao = DAORegistry::getDAO('IssueDAO');
     $journalDao = DAORegistry::getDAO('JournalDAO');
     $sectionDao = DAORegistry::getDAO('SectionDAO');
     $publishedArticleCache = array();
     $articleCache = array();
     $issueCache = array();
     $issueAvailabilityCache = array();
     $journalCache = array();
     $sectionCache = array();
     $returner = array();
     foreach ($results as $articleId) {
         // Get the article, storing in cache if necessary.
         if (!isset($articleCache[$articleId])) {
             $publishedArticleCache[$articleId] = $publishedArticleDao->getPublishedArticleByArticleId($articleId);
             $articleCache[$articleId] = $articleDao->getById($articleId);
         }
         $article = $articleCache[$articleId];
         $publishedArticle = $publishedArticleCache[$articleId];
         if ($publishedArticle && $article) {
             $sectionId = $article->getSectionId();
             if (!isset($sectionCache[$sectionId])) {
                 $sectionCache[$sectionId] = $sectionDao->getById($sectionId);
             }
             // Get the journal, storing in cache if necessary.
             $journalId = $article->getJournalId();
             if (!isset($journalCache[$journalId])) {
                 $journalCache[$journalId] = $journalDao->getById($journalId);
             }
             // Get the issue, storing in cache if necessary.
             $issueId = $publishedArticle->getIssueId();
             if (!isset($issueCache[$issueId])) {
                 $issue = $issueDao->getById($issueId);
                 $issueCache[$issueId] = $issue;
                 import('classes.issue.IssueAction');
                 $issueAction = new IssueAction();
                 $issueAvailabilityCache[$issueId] = !$issueAction->subscriptionRequired($issue) || $issueAction->subscribedUser($journalCache[$journalId], $issueId, $articleId) || $issueAction->subscribedDomain($journalCache[$journalId], $issueId, $articleId);
             }
             // Only display articles from published issues.
             if (!$issueCache[$issueId]->getPublished()) {
                 continue;
             }
             // Store the retrieved objects in the result array.
             $returner[] = array('article' => $article, 'publishedArticle' => $publishedArticleCache[$articleId], 'issue' => $issueCache[$issueId], 'journal' => $journalCache[$journalId], 'issueAvailable' => $issueAvailabilityCache[$issueId], 'section' => $sectionCache[$sectionId]);
         }
     }
     return $returner;
 }
开发者ID:jalperin,项目名称:ojs,代码行数:57,代码来源:ArticleSearch.inc.php


示例10: _setupIssueTemplate

 /**
  * Given an issue, set up the template with all the required variables for
  * frontend/objects/issue_toc.tpl to function properly (i.e. current issue
  * and view issue).
  * @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($request, $issue, $showToc = false)
 {
     $journal = $request->getJournal();
     $templateMgr = TemplateManager::getManager($request);
     // Determine pre-publication access
     // FIXME: Do that. (Bug #8278)
     if (!$issue) {
         $issue = $this->getAuthorizedContextObject(ASSOC_TYPE_ISSUE);
     }
     $templateMgr->assign(array('issueIdentification' => $issue->getIssueIdentification(), 'issueTitle' => $issue->getLocalizedTitle(), 'issueSeries' => $issue->getIssueIdentification(array('showTitle' => false))));
     $locale = AppLocale::getLocale();
     import('classes.file.PublicFileManager');
     $publicFileManager = new PublicFileManager();
     $templateMgr->assign(array('coverPagePath' => $request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journal->getId()) . '/', 'locale' => $locale));
     if (!$showToc && $issue->getFileName($locale) && $issue->getShowCoverPage($locale) && !$issue->getHideCoverPageCover($locale)) {
         $templateMgr->assign(array('fileName' => $issue->getFileName($locale), 'width' => $issue->getWidth($locale), 'height' => $issue->getHeight($locale), 'coverPageAltText' => $issue->getCoverPageAltText($locale), 'originalFileName' => $issue->getOriginalFileName($locale), 'originalFileName' => $issue->getOriginalFileName($locale)));
     } else {
         $issueGalleyDao = DAORegistry::getDAO('IssueGalleyDAO');
         $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
         $templateMgr->assign(array('issueGalleys' => $issueGalleyDao->getByIssueId($issue->getId()), 'publishedArticles' => $publishedArticleDao->getPublishedArticlesInSections($issue->getId(), true)));
         $showToc = true;
     }
     $templateMgr->assign(array('showToc' => $showToc, 'issue' => $issue));
     // Subscription Access
     import('classes.issue.IssueAction');
     $issueAction = new IssueAction();
     $subscriptionRequired = $issueAction->subscriptionRequired($issue);
     $subscribedUser = $issueAction->subscribedUser($journal);
     $subscribedDomain = $issueAction->subscribedDomain($journal);
     if ($showToc && $subscriptionRequired && !$subscribedUser && !$subscribedDomain) {
         $templateMgr->assign('subscriptionExpiryPartial', true);
         // Partial subscription expiry for issue
         $partial = $issueAction->subscribedUser($journal, $issue->getId());
         if (!$partial) {
             $issueAction->subscribedDomain($journal, $issue->getId());
         }
         $templateMgr->assign('issueExpiryPartial', $partial);
         // Partial subscription expiry for articles
         $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('articleExpiryPartial', $articleExpiryPartial);
     }
     $templateMgr->assign(array('showGalleyLinks' => !$subscriptionRequired || $journal->getSetting('showGalleyLinks'), 'hasAccess' => !$subscriptionRequired || $issue->getAccessStatus() == ISSUE_ACCESS_OPEN || $subscribedUser || $subscribedDomain));
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     if ($paymentManager->onlyPdfEnabled()) {
         $templateMgr->assign('restrictOnlyPdf', true);
     }
     if ($paymentManager->purchaseArticleEnabled()) {
         $templateMgr->assign('purchaseArticleEnabled', true);
     }
     if ($styleFileName = $issue->getStyleFileName()) {
         import('classes.file.PublicFileManager');
         $publicFileManager = new PublicFileManager();
         $templateMgr->addStyleSheet($request->getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journal->getId()) . '/' . $styleFileName);
     }
 }
开发者ID:mosvits,项目名称:ojs,代码行数:74,代码来源:IssueHandler.inc.php


示例11: submissionEditing

 function submissionEditing($args)
 {
     $articleId = isset($args[0]) ? (int) $args[0] : 0;
     list($journal, $submission) = SubmissionEditHandler::validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
     parent::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->getCopyeditFile());
     $templateMgr->assign_by_ref('initialCopyeditFile', $submission->getInitialCopyeditFile());
     $templateMgr->assign_by_ref('editorAuthorCopyeditFile', $submission->getEditorAuthorCopyeditFile());
     $templateMgr->assign_by_ref('finalCopyeditFile', $submission->getFinalCopyeditFile());
     $templateMgr->assign_by_ref('suppFiles', $submission->getSuppFiles());
     $templateMgr->assign_by_ref('copyeditor', $submission->getCopyeditor());
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $user =& Request::getUser();
     $templateMgr->assign('isEditor', $roleDao->roleExists($journal->getJournalId(), $user->getUserId(), ROLE_ID_EDITOR));
     import('issue.IssueAction');
     $templateMgr->assign('issueOptions', IssueAction::getIssueOptions());
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($submission->getArticleId());
     $templateMgr->assign_by_ref('publishedArticle', $publishedArticle);
     $templateMgr->assign('useCopyeditors', $useCopyeditors);
     $templateMgr->assign('useLayoutEditors', $useLayoutEditors);
     $templateMgr->assign('useProofreaders', $useProofreaders);
     $templateMgr->assign_by_ref('proofAssignment', $submission->getProofAssignment());
     $templateMgr->assign_by_ref('layoutAssignment', $submission->getLayoutAssignment());
     $templateMgr->assign('submissionAccepted', $submissionAccepted);
     // Set up required Payment Related Information
     import('payment.ojs.OJSPaymentManager');
     $paymentManager =& OJSPaymentManager::getManager();
     $completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
     $publicationFeeEnabled = $paymentManager->publicationEnabled();
     $templateMgr->assign('publicatonFeeEnabled', $publicationFeeEnabled);
     if ($publicationFeeEnabled) {
         $templateMgr->assign_by_ref('publicationPayment', $completedPaymentDAO->getPublicationCompletedPayment($journal->getJournalId(), $articleId));
     }
     $templateMgr->assign('helpTopicId', 'editorial.sectionEditorsRole.editing');
     $templateMgr->display('sectionEditor/submissionEditing.tpl');
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:48,代码来源:SubmissionEditHandler.inc.php


示例12: 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');
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:54,代码来源:SubmissionEditHandler.inc.php


示例13: validate

 /**
  * Validation
  * @param $request PKPRequest
  * @param $articleId int
  */
 function validate(&$request, $articleId)
 {
     parent::validate();
     $journal =& $request->getJournal();
     $journalId = $journal->getId();
     $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $article =& $publishedArticleDao->getPublishedArticleByArticleId($articleId);
     // Bring in comment constants
     $commentDao =& DAORegistry::getDAO('CommentDAO');
     $enableComments = $journal->getSetting('enableComments');
     if (!Validation::isLoggedIn() && $journalSettingsDao->getSetting($journalId, 'restrictArticleAccess') || $article && !$article->getEnableComments() || $enableComments != COMMENTS_ANONYMOUS && $enableComments != COMMENTS_AUTHENTICATED && $enableComments != COMMENTS_UNAUTHENTICATED) {
         Validation::redirectLogin();
     }
     // Subscription Access
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     $issue =& $issueDao->getIssueByArticleId($articleId);
     if (isset($issue) && isset($article)) {
         import('classes.issue.IssueAction');
         $subscriptionRequired = IssueAction::subscriptionRequired($issue);
         $subscribedUser = IssueAction::subscribedUser($journal, $issue->getId(), $articleId);
         if (!(!$subscriptionRequired || $article->getAccessStatus() == ARTICLE_ACCESS_OPEN || $subscribedUser)) {
             $request->redirect(null, 'index');
         }
     } else {
         $request->redirect(null, 'index');
     }
     $this->issue =& $issue;
     $this->article =& $article;
     return true;
 }
开发者ID:yuricampos,项目名称:ojs,代码行数:36,代码来源:CommentHandler.inc.php


示例14: _setupIssueTemplate

 /**
  * Given an issue, set up the template with all the required variables for
  * frontend/objects/issue_toc.tpl to function properly (i.e. current issue
  * and view issue).
  * @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($request, $issue, $showToc = false)
 {
     $journal = $request->getJournal();
     $templateMgr = TemplateManager::getManager($request);
     // Determine pre-publication access
     // FIXME: Do that. (Bug #8278)
     if (!$issue) {
         $issue = $this->getAuthorizedContextObject(ASSOC_TYPE_ISSUE);
     }
     $templateMgr->assign(array('issueIdentification' => $issue->getIssueIdentification(), 'issueTitle' => $issue->getLocalizedTitle(), 'issueSeries' => $issue->getIssueIdentification(array('showTitle' => false))));
     $locale = AppLocale::getLocale();
     $templateMgr->assign(array('locale' => $locale));
     $issueGalleyDao = DAORegistry::getDAO('IssueGalleyDAO');
     $publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
     $templateMgr->assign(array('issue' => $issue, 'issueGalleys' => $issueGalleyDao->getByIssueId($issue->getId()), 'publishedArticles' => $publishedArticleDao->getPublishedArticlesInSections($issue->getId(), true)));
     // Subscription Access
     import('classes.issue.IssueAction');
     $issueAction = new IssueAction();
     $subscriptionRequired = $issueAction->subscriptionRequired($issue);
     $subscribedUser = $issueAction->subscribedUser($journal);
     $subscribedDomain = $issueAction->subscribedDomain($journal);
     if ($subscriptionRequired && !$subscribedUser && !$subscribedDomain) {
         $templateMgr->assign('subscriptionExpiryPartial', true);
         // Partial subscription expiry for issue
         $partial = $issueAction->subscribedUser($journal, $issue->getId());
         if (!$partial) {
             $issueAction->subscribedDomain($journal, $issue->getId());
         }
         $templateMgr->assign('issueExpiryPartial', $partial);
         // Partial subscription expiry for articles
         $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('articleExpiryPartial', $articleExpiryPartial);
     }
     $templateMgr->assign(array('hasAccess' => !$subscriptionRequired || $issue->getAccessStatus() == ISSUE_ACCESS_OPEN || $subscribedUser || $subscribedDomain));
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     if ($paymentManager->onlyPdfEnabled()) {
         $templateMgr->assign('restrictOnlyPdf', true);
     }
     if ($paymentManager->purchaseArticleEnabled()) {
         $templateMgr->assign('purchaseArticleEnabled', true);
     }
 }
开发者ID:pkp,项目名称:ojs,代码行数:61,代码来源:IssueHandler.inc.php


示例15: setupIssueTemplate


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP It类代码示例发布时间:2022-05-23
下一篇:
PHP Issue类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap