/** * 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) { $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(); } }