本文整理汇总了PHP中Author::setSequence方法的典型用法代码示例。如果您正苦于以下问题:PHP Author::setSequence方法的具体用法?PHP Author::setSequence怎么用?PHP Author::setSequence使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Author
的用法示例。
在下文中一共展示了Author::setSequence方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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();
}
示例4: execute
/**
* Save changes to article.
* @param $request Request
* @return int the article ID
*/
function execute(&$request)
{
$articleDao =& DAORegistry::getDAO('ArticleDAO');
$article =& $this->article;
$articleSitesData = $this->getData('articleSites');
$articleSites = $article->getArticleSites();
import('classes.journal.TrialSite');
import('classes.article.ArticleSite');
// Remove deleted article sites
foreach ($articleSites as $articleSite) {
$isPresent = false;
foreach ($articleSitesData as $articleSiteData) {
if (!empty($articleSiteData['id'])) {
if ($articleSite->getId() == $articleSiteData['id']) {
$isPresent = true;
}
}
}
if (!$isPresent) {
$article->removeArticleSite($articleSite->getId());
}
unset($isPresent);
unset($articleSite);
}
// Update / Insters article sites
foreach ($articleSitesData as $articleSiteData) {
if (isset($articleSiteData['id'])) {
$articleSite = $article->getArticleSite($articleSiteData['id']);
$isExistingSite = true;
} else {
$articleSite = new ArticleSite();
$isExistingSite = false;
}
$articleSite->setArticleId($article->getId());
if ($articleSiteData['siteSelect'] == "OTHER") {
$trialSite = new TrialSite();
$trialSite->setName($articleSiteData['siteName']);
$trialSite->setAddress($articleSiteData['siteAddress']);
$trialSite->setCity($articleSiteData['siteCity']);
$trialSite->setRegion($articleSiteData['siteRegion']);
$trialSite->setLicensure($articleSiteData['siteLicensure']);
$trialSite->setAccreditation($articleSiteData['siteAccreditation']);
$articleSite->setSiteId($this->trialSiteDao->insertTrialSite($trialSite));
} else {
$articleSite->setSiteId($articleSiteData['siteSelect']);
}
$articleSite->setAuthority($articleSiteData['authority']);
$articleSite->setERCId($articleSiteData['erc']);
$articleSite->setPrimaryPhone($articleSiteData['primaryPhone']);
$articleSite->setSecondaryPhone($articleSiteData['secondaryPhone']);
$articleSite->setFax($articleSiteData['fax']);
$articleSite->setEmail($articleSiteData['email']);
$articleSite->setSubjectsNumber($articleSiteData['subjectsNumber']);
$investigatorsData = $articleSiteData['investigators'];
$investigators = $articleSite->getInvestigators();
// Remove deleted investigators
foreach ($investigators as $investigator) {
$isPresent = false;
foreach ($investigatorsData as $investigatorData) {
if (!empty($investigatorData['id'])) {
if ($investigator->getId() == $investigatorData['id']) {
$isPresent = true;
}
}
}
if (!$isPresent) {
$articleSite->removeInvestigator($investigator->getId());
}
unset($isPresent);
unset($investigator);
}
// Update / Insert Investigators
$investigatorIterator = 1;
foreach ($investigatorsData as $investigatorData) {
if (isset($investigatorData['id'])) {
$investigator = $articleSite->getInvestigator($investigatorData['id']);
} else {
$investigator = new Author();
}
if ($isExistingSite) {
$investigator->setSiteId($articleSite->getId());
}
if ($investigatorIterator == 1) {
$investigator->setPrimaryContact(1);
}
$investigator->setSequence($investigatorIterator);
$investigator->setFirstName($investigatorData['firstName']);
$investigator->setLastName($investigatorData['lastName']);
$investigator->setExpertise($investigatorData['expertise']);
$investigator->setPrimaryPhoneNumber($investigatorData['iPrimaryPhone']);
$investigator->setSecondaryPhoneNumber($investigatorData['iSecondaryPhone']);
$investigator->setFaxNumber($investigatorData['iFax']);
$investigator->setEmail($investigatorData['iEmail']);
$articleSite->addInvestigator($investigator);
$investigatorIterator++;
//.........这里部分代码省略.........
示例5: 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;
}
示例6: execute
/**
* Save changes to paper.
* @return int the paper ID
*/
function execute()
{
$paperDao =& DAORegistry::getDAO('PaperDAO');
$authorDao =& DAORegistry::getDAO('AuthorDAO');
$trackDao =& DAORegistry::getDAO('TrackDAO');
// Update paper
$paper =& $this->paper;
$paper->setTitle($this->getData('title'), null);
// Localized
$track =& $trackDao->getTrack($paper->getTrackId());
$paper->setAbstract($this->getData('abstract'), null);
// Localized
$paper->setDiscipline($this->getData('discipline'), null);
// Localized
$paper->setSubjectClass($this->getData('subjectClass'), null);
// Localized
$paper->setSubject($this->getData('subject'), null);
// Localized
$paper->setCoverageGeo($this->getData('coverageGeo'), null);
// Localized
$paper->setCoverageChron($this->getData('coverageChron'), null);
// Localized
$paper->setCoverageSample($this->getData('coverageSample'), null);
// Localized
$paper->setType($this->getData('type'), null);
// Localized
$paper->setLanguage($this->getData('language'));
$paper->setSponsor($this->getData('sponsor'), null);
// Localized
$paper->setCitations($this->getData('citations'));
// 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 =& $paper->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']);
$author->setBiography($authors[$i]['biography'], null);
// Localized
$author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0);
$author->setSequence($authors[$i]['seq']);
if ($isExistingAuthor == false) {
$paper->addAuthor($author);
}
}
}
// Remove deleted authors
$deletedAuthors = explode(':', $this->getData('deletedAuthors'));
for ($i = 0, $count = count($deletedAuthors); $i < $count; $i++) {
$paper->removeAuthor($deletedAuthors[$i]);
}
// Save the paper
$paperDao->updatePaper($paper);
// Update search index
import('search.PaperSearchIndex');
PaperSearchIndex::indexPaperMetadata($paper);
return $paper->getId();
}
示例7: execute
/**
* Save changes to paper.
* @return int the paper ID
*/
function execute()
{
$paperDao =& DAORegistry::getDAO('PaperDAO');
$authorDao =& DAORegistry::getDAO('AuthorDAO');
$paper =& $this->paper;
$conference =& Request::getConference();
$schedConf =& Request::getSchedConf();
$user =& Request::getUser();
// Update paper
$paper->setTitle($this->getData('title'), null);
// Localized
$reviewMode = $this->paper->getReviewMode();
if ($reviewMode != REVIEW_MODE_PRESENTATIONS_ALONE) {
$paper->setAbstract($this->getData('abstract'), null);
// Localized
}
$paper->setDiscipline($this->getData('discipline'), null);
// Localized
$paper->setSubjectClass($this->getData('subjectClass'), null);
// Localized
$paper->setSubject($this->getData('subject'), null);
// Localized
$paper->setCoverageGeo($this->getData('coverageGeo'), null);
// Localized
$paper->setCoverageChron($this->getData('coverageChron'), null);
// Localized
$paper->setCoverageSample($this->getData('coverageSample'), null);
// Localized
$paper->setType($this->getData('type'), null);
// Localized
$paper->setLanguage($this->getData('language'));
// Localized
$paper->setSponsor($this->getData('sponsor'), null);
// Localized
$paper->setCitations($this->getData('citations'));
// Update the submission progress if necessary.
if ($paper->getSubmissionProgress() <= $this->step) {
$paper->stampStatusModified();
// If we aren't about to collect the paper, the submission is complete
// (for now)
$reviewMode = $this->paper->getReviewMode();
if ($reviewMode == REVIEW_MODE_BOTH_SIMULTANEOUS || $reviewMode == REVIEW_MODE_PRESENTATIONS_ALONE) {
if (!$schedConf->getSetting('acceptSupplementaryReviewMaterials')) {
$paper->setSubmissionProgress($this->step + 2);
} else {
$paper->setSubmissionProgress($this->step + 1);
}
// The line below is necessary to ensure that
// the paper upload goes in with the correct
// stage number (i.e. paper).
$paper->setCurrentStage(REVIEW_STAGE_PRESENTATION);
} else {
$paper->setDateSubmitted(Core::getCurrentDate());
$paper->stampStatusModified();
$paper->setCurrentStage(REVIEW_STAGE_ABSTRACT);
$this->assignDirectors($paper);
if ($schedConf->getSetting('acceptSupplementaryReviewMaterials')) {
$paper->setSubmissionProgress($this->step + 2);
} else {
$paper->setSubmissionProgress(0);
$this->confirmSubmission($paper, $user, $schedConf, $conference, 'SUBMISSION_ACK');
}
}
}
// 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 =& $paper->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']);
$author->setBiography($authors[$i]['biography'], null);
// Localized
$author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0);
$author->setSequence($authors[$i]['seq']);
if ($isExistingAuthor == false) {
$paper->addAuthor($author);
}
}
unset($author);
}
// Remove deleted authors
$deletedAuthors = explode(':', $this->getData('deletedAuthors'));
//.........这里部分代码省略.........
示例8: 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();
}
示例9: 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();
//.........这里部分代码省略.........
示例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;
}
示例11: Author
/**
* Internal function to return an Author object from a row.
* @param $row array
* @return Author
*/
function &_returnAuthorFromRow(&$row)
{
$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->setCountry($row['country']);
$author->setEmail($row['email']);
$author->setUrl($row['url']);
$author->setPrimaryContact($row['primary_contact']);
$author->setSequence($row['seq']);
$this->getDataObjectSettings('paper_author_settings', 'author_id', $row['author_id'], $author);
HookRegistry::call('AuthorDAO::_returnAuthorFromRow', array(&$author, &$row));
return $author;
}
示例12: handleAuthorNode
/**
* Handle an author node (i.e. convert an author from DOM to DAO).
* @param $journal Journal
* @param $authorNode DOMElement
* @param $issue Issue
* @param $section Section
* @param $article Article
* @param $errors array
* @param $authorIndex int 0 for first author, 1 for second, ...
*/
function handleAuthorNode(&$journal, &$authorNode, &$issue, &$section, &$article, &$errors, $authorIndex)
{
$errors = array();
$journalSupportedLocales = array_keys($journal->getSupportedLocaleNames());
// => journal locales must be set up before
$author = new Author();
if ($node = $authorNode->getChildByName('firstname')) {
$author->setFirstName((string) $node->getValue());
}
if ($node = $authorNode->getChildByName('middlename')) {
$author->setMiddleName($node->getValue());
}
if ($node = $authorNode->getChildByName('lastname')) {
$author->setLastName((string) $node->getValue());
}
$author->setSequence($authorIndex + 1);
// 1-based
for ($index = 0; $node = $authorNode->getChildByName('affiliation', $index); $index++) {
$locale = $node->getAttribute('locale');
if ($locale == '') {
$locale = $article->getLocale();
} elseif (!in_array($locale, $journalSupportedLocales)) {
$errors[] = array('plugins.importexport.native.import.error.articleAuthorAffiliationLocaleUnsupported', array('authorFullName' => $author->getFullName(), 'articleTitle' => $article->getLocalizedTitle(), 'issueTitle' => $issue->getIssueIdentification(), 'locale' => $locale));
return false;
}
$author->setAffiliation($node->getValue(), $locale);
}
if ($node = $authorNode->getChildByName('country')) {
$author->setCountry($node->getValue());
}
if ($node = $authorNode->getChildByName('email')) {
$author->setEmail((string) $node->getValue());
}
if ($node = $authorNode->getChildByName('url')) {
$author->setUrl($node->getValue());
}
for ($index = 0; $node = $authorNode->getChildByName('competing_interests', $index); $index++) {
$locale = $node->getAttribute('locale');
if ($locale == '') {
$locale = $article->getLocale();
} elseif (!in_array($locale, $journalSupportedLocales)) {
$errors[] = array('plugins.importexport.native.import.error.articleAuthorCompetingInterestsLocaleUnsupported', array('authorFullName' => $author->getFullName(), 'articleTitle' => $article->getLocalizedTitle(), 'issueTitle' => $issue->getIssueIdentification(), 'locale' => $locale));
return false;
}
$author->setCompetingInterests($node->getValue(), $locale);
}
for ($index = 0; $node = $authorNode->getChildByName('biography', $index); $index++) {
$locale = $node->getAttribute('locale');
if ($locale == '') {
$locale = $article->getLocale();
} elseif (!in_array($locale, $journalSupportedLocales)) {
$errors[] = array('plugins.importexport.native.import.error.articleAuthorBiographyLocaleUnsupported', array('authorFullName' => $author->getFullName(), 'articleTitle' => $article->getLocalizedTitle(), 'issueTitle' => $issue->getIssueIdentification(), 'locale' => $locale));
return false;
}
$author->setBiography($node->getValue(), $locale);
}
$author->setSubmissionId($article->getId());
$author->setPrimaryContact($authorNode->getAttribute('primary_contact') === 'true' ? 1 : 0);
$authorDao =& DAORegistry::getDAO('AuthorDAO');
/* @var $authorDao AuthorDAO */
$authorDao->insertAuthor($author);
return true;
}
示例13: 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;
}
示例14: 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);
}
}
//.........这里部分代码省略.........
示例15: execute
/**
* Save changes to article.
* @param $request PKPRequest
* @return int the article ID
*/
function execute(&$request)
{
$articleDao =& DAORegistry::getDAO('ArticleDAO');
$article =& $this->article;
// Retrieve the previous citation list for comparison.
$previousRawCitationList = $article->getCitations();
///////////////////////////////////////////
////////////// Update Authors /////////////
///////////////////////////////////////////
$authors = $this->getData('authors');
for ($i = 0, $count = count($authors); $i < $count; $i++) {
if ($authors[$i]['authorId'] > 0) {
// Update an existing author
$author =& $article->getAuthor($authors[$i]['authorId']);
$isExistingAuthor = true;
} else {
// Create a new author
$author = new Author();
$isExistingAuthor = false;
}
if ($author != null) {
$author->setSubmissionId($article->getId());
if (isset($authors[$i]['firstName'])) {
$author->setFirstName($authors[$i]['firstName']);
}
if (isset($authors[$i]['middleName'])) {
$author->setMiddleName($authors[$i]['middleName']);
}
if (isset($authors[$i]['lastName'])) {
$author->setLastName($authors[$i]['lastName']);
}
if (isset($authors[$i]['affiliation'])) {
$author->setAffiliation($authors[$i]['affiliation']);
}
if (isset($authors[$i]['phone'])) {
$author->setPhoneNumber($authors[$i]['phone']);
}
if (isset($authors[$i]['email'])) {
$author->setEmail($authors[$i]['email']);
}
$author->setPrimaryContact($this->getData('primaryContact') == $i ? 1 : 0);
$author->setSequence($authors[$i]['seq']);
if ($isExistingAuthor == false) {
$article->addAuthor($author);
}
}
unset($author);
}
// Remove deleted authors
$deletedAuthors = explode(':', $this->getData('deletedAuthors'));
for ($i = 0, $count = count($deletedAuthors); $i < $count; $i++) {
$article->removeAuthor($deletedAuthors[$i]);
}
///////////////////////////////////////////
//////////// Update Abstract(s) ///////////
///////////////////////////////////////////
import('classes.article.ProposalAbstract');
$journal = Request::getJournal();
$abstracts = $this->getData('abstracts');
foreach ($journal->getSupportedLocaleNames() as $localeKey => $localeValue) {
if ($abstracts[$localeKey]['abstractId'] > 0) {
$abstract = $article->getAbstractByLocale($localeKey);
$isExistingAbstract = true;
} else {
$abstract = new ProposalAbstract();
$isExistingAbstract = false;
}
if ($abstract != null) {
$abstract->setArticleId($article->getId());
$abstract->setLocale($localeKey);
$abstract->setScientificTitle($abstracts[$localeKey]['scientificTitle']);
$abstract->setPublicTitle($abstracts[$localeKey]['publicTitle']);
$abstract->setBackground($abstracts[$localeKey]['background']);
$abstract->setObjectives($abstracts[$localeKey]['objectives']);
$abstract->setStudyMethods($abstracts[$localeKey]['studyMethods']);
$abstract->setExpectedOutcomes($abstracts[$localeKey]['expectedOutcomes']);
$abstract->setKeywords($abstracts[$localeKey]['keywords']);
if ($isExistingAbstract == false) {
$article->addAbstract($abstract);
}
}
unset($abstract);
}
///////////////////////////////////////////
///////// Update Proposal Details /////////
///////////////////////////////////////////
$proposalDetailsData = $this->getData('proposalDetails');
import('classes.article.ProposalDetails');
$proposalDetails = new ProposalDetails();
$institutionDao =& DAORegistry::getDAO('InstitutionDAO');
import('classes.journal.Institution');
$proposalDetails->setArticleId($article->getId());
$proposalDetails->setStudentResearch($proposalDetailsData['studentInitiatedResearch']);
$proposalDetails->setStartDate($proposalDetailsData['startDate']);
$proposalDetails->setEndDate($proposalDetailsData['endDate']);
//.........这里部分代码省略.........