Example #1
1
 /**
  * Perform installation.
  */
 function execute()
 {
     define('RUNNING_UPGRADE', 1);
     $templateMgr = TemplateManager::getManager($this->_request);
     $installer = new Upgrade($this->_data);
     // FIXME Use logger?
     // FIXME Mostly common with InstallForm
     if ($installer->execute()) {
         if (!$installer->wroteConfig()) {
             // Display config file contents for manual replacement
             $templateMgr->assign(array('writeConfigFailed' => true, 'configFileContents' => $installer->getConfigContents()));
         }
         $templateMgr->assign('notes', $installer->getNotes());
         $templateMgr->assign('newVersion', $installer->getNewVersion());
         $templateMgr->display('install/upgradeComplete.tpl');
     } else {
         switch ($installer->getErrorType()) {
             case INSTALLER_ERROR_DB:
                 $this->dbInstallError($installer->getErrorMsg());
                 break;
             default:
                 $this->installError($installer->getErrorMsg());
                 break;
         }
     }
     $installer->destroy();
 }
Example #2
0
 public function evaluate(TemplateManager $manager, $context, $value)
 {
     $filter = $manager->filter($this->m_name);
     if (!$filter) {
         throw new \Exception("Unknown filter `{$this->m_name}`");
     }
     return $filter($this->m_options, $context, $value);
 }
 /**
  * @see PKPHandler::setupTemplate()
  * @param $request PKPKRequest
  */
 function setupTemplate($request)
 {
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign('oldUserId', (int) $request->getUserVar('oldUserId'));
     // for merging users.
     parent::setupTemplate($request);
 }
 /**
  * Fetch information for the author on the specified review round
  * @param $args array
  * @param $request Request
  * @return JSONMessage JSON object
  */
 function fetchReviewRoundInfo($args, $request)
 {
     $this->setupTemplate($request);
     $templateMgr = TemplateManager::getManager($request);
     $stageId = $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
     if ($stageId !== WORKFLOW_STAGE_ID_INTERNAL_REVIEW && $stageId !== WORKFLOW_STAGE_ID_EXTERNAL_REVIEW) {
         fatalError('Invalid Stage Id');
     }
     $templateMgr->assign('stageId', $stageId);
     $reviewRound = $this->getAuthorizedContextObject(ASSOC_TYPE_REVIEW_ROUND);
     $templateMgr->assign('reviewRoundId', $reviewRound->getId());
     $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
     $templateMgr->assign('submission', $submission);
     // Review round request notification options.
     $notificationRequestOptions = array(NOTIFICATION_LEVEL_NORMAL => array(NOTIFICATION_TYPE_REVIEW_ROUND_STATUS => array(ASSOC_TYPE_REVIEW_ROUND, $reviewRound->getId())), NOTIFICATION_LEVEL_TRIVIAL => array());
     $templateMgr->assign('reviewRoundNotificationRequestOptions', $notificationRequestOptions);
     // Editor has taken an action and sent an email; Display the email
     import('classes.workflow.EditorDecisionActionsManager');
     if (EditorDecisionActionsManager::getEditorTakenActionInReviewRound($reviewRound)) {
         $submissionEmailLogDao = DAORegistry::getDAO('SubmissionEmailLogDAO');
         $user = $request->getUser();
         $submissionEmailFactory = $submissionEmailLogDao->getByEventType($submission->getId(), SUBMISSION_EMAIL_EDITOR_NOTIFY_AUTHOR, $user->getId());
         $templateMgr->assign('submissionEmails', $submissionEmailFactory);
         $templateMgr->assign('showReviewAttachments', true);
     }
     return $templateMgr->fetchJson('authorDashboard/reviewRoundInfo.tpl');
 }
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('paperId', $this->paperId);
     $templateMgr->assign('submitStep', $this->step);
     switch ($this->step) {
         case 3:
             $helpTopicId = 'submission.indexingMetadata';
             break;
         case 4:
             $helpTopicId = 'submission.supplementaryFiles';
             break;
         default:
             $helpTopicId = 'submission.index';
     }
     $templateMgr->assign('helpTopicId', $helpTopicId);
     $schedConf =& Request::getSchedConf();
     $settingsDao =& DAORegistry::getDAO('SchedConfSettingsDAO');
     // Determine which submission steps should be shown
     $progress = isset($this->paper) ? $this->paper->getCurrentStage() : REVIEW_STAGE_ABSTRACT;
     $reviewMode = isset($this->paper) ? $this->paper->getReviewMode() : $schedConf->getSetting('reviewMode');
     $showAbstractSteps = $progress == REVIEW_STAGE_ABSTRACT || $reviewMode != REVIEW_MODE_BOTH_SEQUENTIAL;
     $showPaperSteps = $progress == REVIEW_STAGE_PRESENTATION || $reviewMode == REVIEW_MODE_BOTH_SIMULTANEOUS || $reviewMode == REVIEW_MODE_PRESENTATIONS_ALONE;
     $templateMgr->assign('showAbstractSteps', $showAbstractSteps);
     $templateMgr->assign('showPaperSteps', $showPaperSteps);
     $templateMgr->assign('addSuppFileMessage', $schedConf->getLocalizedSetting("addSuppFileMessage"));
     $templateMgr->assign('stepFinalMessage', $schedConf->getLocalizedSetting("stepFinalMessage"));
     $templateMgr->assign('uploadInstructions', $schedConf->getLocalizedSetting("uploadInstructions"));
     if (isset($this->paper)) {
         $templateMgr->assign('submissionProgress', $this->paper->getSubmissionProgress());
     }
     parent::display();
 }
Example #6
0
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign_by_ref('group', $this->group);
     $templateMgr->assign('helpTopicId', 'conference.currentConferences.organizingTeam');
     parent::display();
 }
Example #7
0
 /**
  * @copydoc Form::fetch()
  */
 function fetch($request)
 {
     $urnNamespaces = array('' => '', 'urn:nbn:de' => 'urn:nbn:de', 'urn:nbn:at' => 'urn:nbn:at', 'urn:nbn:ch' => 'urn:nbn:ch', 'urn:nbn' => 'urn:nbn', 'urn' => 'urn');
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign('urnNamespaces', $urnNamespaces);
     return parent::fetch($request);
 }
 /**
  * Save changes to an announcement type.
  */
 function updateReferral()
 {
     $referralId = (int) Request::getUserVar('referralId');
     if ($referralId === 0) {
         $referralId = null;
     }
     list($plugin, $referral, $article) = $this->validate($referralId);
     // If it's an insert, ensure that it's allowed for this article
     if (!isset($referral)) {
         $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
         $journal =& Request::getJournal();
         $article =& $publishedArticleDao->getPublishedArticleByArticleId((int) Request::getUserVar('articleId'));
         if (!$article || $article->getUserId() != $user->getId() && !Validation::isSectionEditor($journal->getId()) && !Validation::isEditor($journal->getId())) {
             Request::redirect(null, 'author');
         }
     }
     $this->setupTemplate();
     $plugin->import('ReferralForm');
     $referralForm = new ReferralForm($plugin, $article, $referralId);
     $referralForm->readInputData();
     if ($referralForm->validate()) {
         $referralForm->execute();
         Request::redirect(null, 'author');
     } else {
         $templateMgr =& TemplateManager::getManager();
         if ($referralId == null) {
             $templateMgr->assign('referralTitle', 'plugins.generic.referral.createReferral');
         } else {
             $templateMgr->assign('referralTitle', 'plugins.generic.referral.editReferral');
         }
         $referralForm->display();
     }
 }
Example #9
0
 /**
  * Display the form.
  */
 function display()
 {
     $conference =& Request::getConference();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('enablePublicSuppFileId', $conference->getSetting('enablePublicSuppFileId'));
     $templateMgr->assign('rolePath', Request::getRequestedPage());
     $templateMgr->assign('paperId', $this->paper->getPaperId());
     $templateMgr->assign('suppFileId', $this->suppFileId);
     $typeOptionsOutput = array('author.submit.suppFile.researchInstrument', 'author.submit.suppFile.researchMaterials', 'author.submit.suppFile.researchResults', 'author.submit.suppFile.transcripts', 'author.submit.suppFile.dataAnalysis', 'author.submit.suppFile.dataSet', 'author.submit.suppFile.sourceText');
     $typeOptionsValues = $typeOptionsOutput;
     array_push($typeOptionsOutput, 'common.other');
     array_push($typeOptionsValues, '');
     $templateMgr->assign('typeOptionsOutput', $typeOptionsOutput);
     $templateMgr->assign('typeOptionsValues', $typeOptionsValues);
     // Sometimes it's necessary to track the page we came from in
     // order to redirect back to the right place
     $templateMgr->assign('from', Request::getUserVar('from'));
     if (isset($this->paper)) {
         $templateMgr->assign('submissionProgress', $this->paper->getSubmissionProgress());
     }
     if (isset($this->suppFile)) {
         $templateMgr->assign_by_ref('suppFile', $this->suppFile);
     }
     $templateMgr->assign('helpTopicId', 'submission.supplementaryFiles');
     parent::display();
 }
Example #10
0
 /**
  * Fetch the form
  * @param $request Request
  */
 function fetch($request)
 {
     $templateMgr = TemplateManager::getManager($request);
     $baseUrl = $templateMgr->_request->getBaseUrl();
     // Add extra java script required for ajax components
     // FIXME: Must be removed after OMP->OJS backporting
     // NOTE: I believe this needs attention. jquery.validate.min.js is
     // loaded with our minifiedScripts.tpl list and includes some i18n
     // features.
     $templateMgr->addJavaScript('citation', $baseUrl . '/lib/pkp/js/functions/citation.js', array('contexts' => 'backend'));
     $templateMgr->addJavaScript('jqueryValidate', $baseUrl . '/lib/pkp/js/lib/jquery/plugins/validate/jquery.validate.min.js', array('contexts' => 'backend'));
     $templateMgr->addJavaScript('jqueryValidatorI18n', $baseUrl . '/lib/pkp/js/functions/jqueryValidatorI18n.js', array('contexts' => 'backend'));
     //
     // Citation editor filter configuration
     //
     // 1) Add the filter grid URLs
     $dispatcher = $request->getDispatcher();
     $parserFilterGridUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.filter.ParserFilterGridHandler', 'fetchGrid');
     $templateMgr->assign('parserFilterGridUrl', $parserFilterGridUrl);
     $lookupFilterGridUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.filter.LookupFilterGridHandler', 'fetchGrid');
     $templateMgr->assign('lookupFilterGridUrl', $lookupFilterGridUrl);
     // 2) Create a list of all available citation output filters.
     $router = $request->getRouter();
     $journal = $router->getContext($request);
     $filterDao = DAORegistry::getDAO('FilterDAO');
     /* @var $filterDao FilterDAO */
     $metaCitationOutputFilterObjects = $filterDao->getObjectsByGroup('nlm30-element-citation=>plaintext', $journal->getId());
     foreach ($metaCitationOutputFilterObjects as $metaCitationOutputFilterObject) {
         $metaCitationOutputFilters[$metaCitationOutputFilterObject->getId()] = $metaCitationOutputFilterObject->getDisplayName();
     }
     $templateMgr->assign_by_ref('metaCitationOutputFilters', $metaCitationOutputFilters);
     return parent::fetch($request);
 }
 function display()
 {
     $templateMgr = TemplateManager::getManager();
     $templateMgr->assign('depositPointId', $this->depositPointId);
     $templateMgr->assign('depositPointTypes', $this->plugin->getTypeMap());
     parent::display();
 }
    /**
     * Add the tinyMCE script for editing sidebar blocks with a WYSIWYG editor
     */
    function addTinyMCE()
    {
        $journalId = $this->journalId;
        $plugin =& $this->plugin;
        $templateMgr =& TemplateManager::getManager();
        // Enable TinyMCE with specific params
        $additionalHeadData = $templateMgr->get_template_vars('additionalHeadData');
        import('classes.file.JournalFileManager');
        $publicFileManager = new PublicFileManager();
        $tinyMCE_script = '
		<script language="javascript" type="text/javascript" src="' . Request::getBaseUrl() . '/' . TINYMCE_JS_PATH . '/tiny_mce.js"></script>
		<script language="javascript" type="text/javascript">
			tinyMCE.init({
			mode : "textareas",
			plugins : "style,paste",
			theme : "advanced",
			theme_advanced_buttons1 : "formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
			theme_advanced_buttons3 : "cut,copy,paste,pastetext,pasteword,|,cleanup,help,code,",
			theme_advanced_toolbar_location : "bottom",
			theme_advanced_toolbar_align : "left",
			content_css : "' . Request::getBaseUrl() . '/styles/common.css", 
			relative_urls : false, 		
			document_base_url : "' . Request::getBaseUrl() . '/' . $publicFileManager->getJournalFilesPath($journalId) . '/", 
			extended_valid_elements : "span[*], div[*]"
			});
		</script>';
        $templateMgr->assign('additionalHeadData', $additionalHeadData . "\n" . $tinyMCE_script);
    }
 /**
  * Save changes to program settings.
  */
 function saveProgramSettings()
 {
     $this->validate();
     $this->setupTemplate(true);
     $schedConf =& Request::getSchedConf();
     if (!$schedConf) {
         Request::redirect(null, null, 'index');
     }
     import('classes.manager.form.ProgramSettingsForm');
     $settingsForm = new ProgramSettingsForm();
     $settingsForm->readInputData();
     $formLocale = $settingsForm->getFormLocale();
     $programTitle = Request::getUserVar('programFileTitle');
     $editData = false;
     if (Request::getUserVar('uploadProgramFile')) {
         if (!$settingsForm->uploadProgram('programFile', $formLocale)) {
             $settingsForm->addError('programFile', Locale::translate('common.uploadFailed'));
         }
         $editData = true;
     } elseif (Request::getUserVar('deleteProgramFile')) {
         $settingsForm->deleteProgram('programFile', $formLocale);
         $editData = true;
     }
     if (!$editData && $settingsForm->validate()) {
         $settingsForm->execute();
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign(array('currentUrl' => Request::url(null, null, null, 'program'), 'pageTitle' => 'schedConf.program', 'message' => 'common.changesSaved', 'backLink' => Request::url(null, null, Request::getRequestedPage()), 'backLinkLabel' => 'manager.conferenceSiteManagement'));
         $templateMgr->display('common/message.tpl');
     } else {
         $settingsForm->display();
     }
 }
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $site =& Request::getSite();
     $templateMgr->assign('minPasswordLength', $site->getMinPasswordLength());
     parent::display();
 }
Example #15
0
 /**
  * Displays the issue listings in a tabbed interface.
  * @param $args array
  * @param $request PKPRequest
  */
 function index($args, $request)
 {
     $this->setupTemplate($request);
     AppLocale::requireComponents(LOCALE_COMPONENT_APP_EDITOR);
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->display('manageIssues/issues.tpl');
 }
Example #16
0
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('buildingId', $this->buildingId);
     $templateMgr->assign('helpTopicId', 'conference.currentConferences.buildings');
     parent::display();
 }
Example #17
0
 /**
  * Fetch
  * @param $request PKPRequest
  * @see Form::fetch()
  */
 function fetch($request)
 {
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign('submissionFileCategories', array(GENRE_CATEGORY_DOCUMENT => __('submission.document'), GENRE_CATEGORY_ARTWORK => __('submission.art'), GENRE_CATEGORY_SUPPLEMENTARY => __('submission.supplementary')));
     AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER);
     return parent::fetch($request);
 }
Example #18
0
 /**
  * Display the form.
  */
 function display()
 {
     $journal = Request::getJournal();
     $templateMgr = TemplateManager::getManager();
     if (isset($this->comment)) {
         $templateMgr->assign('comment', $this->comment);
         $templateMgr->assign('commentId', $this->commentId);
     }
     $user = Request::getUser();
     if ($user) {
         $templateMgr->assign('userName', $user->getFullName());
         $templateMgr->assign('userEmail', $user->getEmail());
     }
     if ($this->captchaEnabled) {
         $templateMgr->assign('captchaEnabled', true);
         import('lib.pkp.lib.recaptcha.recaptchalib');
         $publicKey = Config::getVar('captcha', 'recaptcha_public_key');
         $useSSL = Config::getVar('security', 'force_ssl') ? true : false;
         $reCaptchaHtml = recaptcha_get_html($publicKey, null, $useSSL);
         $templateMgr->assign('reCaptchaHtml', $reCaptchaHtml);
     }
     $templateMgr->assign('parentId', $this->parentId);
     $templateMgr->assign('articleId', $this->articleId);
     $templateMgr->assign('galleyId', $this->galleyId);
     $templateMgr->assign('enableComments', $journal->getSetting('enableComments'));
     parent::display();
 }
 /**
  * Displays the context settings wizard.
  * @param $args array
  * @param $request Request
  * @return JSONMessage JSON object
  */
 function startWizard($args, $request)
 {
     $templateMgr = TemplateManager::getManager($request);
     AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER, LOCALE_COMPONENT_PKP_MANAGER);
     $this->setupTemplate($request);
     return $templateMgr->fetchJson('controllers/wizard/settings/settingsWizard.tpl');
 }
Example #20
0
 /**
  * Sign in as another user.
  * @param $args array ($userId)
  */
 function signInAsUser($args)
 {
     $this->addCheck(new HandlerValidatorConference($this));
     $this->addCheck(new HandlerValidatorRoles($this, true, null, null, array(ROLE_ID_SITE_ADMIN, ROLE_ID_CONFERENCE_MANAGER)));
     $this->validate();
     if (isset($args[0]) && !empty($args[0])) {
         $userId = (int) $args[0];
         $conference =& Request::getConference();
         if (!Validation::canAdminister($conference->getId(), $userId)) {
             $this->setupTemplate();
             // We don't have administrative rights
             // over this user. Display an error.
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->assign('pageTitle', 'manager.people');
             $templateMgr->assign('errorMsg', 'manager.people.noAdministrativeRights');
             $templateMgr->assign('backLink', Request::url(null, null, null, 'people', 'all'));
             $templateMgr->assign('backLinkLabel', 'manager.people.allUsers');
             return $templateMgr->display('common/error.tpl');
         }
         $userDao =& DAORegistry::getDAO('UserDAO');
         $newUser =& $userDao->getUser($userId);
         $session =& Request::getSession();
         // FIXME Support "stack" of signed-in-as user IDs?
         if (isset($newUser) && $session->getUserId() != $newUser->getId()) {
             $session->setSessionVar('signedInAs', $session->getUserId());
             $session->setSessionVar('userId', $userId);
             $session->setUserId($userId);
             $session->setSessionVar('username', $newUser->getUsername());
             Request::redirect(null, null, 'user');
         }
     }
     Request::redirect(null, null, Request::getRequestedPage());
 }
 /**
  * Return an HTML-formatted citation. Default implementation displays
  * an HTML-based citation using the citation.tpl template in the plugin
  * path.
  * @param $article object
  * @param $issue object
  */
 function cite(&$article, &$issue)
 {
     HookRegistry::register('Template::RT::CaptureCite', array(&$this, 'displayCitation'));
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign_by_ref('citationPlugin', $this);
     $templateMgr->display('rt/captureCite.tpl');
 }
 /**
  * Display a list of the review form elements within a review form.
  * @param $args array
  * @param $request PKPRequest
  * @return JSONMessage JSON object
  */
 function documentLibrary($args, $request)
 {
     $templateMgr = TemplateManager::getManager($request);
     $dispatcher = $request->getDispatcher();
     $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
     return $templateMgr->fetchAjax('submissionLibraryContainer', $dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.files.submissionDocuments.SubmissionDocumentsFilesGridHandler', 'fetchGrid', null, array('submissionId' => $submission->getId())));
 }
 /**
  * Display the form.
  */
 function display()
 {
     $journal = Request::getJournal();
     $templateMgr =& TemplateManager::getManager();
     if (isset($this->comment)) {
         $templateMgr->assign_by_ref('comment', $this->comment);
         $templateMgr->assign('commentId', $this->commentId);
     }
     $user = Request::getUser();
     if ($user) {
         $templateMgr->assign('userName', $user->getFullName());
         $templateMgr->assign('userEmail', $user->getEmail());
     }
     if ($this->captchaEnabled) {
         import('lib.pkp.classes.captcha.CaptchaManager');
         $captchaManager = new CaptchaManager();
         $captcha =& $captchaManager->createCaptcha();
         if ($captcha) {
             $templateMgr->assign('captchaEnabled', $this->captchaEnabled);
             $this->setData('captchaId', $captcha->getId());
         }
     }
     $templateMgr->assign('parentId', $this->parentId);
     $templateMgr->assign('articleId', $this->articleId);
     $templateMgr->assign('galleyId', $this->galleyId);
     $templateMgr->assign('enableComments', $journal->getSetting('enableComments'));
     parent::display();
 }
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('conferenceId', $this->conferenceId);
     $templateMgr->assign('helpTopicId', 'site.siteManagement');
     parent::display();
 }
 function displayPaymentForm($queuedPaymentId, &$queuedPayment)
 {
     if (!$this->isConfigured()) {
         return false;
     }
     $journal =& Request::getJournal();
     $templateMgr =& TemplateManager::getManager();
     $user =& Request::getUser();
     $templateMgr->assign('itemName', $queuedPayment->getName());
     $templateMgr->assign('itemDescription', $queuedPayment->getDescription());
     if ($queuedPayment->getAmount() > 0) {
         $templateMgr->assign('itemAmount', $queuedPayment->getAmount());
         $templateMgr->assign('itemCurrencyCode', $queuedPayment->getCurrencyCode());
     }
     $templateMgr->assign('manualInstructions', $this->getSetting($journal->getJournalId(), 'manualInstructions'));
     $templateMgr->display($this->getTemplatePath() . 'paymentForm.tpl');
     if ($queuedPayment->getAmount() > 0) {
         import('mail.MailTemplate');
         $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->getJournalTitle(), '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();
     }
 }
 function fetch(&$request)
 {
     $monograph =& $this->getMonograph();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign_by_ref('monograph', $this->getMonograph());
     return parent::fetch($request);
 }
 /**
  * Display the form.
  */
 function display()
 {
     $journal =& Request::getJournal();
     $user =& 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', Request::getJournal());
     // 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));
             $templateMgr->assign('manualPayment', $journal->getSetting('paymentMethodPluginName') == 'ManualPayment');
         }
         if ($paymentManager->fastTrackEnabled()) {
             $templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDAO->getFastTrackCompletedPayment($journal->getId(), $articleId));
         }
     }
     parent::display();
 }
Example #28
0
 function settings()
 {
     $this->validate();
     $conference = Request::getConference();
     if ($conference) {
         $this->setupTemplate(true);
         $templateMgr =& TemplateManager::getManager();
         $rtDao =& DAORegistry::getDAO('RTDAO');
         $rt = $rtDao->getConferenceRTByConference($conference);
         $versionOptions = array();
         $versions = $rtDao->getVersions($conference->getId());
         foreach ($versions->toArray() as $version) {
             $versionOptions[$version->getVersionId()] = $version->getTitle();
         }
         $templateMgr->assign('versionOptions', $versionOptions);
         $templateMgr->assign_by_ref('version', $rt->getVersion());
         $templateMgr->assign('enabled', $rt->getEnabled());
         $templateMgr->assign('abstract', $rt->getAbstract());
         $templateMgr->assign('captureCite', $rt->getCaptureCite());
         $templateMgr->assign('viewMetadata', $rt->getViewMetadata());
         $templateMgr->assign('supplementaryFiles', $rt->getSupplementaryFiles());
         $templateMgr->assign('printerFriendly', $rt->getPrinterFriendly());
         $templateMgr->assign('authorBio', $rt->getAuthorBio());
         $templateMgr->assign('defineTerms', $rt->getDefineTerms());
         $templateMgr->assign('addComment', $rt->getAddComment());
         $templateMgr->assign('emailAuthor', $rt->getEmailAuthor());
         $templateMgr->assign('emailOthers', $rt->getEmailOthers());
         $templateMgr->assign('findingReferences', $rt->getFindingReferences());
         $templateMgr->assign('helpTopicId', 'conference.generalManagement.readingTools.settings');
         $templateMgr->display('rtadmin/settings.tpl');
     } else {
         Request::redirect(null, null, Request::getRequestedPage());
     }
 }
Example #29
0
 function display(&$args, $request)
 {
     $templateMgr =& TemplateManager::getManager();
     parent::display($args, $request);
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $articleGalleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $journal =& Request::getJournal();
     switch (array_shift($args)) {
         case 'exportGalley':
             $articleId = array_shift($args);
             $galleyId = array_shift($args);
             $article =& $publishedArticleDao->getPublishedArticleByArticleId($articleId);
             $galley =& $articleGalleyDao->getGalley($galleyId, $articleId);
             if ($article && $galley && ($issue =& $issueDao->getIssueById($article->getIssueId(), $journal->getId()))) {
                 $this->exportArticle($journal, $issue, $article, $galley);
                 break;
             }
         default:
             // Display a list of articles for export
             $this->setBreadcrumbs();
             AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION);
             $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
             $rangeInfo = Handler::getRangeInfo('articles');
             $articleIds = $publishedArticleDao->getPublishedArticleIdsAlphabetizedByJournal($journal->getId(), false);
             $totalArticles = count($articleIds);
             $articleIds = array_slice($articleIds, $rangeInfo->getCount() * ($rangeInfo->getPage() - 1), $rangeInfo->getCount());
             import('lib.pkp.classes.core.VirtualArrayIterator');
             $iterator = new VirtualArrayIterator(ArticleSearch::formatResults($articleIds), $totalArticles, $rangeInfo->getPage(), $rangeInfo->getCount());
             $templateMgr->assign_by_ref('articles', $iterator);
             $templateMgr->display($this->getTemplatePath() . 'index.tpl');
             break;
     }
 }
 /**
  * Display the site or press index page.
  * (If a site admin is logged in and no presses exist, redirect to the
  * press administration page -- this may be useful upon install.)
  *
  * @param $args array
  * @param $request Request
  */
 function index($args, $request)
 {
     $targetPress = $this->getTargetContext($request);
     $press = $request->getPress();
     $user = $request->getUser();
     if ($user && !$targetPress && Validation::isSiteAdmin()) {
         // If the user is a site admin and no press exists,
         // send them to press administration to create one.
         return $request->redirect(null, 'admin', 'contexts');
     }
     // Public access.
     $this->setupTemplate($request);
     $templateMgr = TemplateManager::getManager($request);
     if ($press) {
         // Display the current press home.
         $this->_displayPressIndexPage($press, $templateMgr);
     } elseif ($targetPress) {
         // We're not on a press homepage, but there's one
         // available; redirect there.
         $request->redirect($targetPress->getPath());
     } else {
         // A target press couldn't be determined for some reason.
         if ($user) {
             // Redirect to user profile.
             $request->redirect(null, 'user', 'profile');
         } else {
             // Not logged in. Redirect to login page.
             $request->redirect(null, 'login');
         }
     }
 }