/** * Save a supplementary file. * @param $args array optional, if set the first parameter is the supplementary file to update * @param $request PKPRequest */ function saveSubmitSuppFile($args, $request) { $articleId = (int) $request->getUserVar('articleId'); $suppFileId = isset($args[0]) ? (int) $args[0] : 0; $journal =& $request->getJournal(); $this->validate($request, $articleId, 4); $article =& $this->article; $this->setupTemplate($request, true); import('classes.author.form.submit.AuthorSubmitSuppFileForm'); $submitForm = new AuthorSubmitSuppFileForm($article, $journal, $suppFileId); $submitForm->readInputData(); if ($submitForm->validate()) { $submitForm->execute(); $request->redirect(null, null, 'submit', '4', array('articleId' => $articleId)); } else { $submitForm->display(); } }
/** * Save a supplementary file. * @param $args array optional, if set the first parameter is the supplementary file to update */ function saveSubmitSuppFile($args, $request) { $paperId = (int) $request->getUserVar('paperId'); $suppFileId = (int) array_shift($args); $this->validate($request, $paperId, 4); $this->setupTemplate($request, true); $schedConf =& $request->getSchedConf(); $paper =& $this->paper; if (!$schedConf->getSetting('acceptSupplementaryReviewMaterials')) { $request->redirect(null, null, 'index'); } import('classes.author.form.submit.AuthorSubmitSuppFileForm'); $submitForm = new AuthorSubmitSuppFileForm($paper, $suppFileId); $submitForm->readInputData(); import('lib.pkp.classes.file.FileManager'); $fileManager = new FileManager(); if ($fileManager->uploadError('uploadSuppFile') && $suppFileId == 0) { $submitForm->addError('uploadSubmissionFile', Locale::translate('common.uploadFailed')); } if ($submitForm->validate()) { $submitForm->execute(); $request->redirect(null, null, null, 'submit', '4', array('paperId' => $paperId)); } else { $submitForm->display(); } }
/** * Save a supplementary file. * @param $args array optional, if set the first parameter is the supplementary file to update */ function saveSubmitSuppFile($args) { $articleId = Request::getUserVar('articleId'); $suppFileId = isset($args[0]) ? (int) $args[0] : 0; $this->validate($articleId, 4); $article =& $this->article; $this->setupTemplate(true); import("author.form.submit.AuthorSubmitSuppFileForm"); $submitForm = new AuthorSubmitSuppFileForm($article, $suppFileId); $submitForm->readInputData(); if ($submitForm->validate()) { $submitForm->execute(); Request::redirect(null, null, 'submit', '4', array('articleId' => $articleId)); } else { $submitForm->display(); } }
/** * Save a supplementary file. * @param $args array optional, if set the first parameter is the supplementary file to update */ function saveSubmitSuppFile($args, $request) { $articleId = $request->getUserVar('articleId'); // Start Edit Raf Tan 04/30/2011 $type = $request->getUserVar('type'); // End Edit Raf Tan 04/30/2011 $suppFileId = isset($args[0]) ? (int) $args[0] : 0; $journal =& $request->getJournal(); $this->validate($articleId, 4); $article =& $this->article; $this->setupTemplate(true); import('classes.author.form.submit.AuthorSubmitSuppFileForm'); $submitForm = new AuthorSubmitSuppFileForm($article, $journal, $suppFileId); /** * Start Edit Raf Tan 04/30/2011 $submitForm->readInputData(); if ($submitForm->validate()) { $submitForm->execute(); Request::redirect(null, null, 'submit', '4', array('articleId' => $articleId)); } else { $submitForm->display(); } * */ //$submitForm->readInputData(); // $suppFileDao = DAORegistry::getDAO('SuppFileDAO'); // $suppFileCount = count($suppFileDao->getSuppFilesByArticle($articleId)); //$submitForm->setData('title', array($article->getLocale() => ('SuppFile'.$suppFileCount))); $submitForm->setData('title', array($article->getLocale() => $type)); $submitForm->setData('type', $type); $submitForm->execute(); Request::redirect(null, null, 'submit', '4', array('articleId' => $articleId)); // End Edit Raf Tan 04/30/2011 }
/** * Save a supplementary file. * @param $args array optional, if set the first parameter is the supplementary file to update */ function saveSubmitSuppFile($args) { $paperId = (int) Request::getUserVar('paperId'); $suppFileId = isset($args[0]) ? (int) $args[0] : 0; $this->validate($paperId, 4); $this->setupTemplate(true); $schedConf =& Request::getSchedConf(); $paper =& $this->paper; if (!$schedConf->getSetting('acceptSupplementaryReviewMaterials')) { Request::redirect(null, null, 'index'); } import('author.form.submit.AuthorSubmitSuppFileForm'); $submitForm = new AuthorSubmitSuppFileForm($paper, $suppFileId); $submitForm->readInputData(); import('file.FileManager'); $fileManager = new FileManager(); if ($fileManager->uploadError('uploadSuppFile') && $suppFileId == 0) { $submitForm->addError('uploadSubmissionFile', __('common.uploadFailed')); } if ($submitForm->validate()) { $submitForm->execute(); Request::redirect(null, null, null, 'submit', '4', array('paperId' => $paperId)); } else { $submitForm->display(); } }
/** * Save a supplementary file. * @param $args array optional, if set the first parameter is the supplementary file to update */ function saveSubmitSuppFile($args, $request) { $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $articleId = $request->getUserVar('articleId'); $type = $request->getUserVar('type'); $articleSite = $request->getUserVar('articleSite'); $articleDrugForIB = $request->getUserVar('articleDrugForIB'); $articleDrugForSmPC = $request->getUserVar('articleDrugForSmPC'); $articleCRO = $request->getUserVar('articleCRO'); $suppFileId = isset($args[0]) ? (int) $args[0] : 0; $journal =& $request->getJournal(); $this->validate($articleId, 8); $article =& $this->article; $this->setupTemplate(true); import('classes.author.form.submit.AuthorSubmitSuppFileForm'); $submitForm = new AuthorSubmitSuppFileForm($article, $journal, $suppFileId); $typeMap = $suppFileDao->getTypeMap(); $submitForm->setData('title', array($article->getLocale() => $typeMap[$type])); $submitForm->setData('type', $type); $submitForm->setData('articleSite', $articleSite); $submitForm->setData('articleDrugForIB', $articleDrugForIB); $submitForm->setData('articleDrugForSmPC', $articleDrugForSmPC); $submitForm->setData('articleCRO', $articleCRO); $submitForm->execute(); Request::redirect(null, null, 'submit', '8', array('articleId' => $articleId)); }