/** * Save a submission step. * @param $args array first parameter is the step being saved * @param $request Request */ function saveSubmit($args, &$request) { $step = isset($args[0]) ? (int) $args[0] : 0; $articleId = (int) $request->getUserVar('articleId'); $journal =& $request->getJournal(); $this->validate($articleId, $step); $this->setupTemplate(true); $article =& $this->article; $formClass = "AuthorSubmitStep{$step}Form"; import("classes.author.form.submit.{$formClass}"); $submitForm = new $formClass($article, $journal); $submitForm->readInputData(); if (!HookRegistry::call('SubmitHandler::saveSubmit', array($step, &$article, &$submitForm))) { // Check for any special cases before trying to save switch ($step) { case 2: if ($request->getUserVar('uploadSubmissionFile')) { $submitForm->uploadSubmissionFile('submissionFile'); $editData = true; } break; case 3: if ($request->getUserVar('addAuthor')) { // Add a sponsor $editData = true; $authors = $submitForm->getData('authors'); array_push($authors, array()); $submitForm->setData('authors', $authors); } else { if (($delAuthor = $request->getUserVar('delAuthor')) && count($delAuthor) == 1) { // Delete an author $editData = true; list($delAuthor) = array_keys($delAuthor); $delAuthor = (int) $delAuthor; $authors = $submitForm->getData('authors'); if (isset($authors[$delAuthor]['authorId']) && !empty($authors[$delAuthor]['authorId'])) { $deletedAuthors = explode(':', $submitForm->getData('deletedAuthors')); array_push($deletedAuthors, $authors[$delAuthor]['authorId']); $submitForm->setData('deletedAuthors', join(':', $deletedAuthors)); } array_splice($authors, $delAuthor, 1); $submitForm->setData('authors', $authors); if ($submitForm->getData('primaryContact') == $delAuthor) { $submitForm->setData('primaryContact', 0); } } else { if ($request->getUserVar('moveAuthor')) { // Move an author up/down $editData = true; $moveAuthorDir = $request->getUserVar('moveAuthorDir'); $moveAuthorDir = $moveAuthorDir == 'u' ? 'u' : 'd'; $moveAuthorIndex = (int) $request->getUserVar('moveAuthorIndex'); $authors = $submitForm->getData('authors'); if (!($moveAuthorDir == 'u' && $moveAuthorIndex <= 0 || $moveAuthorDir == 'd' && $moveAuthorIndex >= count($authors) - 1)) { $tmpAuthor = $authors[$moveAuthorIndex]; $primaryContact = $submitForm->getData('primaryContact'); if ($moveAuthorDir == 'u') { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex - 1]; $authors[$moveAuthorIndex - 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $submitForm->setData('primaryContact', $moveAuthorIndex - 1); } else { if ($primaryContact == $moveAuthorIndex - 1) { $submitForm->setData('primaryContact', $moveAuthorIndex); } } } else { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex + 1]; $authors[$moveAuthorIndex + 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $submitForm->setData('primaryContact', $moveAuthorIndex + 1); } else { if ($primaryContact == $moveAuthorIndex + 1) { $submitForm->setData('primaryContact', $moveAuthorIndex); } } } } $submitForm->setData('authors', $authors); } } } break; case 4: if ($request->getUserVar('submitUploadSuppFile')) { SubmitHandler::submitUploadSuppFile(array(), $request); return; } break; } if (!isset($editData) && $submitForm->validate()) { $articleId = $submitForm->execute($request); HookRegistry::call('Author::SubmitHandler::saveSubmit', array(&$step, &$article, &$submitForm)); if ($step == 5) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $articleDao =& DAORegistry::getDAO('ArticleDAO'); $article =& $articleDao->getArticle($articleId); $roleDao =& DAORegistry::getDAO('RoleDAO'); $notificationUsers = array(); $editors = $roleDao->getUsersByRoleId(ROLE_ID_EDITOR, $journal->getId()); while ($editor =& $editors->next()) { $url = $request->url(null, 'editor', 'submission', $articleId); $notificationManager->createNotification($editor->getId(), 'notification.type.articleSubmitted', $article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_ARTICLE_SUBMITTED); unset($editor); } $journal =& $request->getJournal(); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign_by_ref('journal', $journal); // If this is an editor and there is a // submission file, article can be expedited. if (Validation::isEditor($journal->getId()) && $article->getSubmissionFileId()) { $templateMgr->assign('canExpedite', true); } $templateMgr->assign('articleId', $articleId); $templateMgr->assign('helpTopicId', 'submission.index'); $templateMgr->display('author/submit/complete.tpl'); } else { $request->redirect(null, null, 'submit', $step + 1, array('articleId' => $articleId)); } } else { $submitForm->display(); } } }
/** * Save a submission step. * @param $args array first parameter is the step being saved */ function saveSubmit($args, $request) { $step = (int) array_shift($args); $paperId = (int) $request->getUserVar('paperId'); $this->validate($request, $paperId, $step); $this->setupTemplate($request, true); $paper =& $this->paper; $formClass = "AuthorSubmitStep{$step}Form"; import("classes.author.form.submit.{$formClass}"); $submitForm = new $formClass($paper); $submitForm->readInputData(); if (!HookRegistry::call('SubmitHandler::saveSubmit', array($step, &$paper, &$submitForm))) { // Check for any special cases before trying to save switch ($step) { case 2: if ($request->getUserVar('uploadSubmissionFile')) { if (!$submitForm->uploadSubmissionFile('submissionFile')) { $submitForm->addError('uploadSubmissionFile', Locale::translate('common.uploadFailed')); } $editData = true; } break; case 3: if ($request->getUserVar('addAuthor')) { // Add a sponsor $editData = true; $authors = $submitForm->getData('authors'); array_push($authors, array()); $submitForm->setData('authors', $authors); } else { if (($delAuthor = $request->getUserVar('delAuthor')) && count($delAuthor) == 1) { // Delete an author $editData = true; list($delAuthor) = array_keys($delAuthor); $delAuthor = (int) $delAuthor; $authors = $submitForm->getData('authors'); if (isset($authors[$delAuthor]['authorId']) && !empty($authors[$delAuthor]['authorId'])) { $deletedAuthors = explode(':', $submitForm->getData('deletedAuthors')); array_push($deletedAuthors, $authors[$delAuthor]['authorId']); $submitForm->setData('deletedAuthors', join(':', $deletedAuthors)); } array_splice($authors, $delAuthor, 1); $submitForm->setData('authors', $authors); if ($submitForm->getData('primaryContact') == $delAuthor) { $submitForm->setData('primaryContact', 0); } } else { if ($request->getUserVar('moveAuthor')) { // Move an author up/down $editData = true; $moveAuthorDir = $request->getUserVar('moveAuthorDir'); $moveAuthorDir = $moveAuthorDir == 'u' ? 'u' : 'd'; $moveAuthorIndex = (int) $request->getUserVar('moveAuthorIndex'); $authors = $submitForm->getData('authors'); if (!($moveAuthorDir == 'u' && $moveAuthorIndex <= 0 || $moveAuthorDir == 'd' && $moveAuthorIndex >= count($authors) - 1)) { $tmpAuthor = $authors[$moveAuthorIndex]; $primaryContact = $submitForm->getData('primaryContact'); if ($moveAuthorDir == 'u') { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex - 1]; $authors[$moveAuthorIndex - 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $submitForm->setData('primaryContact', $moveAuthorIndex - 1); } else { if ($primaryContact == $moveAuthorIndex - 1) { $submitForm->setData('primaryContact', $moveAuthorIndex); } } } else { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex + 1]; $authors[$moveAuthorIndex + 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $submitForm->setData('primaryContact', $moveAuthorIndex + 1); } else { if ($primaryContact == $moveAuthorIndex + 1) { $submitForm->setData('primaryContact', $moveAuthorIndex); } } } } $submitForm->setData('authors', $authors); } } } break; case 4: if ($request->getUserVar('submitUploadSuppFile')) { if ($suppFileId = SubmitHandler::submitUploadSuppFile(array(), $request)) { $request->redirect(null, null, null, 'submitSuppFile', $suppFileId, array('paperId' => $paperId)); } else { $submitForm->addError('uploadSubmissionFile', Locale::translate('common.uploadFailed')); } } break; } } if (!isset($editData) && $submitForm->validate()) { $paperId = $submitForm->execute(); $conference =& $request->getConference(); $schedConf =& $request->getSchedConf(); // For the "abstract only" or sequential review models, nothing else needs // to be collected beyond page 2. $reviewMode = $paper ? $paper->getReviewMode() : $schedConf->getSetting('reviewMode'); if ($step == 3 && $reviewMode == REVIEW_MODE_BOTH_SEQUENTIAL && !$schedConf->getSetting('acceptSupplementaryReviewMaterials') || $step == 3 && $reviewMode == REVIEW_MODE_ABSTRACTS_ALONE && !$schedConf->getSetting('acceptSupplementaryReviewMaterials') || $step == 5) { // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $roleDao =& DAORegistry::getDAO('RoleDAO'); $notificationUsers = array(); $conferenceManagers = $roleDao->getUsersByRoleId(ROLE_ID_CONFERENCE_MANAGER); $allUsers = $conferenceManagers->toArray(); $directors = $roleDao->getUsersByRoleId(ROLE_ID_DIRECTOR); array_merge($allUsers, $directors->toArray()); foreach ($allUsers as $user) { $notificationUsers[] = array('id' => $user->getId()); } foreach ($notificationUsers as $userRole) { $url = $request->url(null, null, 'director', 'submission', $paperId); $notificationManager->createNotification($userRole['id'], 'notification.type.paperSubmitted', $paper->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_PAPER_SUBMITTED); } $templateMgr =& TemplateManager::getManager(); $templateMgr->assign_by_ref('conference', $conference); $templateMgr->assign('paperId', $paperId); $templateMgr->assign('helpTopicId', 'submission.index'); $templateMgr->display('author/submit/complete.tpl'); } elseif ($step == 3 && !$schedConf->getSetting('acceptSupplementaryReviewMaterials')) { $request->redirect(null, null, null, 'submit', 5, array('paperId' => $paperId)); } elseif ($step == 1 && ($reviewMode == REVIEW_MODE_ABSTRACTS_ALONE || $reviewMode == REVIEW_MODE_BOTH_SEQUENTIAL)) { $request->redirect(null, null, null, 'submit', 3, array('paperId' => $paperId)); } elseif ($step == 2 && $reviewMode == REVIEW_MODE_BOTH_SEQUENTIAL) { $nextStep = $schedConf->getSetting('acceptSupplementaryReviewMaterials') ? 4 : 5; $request->redirect(null, null, null, 'submit', $nextStep, array('paperId' => $paperId)); } else { $request->redirect(null, null, null, 'submit', $step + 1, array('paperId' => $paperId)); } } else { $submitForm->display(); } }
/** * Save a submission step. * @param $args array first parameter is the step being saved * @param $request Request */ function saveSubmit($args, &$request) { $step = isset($args[0]) ? (int) $args[0] : 0; $articleId = $request->getUserVar('articleId'); $journal =& $request->getJournal(); $this->validate($articleId, $step); $this->setupTemplate(true); $article =& $this->article; $formClass = "AuthorSubmitStep{$step}Form"; import("classes.author.form.submit.{$formClass}"); $submitForm = new $formClass($article, $journal); $submitForm->readInputData(); if (!HookRegistry::call('SubmitHandler::saveSubmit', array($step, &$article, &$submitForm))) { // Check for any special cases before trying to save switch ($step) { case 3: if ($request->getUserVar('uploadSubmissionFile')) { $submitForm->uploadSubmissionFile('submissionFile'); $editData = true; } break; case 2: if ($request->getUserVar('addAuthor')) { // Add a sponsor $editData = true; $authors = $submitForm->getData('authors'); array_push($authors, array()); $submitForm->setData('authors', $authors); } else { if (($delAuthor = $request->getUserVar('delAuthor')) && count($delAuthor) == 1) { // Delete an author $editData = true; list($delAuthor) = array_keys($delAuthor); $delAuthor = (int) $delAuthor; $authors = $submitForm->getData('authors'); if (isset($authors[$delAuthor]['authorId']) && !empty($authors[$delAuthor]['authorId'])) { $deletedAuthors = explode(':', $submitForm->getData('deletedAuthors')); array_push($deletedAuthors, $authors[$delAuthor]['authorId']); $submitForm->setData('deletedAuthors', join(':', $deletedAuthors)); } array_splice($authors, $delAuthor, 1); $submitForm->setData('authors', $authors); if ($submitForm->getData('primaryContact') == $delAuthor) { $submitForm->setData('primaryContact', 0); } } else { if ($request->getUserVar('moveAuthor')) { // Move an author up/down $editData = true; $moveAuthorDir = $request->getUserVar('moveAuthorDir'); $moveAuthorDir = $moveAuthorDir == 'u' ? 'u' : 'd'; $moveAuthorIndex = (int) $request->getUserVar('moveAuthorIndex'); $authors = $submitForm->getData('authors'); if (!($moveAuthorDir == 'u' && $moveAuthorIndex <= 0 || $moveAuthorDir == 'd' && $moveAuthorIndex >= count($authors) - 1)) { $tmpAuthor = $authors[$moveAuthorIndex]; $primaryContact = $submitForm->getData('primaryContact'); if ($moveAuthorDir == 'u') { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex - 1]; $authors[$moveAuthorIndex - 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $submitForm->setData('primaryContact', $moveAuthorIndex - 1); } else { if ($primaryContact == $moveAuthorIndex - 1) { $submitForm->setData('primaryContact', $moveAuthorIndex); } } } else { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex + 1]; $authors[$moveAuthorIndex + 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $submitForm->setData('primaryContact', $moveAuthorIndex + 1); } else { if ($primaryContact == $moveAuthorIndex + 1) { $submitForm->setData('primaryContact', $moveAuthorIndex); } } } } $submitForm->setData('authors', $authors); } } } break; case 4: if ($request->getUserVar('submitUploadSuppFile')) { //AIM, 12.12.2011 if ($request->getUserVar('fileType')) { SubmitHandler::submitUploadSuppFile(array(), $request); } else { Request::redirect(null, null, 'submit', '4', array('articleId' => $articleId)); } } break; } if (!isset($editData) && $submitForm->validate()) { $articleId = $submitForm->execute($request); HookRegistry::call('Author::SubmitHandler::saveSubmit', array(&$step, &$article, &$submitForm)); if ($step == 5) { // Rename uploaded files $this->renameSubmittedFiles(); /*Added by MSB, Sept29, 2011*/ $journal =& $request->getJournal(); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign_by_ref('journal', $journal); // If this is an editor and there is a // submission file, article can be expedited. if (Validation::isEditor($journal->getId()) && $article->getSubmissionFileId()) { $templateMgr->assign('canExpedite', true); } $templateMgr->assign('articleId', $articleId); $templateMgr->assign('helpTopicId', 'submission.index'); $templateMgr->assign_by_ref('article', $this->article); $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO'); $articleFiles =& $articleFileDao->getArticleFilesByArticle($articleId); $templateMgr->assign_by_ref('files', $articleFiles); $templateMgr->assign_by_ref('abstractLocales', $journal->getSupportedLocaleNames()); $sectionDao =& DAORegistry::getDAO('SectionDAO'); $section = $sectionDao->getSection($article->getSectionId()); $templateMgr->assign_by_ref('section', $section); $currencyDao =& DAORegistry::getDAO('CurrencyDAO'); $sourceCurrencyId = $journal->getSetting('sourceCurrency'); $templateMgr->assign('sourceCurrency', $currencyDao->getCurrencyByAlphaCode($sourceCurrencyId)); $templateMgr->display('author/submit/complete.tpl'); } else { $request->redirect(null, null, 'submit', $step + 1, array('articleId' => $articleId)); } } else { $submitForm->display(); } } }
/** * Save a submission step. * @param $args array first parameter is the step being saved */ function saveSubmit($args) { parent::validate(); parent::setupTemplate(true); $step = isset($args[0]) ? (int) $args[0] : 0; $articleId = Request::getUserVar('articleId'); list($journal, $article) = SubmitHandler::validate($articleId, $step); // Opatan Inc. : if step is 2 , AuthorSubmitStep2MergedForm is loaded instead of AuthorSubmitStep2Form if ($step == 2) { $formClass = "AuthorSubmitStep2MergedForm"; } else { $formClass = "AuthorSubmitStep{$step}Form"; } import("author.form.submit.{$formClass}"); $submitForm =& new $formClass($article); $submitForm->readInputData(); // Check for any special cases before trying to save switch ($step) { case 2: if (Request::getUserVar('addAuthor')) { // Add a sponsor $editData = true; $authors = $submitForm->getData('authors'); array_push($authors, array()); $submitForm->setData('authors', $authors); } else { if (($delAuthor = Request::getUserVar('delAuthor')) && count($delAuthor) == 1) { // Delete an author $editData = true; list($delAuthor) = array_keys($delAuthor); $delAuthor = (int) $delAuthor; $authors = $submitForm->getData('authors'); if (isset($authors[$delAuthor]['authorId']) && !empty($authors[$delAuthor]['authorId'])) { $deletedAuthors = explode(':', $submitForm->getData('deletedAuthors')); array_push($deletedAuthors, $authors[$delAuthor]['authorId']); $submitForm->setData('deletedAuthors', join(':', $deletedAuthors)); } array_splice($authors, $delAuthor, 1); $submitForm->setData('authors', $authors); if ($submitForm->getData('primaryContact') == $delAuthor) { $submitForm->setData('primaryContact', 0); } } else { if (Request::getUserVar('moveAuthor')) { // Move an author up/down $editData = true; $moveAuthorDir = Request::getUserVar('moveAuthorDir'); $moveAuthorDir = $moveAuthorDir == 'u' ? 'u' : 'd'; $moveAuthorIndex = (int) Request::getUserVar('moveAuthorIndex'); $authors = $submitForm->getData('authors'); if (!($moveAuthorDir == 'u' && $moveAuthorIndex <= 0 || $moveAuthorDir == 'd' && $moveAuthorIndex >= count($authors) - 1)) { $tmpAuthor = $authors[$moveAuthorIndex]; $primaryContact = $submitForm->getData('primaryContact'); if ($moveAuthorDir == 'u') { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex - 1]; $authors[$moveAuthorIndex - 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $submitForm->setData('primaryContact', $moveAuthorIndex - 1); } else { if ($primaryContact == $moveAuthorIndex - 1) { $submitForm->setData('primaryContact', $moveAuthorIndex); } } } else { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex + 1]; $authors[$moveAuthorIndex + 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $submitForm->setData('primaryContact', $moveAuthorIndex + 1); } else { if ($primaryContact == $moveAuthorIndex + 1) { $submitForm->setData('primaryContact', $moveAuthorIndex); } } } } $submitForm->setData('authors', $authors); } else { if (Request::getUserVar('uploadSubmissionFile')) { // Opatan Inc. : Upload submission file section is included in step 2 $editData = true; $submitForm->uploadSubmissionFile('submissionFile'); } else { if (Request::getUserVar('submitUploadSuppFile')) { // Opatan Inc. : Upload supplementary file section is included in step 2 $editData = true; list($journal, $article) = SubmitHandler::validate($articleId, 2); // Opatan Inc. : SubmitHandler::submitUploadSuppFile() is removed and uploadSuppFile // method of the form is replaced $submitForm->uploadSuppFile(); $submitForm->execute(); } } } } } break; case 3: if (Request::getUserVar('uploadSubmissionFile')) { $submitForm->uploadSubmissionFile('submissionFile'); $editData = true; } break; case 4: if (Request::getUserVar('submitUploadSuppFile')) { SubmitHandler::submitUploadSuppFile(); return; } break; // Opatan Inc. // Opatan Inc. case 5: if (Request::getUserVar('replaceSubmissionFile')) { $editData = true; import('file.ArticleFileManager'); $articleFileManager =& new ArticleFileManager($articleId); $articleFileManager->deleteFile(Request::getUserVar('submissionFileId')); $submitForm->replaceSubmissionFile('submissionFile'); } break; } if (!isset($editData) && $submitForm->validate()) { $articleId = $submitForm->execute(); if ($step == 5) { $journal =& Request::getJournal(); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign_by_ref('journal', $journal); // If this is an editor and there is a // submission file, article can be expedited. if (Validation::isEditor($journal->getJournalId()) && $article->getSubmissionFileId()) { $templateMgr->assign('canExpedite', true); } $templateMgr->assign('articleId', $articleId); $templateMgr->assign('helpTopicId', 'submission.index'); $templateMgr->display('author/submit/complete.tpl'); } else { if ($step == 2) { // Opatan Inc. : if step is 2 , it is redirected to step 5 instead of step+1 Request::redirect(null, null, 'submit', $step + 3, array('articleId' => $articleId)); } else { Request::redirect(null, null, 'submit', $step + 1, array('articleId' => $articleId)); } } } else { $submitForm->display(); } }
/** * Save a submission step. * @param $args array first parameter is the step being saved * @param $request Request */ function saveSubmit($args, &$request) { $step = isset($args[0]) ? (int) $args[0] : 0; $articleId = $request->getUserVar('articleId'); $journal =& $request->getJournal(); $this->validate($articleId, $step); $this->setupTemplate(true); $article =& $this->article; $formClass = "AuthorSubmitStep{$step}Form"; import("classes.author.form.submit.{$formClass}"); $submitForm = new $formClass($article, $journal); $submitForm->readInputData(); if (!HookRegistry::call('SubmitHandler::saveSubmit', array($step, &$article, &$submitForm))) { // Check for any special cases before trying to save switch ($step) { case 2: break; case 3: break; case 4: break; case 5: break; case 6: break; case 7: if ($request->getUserVar('uploadSubmissionFile')) { $submitForm->uploadSubmissionFile('submissionFile'); $editData = true; } break; case 8: if ($request->getUserVar('submitUploadSuppFile')) { if ($request->getUserVar('fileType')) { SubmitHandler::submitUploadSuppFile(array(), $request); } else { Request::redirect(null, null, 'submit', '8', array('articleId' => $articleId)); } } break; } if (!isset($editData) && $submitForm->validate()) { $articleId = $submitForm->execute($request); HookRegistry::call('Author::SubmitHandler::saveSubmit', array(&$step, &$article, &$submitForm)); if ($step == 9) { $countryDao =& DAORegistry::getDAO('CountryDAO'); $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO'); $sectionDao =& DAORegistry::getDAO('SectionDAO'); $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $articleDrugInfoDao =& DAORegistry::getDAO('ArticleDrugInfoDAO'); $currencyDao =& DAORegistry::getDAO('CurrencyDAO'); $extraFieldDAO =& DAORegistry::getDAO('ExtraFieldDAO'); $details = $this->article->getArticleDetails(); $articleFiles =& $articleFileDao->getArticleFilesByArticle($articleId); $previousFiles =& $articleFileDao->getPreviousFilesByArticleId($articleId); foreach ($articleFiles as $articleFile) { foreach ($previousFiles as $previousFile) { if ($articleFile->getFileId() == $previousFile->getFileId()) { $articleFile->setType('previous'); } } if ($articleFile->getType() == 'supp') { $suppFile = $suppFileDao->getSuppFileByFileId($articleFile->getFileId()); $articleFile->setType(Locale::translate($suppFile->getTypeKey())); } } $showAdvertisements = false; $advertisements = array(); if ($details->getAdvertisingScheme() == ARTICLE_DETAIL_YES) { $showAdvertisements = true; $advertisements = $suppFileDao->getSuppFilesByArticleAndType($this->articleId, SUPP_FILE_ADVERTISEMENT); } $section = $sectionDao->getSection($article->getSectionId()); $sourceCurrencyId = $journal->getSetting('sourceCurrency'); // Rename uploaded files $this->renameSubmittedFiles(); $journal =& $request->getJournal(); $templateMgr =& TemplateManager::getManager(); // If this is an editor and there is a // submission file, article can be expedited. if (Validation::isEditor($journal->getId()) && $article->getSubmissionFileId()) { $templateMgr->assign('canExpedite', true); } $templateMgr->assign_by_ref('section', $section); $templateMgr->assign_by_ref('files', $articleFiles); $templateMgr->assign_by_ref('journal', $journal); $templateMgr->assign('articleId', $articleId); $templateMgr->assign('helpTopicId', 'submission.index'); $templateMgr->assign_by_ref('article', $this->article); $templateMgr->assign('sourceCurrency', $currencyDao->getCurrencyByAlphaCode($sourceCurrencyId)); $templateMgr->assign_by_ref('articleDetails', $details); $templateMgr->assign_by_ref('articleTexts', $this->article->getArticleTexts()); $templateMgr->assign_by_ref('articleSecIds', $this->article->getArticleSecIds()); $templateMgr->assign_by_ref('articlePurposes', $this->article->getArticlePurposes()); $templateMgr->assign('articleTextLocales', $journal->getSupportedLocaleNames()); $templateMgr->assign_by_ref('articlePrimaryOutcomes', $this->article->getArticleOutcomesByType(ARTICLE_OUTCOME_PRIMARY)); $templateMgr->assign_by_ref('articleSecondaryOutcomes', $this->article->getArticleOutcomesByType(ARTICLE_OUTCOME_SECONDARY)); $templateMgr->assign('coveringArea', $journal->getLocalizedSetting('location')); $templateMgr->assign('coutryList', $countryDao->getCountries()); $templateMgr->assign('showAdvertisements', $showAdvertisements); $templateMgr->assign_by_ref('advertisements', $advertisements); $templateMgr->assign_by_ref('articleDrugs', $this->article->getArticleDrugs()); $templateMgr->assign('pharmaClasses', $articleDrugInfoDao->getPharmaClasses()); $templateMgr->assign('drugStudyClasses', $articleDrugInfoDao->getClassMap()); $templateMgr->assign_by_ref('articleSites', $this->article->getArticleSites()); $templateMgr->assign('expertisesList', $extraFieldDAO->getExtraFieldsList(EXTRA_FIELD_THERAPEUTIC_AREA, EXTRA_FIELD_ACTIVE)); $templateMgr->assign_by_ref('fundingSources', $this->article->getArticleFundingSources()); $templateMgr->assign_by_ref('pSponsor', $this->article->getArticlePrimarySponsor()); $templateMgr->assign_by_ref('sSponsors', $this->article->getArticleSecondarySponsors()); $templateMgr->assign_by_ref('CROs', $this->article->getArticleCROs()); $templateMgr->assign_by_ref('contact', $this->article->getArticleContact()); $templateMgr->display('author/submit/complete.tpl'); } else { $request->redirect(null, null, 'submit', $step + 1, array('articleId' => $articleId)); } } else { $submitForm->display(); } } }