function initData($filterData, $request)
 {
     $this->_data = $filterData;
     $submission = $this->getSubmission();
     $this->setData('submissionId', $submission->getId());
     $this->setData('stageId', $this->getStageId());
     $this->setData('reviewRoundId', $this->getReviewRoundId());
     return parent::initData($filterData, $request);
 }
Example #2
0
 /**
  * Initialize form data from current article.
  */
 function initData()
 {
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     if (isset($this->article)) {
         $article =& $this->article;
         // Initialize th proposal details
         $this->_data = array('section' => $sectionDao->getSection($article->getSectionId()));
     }
     return parent::initData();
 }
 /**
  * Initialize form data from current settings.
  */
 function initData()
 {
     $journal =& Request::getJournal();
     foreach ($this->settings as $settingName => $settingType) {
         $this->_data[$settingName] = $journal->getSetting($settingName);
     }
     $this->setData('primaryLocale', $journal->getPrimaryLocale());
     foreach (array('supportedFormLocales', 'supportedSubmissionLocales', 'supportedLocales') as $name) {
         if ($this->getData($name) == null || !is_array($this->getData($name))) {
             $this->setData($name, array());
         }
     }
     return parent::initData();
 }
Example #4
0
 /**
  * Initialize form data from current issue.
  */
 function initData($request)
 {
     if (isset($this->issue)) {
         $this->_data = array('title' => $this->issue->getTitle(null), 'volume' => $this->issue->getVolume(), 'number' => $this->issue->getNumber(), 'year' => $this->issue->getYear(), 'datePublished' => $this->issue->getDatePublished(), 'description' => $this->issue->getDescription(null), 'accessStatus' => $this->issue->getAccessStatus(), 'openAccessDate' => $this->issue->getOpenAccessDate(), 'showVolume' => $this->issue->getShowVolume(), 'showNumber' => $this->issue->getShowNumber(), 'showYear' => $this->issue->getShowYear(), 'showTitle' => $this->issue->getShowTitle(), 'styleFileName' => $this->issue->getStyleFileName(), 'originalStyleFileName' => $this->issue->getOriginalStyleFileName());
         parent::initData();
     } else {
         $journal = $request->getJournal();
         switch ($journal->getSetting('publishingMode')) {
             case PUBLISHING_MODE_SUBSCRIPTION:
             case PUBLISHING_MODE_NONE:
                 $accessStatus = ISSUE_ACCESS_SUBSCRIPTION;
                 break;
             case PUBLISHING_MODE_OPEN:
             default:
                 $accessStatus = ISSUE_ACCESS_OPEN;
                 break;
         }
         $this->_data = array('showVolume' => 1, 'showNumber' => 1, 'showYear' => 1, 'showTitle' => 1, 'accessStatus' => $accessStatus);
     }
 }
 /**
  * Initialize form data from current galley (if applicable).
  */
 function initData()
 {
     if (isset($this->galley)) {
         $galley =& $this->galley;
         $this->_data = array('label' => $galley->getLabel(), 'publicGalleyId' => $galley->getPubId('publisher-id'), 'galleyLocale' => $galley->getLocale());
     } else {
         $this->_data = array();
     }
     // consider the additional field names from the public identifer plugins
     import('classes.plugins.PubIdPluginHelper');
     $pubIdPluginHelper = new PubIdPluginHelper();
     $pubIdPluginHelper->init($this, $galley);
     parent::initData();
 }
 /**
  * @see Form::readInputData()
  */
 function readInputData()
 {
     $this->readUserVars(array('selectedFiles'));
     parent::initData();
 }
 /**
  * Initialize form data from the associated author.
  */
 function initData()
 {
     $this->setData('responseDueDate', $this->_reviewAssignment->getDateResponseDue());
     $this->setData('reviewDueDate', $this->_reviewAssignment->getDateDue());
     return parent::initData();
 }
 /**
  * Initialize form data from current supplementary file (if applicable).
  */
 function initData()
 {
     if (isset($this->suppFile)) {
         $suppFile =& $this->suppFile;
         $this->_data = array('title' => $suppFile->getTitle(null), 'creator' => $suppFile->getCreator(null), 'subject' => $suppFile->getSubject(null), 'type' => $suppFile->getType(), 'typeOther' => $suppFile->getTypeOther(null), 'description' => $suppFile->getDescription(null), 'publisher' => $suppFile->getPublisher(null), 'sponsor' => $suppFile->getSponsor(null), 'dateCreated' => $suppFile->getDateCreated(), 'source' => $suppFile->getSource(null), 'language' => $suppFile->getLanguage(), 'showReviewers' => $suppFile->getShowReviewers() == 1 ? 1 : 0, 'publicSuppFileId' => $suppFile->getPublicSuppFileId());
     } else {
         $this->_data = array('type' => '', 'showReviewers' => 1);
     }
     return parent::initData();
 }
 /**
  * Initialize form data from current settings.
  */
 function initData(&$args, &$request)
 {
     $user =& $request->getUser();
     import('lib.pkp.classes.user.InterestManager');
     $interestManager = new InterestManager();
     $this->_data = array('salutation' => $user->getSalutation(), 'firstName' => $user->getFirstName(), 'middleName' => $user->getMiddleName(), 'initials' => $user->getInitials(), 'lastName' => $user->getLastName(), 'gender' => $user->getGender(), 'affiliation' => $user->getAffiliation(null), 'signature' => $user->getSignature(null), 'email' => $user->getEmail(), 'orcid' => $user->getData('orcid'), 'userUrl' => $user->getUrl(), 'phone' => $user->getPhone(), 'fax' => $user->getFax(), 'mailingAddress' => $user->getMailingAddress(), 'country' => $user->getCountry(), 'biography' => $user->getBiography(null), 'userLocales' => $user->getLocales(), 'isAuthor' => Validation::isAuthor(), 'isReader' => Validation::isReader(), 'isReviewer' => Validation::isReviewer(), 'interestsKeywords' => $interestManager->getInterestsForUser($user), 'interestsTextOnly' => $interestManager->getInterestsString($user));
     return parent::initData();
 }
 function initData()
 {
     parent::initData();
     // Provide preselected registration options to template, if available
     if ($this->_registration) {
         $registration =& $this->_registration;
         $registrationOptionDao =& DAORegistry::getDAO('RegistrationOptionDAO');
         $registrationOptionIds = $registrationOptionDao->getRegistrationOptions($registration->getRegistrationId());
         $this->_data['registrationOptionId'] = $registrationOptionIds;
     }
 }
Example #11
0
 /**
  * Initialize form data from current article.
  */
 function initData()
 {
     if (isset($this->article)) {
         $article =& $this->article;
         $this->_data = array('authors' => array(), 'title' => $article->getTitle(null), 'abstract' => $article->getAbstract(null), 'coverPageAltText' => $article->getCoverPageAltText(null), 'showCoverPage' => $article->getShowCoverPage(null), 'hideCoverPageToc' => $article->getHideCoverPageToc(null), 'hideCoverPageAbstract' => $article->getHideCoverPageAbstract(null), 'originalFileName' => $article->getOriginalFileName(null), 'fileName' => $article->getFileName(null), 'width' => $article->getWidth(null), 'height' => $article->getHeight(null), 'discipline' => $article->getDiscipline(null), 'subjectClass' => $article->getSubjectClass(null), 'subject' => $article->getSubject(null), 'coverageGeo' => $article->getCoverageGeo(null), 'coverageChron' => $article->getCoverageChron(null), 'coverageSample' => $article->getCoverageSample(null), 'type' => $article->getType(null), 'language' => $article->getLanguage(), 'sponsor' => $article->getSponsor(null), 'citations' => $article->getCitations(), 'hideAuthor' => $article->getHideAuthor());
         // consider the additional field names from the public identifer plugins
         import('classes.plugins.PubIdPluginHelper');
         $pubIdPluginHelper = new PubIdPluginHelper();
         $pubIdPluginHelper->init($this, $article);
         $authors =& $article->getAuthors();
         for ($i = 0, $count = count($authors); $i < $count; $i++) {
             array_push($this->_data['authors'], array('authorId' => $authors[$i]->getId(), 'firstName' => $authors[$i]->getFirstName(), 'middleName' => $authors[$i]->getMiddleName(), 'lastName' => $authors[$i]->getLastName(), 'affiliation' => $authors[$i]->getAffiliation(null), 'country' => $authors[$i]->getCountry(), 'countryLocalized' => $authors[$i]->getCountryLocalized(), 'email' => $authors[$i]->getEmail(), 'orcid' => $authors[$i]->getData('orcid'), 'url' => $authors[$i]->getUrl(), 'competingInterests' => $authors[$i]->getCompetingInterests(null), 'biography' => $authors[$i]->getBiography(null)));
             if ($authors[$i]->getPrimaryContact()) {
                 $this->setData('primaryContact', $i);
             }
         }
         if ($this->isEditor) {
             $this->setData('copyrightHolder', $article->getCopyrightHolder(null));
             $this->setData('copyrightYear', $article->getCopyrightYear());
             $this->setData('licenseURL', $article->getLicenseURL());
         }
     }
     return parent::initData();
 }
 /**
  * @copydoc Form::initData()
  */
 function initData($request)
 {
     parent::initData($request);
     $site = $request->getSite();
     $this->setData('installedLocales', $site->getInstalledLocales());
 }
 /**
  * Initialize form data from current subscription.
  */
 function initData()
 {
     if (isset($this->subscription)) {
         $subscription =& $this->subscription;
         $userDao =& DAORegistry::getDAO('UserDAO');
         if (isset($this->userId)) {
             $user =& $userDao->getUser($this->userId);
         } else {
             $user =& $userDao->getUser($subscription->getUserId());
         }
         $this->_data = array('status' => $subscription->getStatus(), 'userId' => $user->getId(), 'typeId' => $subscription->getTypeId(), 'dateStart' => $subscription->getDateStart(), 'dateEnd' => $subscription->getDateEnd(), 'username', $user->getUsername(), 'userSalutation', $user->getSalutation(), 'userFirstName', $user->getFirstName(), 'userMiddleName', $user->getMiddleName(), 'userLastName', $user->getLastName(), 'userInitials', $user->getInitials(), 'userGender', $user->getGender(), 'userAffiliation', $user->getAffiliation(null), 'orcid', $user->getData('orcid'), 'userUrl', $user->getUrl(), 'userEmail' => $user->getEmail(), 'userPhone' => $user->getPhone(), 'userFax' => $user->getFax(), 'userMailingAddress' => $user->getMailingAddress(), 'userCountry' => $user->getCountry(), 'membership' => $subscription->getMembership(), 'referenceNumber' => $subscription->getReferenceNumber(), 'notes' => $subscription->getNotes());
     }
     return parent::initData();
 }
Example #14
0
 /**
  * Initialize form data from current issue.
  * returns issue id that it initialized the page with
  */
 function initData($issueId = null)
 {
     $issueDao =& DAORegistry::getDAO('IssueDAO');
     // retrieve issue by id, if not specified, then select first unpublished issue
     if (isset($issueId)) {
         $issue =& $issueDao->getIssueById($issueId);
     }
     if (isset($issue)) {
         $this->issue =& $issue;
         $this->_data = array('title' => $issue->getTitle(null), 'volume' => $issue->getVolume(), 'number' => $issue->getNumber(), 'year' => $issue->getYear(), 'datePublished' => $issue->getDatePublished(), 'description' => $issue->getDescription(null), 'publicIssueId' => $issue->getPubId('publisher-id'), 'accessStatus' => $issue->getAccessStatus(), 'openAccessDate' => $issue->getOpenAccessDate(), 'showVolume' => $issue->getShowVolume(), 'showNumber' => $issue->getShowNumber(), 'showYear' => $issue->getShowYear(), 'showTitle' => $issue->getShowTitle(), 'fileName' => $issue->getFileName(null), 'originalFileName' => $issue->getOriginalFileName(null), 'coverPageDescription' => $issue->getCoverPageDescription(null), 'coverPageAltText' => $issue->getCoverPageAltText(null), 'showCoverPage' => $issue->getShowCoverPage(null), 'hideCoverPageArchives' => $issue->getHideCoverPageArchives(null), 'hideCoverPageCover' => $issue->getHideCoverPageCover(null), 'styleFileName' => $issue->getStyleFileName(), 'originalStyleFileName' => $issue->getOriginalStyleFileName());
         // consider the additional field names from the public identifer plugins
         import('classes.plugins.PubIdPluginHelper');
         $pubIdPluginHelper = new PubIdPluginHelper();
         $pubIdPluginHelper->init($this, $issue);
         parent::initData();
         return $issue->getId();
     } else {
         $journal =& Request::getJournal();
         $showVolume = $journal->getSetting('publicationFormatVolume');
         $showNumber = $journal->getSetting('publicationFormatNumber');
         $showYear = $journal->getSetting('publicationFormatYear');
         $showTitle = $journal->getSetting('publicationFormatTitle');
         $this->setData('showVolume', $showVolume);
         $this->setData('showNumber', $showNumber);
         $this->setData('showYear', $showYear);
         $this->setData('showTitle', $showTitle);
         // set up the default values for volume, number and year
         $issueDao =& DAORegistry::getDAO('IssueDAO');
         $issue = $issueDao->getLastCreatedIssue($journal->getId());
         if (isset($issue)) {
             $volumePerYear = $journal->getSetting('volumePerYear');
             $issuePerVolume = $journal->getSetting('issuePerVolume');
             $number = $issue->getNumber();
             $volume = $issue->getVolume();
             $year = $issue->getYear();
             if ($showVolume && $showNumber && $showYear) {
                 $number++;
                 if ($issuePerVolume && $number > $issuePerVolume) {
                     $number = 1;
                     $volume++;
                     if ($volumePerYear && $volume > $volumePerYear) {
                         $volume = 1;
                         $year++;
                     }
                 }
             } elseif ($showVolume && $showNumber) {
                 $number++;
                 if ($issuePerVolume && $number > $issuePerVolume) {
                     $number = 1;
                     $volume++;
                 }
             } elseif ($showVolume && $showYear) {
                 $number = 0;
                 $volume++;
                 if ($volumePerYear && $volume > $volumePerYear) {
                     $volume = 1;
                     $year++;
                 }
             } elseif ($showYear) {
                 $volume = $number = 0;
                 $year++;
             } else {
                 $year = $volume = $number = 0;
             }
         } else {
             $volume = $journal->getSetting('initialVolume');
             $number = $journal->getSetting('initialNumber');
             $year = $journal->getSetting('initialYear');
         }
         switch ($journal->getSetting('publishingMode')) {
             case PUBLISHING_MODE_SUBSCRIPTION:
             case PUBLISHING_MODE_NONE:
                 $accessStatus = ISSUE_ACCESS_SUBSCRIPTION;
                 break;
             case PUBLISHING_MODE_OPEN:
             default:
                 $accessStatus = ISSUE_ACCESS_OPEN;
                 break;
         }
         $this->_data = array('showVolume' => $showVolume, 'showNumber' => $showNumber, 'showYear' => $showYear, 'showTitle' => $showTitle, 'volume' => $volume, 'number' => $number, 'year' => $year, 'accessStatus' => $accessStatus);
     }
 }
Example #15
0
 /**
  * Initialize form data from current supplementary file (if applicable).
  */
 function initData()
 {
     if (isset($this->suppFile)) {
         $suppFile =& $this->suppFile;
         $this->_data = array('title' => $suppFile->getTitle(null), 'creator' => $suppFile->getCreator(null), 'subject' => $suppFile->getSubject(null), 'type' => $suppFile->getType(), 'typeOther' => $suppFile->getTypeOther(null), 'description' => $suppFile->getDescription(null), 'publisher' => $suppFile->getPublisher(null), 'sponsor' => $suppFile->getSponsor(null), 'dateCreated' => $suppFile->getDateCreated(), 'source' => $suppFile->getSource(null), 'language' => $suppFile->getLanguage(), 'showReviewers' => $suppFile->getShowReviewers() == 1 ? 1 : 0, 'publicSuppFileId' => $suppFile->getPubId('publisher-id'));
     } else {
         $this->_data = array('type' => '', 'showReviewers' => 1);
     }
     // consider the additional field names from the public identifer plugins
     import('classes.plugins.PubIdPluginHelper');
     $pubIdPluginHelper = new PubIdPluginHelper();
     $pubIdPluginHelper->init($this, $suppFile);
     return parent::initData();
 }
Example #16
0
 /**
  * Initialize form data from current issue.
  */
 function initData($request)
 {
     $this->_data = array('fileName' => $this->issue->getFileName(null), 'originalFileName' => $this->issue->getOriginalFileName(null), 'coverPageDescription' => $this->issue->getCoverPageDescription(null), 'coverPageAltText' => $this->issue->getCoverPageAltText(null), 'showCoverPage' => $this->issue->getShowCoverPage(null), 'hideCoverPageArchives' => $this->issue->getHideCoverPageArchives(null), 'hideCoverPageCover' => $this->issue->getHideCoverPageCover(null));
     parent::initData();
 }
Example #17
0
 /**
  * Initialize form data from the associated author.
  */
 function initData()
 {
     $queryDao = DAORegistry::getDAO('QueryDAO');
     if ($query = $this->getQuery()) {
         $headNote = $query->getHeadNote();
         $this->_data = array('queryId' => $query->getId(), 'subject' => $headNote ? $headNote->getTitle() : null, 'comment' => $headNote ? $headNote->getContents() : null, 'userIds' => $queryDao->getParticipantIds($query->getId()));
     } else {
         // set intial defaults for queries.
     }
     // in order to be able to use the hook
     return parent::initData();
 }
Example #18
0
 /**
  * Initialize form data from current settings.
  */
 function initData()
 {
     $journal =& Request::getJournal();
     $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
     $section =& $this->section;
     if (is_a($section, 'Section')) {
         $this->_data = array('title' => $section->getTitle(null), 'abbrev' => $section->getAbbrev(null), 'reviewFormId' => $section->getReviewFormId(), 'metaIndexed' => !$section->getMetaIndexed(), 'metaReviewed' => !$section->getMetaReviewed(), 'abstractsNotRequired' => $section->getAbstractsNotRequired(), 'identifyType' => $section->getIdentifyType(null), 'editorRestriction' => $section->getEditorRestricted(), 'hideTitle' => $section->getHideTitle(), 'hideAuthor' => $section->getHideAuthor(), 'hideAbout' => $section->getHideAbout(), 'disableComments' => $section->getDisableComments(), 'policy' => $section->getPolicy(null), 'assignedEditors' => $sectionEditorsDao->getEditorsBySectionId($journal->getId(), $section->getId()), 'unassignedEditors' => $sectionEditorsDao->getEditorsNotInSection($journal->getId(), $section->getId()), 'wordCount' => $section->getAbstractWordCount());
     } else {
         $this->_data = array('unassignedEditors' => $sectionEditorsDao->getEditorsNotInSection($journal->getId(), null));
     }
     parent::initData();
 }
Example #19
0
 /**
  * Initialize form data from the associated author.
  * @param $author Author
  */
 function initData()
 {
     $author = $this->getAuthor();
     if ($author) {
         $this->_data = array('authorId' => $author->getId(), 'firstName' => $author->getFirstName(), 'middleName' => $author->getMiddleName(), 'lastName' => $author->getLastName(), 'suffix' => $author->getSuffix(), 'affiliation' => $author->getAffiliation(null), 'country' => $author->getCountry(), 'email' => $author->getEmail(), 'userUrl' => $author->getUrl(), 'orcid' => $author->getOrcid(), 'userGroupId' => $author->getUserGroupId(), 'biography' => $author->getBiography(null), 'primaryContact' => $author->getPrimaryContact(), 'includeInBrowse' => $author->getIncludeInBrowse());
     } else {
         // assume authors should be listed unless otherwise specified.
         $this->_data = array('includeInBrowse' => true);
     }
     // in order to be able to use the hook
     return parent::initData();
 }
Example #20
0
 /**
  * Initialize form data from current issue.
  */
 function initData($request)
 {
     if (isset($this->issue)) {
         $this->_data = array('title' => $this->issue->getTitle(null), 'volume' => $this->issue->getVolume(), 'number' => $this->issue->getNumber(), 'year' => $this->issue->getYear(), 'datePublished' => $this->issue->getDatePublished(), 'description' => $this->issue->getDescription(null), 'publicIssueId' => $this->issue->getPubId('publisher-id'), 'accessStatus' => $this->issue->getAccessStatus(), 'openAccessDate' => $this->issue->getOpenAccessDate(), 'showVolume' => $this->issue->getShowVolume(), 'showNumber' => $this->issue->getShowNumber(), 'showYear' => $this->issue->getShowYear(), 'showTitle' => $this->issue->getShowTitle(), 'styleFileName' => $this->issue->getStyleFileName(), 'originalStyleFileName' => $this->issue->getOriginalStyleFileName());
         // consider the additional field names from the public identifer plugins
         import('classes.plugins.PubIdPluginHelper');
         $pubIdPluginHelper = new PubIdPluginHelper();
         $pubIdPluginHelper->init($this, $this->issue);
         parent::initData();
     } else {
         $journal = $request->getJournal();
         switch ($journal->getSetting('publishingMode')) {
             case PUBLISHING_MODE_SUBSCRIPTION:
             case PUBLISHING_MODE_NONE:
                 $accessStatus = ISSUE_ACCESS_SUBSCRIPTION;
                 break;
             case PUBLISHING_MODE_OPEN:
             default:
                 $accessStatus = ISSUE_ACCESS_OPEN;
                 break;
         }
         $this->_data = array('showVolume' => 1, 'showNumber' => 1, 'showYear' => 1, 'showTitle' => 1, 'accessStatus' => $accessStatus);
     }
 }
 /**
  * Initialize form data with the author name and the submission id.
  * @param $args array
  * @param $request PKPRequest
  */
 function initData($args, $request)
 {
     AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_APP_SUBMISSION);
     $this->_metadataFormImplem->initData($this->getSubmission());
     parent::initData();
 }
 /**
  * Initialize form data from current user profile.
  */
 function initData(&$args, &$request)
 {
     if (isset($this->userId)) {
         $userDao =& DAORegistry::getDAO('UserDAO');
         $user =& $userDao->getById($this->userId);
         import('lib.pkp.classes.user.InterestManager');
         $interestManager = new InterestManager();
         if ($user != null) {
             $this->_data = array('authId' => $user->getAuthId(), 'username' => $user->getUsername(), 'salutation' => $user->getSalutation(), 'firstName' => $user->getFirstName(), 'middleName' => $user->getMiddleName(), 'lastName' => $user->getLastName(), 'signature' => $user->getSignature(null), 'initials' => $user->getInitials(), 'gender' => $user->getGender(), 'affiliation' => $user->getAffiliation(null), 'email' => $user->getEmail(), 'orcid' => $user->getData('orcid'), 'userUrl' => $user->getUrl(), 'phone' => $user->getPhone(), 'fax' => $user->getFax(), 'mailingAddress' => $user->getMailingAddress(), 'country' => $user->getCountry(), 'biography' => $user->getBiography(null), 'interestsKeywords' => $interestManager->getInterestsForUser($user), 'interestsTextOnly' => $interestManager->getInterestsString($user), 'gossip' => $user->getGossip(null), 'userLocales' => $user->getLocales());
         } else {
             $this->userId = null;
         }
     }
     if (!isset($this->userId)) {
         $roleDao =& DAORegistry::getDAO('RoleDAO');
         $roleId = Request::getUserVar('roleId');
         $roleSymbolic = $roleDao->getRolePath($roleId);
         $this->_data = array('enrollAs' => array($roleSymbolic), 'generatePassword' => 1, 'sendNotify' => 1, 'mustChangePassword' => 1);
     }
     return parent::initData();
 }
Example #23
0
 /**
  * Initialize form data from current article.
  */
 function initData()
 {
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     if (isset($this->article)) {
         $article =& $this->article;
         // Initialize th proposal details
         $proposalDetails =& $article->getProposalDetails();
         $countriesArray = $proposalDetails->getCountries();
         $countries = explode(",", $countriesArray);
         $geoAreas = $proposalDetails->getGeoAreasArray();
         if ($geoAreas == null) {
             $geoAreas = array(0 => '');
         }
         $researchDomainsArray = $proposalDetails->getResearchDomainsArray();
         if ($researchDomainsArray == null) {
             $researchDomainsArray = array(0 => '');
         }
         $researchFieldsArray = $proposalDetails->getResearchFieldsArray();
         if ($researchFieldsArray == null) {
             $researchFieldsArray = array(0 => '');
         } else {
             $i = 0;
             foreach ($researchFieldsArray as $field) {
                 if (preg_match('#^Other\\s\\(.+\\)$#', $field)) {
                     $tempField = $field;
                     $field = preg_replace('#^Other\\s\\(.+\\)$#', 'OTHER', $field);
                     $tempField = preg_replace('#^Other\\s\\(#', '', $tempField);
                     $tempField = preg_replace('#\\)$#', '', $tempField);
                     $proposalDetails->setOtherResearchField($tempField);
                 }
                 $test = array($i => $field);
                 $researchFieldsArray = array_replace($researchFieldsArray, $test);
                 $i++;
                 unset($field);
             }
         }
         $proposalTypesArray = $proposalDetails->getProposalTypesArray();
         if ($proposalTypesArray == null) {
             $proposalTypesArray = array(0 => '');
         } else {
             $f = 0;
             foreach ($proposalTypesArray as $type) {
                 if (preg_match('#^Other\\s\\(.+\\)$#', $type)) {
                     $tempType = $type;
                     $type = preg_replace('#^Other\\s\\(.+\\)$#', 'OTHER', $type);
                     $tempType = preg_replace('#^Other\\s\\(#', '', $tempType);
                     $tempType = preg_replace('#\\)$#', '', $tempType);
                     $proposalDetails->setOtherProposalType($tempType);
                 }
                 $test2 = array($f => $type);
                 $proposalTypesArray = array_replace($proposalTypesArray, $test2);
                 $f++;
                 unset($type);
             }
         }
         $committeeReviewed = $proposalDetails->getCommitteeReviewed();
         if ($committeeReviewed == "2" || $committeeReviewed == "3") {
             $reviewedByOtherErc = "2";
             $otherErcDecision = $committeeReviewed;
         } elseif ($committeeReviewed == "1") {
             $reviewedByOtherErc = $committeeReviewed;
             $otherErcDecision = $committeeReviewed;
         } else {
             $reviewedByOtherErc = null;
             $otherErcDecision = "1";
         }
         $proposalDetailsArray = array('studentInitiatedResearch' => $proposalDetails->getStudentResearch(), 'startDate' => $proposalDetails->getStartDate(), 'endDate' => $proposalDetails->getEndDate(), 'keyImplInstitution' => $proposalDetails->getKeyImplInstitution(), 'multiCountryResearch' => $proposalDetails->getMultiCountryResearch(), 'countries' => $countries, 'nationwide' => $proposalDetails->getNationwide(), 'geoAreas' => $geoAreas, 'researchDomains' => $researchDomainsArray, 'researchFields' => $researchFieldsArray, 'otherResearchField' => $proposalDetails->getOtherResearchField(), 'withHumanSubjects' => $proposalDetails->getHumanSubjects(), 'proposalTypes' => $proposalTypesArray, 'otherProposalType' => $proposalDetails->getOtherProposalType(), 'dataCollection' => $proposalDetails->getDataCollection(), 'reviewedByOtherErc' => $reviewedByOtherErc, 'otherErcDecision' => $otherErcDecision);
         // Student research
         $studentResearch =& $proposalDetails->getStudentResearchInfo();
         $studentResearchArray = array('studentInstitution' => $studentResearch->getInstitution(), 'academicDegree' => $studentResearch->getDegree(), 'supervisorName' => $studentResearch->getSupervisorName(), 'supervisorEmail' => $studentResearch->getSupervisorEmail());
         // Risk Assessments
         $riskAssessment =& $article->getRiskAssessment();
         $riskAssessmentArray = array('identityRevealed' => $riskAssessment->getIdentityRevealed(), 'unableToConsent' => $riskAssessment->getUnableToConsent(), 'under18' => $riskAssessment->getUnder18(), 'dependentRelationship' => $riskAssessment->getDependentRelationship(), 'ethnicMinority' => $riskAssessment->getEthnicMinority(), 'impairment' => $riskAssessment->getImpairment(), 'pregnant' => $riskAssessment->getPregnant(), 'newTreatment' => $riskAssessment->getNewTreatment(), 'bioSamples' => $riskAssessment->getBioSamples(), 'exportHumanTissue' => $riskAssessment->getExportHumanTissue(), 'exportReason' => $riskAssessment->getExportReason(), 'radiation' => $riskAssessment->getRadiation(), 'distress' => $riskAssessment->getDistress(), 'inducements' => $riskAssessment->getInducements(), 'sensitiveInfo' => $riskAssessment->getSensitiveInfo(), 'reproTechnology' => $riskAssessment->getReproTechnology(), 'genetic' => $riskAssessment->getGenetic(), 'stemCell' => $riskAssessment->getStemCell(), 'biosafety' => $riskAssessment->getBiosafety(), 'riskLevel' => $riskAssessment->getRiskLevel(), 'listRisks' => $riskAssessment->getListRisks(), 'howRisksMinimized' => $riskAssessment->getHowRisksMinimized(), 'risksToTeam' => $riskAssessment->getRisksToTeam(), 'risksToSubjects' => $riskAssessment->getRisksToSubjects(), 'risksToCommunity' => $riskAssessment->getRisksToCommunity(), 'benefitsToParticipants' => $riskAssessment->getBenefitsToParticipants(), 'knowledgeOnCondition' => $riskAssessment->getKnowledgeOnCondition(), 'knowledgeOnDisease' => $riskAssessment->getKnowledgeOnDisease(), 'conflictOfInterest' => $riskAssessment->getConflictOfInterest(), 'multiInstitutions' => $riskAssessment->getMultiInstitutions());
         $this->_data = array('authors' => array(), 'abstracts' => array(), 'proposalDetails' => $proposalDetailsArray, 'sources' => array(), 'studentResearch' => $studentResearchArray, 'riskAssessment' => $riskAssessmentArray, 'section' => $sectionDao->getSection($article->getSectionId()));
         $authors =& $article->getAuthors();
         for ($i = 0, $count = count($authors); $i < $count; $i++) {
             array_push($this->_data['authors'], array('authorId' => $authors[$i]->getId(), 'firstName' => $authors[$i]->getFirstName(), 'middleName' => $authors[$i]->getMiddleName(), 'lastName' => $authors[$i]->getLastName(), 'affiliation' => $authors[$i]->getAffiliation(), 'phone' => $authors[$i]->getPhoneNumber(), 'email' => $authors[$i]->getEmail()));
             if ($authors[$i]->getPrimaryContact()) {
                 $this->setData('primaryContact', $i);
             }
         }
         $sources =& $article->getSources();
         if (empty($sources)) {
             array_push($sources, new ProposalSource());
         }
         for ($i = 0, $count = count($sources); $i < $count; $i++) {
             array_push($this->_data['sources'], array('sourceId' => $sources[$i]->getSourceId(), 'institution' => $sources[$i]->getInstitutionId(), 'amount' => $sources[$i]->getSourceAmount()));
         }
         $journal = Request::getJournal();
         $abstracts =& $article->getAbstracts();
         foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) {
             if (isset($abstracts[$localeKey])) {
                 $this->_data['abstracts'][$localeKey] = array('abstractId' => $abstracts[$localeKey]->getAbstractId(), 'scientificTitle' => $abstracts[$localeKey]->getScientificTitle(), 'publicTitle' => $abstracts[$localeKey]->getPublicTitle(), 'background' => $abstracts[$localeKey]->getBackground(), 'objectives' => $abstracts[$localeKey]->getObjectives(), 'studyMethods' => $abstracts[$localeKey]->getStudyMethods(), 'expectedOutcomes' => $abstracts[$localeKey]->getExpectedOutcomes(), 'keywords' => $abstracts[$localeKey]->getKeywords());
             }
         }
     }
     return parent::initData();
 }
Example #24
0
 /**
  * Initialize form data from current article.
  */
 function initData()
 {
     if (isset($this->article)) {
         $article =& $this->article;
         $this->_data = array('authors' => array(), 'title' => $article->getTitle(null), 'abstract' => $article->getAbstract(null), 'coverPageAltText' => $article->getCoverPageAltText(null), 'showCoverPage' => $article->getShowCoverPage(null), 'hideCoverPageToc' => $article->getHideCoverPageToc(null), 'hideCoverPageAbstract' => $article->getHideCoverPageAbstract(null), 'originalFileName' => $article->getOriginalFileName(null), 'fileName' => $article->getFileName(null), 'width' => $article->getWidth(null), 'height' => $article->getHeight(null), 'discipline' => $article->getDiscipline(null), 'subjectClass' => $article->getSubjectClass(null), 'subject' => $article->getSubject(null), 'coverageGeo' => $article->getCoverageGeo(null), 'coverageChron' => $article->getCoverageChron(null), 'coverageSample' => $article->getCoverageSample(null), 'type' => $article->getType(null), 'language' => $article->getLanguage(), 'sponsor' => $article->getSponsor(null), 'citations' => $article->getCitations(), 'hideAuthor' => $article->getHideAuthor());
         $authors =& $article->getAuthors();
         for ($i = 0, $count = count($authors); $i < $count; $i++) {
             array_push($this->_data['authors'], array('authorId' => $authors[$i]->getId(), 'firstName' => $authors[$i]->getFirstName(), 'middleName' => $authors[$i]->getMiddleName(), 'lastName' => $authors[$i]->getLastName(), 'affiliation' => $authors[$i]->getAffiliation(), 'country' => $authors[$i]->getCountry(), 'countryLocalized' => $authors[$i]->getCountryLocalized(), 'email' => $authors[$i]->getEmail(), 'url' => $authors[$i]->getUrl(), 'competingInterests' => $authors[$i]->getCompetingInterests(null), 'biography' => $authors[$i]->getBiography(null)));
             if ($authors[$i]->getPrimaryContact()) {
                 $this->setData('primaryContact', $i);
             }
         }
     }
     return parent::initData();
 }