/** * Constructor. */ function AuthorSubmitStep2Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 2, $journal); $this->addCheck(new FormValidatorArray($this, 'articleTexts', 'required', 'author.submit.form.titlesRequired', array('scientificTitle', 'publicTitle'))); $this->addCheck(new FormValidatorArray($this, 'articleTexts', 'required', 'author.submit.form.textsRequired', array('description', 'keyInclusionCriteria', 'keyExclusionCriteria'))); $this->addCheck(new FormValidator($this, 'articleDetails-protocolVersion', 'required', 'author.submit.form.protocolVersion.required')); $this->addCheck(new FormValidator($this, 'articleDetails-therapeuticArea', 'required', 'author.submit.form.therapeuticArea.required')); $this->addCheck(new FormValidator($this, 'articleDetails-otherTherapeuticArea', 'required', 'author.submit.form.otherTherapeuticArea.required')); $this->addCheck(new FormValidatorArray($this, 'articleDetails-healthConds', 'required', 'author.submit.form.icd10s.required')); $this->addCheck(new FormValidatorArray($this, 'purposes', 'required', 'author.submit.form.purposes.required', array('interventional'))); $this->addCheck(new FormValidatorArray($this, 'purposes', 'required', 'author.submit.form.purposes.fields.required', array('type', 'ctPhase', 'allocation', 'masking', 'control', 'assignment', 'endpoint'))); $this->addCheck(new FormValidatorArray($this, 'primaryOutcomes', 'required', 'author.submit.form.primaryOutcome.required', array('name', 'measurement', 'timepoint'), true)); $this->addCheck(new FormValidator($this, 'articleDetails-minAgeNum', 'required', 'author.submit.form.minAgeNum.required')); $this->addCheck(new FormValidator($this, 'articleDetails-maxAgeNum', 'required', 'author.submit.form.maxAgeNum.required')); $this->addCheck(new FormValidator($this, 'articleDetails-sex', 'required', 'author.submit.form.sex.required')); $this->addCheck(new FormValidator($this, 'articleDetails-healthy', 'required', 'author.submit.form.healthy.required')); $this->addCheck(new FormValidator($this, 'articleDetails-localeSampleSize', 'required', 'author.submit.form.localeSampleSize.required')); $this->addCheck(new FormValidator($this, 'articleDetails-multinational', 'required', 'author.submit.form.multinational.required')); //$this->addCheck(new FormValidatorArray($this, 'articleDetails-intSampleSize', 'required', 'author.submit.form.intSampleSize.required')); $this->addCheck(new FormValidator($this, 'articleDetails-startDate', 'required', 'author.submit.form.startDate.required')); $this->addCheck(new FormValidator($this, 'articleDetails-endDate', 'required', 'author.submit.form.endDate.required')); $this->addCheck(new FormValidator($this, 'articleDetails-recruitStatus', 'required', 'author.submit.form.recruitStatus.required')); $this->addCheck(new FormValidator($this, 'articleDetails-adScheme', 'required', 'author.submit.form.adScheme.required')); $this->addCheck(new FormValidator($this, 'articleDetails-compensationPolicy', 'required', 'author.submit.form.compensationPolicy.required')); }
/** * Constructor. */ function AuthorSubmitStep2MergedForm($article, $suppFileId = null) { parent::AuthorSubmitForm($article, 2); $journal =& Request::getJournal(); $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO'); $this->articleId = $article->getArticleId(); if (isset($suppFileId) && !empty($suppFileId)) { $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $this->suppFile =& $suppFileDao->getSuppFile($suppFileId, $article->getArticleId()); if (isset($this->suppFile)) { $this->suppFileId = $suppFileId; } } $locale = Locale::getLocale(); // Validation checks for this form $this->addCheck(new FormValidatorCustom($this, 'authors', 'required', 'author.submit.form.authorRequired', create_function('$authors', 'return count($authors) > 0;'))); $this->addCheck(new FormValidatorArray($this, 'authors', 'required', 'author.submit.form.authorRequiredFields', array(array('firstName', $locale), array('lastName', $locale), 'email'))); $this->addCheck(new FormValidatorLocale($this, 'title', 'required', 'author.submit.form.titleRequired')); // Opatan Inc. $this->addCheck(new FormValidatorLocale($this, 'runningTitle', 'required', 'author.submit.form.runningTitleRequired')); // Opatan Inc. : if author can specify reviewers and specifying reviewers is not optional adds reviewers validator if ($journalSettingsDao->getSetting($journal->getJournalId(), 'authorCanSpecifyReviewers')) { $reviewerIsOptional =& $journalSettingsDao->getSetting($journal->getJournalId(), 'reviewerIsOptional'); if ($reviewerIsOptional == 0) { $this->addCheck(new FormValidatorArray($this, 'reviewers', 'required', 'author.submit.form.reviewerRequiredFields', array(array('firstName', $locale), array('lastName', $locale), 'email'))); } } $this->addCheck(new FormValidatorPost($this)); }
/** * Constructor. */ function AuthorSubmitStep1Form($article = null) { parent::AuthorSubmitForm($article, 1); $journal =& Request::getJournal(); // Validation checks for this form $this->addCheck(new FormValidator($this, 'sectionId', 'required', 'author.submit.form.sectionRequired')); $this->addCheck(new FormValidatorCustom($this, 'sectionId', 'required', 'author.submit.form.sectionRequired', array(DAORegistry::getDAO('SectionDAO'), 'sectionExists'), array($journal->getId()))); }
/** * Constructor. */ function AuthorSubmitStep4Form($paper) { parent::AuthorSubmitForm($paper, 4); $schedConf =& Request::getSchedConf(); if (!$schedConf->getSetting('acceptSupplementaryReviewMaterials')) { // If supplementary files are not allowed, redirect. Request::redirect(null, null, null, null, '5'); } }
/** * Constructor. */ function AuthorSubmitStep1Form($paper = null) { parent::AuthorSubmitForm($paper, 1); $schedConf =& Request::getSchedConf(); // Validation checks for this form $this->addCheck(new FormValidator($this, 'trackId', 'required', 'author.submit.form.trackRequired')); $this->addCheck(new FormValidatorCustom($this, 'trackId', 'required', 'author.submit.form.trackRequired', array(DAORegistry::getDAO('TrackDAO'), 'trackExists'), array($schedConf->getId()))); $this->addCheck(new FormValidatorControlledVocab($this, 'sessionType', 'optional', 'author.submit.form.sessionTypeRequired', 'paperType', ASSOC_TYPE_SCHED_CONF, $schedConf->getId())); }
/** * Constructor. */ function AuthorSubmitStep2Form($article) { parent::AuthorSubmitForm($article, 2); $journal =& Request::getJournal(); // Validation checks for this form $this->addCheck(new FormValidatorCustom($this, 'authors', 'required', 'author.submit.form.authorRequired', create_function('$authors', 'return count($authors) > 0;'))); $this->addCheck(new FormValidatorArray($this, 'authors', 'required', 'author.submit.form.authorRequiredFields', array('firstName', 'lastName', 'email'))); $this->addCheck(new FormValidatorLocale($this, 'title', 'required', 'author.submit.form.titleRequired')); }
/** * Constructor. */ function AuthorSubmitStep1Form(&$article, &$journal, $request) { parent::AuthorSubmitForm($article, 1, $journal, $request); // Validation checks for this form $this->addCheck(new FormValidator($this, 'sectionId', 'required', 'author.submit.form.sectionRequired')); $this->addCheck(new FormValidatorCustom($this, 'sectionId', 'required', 'author.submit.form.sectionRequired', array(DAORegistry::getDAO('SectionDAO'), 'sectionExists'), array($journal->getId()))); $supportedSubmissionLocales = $journal->getSetting('supportedSubmissionLocales'); if (!is_array($supportedSubmissionLocales) || count($supportedSubmissionLocales) < 1) { $supportedSubmissionLocales = array($journal->getPrimaryLocale()); } $this->addCheck(new FormValidatorInSet($this, 'locale', 'required', 'author.submit.form.localeRequired', $supportedSubmissionLocales)); }
/** * Constructor. */ function AuthorSubmitStep1Form($paper = null) { parent::AuthorSubmitForm($paper, 1); $conference =& Request::getConference(); $schedConf =& Request::getSchedConf(); // Validation checks for this form $this->addCheck(new FormValidator($this, 'trackId', 'required', 'author.submit.form.trackRequired')); $this->addCheck(new FormValidatorCustom($this, 'trackId', 'required', 'author.submit.form.trackRequired', array(DAORegistry::getDAO('TrackDAO'), 'trackExists'), array($schedConf->getId()))); $this->addCheck(new FormValidatorControlledVocab($this, 'sessionType', 'optional', 'author.submit.form.sessionTypeRequired', 'paperType', ASSOC_TYPE_SCHED_CONF, $schedConf->getId())); $supportedSubmissionLocales = $conference->getSetting('supportedSubmissionLocales'); if (!is_array($supportedSubmissionLocales) || count($supportedSubmissionLocales) < 1) { $supportedSubmissionLocales = array($conference->getPrimaryLocale()); } $this->addCheck(new FormValidatorInSet($this, 'locale', 'required', 'author.submit.form.localeRequired', $supportedSubmissionLocales)); }
/** * Constructor. */ function AuthorSubmitStep6Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 6, $journal); $this->addCheck(new FormValidator($this, 'pqName', 'required', 'author.submit.form.pqName.required')); $this->addCheck(new FormValidator($this, 'pqAffiliation', 'required', 'author.submit.form.pqAffiliation.required')); $this->addCheck(new FormValidator($this, 'pqAddress', 'required', 'author.submit.form.pqAddress.required')); $this->addCheck(new FormValidator($this, 'pqCountry', 'required', 'author.submit.form.pqCountry.required')); $this->addCheck(new FormValidator($this, 'pqPhone', 'required', 'author.submit.form.pqPhone.required')); $this->addCheck(new FormValidator($this, 'pqEmail', 'required', 'author.submit.form.pqEmail.required')); $this->addCheck(new FormValidator($this, 'sqName', 'required', 'author.submit.form.sqName.required')); $this->addCheck(new FormValidator($this, 'sqAffiliation', 'required', 'author.submit.form.sqAffiliation.required')); $this->addCheck(new FormValidator($this, 'sqAddress', 'required', 'author.submit.form.sqAddress.required')); $this->addCheck(new FormValidator($this, 'sqCountry', 'required', 'author.submit.form.sqCountry.required')); $this->addCheck(new FormValidator($this, 'sqPhone', 'required', 'author.submit.form.sqPhone.required')); $this->addCheck(new FormValidator($this, 'sqEmail', 'required', 'author.submit.form.sqEmail.required')); }
/** * Constructor. */ function AuthorSubmitStep3Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 3, $journal); // Validation checks for this form $this->addCheck(new FormValidatorCustom($this, 'authors', 'required', 'author.submit.form.authorRequired', create_function('$authors', 'return count($authors) > 0;'))); $this->addCheck(new FormValidatorArray($this, 'authors', 'required', 'author.submit.form.authorRequiredFields', array('firstName', 'lastName'))); $this->addCheck(new FormValidatorArrayCustom($this, 'authors', 'required', 'author.submit.form.authorRequiredFields', create_function('$email, $regExp', 'return String::regexp_match($regExp, $email);'), array(ValidatorEmail::getRegexp()), false, array('email'))); $this->addCheck(new FormValidatorArrayCustom($this, 'authors', 'required', 'user.profile.form.urlInvalid', create_function('$url, $regExp', 'return empty($url) ? true : String::regexp_match($regExp, $url);'), array(ValidatorUrl::getRegexp()), false, array('url'))); $this->addCheck(new FormValidatorLocale($this, 'title', 'required', 'author.submit.form.titleRequired', $this->getRequiredLocale())); $sectionDao =& DAORegistry::getDAO('SectionDAO'); $section = $sectionDao->getSection($article->getSectionId()); $abstractWordCount = $section->getAbstractWordCount(); if (isset($abstractWordCount) && $abstractWordCount > 0) { $this->addCheck(new FormValidatorCustom($this, 'abstract', 'required', 'author.submit.form.wordCountAlert', create_function('$abstract, $wordCount', 'foreach ($abstract as $localizedAbstract) {return count(explode(" ",$localizedAbstract)) < $wordCount; }'), array($abstractWordCount))); } }
/** * Constructor. */ function AuthorSubmitStep4Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 4, $journal); $this->trialSiteDao = DAORegistry::getDAO("TrialSiteDAO"); $this->addCheck(new FormValidatorArray($this, 'articleSites', 'required', 'author.submit.form.siteSelect.required', array('siteSelect'))); $this->addCheck(new FormValidatorArray($this, 'articleSites', 'required', 'author.submit.form.siteInfo.required', array('siteName', 'siteAddress', 'siteCity', 'siteRegion', 'siteLicensure', 'siteAccreditation'))); $this->addCheck(new FormValidatorCustom($this, 'articleSites', 'required', 'author.submit.form.site.nameAndCityUsed', function ($articleSites) { foreach ($articleSites as $articleSite) { if ($this->trialSiteDao->trialSiteExistsByNameAndCity($articleSite['siteName'], $articleSite['siteCity'])) { return false; } } return true; })); $this->addCheck(new FormValidatorCustom($this, 'articleSites', 'required', 'author.submit.form.site.licensureUsed', function ($articleSites) { foreach ($articleSites as $articleSite) { if ($this->trialSiteDao->trialSiteExistsByLicensure($articleSite['siteLicensure'])) { return false; } } return true; })); $this->addCheck(new FormValidatorCustom($this, 'articleSites', 'required', 'author.submit.form.site.accreditationUsed', function ($articleSites) { foreach ($articleSites as $articleSite) { if ($this->trialSiteDao->trialSiteExistsByAccreditation($articleSite['siteAccreditation'])) { return false; } } return true; })); $this->addCheck(new FormValidatorArray($this, 'articleSites', 'required', 'author.submit.form.authority.required', array('authority'))); $this->addCheck(new FormValidatorArray($this, 'articleSites', 'required', 'author.submit.form.erc.required', array('erc'))); $this->addCheck(new FormValidatorArray($this, 'articleSites', 'required', 'author.submit.form.primaryPhone.required', array('primaryPhone'))); $this->addCheck(new FormValidatorArray($this, 'articleSites', 'required', 'author.submit.form.email.required', array('email'))); $this->addCheck(new FormValidatorArray($this, 'articleSites', 'required', 'author.submit.form.subjectsNumber.required', array('subjectsNumber'))); $this->addCheck(new FormValidatorCustom($this, 'articleSites', 'required', 'author.submit.form.investigators.required', function ($articleSites) { foreach ($articleSites as $articleSite) { $investigators = $articleSite['investigators']; foreach ($investigators as $investigator) { if ($investigator['firstName'] == '' || $investigator['lastName'] == '' || $investigator['iPrimaryPhone'] == '' || $investigator['expertise'] == '' || $investigator['iEmail'] == '') { return false; } } } return true; })); }
/** * Constructor. */ function AuthorSubmitStep3Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 3, $journal); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugType.required', array('type'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugName.required', array('name'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugAdministration.required', array('administration'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugOtherAdministration.required', array('otherAdministration'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugForm.required', array('form'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugOtherForm.required', array('otherForm'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugStrength.required', array('strength'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugStorage.required', array('storage'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugPharmaClass.required', array('pharmaClass'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugStudyClasses.required', array('studyClasses'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugCountry.required', array('countries'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugConditionsOfUse.required', array('conditionsOfUse'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugCPR.required', array('cpr'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugRegistrationNumber.required', array('drugRegistrationNumber'))); $this->addCheck(new FormValidatorArray($this, 'articleDrugs', 'required', 'author.submit.form.drugManufacturerName.required', array('manufacturers'))); }
/** * Constructor. */ function AuthorSubmitStep3Form($paper) { parent::AuthorSubmitForm($paper, 3); // Validation checks for this form $this->addCheck(new FormValidatorCustom($this, 'authors', 'required', 'author.submit.form.authorRequired', create_function('$authors', 'return count($authors) > 0;'))); $this->addCheck(new FormValidatorArray($this, 'authors', 'required', 'author.submit.form.authorRequiredFields', array('firstName', 'lastName'))); $this->addCheck(new FormValidatorArrayCustom($this, 'authors', 'required', 'author.submit.form.authorRequiredFields', create_function('$email, $regExp', 'return String::regexp_match($regExp, $email);'), array(ValidatorEmail::getRegexp()), false, array('email'))); $this->addCheck(new FormValidatorArrayCustom($this, 'authors', 'required', 'user.profile.form.urlInvalid', create_function('$url, $regExp', 'return empty($url) ? true : String::regexp_match($regExp, $url);'), array(ValidatorUrl::getRegexp()), false, array('url'))); $this->addCheck(new FormValidatorLocale($this, 'title', 'required', 'author.submit.form.titleRequired')); $schedConf =& Request::getSchedConf(); $reviewMode = $paper->getReviewMode(); if ($reviewMode != REVIEW_MODE_PRESENTATIONS_ALONE) { $this->addCheck(new FormValidatorLocale($this, 'abstract', 'required', 'author.submit.form.abstractRequired')); $trackDao =& DAORegistry::getDAO('TrackDAO'); $track = $trackDao->getTrack($paper->getTrackId()); $abstractWordCount = $track->getAbstractWordCount(); if (isset($abstractWordCount) && $abstractWordCount > 0) { $this->addCheck(new FormValidatorCustom($this, 'abstract', 'required', 'author.submit.form.wordCountAlert', create_function('$abstract, $wordCount', 'foreach ($abstract as $localizedAbstract) {return count(explode(" ",strip_tags($localizedAbstract))) < $wordCount; }'), array($abstractWordCount))); } } }
/** * Constructor. */ function AuthorSubmitStep2Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 2, $journal); $this->addCheck(new FormValidatorCustom($this, 'authors', 'required', 'author.submit.form.authorRequired', function ($authors) { return count($authors) > 0; })); $this->addCheck(new FormValidatorArray($this, 'authors', 'required', 'author.submit.form.authorRequiredFields', array('firstName', 'lastName', 'affiliation', 'phone'))); $this->addCheck(new FormValidatorArray($this, 'abstracts', 'required', 'author.submit.form.abstractRequiredFields', array('scientificTitle', 'publicTitle', 'background', 'objectives', 'studyMethods', 'expectedOutcomes', 'keywords'))); $this->addCheck(new FormValidatorArrayRadios($this, 'proposalDetails', 'required', 'author.submit.form.proposalDetails', array('studentInitiatedResearch', 'international', 'multiCountryResearch', 'nationwide', 'withHumanSubjects', 'reviewedByOtherErc'))); $this->addCheck(new FormValidatorCustom($this, 'proposalDetails', 'required', 'author.submit.form.KIINameAlreadyUsed', function ($proposalDetails) { $institutionDao = DAORegistry::getDAO("InstitutionDAO"); if ($institutionDao->institutionExistsByName($proposalDetails["otherInstitutionName"])) { return false; } else { return true; } })); $this->addCheck(new FormValidatorCustom($this, 'proposalDetails', 'required', 'author.submit.form.KIIAcronymAlreadyUsed', function ($proposalDetails) { $institutionDao = DAORegistry::getDAO("InstitutionDAO"); if ($institutionDao->institutionExistsByAcronym($proposalDetails["otherInstitutionAcronym"])) { return false; } else { return true; } })); $this->addCheck(new FormValidatorArray($this, 'studentResearch', 'required', 'author.submit.form.studentResearch')); //$this->addCheck(new FormValidatorArray($this, 'sources', 'required', 'author.submit.form.sourceRequiredFields', array('institution', 'amount', 'otherInstitutionName', 'otherInstitutionAcronym', 'otherInstitutionType', 'locationCountry', 'locationInternational'))); $this->addCheck(new FormValidatorArrayRadios($this, "sources", 'required', 'author.submit.form.sourceRequiredFields', array('international'), true)); $this->addCheck(new FormValidatorArrayCustom($this, 'sources', 'required', 'author.submit.form.sourceNameAlreadyUsed', function ($otherInstitutionName) { $institutionDao = DAORegistry::getDAO("InstitutionDAO"); if ($institutionDao->institutionExistsByName($otherInstitutionName)) { return false; } else { return true; } }, array(), false, array('otherInstitutionName'))); $this->addCheck(new FormValidatorArrayCustom($this, 'sources', 'required', 'author.submit.form.sourceAccronymAlreadyUsed', function ($otherInstitutionAcronym) { $institutionDao = DAORegistry::getDAO("InstitutionDAO"); if ($institutionDao->institutionExistsByAcronym($otherInstitutionAcronym)) { return false; } else { return true; } }, array(), false, array('otherInstitutionAcronym'))); $this->addCheck(new FormValidatorArrayCustom($this, 'sources', 'required', 'author.submit.form.nonNumericValue', function ($amount) { return ctype_digit($amount); }, array(), false, array('amount'))); $this->addCheck(new FormValidatorCustom($this, 'sources', 'required', 'author.submit.form.sameSource', function ($sources) { $institutionArray = array(); foreach ($sources as $source) { if ($source["institution"] != "OTHER" && $source["institution"] != "") { array_push($institutionArray, $source["institution"]); } } if (count($institutionArray) != count(array_unique($institutionArray))) { return false; } else { return true; } })); if (isset($_POST['proposalDetails'])) { $this->addCheck(new FormValidatorCustom($this, 'sources', 'required', 'author.submit.form.sameInstitutionEntries', function ($sources, $KIIOtherInstitutionName, $KIIOtherInstitutionAcronym) { $institutionNameArray = array(); $institutionAcronymArray = array(); foreach ($sources as $source) { if ($source["otherInstitutionName"] != "NA") { array_push($institutionNameArray, $source["otherInstitutionName"]); } if ($source["otherInstitutionAcronym"] != "NA") { array_push($institutionAcronymArray, $source["otherInstitutionAcronym"]); } } if ($KIIOtherInstitutionName != "NA") { array_push($institutionNameArray, $KIIOtherInstitutionName); } if ($KIIOtherInstitutionAcronym != "NA") { array_push($institutionAcronymArray, $KIIOtherInstitutionAcronym); } if (count($institutionNameArray) != count(array_intersect_key($institutionNameArray, array_unique(array_map('strtolower', $institutionNameArray))))) { return false; } elseif (count($institutionAcronymArray) != count(array_intersect_key($institutionAcronymArray, array_unique(array_map('strtolower', $institutionAcronymArray))))) { return false; } else { return true; } }, array($_POST["proposalDetails"]["otherInstitutionName"], $_POST["proposalDetails"]["otherInstitutionAcronym"]))); } $this->addCheck(new FormValidatorArrayRadios($this, "riskAssessment", 'required', 'author.submit.form.riskAssessment', array('identityRevealed', 'unableToConsent', 'under18', 'dependentRelationship', 'ethnicMinority', 'impairment', 'pregnant', 'newTreatment', 'bioSamples', 'exportHumanTissue', 'exportReason', 'radiation', 'distress', 'inducements', 'sensitiveInfo', 'reproTechnology', 'genetic', 'stemCell', 'biosafety', 'multiInstitutions', 'conflictOfInterest'))); }
/** * Constructor. */ function AuthorSubmitStep2Form($article) { parent::AuthorSubmitForm($article, 2); // Validation checks for this form }
/** * Constructor. */ function AuthorSubmitStep5Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 5, $journal); $this->institutionDao = DAORegistry::getDAO("InstitutionDAO"); $this->addCheck(new FormValidatorArray($this, 'fundingSources', 'required', 'author.submit.form.fundingSources.required', array('institutionId', 'name', 'acronym', 'type', 'location', 'locationCountry', 'locationInternational'))); $this->addCheck(new FormValidatorCustom($this, 'fundingSources', 'required', 'author.submit.form.fundingSources.nameUsed', function ($fundingSources) { foreach ($fundingSources as $fundingSource) { if ($this->institutionDao->institutionExistsByName($fundingSource['name'])) { return false; } } return true; })); $this->addCheck(new FormValidatorCustom($this, 'fundingSources', 'required', 'author.submit.form.fundingSources.acronymUsed', function ($fundingSources) { foreach ($fundingSources as $fundingSource) { if ($this->institutionDao->institutionExistsByAcronym($fundingSource['acronym'])) { return false; } } return true; })); $this->addCheck(new FormValidatorArrayRadios($this, 'primarySponsor', 'required', 'author.submit.form.primarySponsor.required', array('location'))); $this->addCheck(new FormValidatorCustom($this, 'primarySponsor', 'required', 'author.submit.form.primarySponsor.nameUsed', function ($primarySponsor) { if ($this->institutionDao->institutionExistsByName($primarySponsor['name'])) { return false; } return true; })); $this->addCheck(new FormValidatorCustom($this, 'primarySponsor', 'required', 'author.submit.form.primarySponsor.acronymUsed', function ($primarySponsor) { if ($this->institutionDao->institutionExistsByAcronym($primarySponsor['acronym'])) { return false; } return true; })); $this->addCheck(new FormValidatorArray($this, 'secondarySponsors', 'required', 'author.submit.form.secondarySponsors.required', array('ssName', 'ssAcronym', 'ssType', 'ssLocation', 'ssLocationCountry', 'ssLocationInternational'))); $this->addCheck(new FormValidatorCustom($this, 'secondarySponsors', 'required', 'author.submit.form.secondarySponsors.nameUsed', function ($secondarySponsors) { foreach ($secondarySponsors as $secondarySponsor) { if ($this->institutionDao->institutionExistsByName($secondarySponsor['ssName'])) { return false; } } return true; })); $this->addCheck(new FormValidatorCustom($this, 'secondarySponsors', 'required', 'author.submit.form.secondarySponsors.acronymUsed', function ($secondarySponsors) { foreach ($secondarySponsors as $secondarySponsor) { if ($this->institutionDao->institutionExistsByAcronym($secondarySponsor['ssAcronym'])) { return false; } } return true; })); // Check if same new institution has been entered twice or more in the fields but the user provided different acronyms for the same name or oppositely if (isset($_POST['primarySponsor']) && isset($_POST['secondarySponsors'])) { $this->addCheck(new FormValidatorCustom($this, 'fundingSources', 'required', 'author.submit.form.sponsors.differentNameAcronym', function ($fundingSources, $primarySponsor, $secondarySponsors) { foreach ($fundingSources as $fundingSource) { if ($fundingSource['name'] == $primarySponsor['name'] && $fundingSource['name'] != 'NA' && $fundingSource['acronym'] != $primarySponsor['acronym']) { return false; } elseif ($fundingSource['acronym'] == $primarySponsor['acronym'] && $fundingSource['acronym'] != 'NA' && $fundingSource['name'] != $primarySponsor['name']) { return false; } foreach ($secondarySponsors as $secondarySponsor) { if ($fundingSource['name'] == $secondarySponsor['ssName'] && $fundingSource['name'] != 'NA' && $fundingSource['acronym'] != $secondarySponsor['ssAcronym']) { return false; } elseif ($fundingSource['acronym'] == $secondarySponsor['ssAcronym'] && $fundingSource['acronym'] != 'NA' && $fundingSource['name'] != $secondarySponsor['ssName']) { return false; } if ($secondarySponsor['ssName'] == $primarySponsor['name'] && $secondarySponsor['ssName'] != 'NA' && $secondarySponsor['ssAcronym'] != $primarySponsor['acronym']) { return false; } elseif ($secondarySponsor['ssAcronym'] == $primarySponsor['acronym'] && $secondarySponsor['ssAcronym'] != 'NA' && $secondarySponsor['ssName'] != $primarySponsor['name']) { return false; } } } return true; }, array($_POST["primarySponsor"], $_POST["secondarySponsors"]))); } // Check if same acronym or same name has been used in the funding sources $this->addCheck(new FormValidatorCustom($this, 'fundingSources', 'required', 'author.submit.form.fundingSources.nameOrAcronymAlreadyProvided', function ($fundingSources) { foreach ($fundingSources as $fundingSource) { $found = 0; foreach ($fundingSources as $sFundingSource) { if ($fundingSource['name'] != 'NA' && $fundingSource['name'] == $sFundingSource['name'] || $fundingSource['acronym'] != 'NA' && $fundingSource['acronym'] == $sFundingSource['acronym']) { $found++; } } if ($found > 1) { return false; } } return true; })); // Check if same acronym or same name has been used in the secondary sponsors $this->addCheck(new FormValidatorCustom($this, 'secondarySponsors', 'required', 'author.submit.form.secondarySponsors.nameOrAcronymAlreadyProvided', function ($secondarySponsors) { foreach ($secondarySponsors as $secondarySponsor) { $found = 0; foreach ($secondarySponsors as $sSecondarySponsor) { if ($secondarySponsor['ssName'] != 'NA' && $secondarySponsor['ssName'] == $sSecondarySponsor['ssName'] || $secondarySponsor['ssAcronym'] != 'NA' && $secondarySponsor['ssAcronym'] == $sSecondarySponsor['ssAcronym']) { $found++; } } if ($found > 1) { return false; } } return true; })); $this->addCheck(new FormValidator($this, 'croInvolved', 'required', 'author.submit.form.croInvolved.required')); $this->addCheck(new FormValidatorArray($this, 'CROs', 'required', 'author.submit.form.CROs.required', array('croName', 'croLocation', 'croLocationCountry', 'croLocationInternational', 'city', 'address', 'primaryPhone', 'email'))); }
/** * Constructor. */ function AuthorSubmitStep3Form($paper) { parent::AuthorSubmitForm($paper, 3); // Validation checks for this form }
/** * Constructor. */ function AuthorSubmitStep5Form($paper) { parent::AuthorSubmitForm($paper, 5); }
/** * Constructor. */ function AuthorSubmitStep3Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 3, $journal); // Validation checks for this form }
/** * Constructor. */ function AuthorSubmitStep4Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 4, $journal); }
/** * Constructor. */ function AuthorSubmitStep4Form($article) { parent::AuthorSubmitForm($article, 4); }
/** * Constructor. */ function AuthorSubmitStep5Form(&$article, &$journal) { parent::AuthorSubmitForm($article, 5, $journal); $this->addCheck(new FormValidatorCustom($this, 'qualifyForWaiver', 'optional', 'author.submit.mustEnterWaiverReason', array(&$this, 'checkWaiverReason'))); }
/** * Constructor. */ function AuthorSubmitStep2Form(&$article, &$journal, $request) { parent::AuthorSubmitForm($article, 2, $journal, $request); // Validation checks for this form }