/** * Display the form. */ function display() { $journal =& Request::getJournal(); $user =& Request::getUser(); $templateMgr =& TemplateManager::getManager(); // Get sections for this journal $sectionDao =& DAORegistry::getDAO('SectionDAO'); // If this user is a section editor or an editor, they are allowed // to submit to sections flagged as "editor-only" for submissions. // Otherwise, display only sections they are allowed to submit to. $roleDao =& DAORegistry::getDAO('RoleDAO'); $isEditor = $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_EDITOR) || $roleDao->roleExists($journal->getId(), $user->getId(), ROLE_ID_SECTION_EDITOR); // Set up required Payment Related Information import('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)); } if ($paymentManager->fastTrackEnabled()) { $templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDAO->getFastTrackCompletedPayment($journal->getId(), $articleId)); } } $templateMgr->assign('sectionOptions', array('0' => Locale::translate('author.submit.selectSection')) + $sectionDao->getSectionTitles($journal->getId(), !$isEditor)); parent::display(); }
/** * Display the form. */ function display() { $conference =& Request::getConference(); $schedConf =& Request::getSchedConf(); $user =& Request::getUser(); $templateMgr =& TemplateManager::getManager(); // Get tracks for this conference $trackDao = DAORegistry::getDAO('TrackDAO'); // If this user is a track director or a director, they are // allowed to submit to tracks flagged as "director-only" for // submissions. Otherwise, display only tracks they are allowed // to submit to. $roleDao = DAORegistry::getDAO('RoleDAO'); $isDirector = $roleDao->userHasRole($conference->getId(), $schedConf->getId(), $user->getId(), ROLE_ID_DIRECTOR) || $roleDao->userHasRole($conference->getId(), $schedConf->getId(), $user->getId(), ROLE_ID_TRACK_DIRECTOR) || $roleDao->userHasRole($conference->getId(), 0, $user->getId(), ROLE_ID_DIRECTOR) || $roleDao->userHasRole($conference->getId(), 0, $user->getId(), ROLE_ID_TRACK_DIRECTOR); $templateMgr->assign('trackOptions', array('0' => __('author.submit.selectTrack')) + $trackDao->getTrackTitles($schedConf->getId(), !$isDirector)); $paperTypeDao = DAORegistry::getDAO('PaperTypeDAO'); $sessionTypes = $paperTypeDao->getPaperTypes($schedConf->getId()); $templateMgr->assign('sessionTypes', $sessionTypes->toArray()); // Provide available submission languages. (Convert the array // of locale symbolic names xx_XX into an associative array // of symbolic names => readable names.) $supportedSubmissionLocales = $conference->getSetting('supportedSubmissionLocales'); if (empty($supportedSubmissionLocales)) { $supportedSubmissionLocales = array($conference->getPrimaryLocale()); } $templateMgr->assign('supportedSubmissionLocaleNames', array_flip(array_intersect(array_flip(AppLocale::getAllLocales()), $supportedSubmissionLocales))); parent::display(); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); // Get supplementary files for this article $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $templateMgr->assign_by_ref('suppFiles', $suppFileDao->getSuppFilesByArticle($this->articleId)); parent::display(); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); $countryDao =& DAORegistry::getDAO('CountryDAO'); $countries =& $countryDao->getCountries(); $templateMgr->assign_by_ref('countries', $countries); parent::display(); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); // Get supplementary files for this paper $paperFileDao = DAORegistry::getDAO('PaperFileDAO'); if ($this->paper->getSubmissionFileId() != null) { $templateMgr->assign_by_ref('submissionFile', $paperFileDao->getPaperFile($this->paper->getSubmissionFileId())); } parent::display(); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); // Get supplementary files for this article $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO'); if ($this->article->getSubmissionFileId() != null) { $templateMgr->assign_by_ref('submissionFile', $articleFileDao->getArticleFile($this->article->getSubmissionFileId())); } parent::display(); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); $typeOptions = array("author.submit.suppFile.summary" => "author.submit.suppFile.summary", "author.submit.suppFile.grantRequest" => "author.submit.suppFile.grantRequest", "author.submit.suppFile.informedConsent" => "author.submit.suppFile.informedConsent", "author.submit.suppFile.minutes" => "author.submit.suppFile.minutes", "author.submit.suppFile.proofOfPayment" => "author.submit.suppFile.proofOfPayment", "author.submit.suppFile.funding" => "author.submit.suppFile.funding", "author.submit.suppFile.cv" => "author.submit.suppFile.cv", "author.submit.suppFile.questionnaire" => "author.submit.suppFile.questionnaire", "author.submit.suppFile.proofOfRegistration" => "author.submit.suppFile.proofOfRegistration", "author.submit.suppFile.otherErcDecision" => "author.submit.suppFile.otherErcDecision", "author.submit.suppFile.amendment" => "author.submit.suppFile.amendment", "common.other" => "common.other"); $templateMgr->assign('typeOptions', $typeOptions); // Get supplementary files for this article $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $templateMgr->assign_by_ref('suppFiles', $suppFileDao->getSuppFilesByArticle($this->articleId)); parent::display(); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); // Get paper file for this paper $paperFileDao =& DAORegistry::getDAO('PaperFileDAO'); $paperFiles =& $paperFileDao->getPaperFilesByPaper($this->paperId); $templateMgr->assign_by_ref('files', $paperFiles); $templateMgr->assign_by_ref('conference', Request::getConference()); parent::display(); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); // Get supplementary files for this article $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $templateMgr->assign_by_ref('suppFiles', $suppFileDao->getSuppFilesByArticle($this->articleId)); //%CBP% get required sections $CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO'); $article = $this->article->_data; $templateMgr->assign_by_ref('requiredSections', $CBPPlatformDao->getRequiredSections($article['journalId'], "author")); parent::display(); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); // Get supplementary files for this article $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO'); if ($this->article->getSubmissionFileId() != null) { $templateMgr->assign_by_ref('submissionFile', $articleFileDao->getArticleFile($this->article->getSubmissionFileId())); } //Get comments, if any, for this article //Updated by: AIM //Last updated: June 21, 2011 $articleCommentsDao =& DAORegistry::getDAO('ArticleCommentDAO'); $articleComments = $articleCommentsDao->getArticleComments($this->articleId); if (!empty($articleComments)) { $templateMgr->assign_by_ref('articleComments', $articleComments); } parent::display(); }
/** * Display the form. */ function display() { $conference =& Request::getConference(); $schedConf =& Request::getSchedConf(); $user =& Request::getUser(); $templateMgr =& TemplateManager::getManager(); // Get tracks for this conference $trackDao =& DAORegistry::getDAO('TrackDAO'); // If this user is a track director or a director, they are // allowed to submit to tracks flagged as "director-only" for // submissions. Otherwise, display only tracks they are allowed // to submit to. $roleDao =& DAORegistry::getDAO('RoleDAO'); $isDirector = $roleDao->roleExists($conference->getId(), $schedConf->getId(), $user->getId(), ROLE_ID_DIRECTOR) || $roleDao->roleExists($conference->getId(), $schedConf->getId(), $user->getId(), ROLE_ID_TRACK_DIRECTOR) || $roleDao->roleExists($conference->getId(), 0, $user->getId(), ROLE_ID_DIRECTOR) || $roleDao->roleExists($conference->getId(), 0, $user->getId(), ROLE_ID_TRACK_DIRECTOR); $templateMgr->assign('trackOptions', array('0' => Locale::translate('author.submit.selectTrack')) + $trackDao->getTrackTitles($schedConf->getId(), !$isDirector)); $paperTypeDao =& DAORegistry::getDAO('PaperTypeDAO'); $sessionTypes = $paperTypeDao->getPaperTypes($schedConf->getId()); $templateMgr->assign('sessionTypes', $sessionTypes->toArray()); parent::display(); }
/** * Display the form. */ function display() { $journal =& $this->request->getJournal(); $user =& $this->request->getUser(); $templateMgr =& TemplateManager::getManager(); // Get sections for this journal $sectionDao =& DAORegistry::getDAO('SectionDAO'); // If this user is a section editor or an editor, they are // allowed to submit to sections flagged as "editor-only" for // submissions. Otherwise, display only sections they are // allowed to submit to. $roleDao =& DAORegistry::getDAO('RoleDAO'); $isEditor = $roleDao->userHasRole($journal->getId(), $user->getId(), ROLE_ID_EDITOR) || $roleDao->userHasRole($journal->getId(), $user->getId(), ROLE_ID_SECTION_EDITOR); $templateMgr->assign('sectionOptions', array('0' => __('author.submit.selectSection')) + $sectionDao->getSectionTitles($journal->getId(), !$isEditor)); // Set up required Payment Related Information import('classes.payment.ojs.OJSPaymentManager'); $paymentManager = new OJSPaymentManager($this->request); 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)); } if ($paymentManager->fastTrackEnabled()) { $templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDao->getFastTrackCompletedPayment($journal->getId(), $articleId)); } } // Provide available submission languages. (Convert the array // of locale symbolic names xx_XX into an associative array // of symbolic names => readable names.) $supportedSubmissionLocales = $journal->getSetting('supportedSubmissionLocales'); if (empty($supportedSubmissionLocales)) { $supportedSubmissionLocales = array($journal->getPrimaryLocale()); } $templateMgr->assign('supportedSubmissionLocaleNames', array_flip(array_intersect(array_flip(AppLocale::getAllLocales()), $supportedSubmissionLocales))); parent::display(); }
/** * Save changes to article. * @param $request Request * @return int the article ID */ function execute() { $articleDao =& DAORegistry::getDAO('ArticleDAO'); $authorDao =& DAORegistry::getDAO('AuthorDAO'); $article =& $this->article; // Retrieve the previous citation list for comparison. $previousRawCitationList = $article->getCitations(); // Update article $article->setTitle($this->getData('title'), null); // Localized $article->setAbstract($this->getData('abstract'), null); // Localized $article->setDiscipline($this->getData('discipline'), null); // Localized $article->setSubjectClass($this->getData('subjectClass'), null); // Localized $article->setSubject($this->getData('subject'), null); // Localized $article->setCoverageGeo($this->getData('coverageGeo'), null); // Localized $article->setCoverageChron($this->getData('coverageChron'), null); // Localized $article->setCoverageSample($this->getData('coverageSample'), null); // Localized $article->setType($this->getData('type'), null); // Localized $article->setLanguage($this->getData('language')); $article->setSponsor($this->getData('sponsor'), null); // Localized $article->setCitations($this->getData('citations')); if ($article->getSubmissionProgress() <= $this->step) { $article->stampStatusModified(); $article->setSubmissionProgress($this->step + 1); } // Update authors $authors = $this->getData('authors'); for ($i = 0, $count = count($authors); $i < $count; $i++) { if ($authors[$i]['authorId'] > 0) { // Update an existing author $author =& $authorDao->getAuthor($authors[$i]['authorId'], $article->getId()); $isExistingAuthor = true; } else { // Create a new author $author = new Author(); $isExistingAuthor = false; } if ($author != null) { $author->setSubmissionId($article->getId()); $author->setFirstName($authors[$i]['firstName']); $author->setMiddleName($authors[$i]['middleName']); $author->setLastName($authors[$i]['lastName']); $author->setAffiliation($authors[$i]['affiliation'], null); $author->setCountry($authors[$i]['country']); $author->setEmail($authors[$i]['email']); $author->setData('orcid', $authors[$i]['orcid']); $author->setUrl($authors[$i]['url']); if (array_key_exists('competingInterests', $authors[$i])) { $author->setCompetingInterests($authors[$i]['competingInterests'], null); } $author->setBiography($authors[$i]['biography'], null); $author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0); $author->setSequence($authors[$i]['seq']); HookRegistry::call('Author::Form::Submit::AuthorSubmitStep3Form::Execute', array(&$author, &$authors[$i])); if ($isExistingAuthor) { $authorDao->updateAuthor($author); } else { $authorDao->insertAuthor($author); } } unset($author); } // Remove deleted authors $deletedAuthors = preg_split('/:/', $this->getData('deletedAuthors'), -1, PREG_SPLIT_NO_EMPTY); for ($i = 0, $count = count($deletedAuthors); $i < $count; $i++) { $authorDao->deleteAuthorById($deletedAuthors[$i], $article->getId()); } parent::execute(); // Save the article $articleDao->updateArticle($article); // Update references list if it changed. $citationDao =& DAORegistry::getDAO('CitationDAO'); $rawCitationList = $article->getCitations(); if ($previousRawCitationList != $rawCitationList) { $citationDao->importCitations($this->request, ASSOC_TYPE_ARTICLE, $article->getId(), $rawCitationList); } return $this->articleId; }
/** * Save changes to article. * @param $request Request * @return int the article ID */ function execute(&$request) { $articleDao =& DAORegistry::getDAO('ArticleDAO'); $article =& $this->article; $articleContact = new ArticleContact(); $articleContact->setArticleId($article->getId()); $articleContact->setPQName($this->getData('pqName')); $articleContact->setPQAffiliation($this->getData('pqAffiliation')); $articleContact->setPQAddress($this->getData('pqAddress')); $articleContact->setPQCountry($this->getData('pqCountry')); $articleContact->setPQPhone($this->getData('pqPhone')); $articleContact->setPQFax($this->getData('pqFax')); $articleContact->setPQEmail($this->getData('pqEmail')); $articleContact->setSQName($this->getData('sqName')); $articleContact->setSQAffiliation($this->getData('sqAffiliation')); $articleContact->setSQAddress($this->getData('sqAddress')); $articleContact->setSQCountry($this->getData('sqCountry')); $articleContact->setSQPhone($this->getData('sqPhone')); $articleContact->setSQFax($this->getData('sqFax')); $articleContact->setSQEmail($this->getData('sqEmail')); $article->setArticleContact($articleContact); //update step if ($article->getSubmissionProgress() <= $this->step) { $article->stampStatusModified(); $article->setSubmissionProgress($this->step + 1); } elseif ($article->getSubmissionProgress() == 9) { $article->setSubmissionProgress(8); } parent::execute(); // Save the article $articleDao->updateArticle($article); return $this->articleId; }
/** * Save changes to article. * @param $request Request * @return int the article ID */ function execute(&$request) { $articleDao =& DAORegistry::getDAO('ArticleDAO'); $article =& $this->article; $articleSitesData = $this->getData('articleSites'); $articleSites = $article->getArticleSites(); import('classes.journal.TrialSite'); import('classes.article.ArticleSite'); // Remove deleted article sites foreach ($articleSites as $articleSite) { $isPresent = false; foreach ($articleSitesData as $articleSiteData) { if (!empty($articleSiteData['id'])) { if ($articleSite->getId() == $articleSiteData['id']) { $isPresent = true; } } } if (!$isPresent) { $article->removeArticleSite($articleSite->getId()); } unset($isPresent); unset($articleSite); } // Update / Insters article sites foreach ($articleSitesData as $articleSiteData) { if (isset($articleSiteData['id'])) { $articleSite = $article->getArticleSite($articleSiteData['id']); $isExistingSite = true; } else { $articleSite = new ArticleSite(); $isExistingSite = false; } $articleSite->setArticleId($article->getId()); if ($articleSiteData['siteSelect'] == "OTHER") { $trialSite = new TrialSite(); $trialSite->setName($articleSiteData['siteName']); $trialSite->setAddress($articleSiteData['siteAddress']); $trialSite->setCity($articleSiteData['siteCity']); $trialSite->setRegion($articleSiteData['siteRegion']); $trialSite->setLicensure($articleSiteData['siteLicensure']); $trialSite->setAccreditation($articleSiteData['siteAccreditation']); $articleSite->setSiteId($this->trialSiteDao->insertTrialSite($trialSite)); } else { $articleSite->setSiteId($articleSiteData['siteSelect']); } $articleSite->setAuthority($articleSiteData['authority']); $articleSite->setERCId($articleSiteData['erc']); $articleSite->setPrimaryPhone($articleSiteData['primaryPhone']); $articleSite->setSecondaryPhone($articleSiteData['secondaryPhone']); $articleSite->setFax($articleSiteData['fax']); $articleSite->setEmail($articleSiteData['email']); $articleSite->setSubjectsNumber($articleSiteData['subjectsNumber']); $investigatorsData = $articleSiteData['investigators']; $investigators = $articleSite->getInvestigators(); // Remove deleted investigators foreach ($investigators as $investigator) { $isPresent = false; foreach ($investigatorsData as $investigatorData) { if (!empty($investigatorData['id'])) { if ($investigator->getId() == $investigatorData['id']) { $isPresent = true; } } } if (!$isPresent) { $articleSite->removeInvestigator($investigator->getId()); } unset($isPresent); unset($investigator); } // Update / Insert Investigators $investigatorIterator = 1; foreach ($investigatorsData as $investigatorData) { if (isset($investigatorData['id'])) { $investigator = $articleSite->getInvestigator($investigatorData['id']); } else { $investigator = new Author(); } if ($isExistingSite) { $investigator->setSiteId($articleSite->getId()); } if ($investigatorIterator == 1) { $investigator->setPrimaryContact(1); } $investigator->setSequence($investigatorIterator); $investigator->setFirstName($investigatorData['firstName']); $investigator->setLastName($investigatorData['lastName']); $investigator->setExpertise($investigatorData['expertise']); $investigator->setPrimaryPhoneNumber($investigatorData['iPrimaryPhone']); $investigator->setSecondaryPhoneNumber($investigatorData['iSecondaryPhone']); $investigator->setFaxNumber($investigatorData['iFax']); $investigator->setEmail($investigatorData['iEmail']); $articleSite->addInvestigator($investigator); $investigatorIterator++; } $article->addArticleSite($articleSite); } //update step if ($article->getSubmissionProgress() <= $this->step) { $article->stampStatusModified(); $article->setSubmissionProgress($this->step + 1); } elseif ($article->getSubmissionProgress() == 9) { $article->setSubmissionProgress(8); } parent::execute(); // Save the article $articleDao->updateArticle($article); return $this->articleId; }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); $countryDao =& DAORegistry::getDAO('CountryDAO'); $countries =& $countryDao->getCountries(); $templateMgr->assign_by_ref('countries', $countries); if (Request::getUserVar('addAuthor') || Request::getUserVar('delAuthor') || Request::getUserVar('moveAuthor')) { $templateMgr->assign('scrollToAuthor', true); } $schedConf =& Request::getSchedConf(); $reviewMode = $this->paper->getReviewMode(); $templateMgr->assign('collectAbstracts', $reviewMode != REVIEW_MODE_PRESENTATIONS_ALONE); parent::display(); }
/** * Display the form. */ function display() { $article =& $this->article; $sites = $article->getArticleSites(); $details = $article->getArticleDetails(); $drugs = $article->getArticleDrugs(); $CROs = $article->getArticleCROs(); $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $trialSiteDao =& DAORegistry::getDAO('TrialSiteDAO'); $goToNextStep = true; $impds = $suppFileDao->getSuppFilesByArticleAndType($this->articleId, SUPP_FILE_IMPD); $approvalLetters = $suppFileDao->getSuppFilesByArticleAndType($this->articleId, SUPP_FILE_APPROVAL); $informedConsents = $suppFileDao->getSuppFilesByArticleAndType($this->articleId, SUPP_FILE_CONSENT); $labelss = $suppFileDao->getSuppFilesByArticleAndType($this->articleId, SUPP_FILE_LABELS); $gmps = $suppFileDao->getSuppFilesByArticleAndType($this->articleId, SUPP_FILE_GMP); $relatedPublications = $suppFileDao->getSuppFilesByArticleAndType($this->articleId, SUPP_FILE_PUBLICATIONS); if (empty($impds) || empty($approvalLetters) || empty($informedConsents) || empty($labelss) || empty($gmps)) { $goToNextStep = false; } $sitesList = array(); $sitesArray = array(); foreach ($sites as $site) { $trialSite = $trialSiteDao->getTrialSiteById($site->getSiteId()); $endorsmentLetters = $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->articleId, SUPP_FILE_ENDORSMENT, $site->getId()); $CVs = $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->articleId, SUPP_FILE_CV, $site->getId()); if (empty($endorsmentLetters) || empty($CVs)) { $goToNextStep = false; } $sitesList[$site->getId()] = $trialSite->getName(); $siteArray = array('name' => $trialSite->getName(), 'endorsmentLetters' => $endorsmentLetters, 'CVs' => $CVs); array_push($sitesArray, $siteArray); } $CROsList = array(); $CROsArray = array(); if ($details->getCROInvolved() == ARTICLE_DETAIL_YES) { foreach ($CROs as $CRO) { $delegationLetters = $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->articleId, SUPP_FILE_DELEGATION, $CRO->getId()); if (empty($delegationLetters)) { $goToNextStep = false; } $CROsList[$CRO->getId()] = $CRO->getName(); array_push($CROsArray, array('name' => $CRO->getName(), 'delegations' => $delegationLetters)); } } $showPolicies = false; if ($details->getCompensationPolicy() == ARTICLE_DETAIL_YES) { $showPolicies = true; $policies = $suppFileDao->getSuppFilesByArticleAndType($this->articleId, SUPP_FILE_POLICY); if (empty($policies)) { $goToNextStep = false; } } $drugsListForIB = array(); $drugsListForSMPC = array(); $drugsArray = array(); foreach ($drugs as $drug) { $IB = false; $classes = $drug->getClassesArray(); foreach ($classes as $class) { if ($class == ARTICLE_DRUG_INFO_CLASS_IV) { $SmPCs = $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->articleId, SUPP_FILE_SMPC, $drug->getId()); array_push($drugsArray, array('name' => $drug->getName(), 'ib' => false, 'smpcs' => $SmPCs)); $drugsListForSMPC[$drug->getId()] = $drug->getName(); if (empty($SmPCs)) { $goToNextStep = false; } } else { if (!$IB) { $IBs = $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->articleId, SUPP_FILE_BROCHURE, $drug->getId()); array_push($drugsArray, array('name' => $drug->getName(), 'ib' => true, 'ibs' => $IBs)); $drugsListForIB[$drug->getId()] = $drug->getName(); if (empty($IBs)) { $goToNextStep = false; } } $IB = true; } } } $showAdvertisements = false; if ($details->getAdvertisingScheme() == ARTICLE_DETAIL_YES) { $showAdvertisements = true; $advertisements = $suppFileDao->getSuppFilesByArticleAndType($this->articleId, SUPP_FILE_ADVERTISEMENT); if (empty($advertisements)) { $goToNextStep = false; } } $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('typeOptions', $suppFileDao->getTypeMap()); $templateMgr->assign_by_ref('impds', $impds); $templateMgr->assign_by_ref('approvalLetters', $approvalLetters); $templateMgr->assign_by_ref('informedConsents', $informedConsents); $templateMgr->assign_by_ref('labelss', $labelss); $templateMgr->assign_by_ref('gmps', $gmps); $templateMgr->assign('sitesArray', $sitesArray); $templateMgr->assign('sitesList', $sitesList); $templateMgr->assign('drugsArray', $drugsArray); $templateMgr->assign('drugsListForIB', $drugsListForIB); $templateMgr->assign('drugsListForSMPC', $drugsListForSMPC); $templateMgr->assign('showAdvertisements', $showAdvertisements); $templateMgr->assign_by_ref('advertisements', $advertisements); $templateMgr->assign('showPolicies', $showPolicies); $templateMgr->assign_by_ref('policies', $policies); $templateMgr->assign('CROsList', $CROsList); $templateMgr->assign('CROsArray', $CROsArray); $templateMgr->assign_by_ref('relatedPublications', $relatedPublications); $templateMgr->assign('goToNextStep', $goToNextStep); parent::display(); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); //Opatan Inc. : Assign Abstract Minimum and Maximum Length $journal =& Request::getJournal(); $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO'); $abstractMinimumLength =& $journalSettingsDao->getSetting($journal->getJournalId(), 'abstractMinimumLength'); $abstractMaximumLength =& $journalSettingsDao->getSetting($journal->getJournalId(), 'abstractMaximumLength'); if ($abstractMinimumLength) { $templateMgr->assign('abstractMinimumLength', $abstractMinimumLength); } else { $abstractMinimumLength = 200; $templateMgr->assign('abstractMinimumLength', $abstractMinimumLength); } if ($abstractMaximumLength) { $templateMgr->assign('abstractMaximumLength', $abstractMaximumLength); } else { $abstractMaximumLength = 300; $templateMgr->assign('abstractMaximumLength', $abstractMaximumLength); } if ($journalSettingsDao->getSetting($journal->getJournalId(), 'authorCanSpecifyReviewers')) { $authorCanRecommend =& $journalSettingsDao->getSetting($journal->getJournalId(), 'authorCanSpecifyReviewers'); $reviewerIsOptional =& $journalSettingsDao->getSetting($journal->getJournalId(), 'reviewerIsOptional'); $numberOfReviewers =& $journalSettingsDao->getSetting($journal->getJournalId(), 'numberOfReviewers'); $num = array(); $count = 0; $number = $numberOfReviewers; while ($number) { $num[] = ++$count; $number--; } $templateMgr->assign('reviewerIsOptional', $reviewerIsOptional); $templateMgr->assign('countOfReviewers', $numberOfReviewers); $templateMgr->assign_by_ref('numberOfReviewers', $num); $templateMgr->assign('authorCanSpecifyReviewers', $authorCanRecommend); } $countryDao =& DAORegistry::getDAO('CountryDAO'); $countries =& $countryDao->getCountries(); $templateMgr->assign_by_ref('countries', $countries); // Get submission files for this article $articleFileDao =& DAORegistry::getDAO('ArticleFileDAO'); if ($this->article->getSubmissionFileId() != null) { $templateMgr->assign_by_ref('submissionFile', $articleFileDao->getArticleFile($this->article->getSubmissionFileId())); } // Get supplementary files for this article $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $templateMgr->assign_by_ref('suppFiles', $suppFileDao->getSuppFilesByArticle($this->articleId)); parent::display(); }
/** * Save settings. */ function execute() { $articleDao = DAORegistry::getDAO('ArticleDAO'); $signoffDao = DAORegistry::getDAO('SignoffDAO'); $sectionEditorSubmissionDao = DAORegistry::getDAO('SectionEditorSubmissionDAO'); $application = PKPApplication::getApplication(); $request = $this->request; $user = $request->getUser(); $router = $request->getRouter(); $journal = $router->getContext($request); $article = $articleDao->newDataObject(); $article->setLocale($journal->getPrimaryLocale()); // FIXME in bug #5543 $article->setUserId($user->getId()); $article->setJournalId($journal->getId()); $article->setSectionId($this->getData('sectionId')); $article->setLanguage($this->getData('language')); $article->setTitle($this->getData('title'), null); // Localized $article->setAbstract($this->getData('abstract'), null); // Localized $article->setDiscipline($this->getData('discipline'), null); // Localized $article->setSubjectClass($this->getData('subjectClass'), null); // Localized $article->setSubject($this->getData('subject'), null); // Localized $article->setCoverageGeo($this->getData('coverageGeo'), null); // Localized $article->setCoverageChron($this->getData('coverageChron'), null); // Localized $article->setCoverageSample($this->getData('coverageSample'), null); // Localized $article->setType($this->getData('type'), null); // Localized $article->setSponsor($this->getData('sponsor'), null); // Localized $article->setCitations($this->getData('citations')); $article->setPages($this->getData('pages')); // Set some default values so the ArticleDAO doesn't complain when adding this article $article->setDateSubmitted(Core::getCurrentDate()); $article->setStatus(STATUS_PUBLISHED); $article->setSubmissionProgress(0); $article->stampStatusModified(); $article->setCurrentRound(1); $article->setFastTracked(1); $article->setHideAuthor(0); $article->setCommentsStatus(0); // Insert the article to get it's ID $articleDao->insertObject($article); $articleId = $article->getId(); // Add authors $authors = $this->getData('authors'); for ($i = 0, $count = count($authors); $i < $count; $i++) { if ($authors[$i]['authorId'] > 0) { // Update an existing author $author =& $authorDao->getAuthor($authors[$i]['authorId'], $articleId); $isExistingAuthor = true; } else { // Create a new author $author = new Author(); $isExistingAuthor = false; } if ($author != null) { $author->setSubmissionId($articleId); $author->setFirstName($authors[$i]['firstName']); $author->setMiddleName($authors[$i]['middleName']); $author->setLastName($authors[$i]['lastName']); if (array_key_exists('affiliation', $authors[$i])) { $author->setAffiliation($authors[$i]['affiliation'], null); } $author->setCountry($authors[$i]['country']); $author->setEmail($authors[$i]['email']); $author->setUrl($authors[$i]['url']); if (array_key_exists('competingInterests', $authors[$i])) { $author->setCompetingInterests($authors[$i]['competingInterests'], null); } $author->setBiography($authors[$i]['biography'], null); $author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0); $author->setSequence($authors[$i]['seq']); if ($isExistingAuthor == false) { $authorDao = DAORegistry::getDAO('AuthorDAO'); /* @var $authorDao AuthorDAO */ $authorDao->insertObject($author); } } } // Add the submission files as galleys import('lib.pkp.classes.file.TemporaryFileManager'); import('classes.file.ArticleFileManager'); $tempFileIds = $this->getData('tempFileId'); $temporaryFileManager = new TemporaryFileManager(); $articleFileManager = new ArticleFileManager($articleId); $designatedPrimary = false; foreach (array_keys($tempFileIds) as $locale) { $temporaryFile = $temporaryFileManager->getFile($tempFileIds[$locale], $user->getId()); $fileId = null; if ($temporaryFile) { $fileId = $articleFileManager->temporaryFileToArticleFile($temporaryFile, SUBMISSION_FILE_SUBMISSION); $fileType = $temporaryFile->getFileType(); if (strstr($fileType, 'html')) { import('classes.article.ArticleHTMLGalley'); $galley = new ArticleHTMLGalley(); } else { import('classes.article.ArticleGalley'); $galley = new ArticleGalley(); } $galley->setArticleId($articleId); $galley->setFileId($fileId); $galley->setLocale($locale); if ($galley->isHTMLGalley()) { $galley->setLabel('HTML'); } else { if (strstr($fileType, 'pdf')) { $galley->setLabel('PDF'); } else { if (strstr($fileType, 'postscript')) { $galley->setLabel('Postscript'); } else { if (strstr($fileType, 'xml')) { $galley->setLabel('XML'); } else { $galley->setLabel(__('common.untitled')); } } } } $galleyDao = DAORegistry::getDAO('ArticleGalleyDAO'); $galleyDao->insertGalley($galley); if (!$designatedPrimary) { $article->setSubmissionFileId($fileId); if ($locale == $journal->getPrimaryLocale()) { // Used to make sure that *some* file // is designated Review Version, but // preferrably the primary locale. $designatedPrimary = true; } } } // Update file search index import('classes.search.ArticleSearchIndex'); $articleSearchIndex = new ArticleSearchIndex(); if (isset($galley)) { $articleSearchIndex->articleFileChanged($galley->getArticleId(), SUBMISSION_SEARCH_GALLEY_FILE, $galley->getFileId()); } $articleSearchIndex->articleChangesFinished(); } // Designate this as the review version by default. $authorSubmissionDao = DAORegistry::getDAO('AuthorSubmissionDAO'); $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($articleId); import('classes.submission.author.AuthorAction'); AuthorAction::designateReviewVersion($authorSubmission, true); // Accept the submission $sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($articleId); $articleFileManager = new ArticleFileManager($articleId); import('classes.submission.sectionEditor.SectionEditorAction'); assert(false); // FIXME: $decisionLabels missing from call below. SectionEditorAction::recordDecision($this->request, $sectionEditorSubmission, SUBMISSION_EDITOR_DECISION_ACCEPT); import('classes.author.form.submit.AuthorSubmitForm'); AuthorSubmitForm::assignEditors($article); $articleDao->updateObject($article); // Add to end of editing queue import('classes.submission.editor.EditorAction'); if (isset($galley)) { EditorAction::expediteSubmission($article, $this->request); } if ($this->getData('destination') == "issue") { // Add to an existing issue $issueId = $this->getData('issueId'); $this->scheduleForPublication($articleId, $issueId); } // Import the references list. $citationDao = DAORegistry::getDAO('CitationDAO'); $rawCitationList = $article->getCitations(); $citationDao->importCitations($request, ASSOC_TYPE_ARTICLE, $articleId, $rawCitationList); // Index article. import('classes.search.ArticleSearchIndex'); $articleSearchIndex = new ArticleSearchIndex(); $articleSearchIndex->articleMetadataChanged($article); $articleSearchIndex->articleChangesFinished(); }
/** * Save changes to article. * @param $request Request * @return int the article ID */ function execute(&$request) { $articleDao =& DAORegistry::getDAO('ArticleDAO'); $article =& $this->article; // Retrieve the previous citation list for comparison. $previousRawCitationList = $article->getCitations(); /////////////////////////////////////////// ////////////// Update Authors ///////////// /////////////////////////////////////////// $authors = $this->getData('authors'); for ($i = 0, $count = count($authors); $i < $count; $i++) { if ($authors[$i]['authorId'] > 0) { // Update an existing author $author =& $article->getAuthor($authors[$i]['authorId']); $isExistingAuthor = true; } else { // Create a new author $author = new Author(); $isExistingAuthor = false; } if ($author != null) { $author->setSubmissionId($article->getId()); if (isset($authors[$i]['firstName'])) { $author->setFirstName($authors[$i]['firstName']); } if (isset($authors[$i]['middleName'])) { $author->setMiddleName($authors[$i]['middleName']); } if (isset($authors[$i]['lastName'])) { $author->setLastName($authors[$i]['lastName']); } if (isset($authors[$i]['affiliation'])) { $author->setAffiliation($authors[$i]['affiliation']); } if (isset($authors[$i]['phone'])) { $author->setPhoneNumber($authors[$i]['phone']); } if (isset($authors[$i]['email'])) { $author->setEmail($authors[$i]['email']); } $author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0); $author->setSequence($authors[$i]['seq']); if ($isExistingAuthor == false) { $article->addAuthor($author); } } unset($author); } // Remove deleted authors $deletedAuthors = explode(':', $this->getData('deletedAuthors')); for ($i = 0, $count = count($deletedAuthors); $i < $count; $i++) { $article->removeAuthor($deletedAuthors[$i]); } /////////////////////////////////////////// //////////// Update Abstract(s) /////////// /////////////////////////////////////////// import('classes.article.ProposalAbstract'); $journal = Request::getJournal(); $abstracts = $this->getData('abstracts'); foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) { if ($abstracts[$localeKey]['abstractId'] > 0) { $abstract = $article->getAbstractByLocale($localeKey); $isExistingAbstract = true; } else { $abstract = new ProposalAbstract(); $isExistingAbstract = false; } if ($abstract != null) { $abstract->setArticleId($article->getId()); $abstract->setLocale($localeKey); $abstract->setScientificTitle($abstracts[$localeKey]['scientificTitle']); $abstract->setPublicTitle($abstracts[$localeKey]['publicTitle']); $abstract->setBackground($abstracts[$localeKey]['background']); $abstract->setObjectives($abstracts[$localeKey]['objectives']); $abstract->setStudyMethods($abstracts[$localeKey]['studyMethods']); $abstract->setExpectedOutcomes($abstracts[$localeKey]['expectedOutcomes']); $abstract->setKeywords($abstracts[$localeKey]['keywords']); if ($isExistingAbstract == false) { $article->addAbstract($abstract); } } unset($abstract); } /////////////////////////////////////////// ///////// Update Proposal Details ///////// /////////////////////////////////////////// $proposalDetailsData = $this->getData('proposalDetails'); import('classes.article.ProposalDetails'); $proposalDetails = new ProposalDetails(); $institutionDao =& DAORegistry::getDAO('InstitutionDAO'); import('classes.journal.Institution'); $proposalDetails->setArticleId($article->getId()); $proposalDetails->setStudentResearch($proposalDetailsData['studentInitiatedResearch']); $proposalDetails->setStartDate($proposalDetailsData['startDate']); $proposalDetails->setEndDate($proposalDetailsData['endDate']); if ($proposalDetailsData['keyImplInstitution'] == "OTHER") { $institution = new Institution(); $institution->setInstitutionName($proposalDetailsData['otherInstitutionName']); $institution->setInstitutionAcronym($proposalDetailsData['otherInstitutionAcronym']); $institution->setInstitutionType($proposalDetailsData['otherInstitutionType']); $institution->setInstitutionInternational($proposalDetailsData['international']); if ($proposalDetailsData['international'] == INSTITUTION_NATIONAL) { $institution->setInstitutionLocation($proposalDetailsData['locationCountry']); } elseif ($proposalDetailsData['international'] == INSTITUTION_INTERNATIONAL) { $institution->setInstitutionLocation($proposalDetailsData['locationInternational']); } $institutionId = $institutionDao->insertInstitution($institution); $proposalDetails->setKeyImplInstitution($institutionId); unset($institution); } else { $proposalDetails->setKeyImplInstitution($proposalDetailsData['keyImplInstitution']); } $proposalDetails->setMultiCountryResearch($proposalDetailsData['multiCountryResearch']); if ($proposalDetailsData['multiCountryResearch'] == PROPOSAL_DETAIL_YES) { $countriesArray = $proposalDetailsData['countries']; $countries = implode(",", $countriesArray); $proposalDetails->setCountries($countries); } $proposalDetails->setNationwide($proposalDetailsData['nationwide']); if ($proposalDetailsData['nationwide'] != PROPOSAL_DETAIL_YES) { $geoAreasArray = $proposalDetailsData['geoAreas']; $proposalDetails->setGeoAreasFromArray($geoAreasArray); } $researchDomainsArray = $proposalDetailsData['researchDomains']; $proposalDetails->setResearchDomainsFromArray($researchDomainsArray); $researchFieldsArray = $proposalDetailsData['researchFields']; foreach ($researchFieldsArray as $i => $field) { if ($field == "OTHER") { $otherField = $proposalDetailsData['otherResearchField']; if ($otherField != "") { $researchFieldsArray[$i] = "Other (" . $otherField . ")"; } } } $proposalDetails->setResearchFieldsFromArray($researchFieldsArray); $proposalDetails->setHumanSubjects($proposalDetailsData['withHumanSubjects']); if ($proposalDetailsData['withHumanSubjects'] == PROPOSAL_DETAIL_YES) { $proposalTypesArray = $proposalDetailsData['proposalTypes']; foreach ($proposalTypesArray as $i => $type) { if ($type == "OTHER") { $otherType = $proposalDetailsData['otherProposalType']; if ($otherType != "") { $proposalTypesArray[$i] = "Other (" . $otherType . ")"; } } } $proposalDetails->setProposalTypesFromArray($proposalTypesArray); } $proposalDetails->setDataCollection($proposalDetailsData['dataCollection']); if ($proposalDetailsData['reviewedByOtherErc'] == PROPOSAL_DETAIL_YES) { $proposalDetails->setCommitteeReviewed($proposalDetailsData['otherErcDecision']); } else { $proposalDetails->setCommitteeReviewed(PROPOSAL_DETAIL_NO); } // Update or insert student research import('classes.article.StudentResearch'); $studentResearchInfo = new StudentResearch(); $studentResearchInfo->setArticleId($article->getId()); $studentResearchData = $this->getData('studentResearch'); $studentResearchInfo->setInstitution($studentResearchData['studentInstitution']); $studentResearchInfo->setDegree($studentResearchData['academicDegree']); $studentResearchInfo->setSupervisorName($studentResearchData['supervisorName']); $studentResearchInfo->setSupervisorEmail($studentResearchData['supervisorEmail']); $proposalDetails->setStudentResearchInfo($studentResearchInfo); $article->setProposalDetails($proposalDetails); /////////////////////////////////////////// //////// Update Sources of Monetary /////// /////////////////////////////////////////// $sources = $article->getSources(); $sourcesData = $this->getData('sources'); //Remove sources foreach ($sources as $source) { $isPresent = false; foreach ($sourcesData as $sourceData) { if (!empty($sourceData['sourceId'])) { if ($source->getSourceId() == $sourceData['sourceId']) { $isPresent = true; } } } if (!$isPresent) { $article->removeSource($source->getSourceId()); } unset($source); } for ($i = 0, $count = count($sourcesData); $i < $count; $i++) { if (!empty($sourcesData[$i]['sourceId'])) { // Update an existing source $source =& $article->getSource($sourcesData[$i]['sourceId']); $isExistingSource = true; } else { // Create a new source $source = new ProposalSource(); $isExistingSource = false; } if ($source != null) { $source->setArticleId($article->getId()); if ($sourcesData[$i]['institution'] == "OTHER") { $institution = new Institution(); $institution->setInstitutionName($sourcesData[$i]['otherInstitutionName']); $institution->setInstitutionAcronym($sourcesData[$i]['otherInstitutionAcronym']); $institution->setInstitutionType($sourcesData[$i]['otherInstitutionType']); $institution->setInstitutionInternational($sourcesData[$i]['international']); if ($sourcesData[$i]['international'] == INSTITUTION_NATIONAL) { $institution->setInstitutionLocation($sourcesData[$i]['locationCountry']); } elseif ($proposalDetailsData['international'] == INSTITUTION_INTERNATIONAL) { $institution->setInstitutionLocation($sourcesData[$i]['locationInternational']); } $institutionId = $institutionDao->insertInstitution($institution); $source->setInstitutionId($institutionId); unset($institution); } elseif ($sourcesData[$i]['institution'] == "KII") { $source->setInstitutionId($proposalDetails->getKeyImplInstitution()); } else { $source->setInstitutionId($sourcesData[$i]['institution']); } $source->setSourceAmount($sourcesData[$i]['amount']); if (!$isExistingSource) { $article->addSource($source); } } unset($source); } /////////////////////////////////////////// ///////////// Risk Assessment ///////////// /////////////////////////////////////////// import('classes.article.RiskAssessment'); $riskAssessment = new RiskAssessment(); $riskAssessmentData = $this->getData('riskAssessment'); $riskAssessment->setArticleId($article->getId()); $riskAssessment->setIdentityRevealed($riskAssessmentData['identityRevealed']); $riskAssessment->setUnableToConsent($riskAssessmentData['unableToConsent']); $riskAssessment->setUnder18($riskAssessmentData['under18']); $riskAssessment->setDependentRelationship($riskAssessmentData['dependentRelationship']); $riskAssessment->setEthnicMinority($riskAssessmentData['ethnicMinority']); $riskAssessment->setImpairment($riskAssessmentData['impairment']); $riskAssessment->setPregnant($riskAssessmentData['pregnant']); $riskAssessment->setNewTreatment($riskAssessmentData['newTreatment']); $riskAssessment->setBioSamples($riskAssessmentData['bioSamples']); $riskAssessment->setExportHumanTissue($riskAssessmentData['exportHumanTissue']); $riskAssessment->setExportReason($riskAssessmentData['exportReason']); $riskAssessment->setRadiation($riskAssessmentData['radiation']); $riskAssessment->setDistress($riskAssessmentData['distress']); $riskAssessment->setInducements($riskAssessmentData['inducements']); $riskAssessment->setSensitiveInfo($riskAssessmentData['sensitiveInfo']); $riskAssessment->setReproTechnology($riskAssessmentData['reproTechnology']); $riskAssessment->setGenetic($riskAssessmentData['genetic']); $riskAssessment->setStemCell($riskAssessmentData['stemCell']); $riskAssessment->setBiosafety($riskAssessmentData['biosafety']); $riskAssessment->setRiskLevel($riskAssessmentData['riskLevel']); $riskAssessment->setListRisks($riskAssessmentData['listRisks']); $riskAssessment->setHowRisksMinimized($riskAssessmentData['howRisksMinimized']); $riskAssessment->setRisksToTeam(isset($riskAssessmentData['risksToTeam']) ? 1 : 0); $riskAssessment->setRisksToSubjects(isset($riskAssessmentData['risksToSubjects']) ? 1 : 0); $riskAssessment->setRisksToCommunity(isset($riskAssessmentData['risksToCommunity']) ? 1 : 0); $riskAssessment->setBenefitsToParticipants(isset($riskAssessmentData['benefitsToParticipants']) ? 1 : 0); $riskAssessment->setKnowledgeOnCondition(isset($riskAssessmentData['knowledgeOnCondition']) ? 1 : 0); $riskAssessment->setKnowledgeOnDisease(isset($riskAssessmentData['knowledgeOnDisease']) ? 1 : 0); $riskAssessment->setMultiInstitutions($riskAssessmentData['multiInstitutions']); $riskAssessment->setConflictOfInterest($riskAssessmentData['conflictOfInterest']); $article->setRiskAssessment($riskAssessment); //update step if ($article->getSubmissionProgress() <= $this->step) { $article->stampStatusModified(); $article->setSubmissionProgress($this->step + 1); } parent::execute(); // Save the article $articleDao->updateArticle($article); // Update references list if it changed. $citationDao =& DAORegistry::getDAO('CitationDAO'); $rawCitationList = $article->getCitations(); if ($previousRawCitationList != $rawCitationList) { $citationDao->importCitations($request, ASSOC_TYPE_ARTICLE, $article->getId(), $rawCitationList); } return $this->articleId; }
/** * Save changes to article. * @return int the article ID */ function execute() { $articleDao =& DAORegistry::getDAO('ArticleDAO'); $authorDao =& DAORegistry::getDAO('AuthorDAO'); // Update article $article =& $this->article; $article->setTitle($this->getData('title'), null); // Localized $article->setAbstract($this->getData('abstract'), null); // Localized $article->setDiscipline($this->getData('discipline'), null); // Localized $article->setSubjectClass($this->getData('subjectClass'), null); // Localized $article->setSubject($this->getData('subject'), null); // Localized $article->setCoverageGeo($this->getData('coverageGeo'), null); // Localized $article->setCoverageChron($this->getData('coverageChron'), null); // Localized $article->setCoverageSample($this->getData('coverageSample'), null); // Localized $article->setType($this->getData('type'), null); // Localized $article->setLanguage($this->getData('language')); $article->setSponsor($this->getData('sponsor'), null); // Localized $article->setCitations($this->getData('citations')); if ($article->getSubmissionProgress() <= $this->step) { $article->stampStatusModified(); $article->setSubmissionProgress($this->step + 1); } // Update authors $authors = $this->getData('authors'); for ($i = 0, $count = count($authors); $i < $count; $i++) { if ($authors[$i]['authorId'] > 0) { // Update an existing author $author =& $article->getAuthor($authors[$i]['authorId']); $isExistingAuthor = true; } else { // Create a new author $author = new Author(); $isExistingAuthor = false; } if ($author != null) { $author->setArticleId($article->getId()); $author->setFirstName($authors[$i]['firstName']); $author->setMiddleName($authors[$i]['middleName']); $author->setLastName($authors[$i]['lastName']); $author->setAffiliation($authors[$i]['affiliation']); $author->setCountry($authors[$i]['country']); $author->setEmail($authors[$i]['email']); $author->setUrl($authors[$i]['url']); if (array_key_exists('competingInterests', $authors[$i])) { $author->setCompetingInterests($authors[$i]['competingInterests'], null); } $author->setBiography($authors[$i]['biography'], null); $author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0); $author->setSequence($authors[$i]['seq']); if ($isExistingAuthor == false) { $article->addAuthor($author); } } unset($author); } // Remove deleted authors $deletedAuthors = explode(':', $this->getData('deletedAuthors')); for ($i = 0, $count = count($deletedAuthors); $i < $count; $i++) { $article->removeAuthor($deletedAuthors[$i]); } parent::execute(); // Save the article $articleDao->updateArticle($article); return $this->articleId; }
/** * Save settings. */ function execute($editArticleId) { $this->editArticleID = $editArticleId; $articleDao =& DAORegistry::getDAO('ArticleDAO'); $signoffDao =& DAORegistry::getDAO('SignoffDAO'); $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO'); $application =& PKPApplication::getApplication(); $request =& $application->getRequest(); $user =& $request->getUser(); $router =& $request->getRouter(); $journal =& $router->getContext($request); $article = new Article(); $article->setLocale($journal->getPrimaryLocale()); // FIXME in bug #5543 $article->setUserId($user->getId()); $article->setJournalId($journal->getId()); $article->setSectionId($this->getData('sectionId')); $article->setLanguage(String::substr($journal->getPrimaryLocale(), 0, 2)); $article->setTitle($this->getData('title'), null); // Localized //add Original Journal to Abstract $orig_journal = $this->getData('originalJournal'); $abstr = $this->getData('abstract'); foreach (array_keys($abstr) as $abs_key) { $abstr[$abs_key] .= ' <p id="originalPub"> ' . $orig_journal . ' </p> '; // $abstr[$abs_key] .= ' <p id="originalPub"> ' . $orig_journal[$abs_key]. ' </p> '; //OriginalJournal in EditPlugin only a string and not an array... $this->setData('abstract', $abstr); } $article->setAbstract($this->getData('abstract'), null); // Localized $article->setDiscipline($this->getData('discipline'), null); // Localized $article->setSubjectClass($this->getData('subjectClass'), null); // Localized $article->setSubject($this->getData('subject'), null); // Localized $article->setCoverageGeo($this->getData('coverageGeo'), null); // Localized $article->setCoverageChron($this->getData('coverageChron'), null); // Localized $article->setCoverageSample($this->getData('coverageSample'), null); // Localized $article->setType($this->getData('type'), null); // Localized $article->setSponsor($this->getData('sponsor'), null); // Localized $article->setCitations($this->getData('citations')); $article->setPages($this->getData('pages')); // Set some default values so the ArticleDAO doesn't complain when adding this article $article->setDateSubmitted(Core::getCurrentDate()); $article->setStatus(STATUS_PUBLISHED); $article->setSubmissionProgress(0); $article->stampStatusModified(); $article->setCurrentRound(1); $article->setFastTracked(1); $article->setHideAuthor(0); $article->setCommentsStatus(0); // As article has an ID already set it $article->setId($this->editArticleID); $articleId = $this->editArticleID; //delete prior Authors to prevent from double saving the same authors $authorDao =& DAORegistry::getDAO('AuthorDAO'); $authorDao->deleteAuthorsByArticle($articleId); // Add authors $authors = $this->getData('authors'); for ($i = 0, $count = count($authors); $i < $count; $i++) { if ($authors[$i]['authorId'] > 0) { // Update an existing author $author =& $article->getAuthor($authors[$i]['authorId']); $isExistingAuthor = true; } else { // Create a new author $author = new Author(); $isExistingAuthor = false; } if ($author != null) { $author->setSubmissionId($articleId); $author->setFirstName($authors[$i]['firstName']); $author->setMiddleName($authors[$i]['middleName']); $author->setLastName($authors[$i]['lastName']); if (array_key_exists('affiliation', $authors[$i])) { $author->setAffiliation($authors[$i]['affiliation'], null); } $author->setCountry($authors[$i]['country']); $author->setEmail($authors[$i]['email']); $author->setUrl($authors[$i]['url']); if (array_key_exists('competingInterests', $authors[$i])) { $author->setCompetingInterests($authors[$i]['competingInterests'], null); } $author->setBiography($authors[$i]['biography'], null); $author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0); $author->setSequence($authors[$i]['seq']); if ($isExistingAuthor == false) { $article->addAuthor($author); } } } // Check whether the user gave a handle and create a handleSubmissionFile in case $submissionHandle = $this->getData('submissionHandle'); $handleSubmissionFileId; $handleCheck = FALSE; //import FileManager before creating files because otherwise naming of the copied files failes import('classes.file.ArticleFileManager'); foreach (array_keys($submissionHandle) as $locale) { if (!empty($submissionHandle[$locale])) { $this->deleteOldFile("submission/original", $articleId); // $this->deleteOldFile("submission/copyedit", $articleId); $handleCheck = TRUE; $handleSubmissionId = $this->createHandleTXTFile($submissionHandle[$locale], $articleId, 'submission'); $handleSubmissionPDFId = $this->createHandlePDF($submissionHandle[$locale], $articleId, 'submission'); //Add the handle submission files as galley $this->setGalley($articleId, $handleSubmissionPDFId, $locale, 'application/pdf'); } if ($handleCheck == TRUE) { if ($locale == $journal->getPrimaryLocale()) { $article->setSubmissionFileId($handleSubmissionPDFId); $article->SetReviewFileId($handleSubmissionPDFId); } // Update file search index import('classes.search.ArticleSearchIndex'); if (isset($galley)) { ArticleSearchIndex::updateFileIndex($galley->getArticleId(), ARTICLE_SEARCH_GALLEY_FILE, $galley->getFileId()); } } } // Add the submission files as galleys import('classes.file.TemporaryFileManager'); import('classes.file.ArticleFileManager'); $tempFileIds = $this->getData('tempFileId'); $temporaryFileManager = new TemporaryFileManager(); $articleFileManager = new ArticleFileManager($articleId); $tempFileCheck = FALSE; foreach (array_keys($tempFileIds) as $locale) { $temporaryFile = $temporaryFileManager->getFile($tempFileIds[$locale], $user->getId()); $fileId = null; if ($temporaryFile) { $this->deleteOldFile("submission/original", $articleId); $this->deleteOldFile("submission/copyedit", $articleId); $tempFileCheck = TRUE; $fileId = $articleFileManager->temporaryFileToArticleFile($temporaryFile, ARTICLE_FILE_SUBMISSION); $fileType = $temporaryFile->getFileType(); $this->setGalley($articleId, $fileId, $locale, $fileType); // $galley =& $this->setGalley($articleId, $fileId, $locale, $fileType); } if ($tempFileCheck == TRUE) { if ($locale == $journal->getPrimaryLocale()) { $article->setSubmissionFileId($fileId); $article->SetReviewFileId($fileId); } // Update file search index import('classes.search.ArticleSearchIndex'); if (isset($galley)) { ArticleSearchIndex::updateFileIndex($galley->getArticleId(), ARTICLE_SEARCH_GALLEY_FILE, $galley->getFileId()); } } } //Check whether the user gave a handle and create handleSupplFile in case $supplHandle = $this->getData('supplHandle'); $handleSuppFileId = null; foreach (array_keys($supplHandle) as $locale) { if (!empty($supplHandle[$locale])) { $this->deleteOldFile("supp", $articleId); $handleSuppFileId = $this->createHandleTXTFile($supplHandle[$locale], $articleId, 'supplementary'); $handleSupplPDFFileID = $this->createHandlePDF($submissionHandle[$locale], $articleId, 'supplementary'); } } //Add uploaded Supplementary file $tempSupplFileIds = $this->getData('tempSupplFileId'); foreach (array_keys($tempSupplFileIds) as $locale) { $temporaryFile = $temporaryFileManager->getFile($tempSupplFileIds[$locale], $user->getId()); $fileId = null; if ($temporaryFile) { $this->deleteOldFile("supp", $articleId); $fileId = $articleFileManager->temporaryFileToArticleFile($temporaryFile, ARTICLE_FILE_SUPP); $fileType = $temporaryFile->getFileType(); } } // Designate this as the review version by default. /*$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO'); $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($articleId); import('classes.submission.author.AuthorAction'); AuthorAction::designateReviewVersion($authorSubmission, true); */ // Accept the submission /*$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($articleId); $articleFileManager = new ArticleFileManager($articleId); $sectionEditorSubmission->setReviewFile($articleFileManager->getFile($article->getSubmissionFileId())); import('classes.submission.sectionEditor.SectionEditorAction'); SectionEditorAction::recordDecision($sectionEditorSubmission, SUBMISSION_EDITOR_DECISION_ACCEPT); */ // Create signoff infrastructure $copyeditInitialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $articleId); $copyeditAuthorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $articleId); $copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $articleId); $copyeditInitialSignoff->setUserId(0); $copyeditAuthorSignoff->setUserId($user->getId()); $copyeditFinalSignoff->setUserId(0); $signoffDao->updateObject($copyeditInitialSignoff); $signoffDao->updateObject($copyeditAuthorSignoff); $signoffDao->updateObject($copyeditFinalSignoff); $layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $articleId); $layoutSignoff->setUserId(0); $signoffDao->updateObject($layoutSignoff); $proofAuthorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_AUTHOR', ASSOC_TYPE_ARTICLE, $articleId); $proofProofreaderSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $articleId); $proofLayoutEditorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_ARTICLE, $articleId); $proofAuthorSignoff->setUserId($user->getId()); $proofProofreaderSignoff->setUserId(0); $proofLayoutEditorSignoff->setUserId(0); $signoffDao->updateObject($proofAuthorSignoff); $signoffDao->updateObject($proofProofreaderSignoff); $signoffDao->updateObject($proofLayoutEditorSignoff); import('classes.author.form.submit.AuthorSubmitForm'); AuthorSubmitForm::assignEditors($article); $articleDao->updateArticle($article); // Add to end of editing queue import('classes.submission.editor.EditorAction'); if (isset($galley)) { EditorAction::expediteSubmission($article); } // As the article already has an issue, just get it from database $issueDao =& DAORegistry::getDAO('IssueDAO'); $issue =& $issueDao->getIssueByArticleId($this->editArticleID); $issueId = $issue->getIssueId(); //$this->scheduleForPublication($articleId, $issueId); // Index article. import('classes.search.ArticleSearchIndex'); ArticleSearchIndex::indexArticleMetadata($article); // Import the references list. $citationDao =& DAORegistry::getDAO('CitationDAO'); $rawCitationList = $article->getCitations(); $citationDao->importCitations($request, ASSOC_TYPE_ARTICLE, $articleId, $rawCitationList); }
/** * Save changes to article. * @param $request Request * @return int the article ID */ function execute(&$request) { $articleDao =& DAORegistry::getDAO('ArticleDAO'); $articleDetailsDao =& DAORegistry::getDAO('ArticleDetailsDAO'); $institutionDao =& DAORegistry::getDAO('InstitutionDAO'); import('classes.journal.Institution'); $article =& $this->article; $fundingSourcesData = $this->getData('fundingSources'); $fundingSources = $article->getArticleFundingSources(); $primarySponsorData = $this->getData('primarySponsor'); $secondarySponsorsData = $this->getData('secondarySponsors'); $secondarySponsors = $article->getArticleSecondarySponsors(); $details = $article->getArticleDetails(); $CROsData = $this->getData('CROs'); $CROs = $article->getArticleCROs(); $newInstitutions = array(); // Remove deleted funding sources foreach ($fundingSources as $fundingSource) { $isPresent = false; foreach ($fundingSourcesData as $fundingSourceData) { if (!empty($fundingSourceData['id'])) { if ($fundingSource->getId() == $fundingSourceData['id']) { $isPresent = true; } } } if (!$isPresent) { $article->removeArticleFundingSource($fundingSource->getId()); } unset($isPresent); unset($fundingSource); } // Update / Insert funding sources foreach ($fundingSourcesData as $fundingSourceData) { if (isset($fundingSourceData['id'])) { $articleSource = $article->getArticleFundingSource($fundingSourceData['id']); } else { $articleSource = new ArticleSponsor(); } $articleSource->setArticleId($article->getId()); $articleSource->setType(ARTICLE_SPONSOR_TYPE_FUNDING); if ($fundingSourceData['institutionId'] == 'OTHER') { $institution = new Institution(); $institution->setInstitutionName($fundingSourceData['name']); $institution->setInstitutionAcronym($fundingSourceData['acronym']); $institution->setInstitutionType($fundingSourceData['type']); $institution->setInstitutionInternational($fundingSourceData['location']); if ($fundingSourceData['location'] == INSTITUTION_NATIONAL) { $institution->setInstitutionLocation($fundingSourceData['locationCountry']); } elseif ($fundingSourceData['location'] == INSTITUTION_INTERNATIONAL) { $institution->setInstitutionLocation($fundingSourceData['locationInternational']); } $institutionId = $institutionDao->insertInstitution($institution); $articleSource->setInstitutionId($institutionId); $fundingSourceData['institutionId'] = $institutionId; array_push($newInstitutions, $fundingSourceData); unset($institution); } else { $articleSource->setInstitutionId($fundingSourceData['institutionId']); } $article->addArticleFundingSource($articleSource); unset($articleSource); } if (isset($primarySponsorData['id'])) { $primarySponsor = $article->getArticlePrimarySponsor(); } else { $primarySponsor = new ArticleSponsor(); } $primarySponsor->setArticleId($article->getId()); $primarySponsor->setType(ARTICLE_SPONSOR_TYPE_PRIMARY); if ($primarySponsorData['institutionId'] == 'OTHER') { $found = false; foreach ($newInstitutions as $newInstitution) { if ($newInstitution['name'] == $primarySponsorData['name'] || $newInstitution['acronym'] == $primarySponsorData['acronym']) { $found = $newInstitution['institutionId']; } } if (!$found) { $institution = new Institution(); $institution->setInstitutionName($primarySponsorData['name']); $institution->setInstitutionAcronym($primarySponsorData['acronym']); $institution->setInstitutionType($primarySponsorData['type']); $institution->setInstitutionInternational($primarySponsorData['location']); if ($primarySponsorData['location'] == INSTITUTION_NATIONAL) { $institution->setInstitutionLocation($primarySponsorData['locationCountry']); } elseif ($primarySponsorData['location'] == INSTITUTION_INTERNATIONAL) { $institution->setInstitutionLocation($primarySponsorData['locationInternational']); } $institutionId = $institutionDao->insertInstitution($institution); $primarySponsor->setInstitutionId($institutionId); $primarySponsorData['institutionId'] = $institutionId; array_push($newInstitutions, $primarySponsorData); unset($institution); } else { $primarySponsor->setInstitutionId($found); } } else { $primarySponsor->setInstitutionId($primarySponsorData['institutionId']); } $article->setArticlePrimarySponsor($primarySponsor); // Remove deleted secondary sponsors foreach ($secondarySponsors as $secondarySponsor) { $isPresent = false; foreach ($secondarySponsorsData as $secondarySponsorData) { if (!empty($secondarySponsorData['id'])) { if ($secondarySponsor->getId() == $secondarySponsorData['id']) { $isPresent = true; } } } if (!$isPresent) { $article->removeArticleSecondarySponsor($secondarySponsor->getId()); } unset($isPresent); unset($secondarySponsor); } // Update / Insert secondary sponsors foreach ($secondarySponsorsData as $secondarySponsorData) { if (isset($secondarySponsorData['id'])) { $secondarySponsor = $article->getArticleSecondarySponsor($secondarySponsorData['id']); } else { $secondarySponsor = new ArticleSponsor(); } $secondarySponsor->setArticleId($article->getId()); $secondarySponsor->setType(ARTICLE_SPONSOR_TYPE_SECONDARY); if ($secondarySponsorData['ssInstitutionId'] == 'OTHER') { $found = false; foreach ($newInstitutions as $newInstitution) { if ($newInstitution['name'] == $secondarySponsorData['ssName'] || $newInstitution['acronym'] == $secondarySponsorData['ssAcronym']) { $found = $newInstitution['institutionId']; } } if (!$found) { $institution = new Institution(); $institution->setInstitutionName($secondarySponsorData['ssName']); $institution->setInstitutionAcronym($secondarySponsorData['ssAcronym']); $institution->setInstitutionType($secondarySponsorData['ssType']); $institution->setInstitutionInternational($secondarySponsorData['ssLocation']); if ($secondarySponsorData['ssLocation'] == INSTITUTION_NATIONAL) { $institution->setInstitutionLocation($secondarySponsorData['ssLocationCountry']); } elseif ($secondarySponsorData['ssLocation'] == INSTITUTION_INTERNATIONAL) { $institution->setInstitutionLocation($secondarySponsorData['ssLocationInternational']); } $institutionId = $institutionDao->insertInstitution($institution); $secondarySponsor->setInstitutionId($institutionId); $primarySponsorData['institutionId'] = $institutionId; array_push($newInstitutions, array('institutionId' => $institutionId, 'name' => $secondarySponsorData['ssName'], 'acronym' => $secondarySponsorData['ssAcronym'])); unset($institution); } else { $secondarySponsor->setInstitutionId($found); } } else { $secondarySponsor->setInstitutionId($secondarySponsorData['ssInstitutionId']); } $article->addArticleSecondarySponsor($secondarySponsor); unset($secondarySponsor); } $details->setCROInvolved($this->getData('croInvolved')); $articleDetailsDao->updateArticleDetails($details); // Remove deleted CROs foreach ($CROs as $CRO) { $isPresent = false; foreach ($CROsData as $CROData) { if (!empty($CROData['id'])) { if ($CRO->getId() == $CROData['id']) { $isPresent = true; } } } if (!$isPresent) { $article->removeArticleCRO($CRO->getId()); } unset($isPresent); unset($CRO); } // Update / Insert CROs if ($details->getCROInvolved() == ARTICLE_DETAIL_YES) { foreach ($CROsData as $CROData) { if (isset($CROData['id'])) { $CRO = $article->getArticleCRO($CROData['id']); } else { $CRO = new ArticleCRO(); } $CRO->setArticleId($article->getId()); $CRO->setName($CROData['croName']); $CRO->setInternational($CROData['croLocation']); if ($CROData['croLocation'] == CRO_NATIONAL) { $CRO->setLocation($CROData['croLocationCountry']); } elseif ($CROData['croLocation'] == CRO_INTERNATIONAL) { $CRO->setLocation($CROData['croLocationInternational']); } $CRO->setCity($CROData['city']); $CRO->setAddress($CROData['address']); $CRO->setPrimaryPhone($CROData['primaryPhone']); $CRO->setSecondaryPhone($CROData['secondaryPhone']); $CRO->setFax($CROData['fax']); $CRO->setEmail($CROData['email']); $article->addArticleCRO($CRO); unset($CRO); } } //update step if ($article->getSubmissionProgress() <= $this->step) { $article->stampStatusModified(); $article->setSubmissionProgress($this->step + 1); } elseif ($article->getSubmissionProgress() == 9) { $article->setSubmissionProgress(8); } parent::execute(); // Save the article $articleDao->updateArticle($article); return $this->articleId; }
/** * Save settings. */ function execute() { $articleDao =& DAORegistry::getDAO('ArticleDAO'); $signoffDao =& DAORegistry::getDAO('SignoffDAO'); $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO'); $application =& PKPApplication::getApplication(); $request =& $application->getRequest(); $user =& $request->getUser(); $router =& $request->getRouter(); $journal =& $router->getContext($request); $article = new Article(); $article->setLocale($journal->getPrimaryLocale()); // FIXME in bug #5543 $article->setUserId($user->getId()); $article->setJournalId($journal->getId()); $article->setSectionId($this->getData('sectionId')); $article->setLanguage(String::substr($journal->getPrimaryLocale(), 0, 2)); $article->setTitle($this->getData('title'), null); // Localized $article->setAbstract($this->getData('abstract'), null); // Localized $article->setDiscipline($this->getData('discipline'), null); // Localized $article->setSubjectClass($this->getData('subjectClass'), null); // Localized $article->setSubject($this->getData('subject'), null); // Localized $article->setCoverageGeo($this->getData('coverageGeo'), null); // Localized $article->setCoverageChron($this->getData('coverageChron'), null); // Localized $article->setCoverageSample($this->getData('coverageSample'), null); // Localized $article->setType($this->getData('type'), null); // Localized $article->setSponsor($this->getData('sponsor'), null); // Localized $article->setCitations($this->getData('citations')); $article->setPages($this->getData('pages')); // Set some default values so the ArticleDAO doesn't complain when adding this article $article->setDateSubmitted(Core::getCurrentDate()); $article->setStatus(STATUS_PUBLISHED); $article->setSubmissionProgress(0); $article->stampStatusModified(); $article->setCurrentRound(1); $article->setFastTracked(1); $article->setHideAuthor(0); $article->setCommentsStatus(0); // Insert the article to get it's ID $articleDao->insertArticle($article); $articleId = $article->getId(); // Add authors $authors = $this->getData('authors'); for ($i = 0, $count = count($authors); $i < $count; $i++) { if ($authors[$i]['authorId'] > 0) { // Update an existing author $author =& $article->getAuthor($authors[$i]['authorId']); $isExistingAuthor = true; } else { // Create a new author $author = new Author(); $isExistingAuthor = false; } if ($author != null) { $author->setSubmissionId($articleId); $author->setFirstName($authors[$i]['firstName']); $author->setMiddleName($authors[$i]['middleName']); $author->setLastName($authors[$i]['lastName']); if (array_key_exists('affiliation', $authors[$i])) { $author->setAffiliation($authors[$i]['affiliation'], null); } $author->setCountry($authors[$i]['country']); $author->setEmail($authors[$i]['email']); $author->setUrl($authors[$i]['url']); if (array_key_exists('competingInterests', $authors[$i])) { $author->setCompetingInterests($authors[$i]['competingInterests'], null); } $author->setBiography($authors[$i]['biography'], null); $author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0); $author->setSequence($authors[$i]['seq']); if ($isExistingAuthor == false) { $article->addAuthor($author); } } } // Add the submission files as galleys import('classes.file.TemporaryFileManager'); import('classes.file.ArticleFileManager'); $tempFileIds = $this->getData('tempFileId'); $temporaryFileManager = new TemporaryFileManager(); $articleFileManager = new ArticleFileManager($articleId); foreach (array_keys($tempFileIds) as $locale) { $temporaryFile = $temporaryFileManager->getFile($tempFileIds[$locale], $user->getId()); $fileId = null; if ($temporaryFile) { $fileId = $articleFileManager->temporaryFileToArticleFile($temporaryFile, ARTICLE_FILE_SUBMISSION); $fileType = $temporaryFile->getFileType(); if (strstr($fileType, 'html')) { import('classes.article.ArticleHTMLGalley'); $galley = new ArticleHTMLGalley(); } else { import('classes.article.ArticleGalley'); $galley = new ArticleGalley(); } $galley->setArticleId($articleId); $galley->setFileId($fileId); $galley->setLocale($locale); if ($galley->isHTMLGalley()) { $galley->setLabel('HTML'); } else { if (strstr($fileType, 'pdf')) { $galley->setLabel('PDF'); } else { if (strstr($fileType, 'postscript')) { $galley->setLabel('Postscript'); } else { if (strstr($fileType, 'xml')) { $galley->setLabel('XML'); } else { $galley->setLabel(__('common.untitled')); } } } } $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO'); $galleyDao->insertGalley($galley); } if ($locale == $journal->getPrimaryLocale()) { $article->setSubmissionFileId($fileId); $article->SetReviewFileId($fileId); } // Update file search index import('classes.search.ArticleSearchIndex'); if (isset($galley)) { ArticleSearchIndex::updateFileIndex($galley->getArticleId(), ARTICLE_SEARCH_GALLEY_FILE, $galley->getFileId()); } } // Designate this as the review version by default. $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO'); $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($articleId); import('classes.submission.author.AuthorAction'); AuthorAction::designateReviewVersion($authorSubmission, true); // Accept the submission $sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($articleId); $articleFileManager = new ArticleFileManager($articleId); $sectionEditorSubmission->setReviewFile($articleFileManager->getFile($article->getSubmissionFileId())); import('classes.submission.sectionEditor.SectionEditorAction'); SectionEditorAction::recordDecision($sectionEditorSubmission, SUBMISSION_EDITOR_DECISION_ACCEPT); // Create signoff infrastructure $copyeditInitialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $articleId); $copyeditAuthorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $articleId); $copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $articleId); $copyeditInitialSignoff->setUserId(0); $copyeditAuthorSignoff->setUserId($user->getId()); $copyeditFinalSignoff->setUserId(0); $signoffDao->updateObject($copyeditInitialSignoff); $signoffDao->updateObject($copyeditAuthorSignoff); $signoffDao->updateObject($copyeditFinalSignoff); $layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $articleId); $layoutSignoff->setUserId(0); $signoffDao->updateObject($layoutSignoff); $proofAuthorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_AUTHOR', ASSOC_TYPE_ARTICLE, $articleId); $proofProofreaderSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $articleId); $proofLayoutEditorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_ARTICLE, $articleId); $proofAuthorSignoff->setUserId($user->getId()); $proofProofreaderSignoff->setUserId(0); $proofLayoutEditorSignoff->setUserId(0); $signoffDao->updateObject($proofAuthorSignoff); $signoffDao->updateObject($proofProofreaderSignoff); $signoffDao->updateObject($proofLayoutEditorSignoff); import('classes.author.form.submit.AuthorSubmitForm'); AuthorSubmitForm::assignEditors($article); $articleDao->updateArticle($article); // Add to end of editing queue import('classes.submission.editor.EditorAction'); if (isset($galley)) { EditorAction::expediteSubmission($article); } if ($this->getData('destination') == "issue") { // Add to an existing issue $issueId = $this->getData('issueId'); $this->scheduleForPublication($articleId, $issueId); } // Index article. import('classes.search.ArticleSearchIndex'); ArticleSearchIndex::indexArticleMetadata($article); // Import the references list. $citationDao =& DAORegistry::getDAO('CitationDAO'); $rawCitationList = $article->getCitations(); $citationDao->importCitations($request, ASSOC_TYPE_ARTICLE, $articleId, $rawCitationList); }
/** * Save changes to article. * @param $request Request * @return int the article ID */ function execute(&$request) { $articleDao =& DAORegistry::getDAO('ArticleDAO'); $article =& $this->article; /////////////////////// ///// UPDATE TEXTS///// /////////////////////// $journal = Request::getJournal(); $articleTexts = $this->getData('articleTexts'); foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) { if ($articleTexts[$localeKey]['articleTextId'] > 0) { $articleText = $article->getArticleTextByLocale($localeKey); $isExistingArticleText = true; } else { $articleText = new ArticleText(); $isExistingArticleText = false; } if ($articleText != null) { $articleText->setArticleId($article->getId()); $articleText->setLocale($localeKey); $articleText->setScientificTitle($articleTexts[$localeKey]['scientificTitle']); $articleText->setPublicTitle($articleTexts[$localeKey]['publicTitle']); $articleText->setDescription($articleTexts[$localeKey]['description']); $articleText->setKeyInclusionCriteria($articleTexts[$localeKey]['keyInclusionCriteria']); $articleText->setKeyExclusionCriteria($articleTexts[$localeKey]['keyExclusionCriteria']); $articleText->setRecruitmentInfo($articleTexts[$localeKey]['recruitmentInfo']); if ($isExistingArticleText == false) { $article->addArticleText($articleText); } } unset($articleText); } /////////////////////////////////////////// /////////// Update secondary IDs ////////// /////////////////////////////////////////// $secIds = $article->getArticleSecIds(); $secIdsData = $this->getData('articleSecIds'); //Remove secondary IDs foreach ($secIds as $secId) { $isPresent = false; foreach ($secIdsData as $secIdData) { if (!empty($secIdData['articleSecIdId'])) { if ($secId->getId() == $secIdData['articleSecIdId']) { $isPresent = true; } } } if (!$isPresent) { $article->removeArticleSecId($secId->getId()); } unset($secId); } foreach ($secIdsData as $secIdData) { if (!empty($secIdData['type']) && !empty($secIdData['id'])) { if (!empty($secIdData['articleSecIdId'])) { // Update an existing sec id $secId =& $article->getArticleSecId($secIdData['articleSecIdId']); } else { // Create a new sec id $secId = new ArticleSecId(); } if ($secId != null) { $secId->setArticleId($article->getId()); $secId->setType($secIdData['type']); $secId->setSecId($secIdData['id']); $article->addArticleSecId($secId); } unset($secId); } } /////////////////////////////////////////// ////////// Update Article Details ///////// /////////////////////////////////////////// $articlelDetailsData = $this->getData('articleDetails'); if ($article->getArticleDetails()) { $articleDetails = $article->getArticleDetails(); } else { $articleDetails = new ArticleDetails(); } $articleDetails->setArticleId($article->getId()); $articleDetails->setProtocolVersion($articlelDetailsData['protocolVersion']); $articleDetails->setTherapeuticArea($articlelDetailsData['therapeuticArea'], $articlelDetailsData['otherTherapeuticArea']); $articleDetails->setHealthCondDiseaseFromArray($articlelDetailsData['healthConds']); $articleDetails->setMinAgeNum($articlelDetailsData['minAgeNum']); $articleDetails->setMinAgeUnit($articlelDetailsData['minAgeUnit']); $articleDetails->setMaxAgeNum($articlelDetailsData['maxAgeNum']); $articleDetails->setMaxAgeUnit($articlelDetailsData['maxAgeUnit']); $articleDetails->setSex($articlelDetailsData['sex']); $articleDetails->setHealthy($articlelDetailsData['healthy']); $articleDetails->setLocaleSampleSize($articlelDetailsData['localeSampleSize']); $articleDetails->setMultinational($articlelDetailsData['multinational']); $articleDetails->setIntSampleSizeFromArray($articlelDetailsData['intSampleSize']); $articleDetails->setStartDate($articlelDetailsData['startDate']); $articleDetails->setEndDate($articlelDetailsData['endDate']); $articleDetails->setRecruitmentStatus($articlelDetailsData['recruitStatus']); $articleDetails->setAdvertisingScheme($articlelDetailsData['adScheme']); $articleDetails->setCompensationPolicy($articlelDetailsData['compensationPolicy']); $article->setArticleDetails($articleDetails); /////////////////////////////////////////// ////////// Update Article Purposes //////// /////////////////////////////////////////// $purposesData = $this->getData('purposes'); $purposes = $article->getArticlePurposes(); //Remove deleted article purposes foreach ($purposes as $purpose) { $isPresent = false; foreach ($purposesData as $purposeData) { if (!empty($purposeData['id'])) { if ($purpose->getId() == $purposeData['id']) { $isPresent = true; } } } if (!$isPresent) { $article->removeArticlePurpose($purpose->getId()); } unset($purpose); } foreach ($purposesData as $purposeData) { if (!empty($purposeData['interventional'])) { if (!empty($purposeData['id'])) { // Update an existing purpose $purpose =& $article->getArticlePurpose($purposeData['id']); } else { // Create a new article purpose $purpose = new ArticlePurpose(); } if ($purpose != null) { $purpose->setArticleId($article->getId()); if ($purposeData['interventional'] == ARTICLE_PURPOSE_TYPE_OBS) { $purpose->setType(ARTICLE_PURPOSE_TYPE_OBS); } else { $purpose->setType($purposeData['type']); } $purpose->setCTPhase($purposeData['ctPhase']); $purpose->setAllocation($purposeData['allocation']); $purpose->setMasking($purposeData['masking']); $purpose->setControl($purposeData['control']); $purpose->setAssignment($purposeData['assignment']); $purpose->setEndpoint($purposeData['endpoint']); $article->addArticlePurpose($purpose); } unset($purpose); } } /////////////////////////////////////////// ////////// Update Article Outcomes //////// /////////////////////////////////////////// $primaryOutcomesData = $this->getData('primaryOutcomes'); $secondaryOutcomesData = $this->getData('secondaryOutcomes'); $articlelOutcomes = $article->getArticleOutcomes(); //Remove outcomes foreach ($articlelOutcomes as $articlelOutcome) { $isPresent = false; foreach ($primaryOutcomesData as $primaryOutcomeData) { foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) { if (!empty($primaryOutcomeData[$localeKey]['primaryOutcomeId'])) { if ($articlelOutcome[$localeKey]->getId() == $primaryOutcomeData[$localeKey]['primaryOutcomeId']) { $isPresent = true; } } } } foreach ($secondaryOutcomesData as $secondaryOutcomeData) { foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) { if (!empty($secondaryOutcomeData[$localeKey]['secondaryOutcomeId'])) { if ($articlelOutcome[$localeKey]->getId() == $secondaryOutcomeData[$localeKey]['secondaryOutcomeId']) { $isPresent = true; } } } } if (!$isPresent) { foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) { if (!empty($articlelOutcome[$localeKey])) { $article->removeArticleOutcome($articlelOutcome[$localeKey]->getId()); } } } unset($articlelOutcome); } foreach ($primaryOutcomesData as $poKey => $primaryOutcomeData) { foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) { if (!empty($primaryOutcomeData[$localeKey]['name']) && !empty($primaryOutcomeData[$localeKey]['measurement']) && !empty($primaryOutcomeData[$localeKey]['timepoint'])) { if (!empty($primaryOutcomeData[$localeKey]['primaryOutcomeId'])) { $primaryOutcome = $article->getArticleOutcome($primaryOutcomeData[$localeKey]['primaryOutcomeId']); } else { $primaryOutcome = new ArticleOutcome(); } if ($primaryOutcome != null) { $primaryOutcome->setArticleId($article->getId()); $primaryOutcome->setName($primaryOutcomeData[$localeKey]['name']); $primaryOutcome->setLocale($localeKey); $primaryOutcome->setType(ARTICLE_OUTCOME_PRIMARY); $primaryOutcome->setMeasurement($primaryOutcomeData[$localeKey]['measurement']); $primaryOutcome->setTimepoint($primaryOutcomeData[$localeKey]['timepoint']); $article->addArticleOutcome($primaryOutcome); } unset($primaryOutcome); } } } foreach ($secondaryOutcomesData as $poKey => $secondaryOutcomeData) { foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) { if (!empty($secondaryOutcomeData[$localeKey]['name']) && !empty($secondaryOutcomeData[$localeKey]['measurement']) && !empty($secondaryOutcomeData[$localeKey]['timepoint'])) { if (!empty($secondaryOutcomeData[$localeKey]['secondaryOutcomeId'])) { $secondaryOutcome = $article->getArticleOutcome($secondaryOutcomeData[$localeKey]['secondaryOutcomeId']); } else { $secondaryOutcome = new ArticleOutcome(); } if ($secondaryOutcome != null) { $secondaryOutcome->setArticleId($article->getId()); $secondaryOutcome->setName($secondaryOutcomeData[$localeKey]['name']); $secondaryOutcome->setLocale($localeKey); $secondaryOutcome->setType(ARTICLE_OUTCOME_SECONDARY); $secondaryOutcome->setMeasurement($secondaryOutcomeData[$localeKey]['measurement']); $secondaryOutcome->setTimepoint($secondaryOutcomeData[$localeKey]['timepoint']); $article->addArticleOutcome($secondaryOutcome); } unset($secondaryOutcome); } } } //update step if ($article->getSubmissionProgress() <= $this->step) { $article->stampStatusModified(); $article->setSubmissionProgress($this->step + 1); } elseif ($article->getSubmissionProgress() == 9) { $article->setSubmissionProgress(8); } parent::execute(); // Save the article $articleDao->updateArticle($article); return $this->articleId; }
/** * Validate the form */ function validate() { import('classes.payment.ojs.OJSPaymentManager'); $paymentManager =& OJSPaymentManager::getManager(); if ($paymentManager->submissionEnabled()) { if (!parent::validate()) { return false; } $journal =& Request::getJournal(); $journalId = $journal->getId(); $articleId = $this->articleId; $user =& Request::getUser(); $completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO'); if ($completedPaymentDAO->hasPaidSubmission($journalId, $articleId)) { return parent::validate(); } elseif (Request::getUserVar('qualifyForWaiver') && Request::getUserVar('commentsToEditor') != '') { return parent::validate(); } elseif (Request::getUserVar('paymentSent')) { return parent::validate(); } else { $queuedPayment =& $paymentManager->createQueuedPayment($journalId, PAYMENT_TYPE_SUBMISSION, $user->getId(), $articleId, $journal->getSetting('submissionFee')); $queuedPaymentId = $paymentManager->queuePayment($queuedPayment); $paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment); exit; } } else { return parent::validate(); } }
/** * Save changes to article. * @param $request Request * @return int the article ID */ function execute(&$request) { $articleDao =& DAORegistry::getDAO('ArticleDAO'); $article =& $this->article; $articleDrugsData = $this->getData('articleDrugs'); $articleDrugs = $article->getArticleDrugs(); // Remove deleted article drugs foreach ($articleDrugs as $articleDrug) { $isPresent = false; foreach ($articleDrugsData as $articleDrugData) { if (!empty($articleDrugData['id'])) { if ($articleDrug->getId() == $articleDrugData['id']) { $isPresent = true; } } } if (!$isPresent) { $article->removeArticleDrug($articleDrug->getId()); } unset($isPresent); unset($articleDrug); } // Update article drugs foreach ($articleDrugsData as $articleDrugData) { if (isset($articleDrugData['id'])) { $articleDrug = $article->getArticleDrug($articleDrugData['id']); $isExistingDrug = true; } else { $articleDrug = new ArticleDrugInfo(); $isExistingDrug = false; } $articleDrug->setArticleId($article->getId()); $articleDrug->setType($articleDrugData['type']); $articleDrug->setName($articleDrugData['name']); $articleDrug->setBrandName($articleDrugData['brandName']); $articleDrug->setAdministration($articleDrugData['administration']); $articleDrug->setOtherAdministration($articleDrugData['otherAdministration']); $articleDrug->setForm($articleDrugData['form']); $articleDrug->setOtherForm($articleDrugData['otherForm']); $articleDrug->setStrength($articleDrugData['strength']); $articleDrug->setStorage($articleDrugData['storage']); $articleDrug->setPharmaClass($articleDrugData['pharmaClass']); $articleDrug->setClassesFromArray($articleDrugData['studyClasses']); $articleDrug->setCountriesFromArray($articleDrugData['countries']); $articleDrug->setDifferentConditionsOfUse($articleDrugData['conditionsOfUse']); $articleDrug->setCPR($articleDrugData['cpr']); $articleDrug->setDrugRegistrationNumber($articleDrugData['drugRegistrationNumber']); $articleDrug->setImportedQuantity($articleDrugData['importedQuantity']); $manufacturersData = $articleDrugData['manufacturers']; $manufacturers = $articleDrug->getManufacturers(); // Remove deleted manufacturers foreach ($manufacturers as $manufacturer) { $isPresent = false; foreach ($manufacturersData as $manufacturerData) { if (!empty($manufacturerData['id'])) { if ($manufacturer->getId() == $manufacturerData['id']) { $isPresent = true; } } } if (!$isPresent) { $articleDrug->removeManufacturer($manufacturer->getId()); } unset($isPresent); unset($manufacturer); } // Update manufacturers foreach ($manufacturersData as $manufacturerData) { if (isset($manufacturerData['id'])) { $manufacturer = $articleDrug->getManufacturer($manufacturerData['id']); } else { $manufacturer = new ArticleDrugManufacturer(); } if ($isExistingDrug) { $manufacturer->setDrugId($articleDrug->getId()); } $manufacturer->setName($manufacturerData['name']); $manufacturer->setAddress($manufacturerData['address']); $articleDrug->addManufacturer($manufacturer); } $article->addArticleDrug($articleDrug); } //update step if ($article->getSubmissionProgress() <= $this->step) { $article->stampStatusModified(); $article->setSubmissionProgress($this->step + 1); } elseif ($article->getSubmissionProgress() == 9) { $article->setSubmissionProgress(8); } parent::execute(); // Save the article $articleDao->updateArticle($article); return $this->articleId; }