/**
  * Display proofreader index page.
  */
 function index($args)
 {
     $this->validate();
     $this->setupTemplate();
     $journal =& Request::getJournal();
     $user =& Request::getUser();
     $proofreaderSubmissionDao =& DAORegistry::getDAO('ProofreaderSubmissionDAO');
     // Get the user's search conditions, if any
     $searchField = Request::getUserVar('searchField');
     $dateSearchField = Request::getUserVar('dateSearchField');
     $searchMatch = Request::getUserVar('searchMatch');
     $search = Request::getUserVar('search');
     $fromDate = Request::getUserDateVar('dateFrom', 1, 1);
     if ($fromDate !== null) {
         $fromDate = date('Y-m-d H:i:s', $fromDate);
     }
     $toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);
     if ($toDate !== null) {
         $toDate = date('Y-m-d H:i:s', $toDate);
     }
     $rangeInfo = Handler::getRangeInfo('submissions');
     $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');
     $countryField = Request::getUserVar('countryField');
     $submissions = $proofreaderSubmissionDao->getSubmissions($user->getId(), $journal->getId(), $searchField, $searchMatch, $search, $dateSearchField, $fromDate, $toDate, $countryField, $active, $rangeInfo, $sort, $sortDirection);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageToDisplay', $page);
     $templateMgr->assign_by_ref('submissions', $submissions);
     // Set search parameters
     $duplicateParameters = array('searchField', 'searchMatch', 'search', 'dateFromMonth', 'dateFromDay', 'dateFromYear', 'dateToMonth', 'dateToDay', 'dateToYear', 'dateSearchField');
     foreach ($duplicateParameters as $param) {
         $templateMgr->assign($param, Request::getUserVar($param));
     }
     $templateMgr->assign('dateFrom', $fromDate);
     $templateMgr->assign('dateTo', $toDate);
     $templateMgr->assign('fieldOptions', array(SUBMISSION_FIELD_TITLE => 'article.title', SUBMISSION_FIELD_AUTHOR => 'user.role.author', SUBMISSION_FIELD_EDITOR => 'user.role.editor'));
     $templateMgr->assign('dateFieldOptions', array(SUBMISSION_FIELD_DATE_SUBMITTED => 'submissions.submitted', SUBMISSION_FIELD_DATE_COPYEDIT_COMPLETE => 'submissions.copyeditComplete', SUBMISSION_FIELD_DATE_LAYOUT_COMPLETE => 'submissions.layoutComplete', SUBMISSION_FIELD_DATE_PROOFREADING_COMPLETE => 'submissions.proofreadingComplete'));
     $extraFieldDao =& DAORegistry::getDAO('ExtraFieldDAO');
     $countries =& $extraFieldDao->getExtraFieldsList(EXTRA_FIELD_GEO_AREA);
     $templateMgr->assign_by_ref('countries', $countries);
     import('classes.issue.IssueAction');
     $issueAction = new IssueAction();
     $templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
     $templateMgr->assign('helpTopicId', 'editorial.proofreadersRole.submissions');
     $templateMgr->assign('sort', $sort);
     $templateMgr->assign('sortDirection', $sortDirection);
     // Added by igm 9/24/11
     $templateMgr->assign('countryField', $countryField);
     $templateMgr->display('proofreader/index.tpl');
 }
Example #2
0
 function thankYou($args)
 {
     $templateMgr =& TemplateManager::getManager();
     $journal =& Request::getJournal();
     $templateMgr->assign(array('currentUrl' => Request::url(null, null, 'donations'), 'pageTitle' => 'donations.thankYou', 'journalName' => $journal->getJournalTitle(), 'message' => 'donations.thankYouMessage'));
     $templateMgr->display('common/message.tpl');
 }
 /**
  * Display the form.
  */
 function display()
 {
     $journal =& Request::getJournal();
     $reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
     $reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, ASSOC_TYPE_JOURNAL, $journal->getId());
     $reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');
     $reviewFormElements =& $reviewFormElementDao->getReviewFormElements($this->reviewFormId);
     $reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
     $reviewFormResponses =& $reviewFormResponseDao->getReviewReviewFormResponseValues($this->reviewId);
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $reviewAssignment = $reviewAssignmentDao->getById($this->reviewId);
     $editorPreview = Request::getRequestedPage() != 'reviewer';
     if (!$editorPreview) {
         ReviewerHandler::setupTemplate(true, $reviewAssignment->getSubmissionId(), $this->reviewId);
     }
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('pageTitle', 'submission.reviewFormResponse');
     $templateMgr->assign_by_ref('reviewForm', $reviewForm);
     $templateMgr->assign('reviewFormElements', $reviewFormElements);
     $templateMgr->assign('reviewFormResponses', $reviewFormResponses);
     $templateMgr->assign('reviewId', $this->reviewId);
     $templateMgr->assign('articleId', $reviewAssignment->getSubmissionId());
     $templateMgr->assign('isLocked', isset($reviewAssignment) && $reviewAssignment->getDateCompleted() != null);
     $templateMgr->assign('editorPreview', $editorPreview);
     parent::display();
 }
Example #4
0
 /**
  * Used by subclasses to validate access keys when they are allowed.
  * @param $userId int The user this key refers to
  * @param $reviewId int The ID of the review this key refers to
  * @param $newKey string The new key name, if one was supplied; otherwise, the existing one (if it exists) is used
  * @return object Valid user object if the key was valid; otherwise NULL.
  */
 function &validateAccessKey($userId, $reviewId, $newKey = null)
 {
     $journal =& Request::getJournal();
     if (!$journal || !$journal->getSetting('reviewerAccessKeysEnabled')) {
         $accessKey = false;
         return $accessKey;
     }
     define('REVIEWER_ACCESS_KEY_SESSION_VAR', 'ReviewerAccessKey');
     import('security.AccessKeyManager');
     $accessKeyManager =& new AccessKeyManager();
     $session =& Request::getSession();
     // Check to see if a new access key is being used.
     if (!empty($newKey)) {
         if (Validation::isLoggedIn()) {
             Validation::logout();
         }
         $keyHash = $accessKeyManager->generateKeyHash($newKey);
         $session->setSessionVar(REVIEWER_ACCESS_KEY_SESSION_VAR, $keyHash);
     } else {
         $keyHash = $session->getSessionVar(REVIEWER_ACCESS_KEY_SESSION_VAR);
     }
     // Now that we've gotten the key hash (if one exists), validate it.
     $accessKey =& $accessKeyManager->validateKey('ReviewerContext', $userId, $keyHash, $reviewId);
     if ($accessKey) {
         $userDao =& DAORegistry::getDAO('UserDAO');
         $user =& $userDao->getUser($accessKey->getUserId(), false);
         return $user;
     }
     // No valid access key -- return NULL.
     return $accessKey;
 }
Example #5
0
 /**
  * Save review form.
  */
 function execute()
 {
     $journal = Request::getJournal();
     $journalId = $journal->getId();
     $reviewFormDao = DAORegistry::getDAO('ReviewFormDAO');
     if ($this->reviewFormId != null) {
         $reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, ASSOC_TYPE_JOURNAL, $journalId);
     }
     if (!isset($reviewForm)) {
         $reviewForm = $reviewFormDao->newDataObject();
         $reviewForm->setAssocType(ASSOC_TYPE_JOURNAL);
         $reviewForm->setAssocId($journalId);
         $reviewForm->setActive(0);
         $reviewForm->setSequence(REALLY_BIG_NUMBER);
     }
     $reviewForm->setTitle($this->getData('title'), null);
     // Localized
     $reviewForm->setDescription($this->getData('description'), null);
     // Localized
     if ($reviewForm->getId() != null) {
         $reviewFormDao->updateObject($reviewForm);
         $reviewFormId = $reviewForm->getId();
     } else {
         $reviewFormId = $reviewFormDao->insertObject($reviewForm);
         $reviewFormDao->resequenceReviewForms(ASSOC_TYPE_JOURNAL, $journalId);
     }
 }
 /**
  * Save review form.
  */
 function execute()
 {
     $journal =& Request::getJournal();
     $journalId = $journal->getJournalId();
     $reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
     if ($this->reviewFormId != null) {
         $reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, $journalId);
     }
     if (!isset($reviewForm)) {
         $reviewForm =& new ReviewForm();
         $reviewForm->setJournalId($journalId);
         $reviewForm->setActive(0);
         $reviewForm->setSequence(REALLY_BIG_NUMBER);
     }
     $reviewForm->setTitle($this->getData('title'), null);
     // Localized
     $reviewForm->setDescription($this->getData('description'), null);
     // Localized
     if ($reviewForm->getReviewFormId() != null) {
         $reviewFormDao->updateReviewForm($reviewForm);
         $reviewFormId = $reviewForm->getReviewFormId();
     } else {
         $reviewFormId = $reviewFormDao->insertReviewForm($reviewForm);
         $reviewFormDao->resequenceReviewForms($journalId, 0);
     }
 }
 function display()
 {
     $journal = Request::getJournal();
     $countryDao =& DAORegistry::getDAO('CountryDAO');
     $extraFieldDao =& DAORegistry::getDAO('ExtraFieldDAO');
     $institutionDao =& DAORegistry::getDAO('InstitutionDAO');
     $currencyDao =& DAORegistry::getDAO('CurrencyDAO');
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $sectionOptions = array('0' => Locale::translate('editor.reports.anyCommittee')) + $sectionDao->getSectionTitles($journal->getId());
     $decisionTypes = array(INITIAL_REVIEW => 'submission.initialReview', PROGRESS_REPORT => 'submission.progressReport', PROTOCOL_AMENDMENT => 'submission.protocolAmendment', SERIOUS_ADVERSE_EVENT => 'submission.seriousAdverseEvents', FINAL_REPORT => 'submission.finalReport');
     $decisionOptions = array(98 => 'editor.reports.aDecisionsIUR', 99 => 'editor.reports.aDecisionsEUR', SUBMISSION_SECTION_DECISION_APPROVED => 'editor.article.decision.approved', SUBMISSION_SECTION_DECISION_RESUBMIT => 'editor.article.decision.resubmit', SUBMISSION_SECTION_DECISION_DECLINED => 'editor.article.decision.declined');
     $budgetOptions = array(">=" => 'editor.reports.budgetSuperiorTo', "<=" => 'editor.reports.budgetInferiorTo');
     $sourceCurrencyId = $journal->getSetting('sourceCurrency');
     $reportTypeOptions = array(0 => 'editor.reports.type.spreadsheet', 1 => 'editor.reports.type.pieChart', 2 => 'editor.reports.type.barChart');
     $measurementOptions = array(0 => 'editor.reports.measurement.proposalNmbre', 1 => 'editor.reports.measurement.cumulatedBudget');
     $chartOptions = array();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('sectionOptions', $sectionOptions);
     $templateMgr->assign('decisionTypes', $decisionTypes);
     $templateMgr->assign('decisionOptions', $decisionOptions);
     $templateMgr->assign('institutionsList', $institutionDao->getInstitutionsList());
     $templateMgr->assign('reportTypeOptions', $reportTypeOptions);
     $templateMgr->assign('measurementOptions', $measurementOptions);
     $templateMgr->assign('chartOptions', $chartOptions);
     parent::display();
 }
 /**
  * Constructor
  * @param subscriptionId int leave as default for new subscription
  */
 function InstitutionalSubscriptionForm($subscriptionId = null, $userId = null)
 {
     parent::Form('subscription/institutionalSubscriptionForm.tpl');
     parent::SubscriptionForm($subscriptionId, $userId);
     $subscriptionId = isset($subscriptionId) ? (int) $subscriptionId : null;
     $userId = isset($userId) ? (int) $userId : null;
     $journal =& Request::getJournal();
     $journalId = $journal->getId();
     if (isset($subscriptionId)) {
         $subscriptionDao =& DAORegistry::getDAO('InstitutionalSubscriptionDAO');
         if ($subscriptionDao->subscriptionExists($subscriptionId)) {
             $this->subscription =& $subscriptionDao->getSubscription($subscriptionId);
         }
     }
     $subscriptionTypeDao =& DAORegistry::getDAO('SubscriptionTypeDAO');
     $subscriptionTypes =& $subscriptionTypeDao->getSubscriptionTypesByInstitutional($journalId, true);
     $this->subscriptionTypes =& $subscriptionTypes->toArray();
     $subscriptionTypeCount = count($this->subscriptionTypes);
     if ($subscriptionTypeCount == 0) {
         $this->addError('typeId', __('manager.subscriptions.form.typeRequired'));
         $this->addErrorField('typeId');
     }
     // Ensure subscription type is valid
     $this->addCheck(new FormValidatorCustom($this, 'typeId', 'required', 'manager.subscriptions.form.typeIdValid', create_function('$typeId, $journalId', '$subscriptionTypeDao =& DAORegistry::getDAO(\'SubscriptionTypeDAO\'); return ($subscriptionTypeDao->subscriptionTypeExistsByTypeId($typeId, $journalId) && $subscriptionTypeDao->getSubscriptionTypeInstitutional($typeId) == 1);'), array($journal->getId())));
     // Ensure institution name is provided
     $this->addCheck(new FormValidator($this, 'institutionName', 'required', 'manager.subscriptions.form.institutionNameRequired'));
     // If provided, domain is valid
     $this->addCheck(new FormValidatorRegExp($this, 'domain', 'optional', 'manager.subscriptions.form.domainValid', '/^' . '[A-Z0-9]+([\\-_\\.][A-Z0-9]+)*' . '\\.' . '[A-Z]{2,4}' . '$/i'));
 }
Example #9
0
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('articleId', $this->articleId);
     $templateMgr->assign('submitStep', $this->step);
     if (isset($this->article)) {
         $templateMgr->assign('submissionProgress', $this->article->getSubmissionProgress());
     }
     switch ($this->step) {
         case 3:
             $helpTopicId = 'submission.indexingAndMetadata';
             break;
         case 4:
             $helpTopicId = 'submission.supplementaryFiles';
             break;
         default:
             $helpTopicId = 'submission.index';
     }
     $templateMgr->assign('helpTopicId', $helpTopicId);
     $journal =& Request::getJournal();
     $settingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     if ($this->article) {
         $lastSectionDecision = $this->article->getLastSectionDecision();
         if ($lastSectionDecision->getReviewType() == REVIEW_TYPE_AMENDMENT) {
             $protocolAmendmentGuidelines = $journal->getLocalizedSetting('protocolAmendmentGuidelines');
         } else {
             $protocolAmendmentGuidelines = (string) '';
         }
         $templateMgr->assign('protocolAmendmentGuidelines', $protocolAmendmentGuidelines);
     }
     $templateMgr->assign_by_ref('journalSettings', $settingsDao->getJournalSettings($journal->getId()));
     parent::display();
 }
 function pendingUsers()
 {
     $this->validate();
     $this->setupTemplate();
     $journal =& Request::getJournal();
     $templateMgr =& TemplateManager::getManager();
     $CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');
     $journalId = $journal->getJournalId();
     if (Request::getUserVar('approve') && Request::getUserVar('role')) {
         $userId = Request::getUserVar('approve');
         $roleId = Request::getUserVar('role');
         if ($CBPPlatformDao->setUserRegistration($userId, $roleId, $journalId) == true) {
             $templateMgr->assign('usersApproved', true);
         }
     }
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $pendingUsers = $CBPPlatformDao->getPendingUserRegistrations($journalId);
     foreach ($pendingUsers as &$pendingUser) {
         $role = $roleDao->getRole($pendingUser['journal_id'], $pendingUser['user_id'], $pendingUser['role_id']);
         $roleArr = explode(".", $role->getRoleName());
         $pendingUser['role'] = ucfirst($roleArr[2]);
     }
     $templateMgr->assign('pendingUsers', $pendingUsers);
     $templateMgr->display('manager/pendingUsers/index.tpl');
 }
Example #11
0
 function display(&$args)
 {
     $journal =& Request::getJournal();
     // FIXME: Localize this.
     $columns = array("Article ID", "Article Title", "Issue", "Date Published", "Abstract Views", "Total Galley Views");
     $galleyLabels = array();
     $galleyViews = array();
     $galleyViewTotals = array();
     $abstractViewCounts = array();
     $issueIdentifications = array();
     $issueDatesPublished = array();
     $articleTitles = array();
     $articleIssueIdentificationMap = array();
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticles =& $publishedArticleDao->getPublishedArticlesByJournalId($journal->getJournalId());
     while ($publishedArticle =& $publishedArticles->next()) {
         $articleId = $publishedArticle->getArticleId();
         $issueId = $publishedArticle->getIssueId();
         $articleTitles[$articleId] = $publishedArticle->getArticleTitle();
         // Store the abstract view count
         $abstractViewCounts[$articleId] = $publishedArticle->getViews();
         // Make sure we get the issue identification
         $articleIssueIdentificationMap[$articleId] = $issueId;
         if (!isset($issueIdentifications[$issueId])) {
             $issue =& $issueDao->getIssueById($issueId);
             $issueIdentifications[$issueId] = $issue->getIssueIdentification();
             $issueDatesPublished[$issueId] = $issue->getDatePublished();
             unset($issue);
         }
         // For each galley, store the label and the count
         $galleys =& $publishedArticle->getGalleys();
         $galleyViews[$articleId] = array();
         $galleyViewTotals[$articleId] = 0;
         foreach ($galleys as $galley) {
             $label = $galley->getGalleyLabel();
             $i = array_search($label, $galleyLabels);
             if ($i === false) {
                 $i = count($galleyLabels);
                 $galleyLabels[] = $label;
             }
             $views = $galley->getViews();
             $galleyViews[$articleId][$i] = $views;
             $galleyViewTotals[$articleId] += $views;
         }
         // Clean up
         unset($publishedArticle, $galleys);
     }
     header('content-type: text/comma-separated-values');
     header('content-disposition: attachment; filename=report.csv');
     $fp = fopen('php://output', 'wt');
     fputcsv($fp, array_merge($columns, $galleyLabels));
     ksort($abstractViewCounts);
     $dateFormatShort = Config::getVar('general', 'date_format_short');
     foreach ($abstractViewCounts as $articleId => $abstractViewCount) {
         $values = array($articleId, $articleTitles[$articleId], $issueIdentifications[$articleIssueIdentificationMap[$articleId]], strftime($dateFormatShort, strtotime($issueDatesPublished[$articleIssueIdentificationMap[$articleId]])), $abstractViewCount, $galleyViewTotals[$articleId]);
         fputcsv($fp, array_merge($values, $galleyViews[$articleId]));
     }
     fclose($fp);
 }
 /**
  * Save modified settings.
  */
 function execute()
 {
     $journal =& Request::getJournal();
     $settingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     // Verify additional locales
     $supportedLocales = array();
     foreach ($this->getData('supportedLocales') as $locale) {
         if (Locale::isLocaleValid($locale) && in_array($locale, $this->availableLocales)) {
             array_push($supportedLocales, $locale);
         }
     }
     $primaryLocale = $this->getData('primaryLocale');
     if ($primaryLocale != null && !empty($primaryLocale) && !in_array($primaryLocale, $supportedLocales)) {
         array_push($supportedLocales, $primaryLocale);
     }
     $this->setData('supportedLocales', $supportedLocales);
     foreach ($this->_data as $name => $value) {
         if (!in_array($name, array_keys($this->settings))) {
             continue;
         }
         $settingsDao->updateSetting($journal->getJournalId(), $name, $value, $this->settings[$name]);
     }
     $journalDao =& DAORegistry::getDAO('JournalDAO');
     $journal->setPrimaryLocale($this->getData('primaryLocale'));
     $journalDao->updateJournal($journal);
 }
 /**
  * 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
 }
 /**
  * Get the HTML contents for this block.
  * @param $templateMgr object
  * @return $string
  */
 function getContents(&$templateMgr)
 {
     $journal =& Request::getJournal();
     $cacheManager =& CacheManager::getManager();
     $cache =& $cacheManager->getFileCache('keywords_' . AppLocale::getLocale(), $journal->getId(), array(&$this, '_cacheMiss'));
     // If the cache is older than a couple of days, regenerate it
     if (time() - $cache->getCacheTime() > 60 * 60 * 24 * KEYWORD_BLOCK_CACHE_DAYS) {
         $cache->flush();
     }
     $keywords =& $cache->getContents();
     if (empty($keywords)) {
         return '';
     }
     // Get the max occurrences for all keywords
     $maxOccurs = array_shift(array_values($keywords));
     // Now sort the array alphabetically
     ksort($keywords);
     $page = Request::getRequestedPage();
     $op = Request::getRequestedOp();
     $templateMgr->assign_by_ref('cloudKeywords', $keywords);
     $templateMgr->assign_by_ref('maxOccurs', $maxOccurs);
     if ($page == 'index' && $op == 'index' || $page == 'issue' || $page == 'search') {
         return parent::getContents($templateMgr);
     } else {
         return '';
     }
 }
 /**
  * Display the form.
  */
 function display()
 {
     $journal = Request::getJournal();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('articleId', $this->articleId);
     $templateMgr->assign('suppFileId', $this->suppFileId);
     $templateMgr->assign('submitStep', 4);
     //%CBP% get CBPPlatformDao - required sections
     $CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');
     $article = $this->article->_data;
     $templateMgr->assign_by_ref('requiredSections', $CBPPlatformDao->getRequiredSections($journal->getJournalId()));
     $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);
     if (isset($this->article)) {
         $templateMgr->assign('submissionProgress', $this->article->getSubmissionProgress());
     }
     if (isset($this->suppFile)) {
         $templateMgr->assign_by_ref('suppFile', $this->suppFile);
     }
     $templateMgr->assign('helpTopicId', 'submission.supplementaryFiles');
     parent::display();
 }
 /**
  * Save modified settings.
  */
 function execute()
 {
     $journal =& Request::getJournal();
     $settingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     // Verify additional locales
     foreach (array('supportedLocales', 'supportedSubmissionLocales', 'supportedFormLocales') as $name) {
         ${$name} = array();
         foreach ($this->getData($name) as $locale) {
             if (AppLocale::isLocaleValid($locale) && in_array($locale, $this->availableLocales)) {
                 array_push(${$name}, $locale);
             }
         }
     }
     $primaryLocale = $this->getData('primaryLocale');
     // Make sure at least the primary locale is chosen as available
     if ($primaryLocale != null && !empty($primaryLocale)) {
         foreach (array('supportedLocales', 'supportedSubmissionLocales', 'supportedFormLocales') as $name) {
             if (!in_array($primaryLocale, ${$name})) {
                 array_push(${$name}, $primaryLocale);
             }
         }
     }
     $this->setData('supportedLocales', $supportedLocales);
     $this->setData('supportedSubmissionLocales', $supportedSubmissionLocales);
     $this->setData('supportedFormLocales', $supportedFormLocales);
     foreach ($this->_data as $name => $value) {
         if (!in_array($name, array_keys($this->settings))) {
             continue;
         }
         $settingsDao->updateSetting($journal->getId(), $name, $value, $this->settings[$name]);
     }
     $journalDao =& DAORegistry::getDAO('JournalDAO');
     $journal->setPrimaryLocale($this->getData('primaryLocale'));
     $journalDao->updateJournal($journal);
 }
 /**
  * @see ReportPlugin::display()
  */
 function display(&$args)
 {
     parent::display($args);
     $journal =& Request::getJournal();
     $reportArgs = array('metricType' => OJS_METRIC_TYPE_COUNTER, 'columns' => array(STATISTICS_DIMENSION_ASSOC_ID, STATISTICS_DIMENSION_ASSOC_TYPE, STATISTICS_DIMENSION_CONTEXT_ID, STATISTICS_DIMENSION_ISSUE_ID, STATISTICS_DIMENSION_MONTH, STATISTICS_DIMENSION_COUNTRY), 'filters' => serialize(array(STATISTICS_DIMENSION_CONTEXT_ID => $journal->getId())), 'orderBy' => serialize(array(STATISTICS_DIMENSION_MONTH => STATISTICS_ORDER_ASC)));
     Request::redirect(null, null, 'generateReport', null, $reportArgs);
 }
Example #18
0
 function validateUrls($args)
 {
     $this->validate();
     $rtDao =& DAORegistry::getDAO('RTDAO');
     $journal = Request::getJournal();
     if (!$journal) {
         Request::redirect(null, Request::getRequestedPage());
         return;
     }
     $versionId = isset($args[0]) ? $args[0] : 0;
     $journalId = $journal->getId();
     $version = $rtDao->getVersion($versionId, $journalId);
     if ($version) {
         // Validate the URLs for a single version
         $versions = array(&$version);
         import('lib.pkp.classes.core.ArrayItemIterator');
         $versions = new ArrayItemIterator($versions, 1, 1);
     } else {
         // Validate all URLs for this journal
         $versions = $rtDao->getVersions($journalId);
     }
     $this->setupTemplate(true, $version);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->register_modifier('validate_url', 'smarty_rtadmin_validate_url');
     $templateMgr->assign_by_ref('versions', $versions);
     $templateMgr->assign('helpTopicId', 'journal.managementPages.readingTools');
     $templateMgr->display('rtadmin/validate.tpl');
 }
Example #19
0
 /**
  * Display the form.
  */
 function display(&$args)
 {
     $meetingId = isset($args[0]) ? $args[0] : 0;
     $journal =& Request::getJournal();
     $journalId = $journal->getId();
     $user =& Request::getUser();
     $sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO');
     $sort = Request::getUserVar('sort');
     $sort = isset($sort) ? $sort : 'id';
     $sortDirection = Request::getUserVar('sortDirection');
     $availableSectionDecisions =& $sectionDecisionDao->getSectionDecisionsAvailableForMeeting($user->getSecretaryCommitteeId(), $journalId, $sort, $sortDirection);
     /*Get the selected submissions to be reviewed*/
     $meetingDao =& DAORegistry::getDAO('MeetingDAO');
     $meeting =& $meetingDao->getMeetingById($meetingId);
     /*Get the selected submissions to be reviewed*/
     $meetingSectionDecisionDao =& DAORegistry::getDAO('MeetingSectionDecisionDAO');
     $mSectionDecisions = $meetingSectionDecisionDao->getMeetingSectionDecisionsByMeetingId($meetingId);
     $sectionDecisionsId = array();
     foreach ($mSectionDecisions as $mSectionDecision) {
         array_push($sectionDecisionsId, $mSectionDecision->getSectionDecisionId());
     }
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('sort', $sort);
     $templateMgr->assign('sortDirection', $sortDirection);
     $templateMgr->assign('meetingId', $meetingId);
     $templateMgr->assign('meetingDate', $meeting->getDate());
     $templateMgr->assign('meetingLength', $meeting->getLength());
     $templateMgr->assign('location', $meeting->getLocation());
     $templateMgr->assign('investigator', $meeting->getInvestigator());
     $templateMgr->assign_by_ref('availableSectionDecisions', $availableSectionDecisions);
     $templateMgr->assign_by_ref('sectionDecisionsId', $sectionDecisionsId);
     $templateMgr->assign('baseUrl', Config::getVar('general', "base_url"));
     parent::display();
 }
Example #20
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;
     }
 }
 /**
  * Email the comment.
  */
 function email()
 {
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $journal =& Request::getJournal();
     // Create list of recipients:
     // Editor Decision comments are to be sent to the editor or author,
     // the opposite of whomever wrote the comment.
     $recipients = array();
     if ($this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR) {
         // Then add author
         $user =& $userDao->getUser($this->article->getUserId());
         if ($user) {
             $recipients = array_merge($recipients, array($user->getEmail() => $user->getFullName()));
         }
     } else {
         $editorAddresses = array();
         $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
         $sectionEditors =& $sectionEditorsDao->getEditorsBySectionId($journal->getId(), $this->article->getSectionId());
         foreach ($sectionEditors as $sectionEditor) {
             $editorAddresses[$sectionEditor->getEmail()] = $sectionEditor->getFullName();
         }
         // If no editors are currently assigned to this article,
         // send the email to all editors for the journal
         if (empty($editorAddresses)) {
             $editors =& $roleDao->getUsersByRoleId(ROLE_ID_EDITOR, $journal->getId());
             while (!$editors->eof()) {
                 $editor =& $editors->next();
                 $editorAddresses[$editor->getEmail()] = $editor->getFullName();
             }
         }
         $recipients = array_merge($recipients, $editorAddresses);
     }
     parent::email($recipients);
 }
Example #22
0
 /**
  * Save group group.
  */
 function execute()
 {
     $groupDao =& DAORegistry::getDAO('GroupDAO');
     $journal =& Request::getJournal();
     if (!isset($this->group)) {
         $this->group = $groupDao->newDataObject();
     }
     $this->group->setAssocType(ASSOC_TYPE_JOURNAL);
     $this->group->setAssocId($journal->getId());
     $this->group->setTitle($this->getData('title'), null);
     // Localized
     $this->group->setContext($this->getData('context'));
     $this->group->setPublishEmail($this->getData('publishEmail'));
     // Eventually this will be a general Groups feature; for now,
     // we're just using it to display journal team entries in About.
     $this->group->setAboutDisplayed(true);
     // Update or insert group group
     if ($this->group->getId() != null) {
         $groupDao->updateObject($this->group);
     } else {
         $this->group->setSequence(REALLY_BIG_NUMBER);
         $groupDao->insertGroup($this->group);
         // Re-order the groups so the new one is at the end of the list.
         $groupDao->resequenceGroups($this->group->getAssocType(), $this->group->getAssocId());
     }
 }
 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 saveSettings()
 {
     RTAdminHandler::validate();
     // Bring in the comments constants.
     $commentDao =& DAORegistry::getDao('CommentDAO');
     $journal = Request::getJournal();
     if ($journal) {
         $rtDao =& DAORegistry::getDAO('RTDAO');
         $rt = $rtDao->getJournalRTByJournal($journal);
         if (Request::getUserVar('version') == '') {
             $rt->setVersion(null);
         } else {
             $rt->setVersion(Request::getUserVar('version'));
         }
         $rt->setEnabled(Request::getUserVar('enabled') == true);
         $rt->setAbstract(Request::getUserVar('abstract') == true);
         $rt->setCaptureCite(Request::getUserVar('captureCite') == true);
         $rt->setViewMetadata(Request::getUserVar('viewMetadata') == true);
         $rt->setSupplementaryFiles(Request::getUserVar('supplementaryFiles') == true);
         $rt->setPrinterFriendly(Request::getUserVar('printerFriendly') == true);
         $rt->setAuthorBio(Request::getUserVar('authorBio') == true);
         $rt->setDefineTerms(Request::getUserVar('defineTerms') == true);
         $rt->setEmailAuthor(Request::getUserVar('emailAuthor') == true);
         $rt->setEmailOthers(Request::getUserVar('emailOthers') == true);
         $rt->setFindingReferences(Request::getUserVar('findingReferences') == true);
         $journal->updateSetting('enableComments', Request::getUserVar('enableComments') ? Request::getUserVar('enableCommentsMode') : COMMENTS_DISABLED);
         $rtDao->updateJournalRT($rt);
     }
     Request::redirect(null, Request::getRequestedPage());
 }
 /**
  * Save email template.
  */
 function execute()
 {
     $journal =& Request::getJournal();
     $emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
     $emailTemplate =& $emailTemplateDao->getLocaleEmailTemplate($this->emailKey, $journal->getJournalId());
     if (!$emailTemplate) {
         $emailTemplate =& new LocaleEmailTemplate();
         $emailTemplate->setCustomTemplate(true);
         $emailTemplate->setCanDisable(false);
         $emailTemplate->setEnabled(true);
         $emailTemplate->setEmailKey($this->getData('emailKey'));
     } else {
         $emailTemplate->setEmailId($this->getData('emailId'));
         if ($emailTemplate->getCanDisable()) {
             $emailTemplate->setEnabled($this->getData('enabled'));
         }
     }
     $emailTemplate->setJournalId($journal->getJournalId());
     $supportedLocales = $journal->getSupportedLocaleNames();
     if (!empty($supportedLocales)) {
         foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeName) {
             $emailTemplate->setSubject($localeKey, $this->_data['subject'][$localeKey]);
             $emailTemplate->setBody($localeKey, $this->_data['body'][$localeKey]);
         }
     } else {
         $localeKey = Locale::getLocale();
         $emailTemplate->setSubject($localeKey, $this->_data['subject'][$localeKey]);
         $emailTemplate->setBody($localeKey, $this->_data['body'][$localeKey]);
     }
     if ($emailTemplate->getEmailId() != null) {
         $emailTemplateDao->updateLocaleEmailTemplate($emailTemplate);
     } else {
         $emailTemplateDao->insertLocaleEmailTemplate($emailTemplate);
     }
 }
Example #26
0
 function manage($verb, $args, &$message)
 {
     if (!parent::manage($verb, $args, $message)) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->register_function('plugin_url', array(&$this, 'smartyPluginUrl'));
             $journal =& Request::getJournal();
             $this->import('ReferralPluginSettingsForm');
             $form = new ReferralPluginSettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, 'manager', 'plugin');
                     return false;
                 } else {
                     $this->setBreadCrumbs(true);
                     $form->display();
                 }
             } else {
                 $this->setBreadCrumbs(true);
                 $form->initData();
                 $form->display();
             }
             return true;
         default:
             // Unknown management verb
             assert(false);
     }
 }
 /**
  * Constructor
  * @param subscriptionId int leave as default for new subscription
  */
 function IndividualSubscriptionForm($subscriptionId = null, $userId = null)
 {
     parent::Form('subscription/individualSubscriptionForm.tpl');
     parent::SubscriptionForm($subscriptionId, $userId);
     $subscriptionId = isset($subscriptionId) ? (int) $subscriptionId : null;
     $userId = isset($userId) ? (int) $userId : null;
     $journal = Request::getJournal();
     $journalId = $journal->getId();
     if (isset($subscriptionId)) {
         $subscriptionDao = DAORegistry::getDAO('IndividualSubscriptionDAO');
         if ($subscriptionDao->subscriptionExists($subscriptionId)) {
             $this->subscription =& $subscriptionDao->getSubscription($subscriptionId);
         }
     }
     $subscriptionTypeDao = DAORegistry::getDAO('SubscriptionTypeDAO');
     $subscriptionTypes =& $subscriptionTypeDao->getSubscriptionTypesByInstitutional($journalId, false);
     $this->subscriptionTypes =& $subscriptionTypes->toArray();
     $subscriptionTypeCount = count($this->subscriptionTypes);
     if ($subscriptionTypeCount == 0) {
         $this->addError('typeId', __('manager.subscriptions.form.typeRequired'));
         $this->addErrorField('typeId');
     }
     // Ensure subscription type is valid
     $this->addCheck(new FormValidatorCustom($this, 'typeId', 'required', 'manager.subscriptions.form.typeIdValid', create_function('$typeId, $journalId', '$subscriptionTypeDao = DAORegistry::getDAO(\'SubscriptionTypeDAO\'); return ($subscriptionTypeDao->subscriptionTypeExistsByTypeId($typeId, $journalId) && $subscriptionTypeDao->getSubscriptionTypeInstitutional($typeId) == 0);'), array($journal->getId())));
     // Ensure that user does not already have a subscription for this journal
     if (!isset($subscriptionId)) {
         $this->addCheck(new FormValidatorCustom($this, 'userId', 'required', 'manager.subscriptions.form.subscriptionExists', array(DAORegistry::getDAO('IndividualSubscriptionDAO'), 'subscriptionExistsByUserForJournal'), array($journalId), true));
     } else {
         $this->addCheck(new FormValidatorCustom($this, 'userId', 'required', 'manager.subscriptions.form.subscriptionExists', create_function('$userId, $journalId, $subscriptionId', '$subscriptionDao = DAORegistry::getDAO(\'IndividualSubscriptionDAO\'); $checkId = $subscriptionDao->getSubscriptionIdByUser($userId, $journalId); return ($checkId == 0 || $checkId == $subscriptionId) ? true : false;'), array($journalId, $subscriptionId)));
     }
 }
 /**
  * Email the comment.
  */
 function email()
 {
     $article = $this->article;
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $journal =& Request::getJournal();
     // Create list of recipients:
     $recipients = array();
     // Copyedit comments are to be sent to the editor, author, and copyeditor,
     // excluding whomever posted the comment.
     $editorAddresses = array();
     $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
     $sectionEditors =& $sectionEditorsDao->getEditorsBySectionId($journal->getId(), $article->getSectionId());
     foreach ($sectionEditors as $sectionEditor) {
         $editorAddresses[$sectionEditor->getEmail()] = $sectionEditor->getFullName();
     }
     // If no editors are currently assigned, send this message to
     // all of the journal's editors.
     if (empty($editorAddresses)) {
         $editors =& $roleDao->getUsersByRoleId(ROLE_ID_EDITOR, $journal->getId());
         while (!$editors->eof()) {
             $editor =& $editors->next();
             $editorAddresses[$editor->getEmail()] = $editor->getFullName();
         }
     }
     // Get copyeditor
     $copySignoff = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $article->getId());
     if ($copySignoff != null && $copySignoff->getUserId() > 0) {
         $copyeditor =& $userDao->getUser($copySignoff->getUserId());
     } else {
         $copyeditor = null;
     }
     // Get author
     $author =& $userDao->getUser($article->getUserId());
     // Choose who receives this email
     if ($this->roleId == ROLE_ID_EDITOR || $this->roleId == ROLE_ID_SECTION_EDITOR) {
         // Then add copyeditor and author
         if ($copyeditor != null) {
             $recipients = array_merge($recipients, array($copyeditor->getEmail() => $copyeditor->getFullName()));
         }
         $recipients = array_merge($recipients, array($author->getEmail() => $author->getFullName()));
     } else {
         if ($this->roleId == ROLE_ID_COPYEDITOR) {
             // Then add editors and author
             $recipients = array_merge($recipients, $editorAddresses);
             if (isset($author)) {
                 $recipients = array_merge($recipients, array($author->getEmail() => $author->getFullName()));
             }
         } else {
             // Then add editors and copyeditor
             $recipients = array_merge($recipients, $editorAddresses);
             if ($copyeditor != null) {
                 $recipients = array_merge($recipients, array($copyeditor->getEmail() => $copyeditor->getFullName()));
             }
         }
     }
     parent::email($recipients);
 }
 /**
  * Copyeditor completes final copyedit.
  * @param $copyeditorSubmission object
  */
 function completeFinalCopyedit($copyeditorSubmission, $send = false)
 {
     $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $journal =& Request::getJournal();
     $finalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getArticleId());
     if ($finalSignoff->getDateCompleted() != null) {
         return true;
     }
     $user =& Request::getUser();
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($copyeditorSubmission, 'COPYEDIT_FINAL_COMPLETE');
     $editAssignments = $copyeditorSubmission->getEditAssignments();
     if (!$email->isEnabled() || $send && !$email->hasErrors()) {
         HookRegistry::call('CopyeditorAction::completeFinalCopyedit', array(&$copyeditorSubmission, &$editAssignments, &$email));
         if ($email->isEnabled()) {
             $email->setAssoc(ARTICLE_EMAIL_COPYEDIT_NOTIFY_FINAL_COMPLETE, ARTICLE_EMAIL_TYPE_COPYEDIT, $copyeditorSubmission->getArticleId());
             $email->send();
         }
         $finalSignoff->setDateCompleted(Core::getCurrentDate());
         $signoffDao->updateObject($finalSignoff);
         if ($copyEdFile = $copyeditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_FINAL')) {
             // Set initial layout version to final copyedit version
             $layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getArticleId());
             if (!$layoutSignoff->getFileId()) {
                 import('classes.file.ArticleFileManager');
                 $articleFileManager = new ArticleFileManager($copyeditorSubmission->getArticleId());
                 if ($layoutFileId = $articleFileManager->copyToLayoutFile($copyEdFile->getFileId(), $copyEdFile->getRevision())) {
                     $layoutSignoff->setFileId($layoutFileId);
                     $signoffDao->updateObject($layoutSignoff);
                 }
             }
         }
         // Add log entry
         import('classes.article.log.ArticleLog');
         import('classes.article.log.ArticleEventLogEntry');
         ArticleLog::logEvent($copyeditorSubmission->getArticleId(), ARTICLE_LOG_COPYEDIT_FINAL, ARTICLE_LOG_TYPE_COPYEDIT, $user->getId(), 'log.copyedit.finalEditComplete', array('copyeditorName' => $user->getFullName(), 'articleId' => $copyeditorSubmission->getArticleId()));
         return true;
     } else {
         if (!Request::getUserVar('continued')) {
             $assignedSectionEditors = $email->toAssignedEditingSectionEditors($copyeditorSubmission->getArticleId());
             $assignedEditors = $email->ccAssignedEditors($copyeditorSubmission->getArticleId());
             if (empty($assignedSectionEditors) && empty($assignedEditors)) {
                 $email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
                 $paramArray = array('editorialContactName' => $journal->getSetting('contactName'), 'copyeditorName' => $user->getFullName());
             } else {
                 $editorialContact = array_shift($assignedSectionEditors);
                 if (!$editorialContact) {
                     $editorialContact = array_shift($assignedEditors);
                 }
                 $paramArray = array('editorialContactName' => $editorialContact->getEditorFullName(), 'copyeditorName' => $user->getFullName());
             }
             $email->assignParams($paramArray);
         }
         $email->displayEditForm(Request::url(null, 'copyeditor', 'completeFinalCopyedit', 'send'), array('articleId' => $copyeditorSubmission->getArticleId()));
         return false;
     }
 }
Example #30
0
 /**
  * Validate that user has permissions to manage the selected journal.
  * Redirects to user index page if not properly authenticated.
  */
 function validate()
 {
     parent::validate();
     $journal =& Request::getJournal();
     if (!$journal || !Validation::isJournalManager() && !Validation::isSiteAdmin()) {
         Validation::redirectLogin();
     }
 }