当前位置: 首页>>代码示例>>PHP>>正文


PHP Author::setBiography方法代码示例

本文整理汇总了PHP中Author::setBiography方法的典型用法代码示例。如果您正苦于以下问题:PHP Author::setBiography方法的具体用法?PHP Author::setBiography怎么用?PHP Author::setBiography使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Author的用法示例。


在下文中一共展示了Author::setBiography方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

    // Reset types
    $types = Input::Get('type', 'array', array());
    AuthorAssignedType::ResetAuthorAssignedTypes($author->getId());
    foreach ($types as $type) {
        $author->setType($type);
    }
    $author->setSkype(Input::Get('skype'));
    $author->setJabber(Input::Get('jabber'));
    $author->setAim(Input::Get('aim'));
    $author->setEmail(Input::Get('email'));
    $authorBiography = array();
    $authorBiography['biography'] = Input::Get("txt_biography", "string");
    $authorBiography['language'] = Input::Get("lang", "int", 0);
    $authorBiography['first_name'] = Input::Get("lang_first_name");
    $authorBiography['last_name'] = Input::Get("lang_last_name");
    $author->setBiography($authorBiography);
    if ($uploadFileSpecified) {
        $attributes = array();
        $image = Image::OnImageUpload($_FILES['file'], $attributes);
        if (PEAR::isError($image)) {
            camp_html_add_msg($image->getMessage());
        } else {
            $author->setImage($image->getImageId());
        }
    }
    $aliases = Input::Get("alias", "array");
    if (!empty($aliases)) {
        $author->setAliases($aliases);
    }
    camp_html_add_msg($translator->trans("Author saved.", array(), 'users'), "ok");
} elseif ($del_id_alias < 1 && $id > -1 && !$can_save) {
开发者ID:kartoffelkage,项目名称:Newscoop,代码行数:31,代码来源:authors.php

示例2: execute

 /**
  * Save author
  * @see Form::execute()
  * @see Form::execute()
  */
 function execute()
 {
     $authorDao = DAORegistry::getDAO('AuthorDAO');
     $submission = $this->getSubmission();
     $author = $this->getAuthor();
     if (!$author) {
         // this is a new submission contributor
         $author = new Author();
         $author->setSubmissionId($submission->getId());
         $existingAuthor = false;
     } else {
         $existingAuthor = true;
         if ($submission->getId() !== $author->getSubmissionId()) {
             fatalError('Invalid author!');
         }
     }
     $author->setFirstName($this->getData('firstName'));
     $author->setMiddleName($this->getData('middleName'));
     $author->setLastName($this->getData('lastName'));
     $author->setSuffix($this->getData('suffix'));
     $author->setAffiliation($this->getData('affiliation'), null);
     // localized
     $author->setCountry($this->getData('country'));
     $author->setEmail($this->getData('email'));
     $author->setUrl($this->getData('userUrl'));
     $author->setOrcid($this->getData('orcid'));
     $author->setUserGroupId($this->getData('userGroupId'));
     $author->setBiography($this->getData('biography'), null);
     // localized
     $author->setPrimaryContact($this->getData('primaryContact') ? true : false);
     $author->setIncludeInBrowse($this->getData('includeInBrowse') ? true : false);
     // in order to be able to use the hook
     parent::execute();
     if ($existingAuthor) {
         $authorDao->updateObject($author);
         $authorId = $author->getId();
     } else {
         $authorId = $authorDao->insertObject($author);
     }
     return $authorId;
 }
开发者ID:selwyntcy,项目名称:pkp-lib,代码行数:46,代码来源:AuthorForm.inc.php

示例3: execute

 /**
  * Save changes to article.
  * @return int the article ID
  */
 function execute()
 {
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     if (isset($this->article)) {
         // Update existing article
         $this->article->setSectionId($this->getData('sectionId'));
         $this->article->setLocale($this->getData('locale'));
         $this->article->setCommentsToEditor($this->getData('commentsToEditor'));
         if ($this->article->getSubmissionProgress() <= $this->step) {
             $this->article->stampStatusModified();
             $this->article->setSubmissionProgress($this->step + 1);
         }
         $articleDao->updateArticle($this->article);
     } else {
         // Insert new article
         $journal =& $this->request->getJournal();
         $user =& $this->request->getUser();
         $this->article = new Article();
         $this->article->setLocale($this->getData('locale'));
         $this->article->setUserId($user->getId());
         $this->article->setJournalId($journal->getId());
         $this->article->setSectionId($this->getData('sectionId'));
         $this->article->stampStatusModified();
         $this->article->setSubmissionProgress($this->step + 1);
         $this->article->setLanguage(String::substr($this->article->getLocale(), 0, 2));
         $this->article->setCommentsToEditor($this->getData('commentsToEditor'));
         $articleDao->insertArticle($this->article);
         $this->articleId = $this->article->getId();
         // Set user to initial author
         $authorDao =& DAORegistry::getDAO('AuthorDAO');
         /* @var $authorDao AuthorDAO */
         $user =& $this->request->getUser();
         $author = new Author();
         $author->setSubmissionId($this->articleId);
         $author->setFirstName($user->getFirstName());
         $author->setMiddleName($user->getMiddleName());
         $author->setLastName($user->getLastName());
         $author->setAffiliation($user->getAffiliation(null), null);
         $author->setCountry($user->getCountry());
         $author->setEmail($user->getEmail());
         $author->setData('orcid', $user->getData('orcid'));
         $author->setUrl($user->getUrl());
         $author->setBiography($user->getBiography(null), null);
         $author->setPrimaryContact(1);
         $authorDao->insertAuthor($author);
     }
     return $this->articleId;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:52,代码来源:AuthorSubmitStep1Form.inc.php

示例4: getPublishedPaperAuthors

 /**
  * Retrieve all authors from published papers
  * @param $schedConfId int
  * @return $authors array Author Objects
  */
 function getPublishedPaperAuthors($schedConfId)
 {
     $authors = array();
     $result =& $this->retrieve('SELECT aa.* FROM paper_authors aa, published_papers pa WHERE aa.paper_id = pa.paper_id AND pa.sched_conf_id = ? ORDER BY pa.sched_conf_id', $schedConfId);
     while (!$result->EOF) {
         $row = $result->GetRowAssoc(false);
         $author = new Author();
         $author->setId($row['author_id']);
         $author->setPaperId($row['paper_id']);
         $author->setFirstName($row['first_name']);
         $author->setMiddleName($row['middle_name']);
         $author->setLastName($row['last_name']);
         $author->setAffiliation($row['affiliation']);
         $author->setEmail($row['email']);
         $author->setBiography($row['biography']);
         $author->setPrimaryContact($row['primary_contact']);
         $author->setSequence($row['seq']);
         $authors[] = $author;
         $result->moveNext();
     }
     $result->Close();
     unset($result);
     return $authors;
 }
开发者ID:sedici,项目名称:ocs,代码行数:29,代码来源:PublishedPaperDAO.inc.php

示例5: getPublishedPaperAuthors

    /**
     * Retrieve all authors from published papers
     * @param $schedConfId int
     * @return $authors array Author Objects
     */
    function getPublishedPaperAuthors($schedConfId)
    {
        $primaryLocale = AppLocale::getPrimaryLocale();
        $locale = AppLocale::getLocale();
        $authors = array();
        $result =& $this->retrieve('SELECT	aa.*,
				aspl.setting_value AS affiliation_pl,
				asl.setting_value AS affiliation_l
			FROM	authors aa
				LEFT JOIN published_papers pa ON (pa.paper_id = aa.submission_id)
				LEFT JOIN author_settings aspl ON (aspl.author_id = aa.author_id AND aspl.setting_name = ? AND aspl.locale = ?)
				LEFT JOIN author_settings asl ON (asl.author_id = aa.author_id AND asl.setting_name = ? AND asl.locale = ?)
			WHERE	pa.sched_conf_id = ?', array('affiliation', $primaryLocale, 'affiliation', $locale, (int) $schedConfId));
        while (!$result->EOF) {
            $row = $result->GetRowAssoc(false);
            $author = new Author();
            $author->setId($row['author_id']);
            $author->setSubmissionId($row['paper_id']);
            $author->setFirstName($row['first_name']);
            $author->setMiddleName($row['middle_name']);
            $author->setLastName($row['last_name']);
            $author->setAffiliation($row['affiliation_pl'], $primaryLocale);
            $author->setAffiliation($row['affiliation_l'], $locale);
            $author->setEmail($row['email']);
            $author->setBiography($row['biography']);
            $author->setPrimaryContact($row['primary_contact']);
            $author->setSequence($row['seq']);
            $authors[] = $author;
            $result->moveNext();
        }
        $result->Close();
        unset($result);
        return $authors;
    }
开发者ID:artkuo,项目名称:ocs,代码行数:39,代码来源:PublishedPaperDAO.inc.php

示例6: execute

 /**
  * Save changes to submission.
  * @return int the monograph ID
  */
 function execute()
 {
     $monographDao =& DAORegistry::getDAO('MonographDAO');
     if (isset($this->monograph)) {
         // Update existing monograph
         $this->monograph->setSeriesId($this->getData('seriesId'));
         $this->monograph->setLocale($this->getData('locale'));
         $this->monograph->setCommentsToEditor($this->getData('commentsToEditor'));
         if ($this->monograph->getSubmissionProgress() <= $this->step) {
             $this->monograph->stampStatusModified();
             $this->monograph->setSubmissionProgress($this->step + 1);
         }
         $monographDao->updateMonograph($this->monograph);
     } else {
         $press =& Request::getPress();
         $user =& Request::getUser();
         // Get the session and the user group id currently used
         $sessionMgr =& SessionManager::getManager();
         $session =& $sessionMgr->getUserSession();
         // Create new monograph
         $this->monograph = new Monograph();
         $this->monograph->setLocale($this->getData('locale'));
         $this->monograph->setUserId($user->getId());
         $this->monograph->setPressId($press->getId());
         $this->monograph->setSeriesId($this->getData('seriesId'));
         $this->monograph->stampStatusModified();
         $this->monograph->setSubmissionProgress($this->step + 1);
         $this->monograph->setLanguage(String::substr($this->monograph->getLocale(), 0, 2));
         $this->monograph->setCommentsToEditor($this->getData('commentsToEditor'));
         $this->monograph->setWorkType($this->getData('isEditedVolume') ? WORK_TYPE_EDITED_VOLUME : WORK_TYPE_AUTHORED_WORK);
         $this->monograph->setCurrentStageId(WORKFLOW_STAGE_ID_SUBMISSION);
         // Get a default user group id for an Author
         $userGroupDao =& DAORegistry::getDAO('UserGroupDAO');
         $defaultAuthorGroup =& $userGroupDao->getDefaultByRoleId($press->getId(), ROLE_ID_AUTHOR);
         // Set user to initial author
         $authorDao =& DAORegistry::getDAO('AuthorDAO');
         $user =& Request::getUser();
         $author = new Author();
         $author->setFirstName($user->getFirstName());
         $author->setMiddleName($user->getMiddleName());
         $author->setLastName($user->getLastName());
         $author->setAffiliation($user->getAffiliation(null), null);
         $author->setCountry($user->getCountry());
         $author->setEmail($user->getEmail());
         $author->setUrl($user->getUrl());
         $author->setUserGroupId($defaultAuthorGroup->getId());
         $author->setBiography($user->getBiography(null), null);
         $author->setPrimaryContact(1);
         $monographDao->insertMonograph($this->monograph);
         $this->monographId = $this->monograph->getId();
         $author->setSubmissionId($this->monographId);
         $authorDao->insertAuthor($author);
     }
     return $this->monographId;
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:59,代码来源:SubmissionSubmitStep1Form.inc.php

示例7: execute


//.........这里部分代码省略.........
         $article->setFileName($newFileName, $this->getFormLocale());
         // Store the image dimensions.
         list($width, $height) = getimagesize($publicFileManager->getJournalFilesPath($journal->getId()) . '/' . $newFileName);
         $article->setWidth($width, $this->getFormLocale());
         $article->setHeight($height, $this->getFormLocale());
     }
     $article->setCoverPageAltText($this->getData('coverPageAltText'), null);
     // Localized
     $showCoverPage = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('showCoverPage'));
     foreach (array_keys($this->getData('coverPageAltText')) as $locale) {
         if (!array_key_exists($locale, $showCoverPage)) {
             $showCoverPage[$locale] = 0;
         }
     }
     $article->setShowCoverPage($showCoverPage, null);
     // Localized
     $hideCoverPageToc = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageToc'));
     foreach (array_keys($this->getData('coverPageAltText')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageToc)) {
             $hideCoverPageToc[$locale] = 0;
         }
     }
     $article->setHideCoverPageToc($hideCoverPageToc, null);
     // Localized
     $hideCoverPageAbstract = array_map(create_function('$arrayElement', 'return (int)$arrayElement;'), (array) $this->getData('hideCoverPageAbstract'));
     foreach (array_keys($this->getData('coverPageAltText')) as $locale) {
         if (!array_key_exists($locale, $hideCoverPageAbstract)) {
             $hideCoverPageAbstract[$locale] = 0;
         }
     }
     $article->setHideCoverPageAbstract($hideCoverPageAbstract, 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'));
     // Localized
     $article->setSponsor($this->getData('sponsor'), null);
     // Localized
     $article->setCitations($this->getData('citations'));
     if ($this->isEditor) {
         $article->setHideAuthor($this->getData('hideAuthor') ? $this->getData('hideAuthor') : 0);
     }
     // 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->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);
                 // Localized
             }
             $author->setBiography($authors[$i]['biography'], null);
             // Localized
             $author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0);
             $author->setSequence($authors[$i]['seq']);
             if ($isExistingAuthor == false) {
                 $article->addAuthor($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);
     // Update search index
     import('search.ArticleSearchIndex');
     ArticleSearchIndex::indexArticleMetadata($article);
     return $article->getId();
 }
开发者ID:philschatz,项目名称:ojs,代码行数:101,代码来源:MetadataForm.inc.php

示例8: execute


//.........这里部分代码省略.........
         }
     }
     $article->setHideCoverPageAbstract($hideCoverPageAbstract, 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'));
     // Localized
     $article->setSponsor($this->getData('sponsor'), null);
     // Localized
     $article->setCitations($this->getData('citations'));
     if ($this->isEditor) {
         $article->setHideAuthor($this->getData('hideAuthor') ? $this->getData('hideAuthor') : 0);
     }
     // consider the additional field names from the public identifer plugins
     import('classes.plugins.PubIdPluginHelper');
     $pubIdPluginHelper = new PubIdPluginHelper();
     $pubIdPluginHelper->execute($this, $article);
     // 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
             if (checkPhpVersion('5.0.0')) {
                 // *5488* PHP4 Requires explicit instantiation-by-reference
                 $author = new Author();
             } else {
                 $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);
             // Localized
             $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);
                 // Localized
             }
             $author->setBiography($authors[$i]['biography'], null);
             // Localized
             $author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0);
             $author->setSequence($authors[$i]['seq']);
             HookRegistry::call('Submission::Form::MetadataForm::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());
     }
     if ($this->isEditor) {
         $article->setCopyrightHolder($this->getData('copyrightHolder'), null);
         $article->setCopyrightYear($this->getData('copyrightYear'));
         $article->setLicenseURL($this->getData('licenseURL'));
     }
     parent::execute();
     // Save the article
     $articleDao->updateArticle($article);
     // Update search index
     import('classes.search.ArticleSearchIndex');
     $articleSearchIndex = new ArticleSearchIndex();
     $articleSearchIndex->articleMetadataChanged($article);
     $articleSearchIndex->articleChangesFinished();
     // Update references list if it changed.
     $rawCitationList = $article->getCitations();
     if ($previousRawCitationList != $rawCitationList) {
         $citationDao->importCitations($request, ASSOC_TYPE_ARTICLE, $article->getId(), $rawCitationList);
     }
     return $article->getId();
 }
开发者ID:EreminDm,项目名称:water-cao,代码行数:101,代码来源:MetadataForm.inc.php

示例9: execute

 /**
  * 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;
 }
开发者ID:philschatz,项目名称:ojs,代码行数:79,代码来源:AuthorSubmitStep3Form.inc.php

示例10: getPublishedArticleAuthors

    /**
     * Retrieve all authors from published articles
     * @param $issueId int
     * @return $authors array Author Objects
     */
    function getPublishedArticleAuthors($issueId)
    {
        $primaryLocale = Locale::getPrimaryLocale();
        $locale = Locale::getLocale();
        $authors = array();
        $result =& $this->retrieve('SELECT	aa.*
			FROM	authors aa
				LEFT JOIN published_articles pa ON (pa.article_id = aa.submission_id)
			WHERE	pa.issue_id = ? ORDER BY pa.issue_id', (int) $issueId);
        while (!$result->EOF) {
            $row = $result->GetRowAssoc(false);
            $author = new Author();
            $author->setId($row['author_id']);
            $author->setSubmissionId($row['article_id']);
            $author->setFirstName($row['first_name']);
            $author->setMiddleName($row['middle_name']);
            $author->setLastName($row['last_name']);
            $author->setAffiliation($row['affiliation_pl'], $primaryLocale);
            $author->setAffiliation($row['affiliation_l'], $locale);
            $author->setEmail($row['email']);
            $author->setBiography($row['biography']);
            $author->setPrimaryContact($row['primary_contact']);
            $author->setSequence($row['seq']);
            $authors[] = $author;
            $result->moveNext();
        }
        $result->Close();
        unset($result);
        return $authors;
    }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:35,代码来源:PublishedArticleDAO.inc.php

示例11: execute

 /**
  * 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);
             }
         }
//.........这里部分代码省略.........
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:101,代码来源:PaperPackageEdForm.inc.php

示例12: execute

 /**
  * Save submissionContributor
  * @see Form::execute()
  * @see Form::execute()
  */
 function execute()
 {
     $authorDao =& DAORegistry::getDAO('AuthorDAO');
     $monograph = $this->getMonograph();
     $submissionContributor =& $this->getSubmissionContributor();
     if (!$submissionContributor) {
         // this is a new submission contributor
         $submissionContributor = new Author();
         $submissionContributor->setMonographId($monograph->getId());
         $existingSubmissionContributor = false;
     } else {
         $existingSubmissionContributor = true;
     }
     assert($monograph->getId() == $submissionContributor->getMonographId());
     $submissionContributor->setFirstName($this->getData('firstName'));
     $submissionContributor->setMiddleName($this->getData('middleName'));
     $submissionContributor->setLastName($this->getData('lastName'));
     $submissionContributor->setAffiliation($this->getData('affiliation'), Locale::getLocale());
     // localized
     $submissionContributor->setCountry($this->getData('country'));
     $submissionContributor->setEmail($this->getData('email'));
     $submissionContributor->setUrl($this->getData('url'));
     $submissionContributor->setUserGroupId($this->getData('userGroupId'));
     $submissionContributor->setBiography($this->getData('biography'), Locale::getLocale());
     // localized
     $submissionContributor->setPrimaryContact($this->getData('primaryContact') ? true : false);
     if ($existingSubmissionContributor) {
         $authorDao->updateAuthor($submissionContributor);
         $authorId = $submissionContributor->getId();
     } else {
         $authorId = $authorDao->insertAuthor($submissionContributor);
     }
     return $authorId;
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:39,代码来源:SubmissionContributorForm.inc.php

示例13: execute

 /**
  * Save changes to article.
  * @return int the article ID
  */
 function execute()
 {
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     if (isset($this->article)) {
         // Update existing article
         $this->article->setLocale($this->getData('locale'));
         $this->article->setCommentsToEditor($this->getData('commentsToEditor'));
         if ($this->article->getSubmissionProgress() <= $this->step) {
             $this->article->stampStatusModified();
             $this->article->setSubmissionProgress($this->step + 1);
         }
         $lastSectionDecision = $this->article->getLastSectionDecision();
         $lastSectionDecision->setSectionId($this->getData('sectionId'));
         $authorSubmissionDao->updateAuthorSubmission($this->article);
     } else {
         // Insert new article
         $journal =& Request::getJournal();
         $user =& Request::getUser();
         $this->article = new AuthorSubmission();
         $this->article->setLocale($this->getData('locale'));
         $this->article->setUserId($user->getId());
         $this->article->setJournalId($journal->getId());
         $this->article->stampStatusModified();
         $this->article->setSubmissionProgress($this->step + 1);
         $this->article->setLanguage(String::substr($this->article->getLocale(), 0, 2));
         $this->article->setCommentsToEditor($this->getData('commentsToEditor'));
         // Set new Section Decision
         $sectionDecision =& new SectionDecision();
         $sectionDecision->setReviewType(REVIEW_TYPE_INITIAL);
         $sectionDecision->setRound(1);
         $sectionDecision->setSectionId($this->getData('sectionId'));
         $sectionDecision->setDecision(0);
         $sectionDecision->setDateDecided(date(Core::getCurrentDate()));
         $this->article->addDecision($sectionDecision);
         // Set user to initial author
         $author = new Author();
         $author->setFirstName($user->getFirstName());
         $author->setMiddleName($user->getMiddleName());
         $author->setLastName($user->getLastName());
         $author->setAffiliation($user->getLocalizedAffiliation());
         $author->setEmail($user->getEmail());
         $author->setPhoneNumber($user->getPhone());
         $author->setBiography($user->getBiography(null), null);
         $author->setPrimaryContact(1);
         $this->article->addAuthor($author);
         $authorSubmissionDao->insertAuthorSubmission($this->article);
         $this->articleId = $this->article->getId();
     }
     return $this->articleId;
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:54,代码来源:AuthorSubmitStep1Form.inc.php

示例14: execute

 /**
  * 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;
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:92,代码来源:AuthorSubmitStep3Form.inc.php

示例15: execute

 /**
  * 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();
//.........这里部分代码省略.........
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:101,代码来源:QuickSubmitForm.inc.php


注:本文中的Author::setBiography方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。