Commit a85cffc1 authored by asmecher's avatar asmecher
Browse files

#4427# Changed Article::[gs]etArticleId to Article::[gs]etId

parent 6d466a31
......@@ -59,7 +59,7 @@ class Article extends Submission {
*/
function addAuthor($author) {
if ($author->getArticleId() == null) {
$author->setArticleId($this->getArticleId());
$author->setArticleId($this->getId());
}
parent::addAuthor($author);
}
......@@ -93,7 +93,8 @@ class Article extends Submission {
* @return int
*/
function getArticleId() {
return $this->getData('articleId');
if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
return $this->getId();
}
/**
......@@ -101,7 +102,8 @@ class Article extends Submission {
* @param $articleId int
*/
function setArticleId($articleId) {
return $this->setData('articleId', $articleId);
if (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');
return $this->setId($articleId);
}
/**
......@@ -451,7 +453,7 @@ class Article extends Submission {
* @return array User IDs
*/
function getAssociatedUserIds($authors = true, $reviewers = true, $editors = true, $proofreader = true, $copyeditor = true, $layoutEditor = true) {
$articleId = $this->getArticleId();
$articleId = $this->getId();
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$userIds = array();
......@@ -509,7 +511,7 @@ class Article extends Submission {
*/
function getSignoff($signoffType) {
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
return $signoffDao->getBySymbolic($signoffType, ASSOC_TYPE_ARTICLE, $this->getArticleId());
return $signoffDao->getBySymbolic($signoffType, ASSOC_TYPE_ARTICLE, $this->getId());
}
/**
......@@ -522,7 +524,7 @@ class Article extends Submission {
$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$signoff = $signoffDao->getBySymbolic($signoffType, ASSOC_TYPE_ARTICLE, $this->getArticleId());
$signoff = $signoffDao->getBySymbolic($signoffType, ASSOC_TYPE_ARTICLE, $this->getId());
if (!$signoff) return false;
if ($idOnly) return $signoff->getFileId();
......@@ -540,7 +542,7 @@ class Article extends Submission {
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$signoff = $signoffDao->getBySymbolic($signoffType, ASSOC_TYPE_ARTICLE, $this->getArticleId());
$signoff = $signoffDao->getBySymbolic($signoffType, ASSOC_TYPE_ARTICLE, $this->getId());
if (!$signoff) return false;
$user =& $userDao->getUser($signoff->getUserId());
......@@ -555,7 +557,7 @@ class Article extends Submission {
function getUserIdBySignoffType($signoffType) {
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$signoff = $signoffDao->getBySymbolic($signoffType, ASSOC_TYPE_ARTICLE, $this->getArticleId());
$signoff = $signoffDao->getBySymbolic($signoffType, ASSOC_TYPE_ARTICLE, $this->getId());
if (!$signoff) return false;
return $signoff->getUserId();
......
......@@ -46,7 +46,7 @@ class ArticleDAO extends DAO {
*/
function updateLocaleFields(&$article) {
$this->updateDataObjectSettings('article_settings', $article, array(
'article_id' => $article->getArticleId()
'article_id' => $article->getId()
));
}
......@@ -115,7 +115,7 @@ class ArticleDAO extends DAO {
* @param $row array input row
*/
function _articleFromRow(&$article, &$row) {
$article->setArticleId($row['article_id']);
$article->setId($row['article_id']);
$article->setUserId($row['user_id']);
$article->setJournalId($row['journal_id']);
$article->setSectionId($row['section_id']);
......@@ -181,17 +181,17 @@ class ArticleDAO extends DAO {
)
);
$article->setArticleId($this->getInsertArticleId());
$article->setId($this->getInsertArticleId());
$this->updateLocaleFields($article);
// Insert authors for this article
$authors =& $article->getAuthors();
for ($i=0, $count=count($authors); $i < $count; $i++) {
$authors[$i]->setArticleId($article->getArticleId());
$authors[$i]->setArticleId($article->getId());
$this->authorDao->insertAuthor($authors[$i]);
}
return $article->getArticleId();
return $article->getId();
}
/**
......@@ -241,7 +241,7 @@ class ArticleDAO extends DAO {
$article->getFastTracked(),
$article->getHideAuthor(),
$article->getCommentsStatus(),
$article->getArticleId()
$article->getId()
)
);
......@@ -260,11 +260,11 @@ class ArticleDAO extends DAO {
// Remove deleted authors
$removedAuthors = $article->getRemovedAuthors();
for ($i=0, $count=count($removedAuthors); $i < $count; $i++) {
$this->authorDao->deleteAuthorById($removedAuthors[$i], $article->getArticleId());
$this->authorDao->deleteAuthorById($removedAuthors[$i], $article->getId());
}
// Update author sequence numbers
$this->authorDao->resequenceAuthors($article->getArticleId());
$this->authorDao->resequenceAuthors($article->getId());
}
/**
......@@ -272,7 +272,7 @@ class ArticleDAO extends DAO {
* @param $article Article
*/
function deleteArticle(&$article) {
return $this->deleteArticleById($article->getArticleId());
return $this->deleteArticleById($article->getId());
}
/**
......@@ -401,7 +401,7 @@ class ArticleDAO extends DAO {
while (!$articles->eof()) {
$article =& $articles->next();
$this->deleteArticleById($article->getArticleId());
$this->deleteArticleById($article->getId());
}
}
......
......@@ -562,7 +562,7 @@ class PublishedArticleDAO extends DAO {
(?, ?, %s, ?, ?, ?)',
$this->datetimeToDB($publishedArticle->getDatePublished())),
array(
$publishedArticle->getArticleId(),
$publishedArticle->getId(),
$publishedArticle->getIssueId(),
$publishedArticle->getSeq(),
$publishedArticle->getAccessStatus(),
......@@ -650,7 +650,7 @@ class PublishedArticleDAO extends DAO {
WHERE pub_id = ?',
$this->datetimeToDB($publishedArticle->getDatePublished())),
array(
$publishedArticle->getArticleId(),
$publishedArticle->getId(),
$publishedArticle->getIssueId(),
$publishedArticle->getSeq(),
$publishedArticle->getAccessStatus(),
......
......@@ -42,7 +42,7 @@ class AuthorSubmitForm extends Form {
$this->addCheck(new FormValidatorPost($this));
$this->step = (int) $step;
$this->article = $article;
$this->articleId = $article ? $article->getArticleId() : null;
$this->articleId = $article ? $article->getId() : null;
}
/**
......@@ -91,7 +91,7 @@ class AuthorSubmitForm extends Form {
foreach ($sectionEditors as $sectionEditorEntry) {
$editAssignment = new EditAssignment();
$editAssignment->setArticleId($article->getArticleId());
$editAssignment->setArticleId($article->getId());
$editAssignment->setEditorId($sectionEditorEntry['user']->getId());
$editAssignment->setCanReview($sectionEditorEntry['canReview']);
$editAssignment->setCanEdit($sectionEditorEntry['canEdit']);
......
......@@ -194,7 +194,7 @@ class AuthorSubmitStep3Form extends AuthorSubmitForm {
}
if ($author != null) {
$author->setArticleId($article->getArticleId());
$author->setArticleId($article->getId());
$author->setFirstName($authors[$i]['firstName']);
$author->setMiddleName($authors[$i]['middleName']);
$author->setLastName($authors[$i]['lastName']);
......
......@@ -147,13 +147,13 @@ class AuthorSubmitStep5Form extends AuthorSubmitForm {
// Designate this as the review version by default.
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getArticleId());
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getId());
AuthorAction::designateReviewVersion($authorSubmission, true);
unset($authorSubmission);
$copyeditInitialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $article->getArticleId());
$copyeditAuthorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getArticleId());
$copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $article->getArticleId());
$copyeditInitialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $article->getId());
$copyeditAuthorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
$copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $article->getId());
$copyeditInitialSignoff->setUserId(0);
$copyeditAuthorSignoff->setUserId($user->getId());
$copyeditFinalSignoff->setUserId(0);
......@@ -161,13 +161,13 @@ class AuthorSubmitStep5Form extends AuthorSubmitForm {
$signoffDao->updateObject($copyeditAuthorSignoff);
$signoffDao->updateObject($copyeditFinalSignoff);
$layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getArticleId());
$layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
$layoutSignoff->setUserId(0);
$signoffDao->updateObject($layoutSignoff);
$proofAuthorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getArticleId());
$proofProofreaderSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $article->getArticleId());
$proofLayoutEditorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getArticleId());
$proofAuthorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
$proofProofreaderSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $article->getId());
$proofLayoutEditorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
$proofAuthorSignoff->setUserId($user->getId());
$proofProofreaderSignoff->setUserId(0);
$proofLayoutEditorSignoff->setUserId(0);
......@@ -213,14 +213,14 @@ class AuthorSubmitStep5Form extends AuthorSubmitForm {
'authorName' => $user->getFullName(),
'authorUsername' => $user->getUsername(),
'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getLocalizedTitle(),
'submissionUrl' => Request::url(null, 'author', 'submission', $article->getArticleId())
'submissionUrl' => Request::url(null, 'author', 'submission', $article->getId())
));
$mail->send();
}
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
ArticleLog::logEvent($this->articleId, ARTICLE_LOG_ARTICLE_SUBMIT, ARTICLE_LOG_TYPE_AUTHOR, $user->getId(), 'log.author.submitted', array('submissionId' => $article->getArticleId(), 'authorName' => $user->getFullName()));
ArticleLog::logEvent($this->articleId, ARTICLE_LOG_ARTICLE_SUBMIT, ARTICLE_LOG_TYPE_AUTHOR, $user->getId(), 'log.author.submitted', array('submissionId' => $article->getId(), 'authorName' => $user->getFullName()));
return $this->articleId;
}
......
......@@ -37,11 +37,11 @@ class AuthorSubmitSuppFileForm extends Form {
*/
function AuthorSubmitSuppFileForm($article, $suppFileId = null) {
parent::Form('author/submit/suppFile.tpl');
$this->articleId = $article->getArticleId();
$this->articleId = $article->getId();
if (isset($suppFileId) && !empty($suppFileId)) {
$suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
$this->suppFile =& $suppFileDao->getSuppFile($suppFileId, $article->getArticleId());
$this->suppFile =& $suppFileDao->getSuppFile($suppFileId, $article->getId());
if (isset($this->suppFile)) {
$this->suppFileId = $suppFileId;
}
......
......@@ -435,7 +435,7 @@ class ArticleFileManager extends FileManager {
function &generateDummyFile(&$article) {
$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
$articleFile = new ArticleFile();
$articleFile->setArticleId($article->getArticleId());
$articleFile->setArticleId($article->getId());
$articleFile->setFileName('temp');
$articleFile->setOriginalFileName('temp');
$articleFile->setFileType('temp');
......
......@@ -66,7 +66,7 @@ class Upgrade extends Installer {
$articles =& $articleDao->getArticlesByJournalId($journal->getId());
while ($article =& $articles->next()) {
if (!$article->getReviewFileId() && $article->getSubmissionProgress() == 0) {
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getArticleId());
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getId());
AuthorAction::designateReviewVersion($authorSubmission, true);
}
unset($article);
......
......@@ -101,7 +101,7 @@ class IssueAction {
if (Validation::isAuthor($journalId)) {
if ($article && $article->getUserId() == $userId) return true;
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
if ($article) $publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($article->getArticleId());
if ($article) $publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($article->getId());
if (isset($publishedArticle) && $publishedArticle && $publishedArticle->getUserId() == $userId) return true;
}
}
......
......@@ -57,7 +57,7 @@ class ArticleMailTemplate extends MailTemplate {
$journal = isset($this->journal)?$this->journal:Request::getJournal();
$paramArray['articleTitle'] = strip_tags($article->getLocalizedTitle());
$paramArray['articleId'] = $article->getArticleId();
$paramArray['articleId'] = $article->getId();
$paramArray['journalName'] = strip_tags($journal->getLocalizedTitle());
$paramArray['sectionName'] = strip_tags($article->getSectionTitle());
$paramArray['articleAbstract'] = strip_tags($article->getLocalizedAbstract());
......@@ -141,11 +141,11 @@ class ArticleMailTemplate extends MailTemplate {
$entry->setBccs($this->getBccString());
// Add log entry
$logEntryId = ArticleLog::logEmailEntry($article->getArticleId(), $entry);
$logEntryId = ArticleLog::logEmailEntry($article->getId(), $entry);
// Add attachments
import('file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($article->getArticleId());
$articleFileManager = new ArticleFileManager($article->getId());
foreach ($this->getAttachmentFiles() as $attachment) {
$articleFileManager->temporaryFileToArticleFile(
$attachment,
......
......@@ -170,7 +170,7 @@ class ArticleSearchIndex {
}
// Update search index
$articleId = $article->getArticleId();
$articleId = $article->getId();
ArticleSearchIndex::updateTextIndex($articleId, ARTICLE_SEARCH_AUTHOR, $authorText);
ArticleSearchIndex::updateTextIndex($articleId, ARTICLE_SEARCH_TITLE, $article->getTitle(null));
ArticleSearchIndex::updateTextIndex($articleId, ARTICLE_SEARCH_ABSTRACT, $article->getAbstract(null));
......@@ -211,10 +211,10 @@ class ArticleSearchIndex {
function indexArticleFiles(&$article) {
// Index supplementary files
$fileDao =& DAORegistry::getDAO('SuppFileDAO');
$files =& $fileDao->getSuppFilesByArticle($article->getArticleId());
$files =& $fileDao->getSuppFilesByArticle($article->getId());
foreach ($files as $file) {
if ($file->getFileId()) {
ArticleSearchIndex::updateFileIndex($article->getArticleId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $file->getFileId());
ArticleSearchIndex::updateFileIndex($article->getId(), ARTICLE_SEARCH_SUPPLEMENTARY_FILE, $file->getFileId());
}
ArticleSearchIndex::indexSuppFileMetadata($file);
}
......@@ -222,10 +222,10 @@ class ArticleSearchIndex {
// Index galley files
$fileDao =& DAORegistry::getDAO('ArticleGalleyDAO');
$files =& $fileDao->getGalleysByArticle($article->getArticleId());
$files =& $fileDao->getGalleysByArticle($article->getId());
foreach ($files as $file) {
if ($file->getFileId()) {
ArticleSearchIndex::updateFileIndex($article->getArticleId(), ARTICLE_SEARCH_GALLEY_FILE, $file->getFileId());
ArticleSearchIndex::updateFileIndex($article->getId(), ARTICLE_SEARCH_GALLEY_FILE, $file->getFileId());
}
}
}
......
......@@ -64,12 +64,12 @@ class AuthorAction extends Action {
function deleteArticleFile($article, $fileId, $revisionId) {
import('file.ArticleFileManager');
$articleFileManager = new ArticleFileManager($article->getArticleId());
$articleFileManager = new ArticleFileManager($article->getId());
$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$articleFile =& $articleFileDao->getArticleFile($fileId, $revisionId, $article->getArticleId());
$authorSubmission = $authorSubmissionDao->getAuthorSubmission($article->getArticleId());
$articleFile =& $articleFileDao->getArticleFile($fileId, $revisionId, $article->getId());
$authorSubmission = $authorSubmissionDao->getAuthorSubmission($article->getId());
$authorRevisions = $authorSubmission->getAuthorFileRevisions();
// Ensure that this is actually an author file.
......@@ -290,7 +290,7 @@ class AuthorAction extends Action {
import('notification.Notification');
$notificationUsers = $article->getAssociatedUserIds(true, false);
foreach ($notificationUsers as $userRole) {
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getArticleId(), null, 'layout');
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getId(), null, 'layout');
Notification::createNotification($userRole['id'], "notification.type.layoutComment",
$article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT);
}
......@@ -408,7 +408,7 @@ class AuthorAction extends Action {
import('notification.Notification');
$notificationUsers = $article->getAssociatedUserIds(true, false);
foreach ($notificationUsers as $userRole) {
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getArticleId(), null, 'copyedit');
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getId(), null, 'copyedit');
Notification::createNotification($userRole['id'], "notification.type.copyeditComment",
$article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT);
}
......@@ -458,7 +458,7 @@ class AuthorAction extends Action {
import('notification.Notification');
$notificationUsers = $article->getAssociatedUserIds(true, false);
foreach ($notificationUsers as $userRole) {
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getArticleId(), null, 'proofread');
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getId(), null, 'proofread');
Notification::createNotification($userRole['id'], "notification.type.proofreadComment",
$article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_PROOFREAD_COMMENT);
}
......@@ -491,7 +491,7 @@ class AuthorAction extends Action {
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getArticleId());
$authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getId());
$layoutSignoff = $signoffDao->getBySymbolic('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $authorSubmission->getArticleId());
$canDownload = false;
......@@ -560,7 +560,7 @@ class AuthorAction extends Action {
// Check current review version
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewFilesByRound =& $reviewAssignmentDao->getReviewFilesByRound($article->getArticleId());
$reviewFilesByRound =& $reviewAssignmentDao->getReviewFilesByRound($article->getId());
$reviewFile = @$reviewFilesByRound[$article->getCurrentRound()];
if ($reviewFile && $fileId == $reviewFile->getFileId()) {
$canDownload = true;
......@@ -578,7 +578,7 @@ class AuthorAction extends Action {
$result = false;
if (!HookRegistry::call('AuthorAction::downloadAuthorFile', array(&$article, &$fileId, &$revision, &$canDownload, &$result))) {
if ($canDownload) {
return Action::downloadFile($article->getArticleId(), $fileId, $revision);
return Action::downloadFile($article->getId(), $fileId, $revision);
} else {
return false;
}
......
......@@ -151,7 +151,7 @@ class Action {
import('notification.Notification');
$notificationUsers = $article->getAssociatedUserIds();
foreach ($notificationUsers as $userRole) {
$url = Request::url(null, $userRole['role'], 'submission', $article->getArticleId(), null, 'metadata');
$url = Request::url(null, $userRole['role'], 'submission', $article->getId(), null, 'metadata');
Notification::createNotification($userRole['id'], "notification.type.metadataModified",
$article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_METADATA_MODIFIED);
}
......@@ -160,7 +160,7 @@ class Action {
$user =& Request::getUser();
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
ArticleLog::logEvent($article->getArticleId(), ARTICLE_LOG_METADATA_UPDATE, ARTICLE_LOG_TYPE_DEFAULT, 0, 'log.editor.metadataModified', Array('editorName' => $user->getFullName()));
ArticleLog::logEvent($article->getId(), ARTICLE_LOG_METADATA_UPDATE, ARTICLE_LOG_TYPE_DEFAULT, 0, 'log.editor.metadataModified', Array('editorName' => $user->getFullName()));
return true;
}
......@@ -266,7 +266,7 @@ class Action {
import('notification.Notification');
$notificationUsers = $article->getAssociatedUserIds(true, false);
foreach ($notificationUsers as $userRole) {
$url = Request::url(null, $userRole['role'], 'submissionReview', $article->getArticleId(), null, 'editorDecision');
$url = Request::url(null, $userRole['role'], 'submissionReview', $article->getId(), null, 'editorDecision');
Notification::createNotification($userRole['id'], "notification.type.submissionComment",
$article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_SUBMISSION_COMMENT);
}
......
......@@ -303,7 +303,7 @@ class CopyeditorAction extends Action {
import('notification.Notification');
$notificationUsers = $article->getAssociatedUserIds(true, false);
foreach ($notificationUsers as $userRole) {
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getArticleId(), null, 'layout');
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getId(), null, 'layout');
Notification::createNotification($userRole['id'], "notification.type.layoutComment",
$article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_LAYOUT_COMMENT);
}
......@@ -352,7 +352,7 @@ class CopyeditorAction extends Action {
import('notification.Notification');
$notificationUsers = $article->getAssociatedUserIds(true, false);
foreach ($notificationUsers as $userRole) {
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getArticleId(), null, 'coypedit');
$url = Request::url(null, $userRole['role'], 'submissionEditing', $article->getId(), null, 'coypedit');
Notification::createNotification($userRole['id'], "notification.type.copyeditComment",
$article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_COPYEDIT_COMMENT);
}
......
......@@ -100,24 +100,24 @@ class EditorAction extends SectionEditorAction {
import('submission.proofreader.ProofreaderAction');
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getArticleId());
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
$submissionFile = $sectionEditorSubmission->getSubmissionFile();
// Add a long entry before doing anything.
import('article.log.ArticleLog');
import('article.log.ArticleEventLogEntry');
ArticleLog::logEvent($article->getArticleId(), ARTICLE_LOG_EDITOR_EXPEDITE, ARTICLE_LOG_TYPE_EDITOR, $user->getId(), 'log.editor.submissionExpedited', array('editorName' => $user->getFullName(), 'articleId' => $article->getArticleId()));
ArticleLog::logEvent($article->getId(), ARTICLE_LOG_EDITOR_EXPEDITE, ARTICLE_LOG_TYPE_EDITOR, $user->getId(), 'log.editor.submissionExpedited', array('editorName' => $user->getFullName(), 'articleId' => $article->getId()));
// 1. Ensure that an editor is assigned.
$editAssignments =& $sectionEditorSubmission->getEditAssignments();
if (empty($editAssignments)) {
// No editors are currently assigned; assign self.
EditorAction::assignEditor($article->getArticleId(), $user->getId(), true);
EditorAction::assignEditor($article->getId(), $user->getId(), true);
}
// 2. Accept the submission and send to copyediting.
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getArticleId());
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
if (!$sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL', true)) {
SectionEditorAction::recordDecision($sectionEditorSubmission, SUBMISSION_EDITOR_DECISION_ACCEPT);
$reviewFile = $sectionEditorSubmission->getReviewFile();
......@@ -125,14 +125,14 @@ class EditorAction extends SectionEditorAction {
}
// 3. Add a galley.
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getArticleId());
$sectionEditorSubmission =& $sectionEditorSubmissionDao->getSectionEditorSubmission($article->getId());
$galleys =& $sectionEditorSubmission->getGalleys();
if (empty($galleys)) {
// No galley present -- use copyediting file.
import('file.ArticleFileManager');
$copyeditFile =& $sectionEditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL');
$fileType = $copyeditFile->getFileType();
$articleFileManager = new ArticleFileManager($article->getArticleId());
$articleFileManager = new ArticleFileManager($article->getId());
$fileId = $articleFileManager->copyPublicFile($copyeditFile->getFilePath(), $fileType);
if (strstr($fileType, 'html')) {
......@@ -140,7 +140,7 @@ class EditorAction extends SectionEditorAction {
} else {
$galley = new ArticleGalley();
}
$galley->setArticleId($article->getArticleId());
$galley->setArticleId($article->getId());
$galley->setFileId($fileId);
$galley->setLocale(Locale::getLocale());
......
......@@ -48,7 +48,7 @@ class MetadataForm extends Form {
$this->isEditor = true;
}
$copyeditInitialSignoff = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $article->getArticleId());
$copyeditInitialSignoff = $signoffDao->getBySymbolic('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $article->getId());
// If the user is an author and the article hasn't passed the Copyediting stage, make the form editable.
if ($roleId == ROLE_ID_AUTHOR) {
if ($article->getStatus() != STATUS_PUBLISHED && ($copyeditInitialSignoff == null || $copyeditInitialSignoff->getDateCompleted() == null)) {
......@@ -59,7 +59,7 @@ class MetadataForm extends Form {
// Copy editors are also allowed to edit metadata, but only if they have
// a current assignment to the article.
if ($roleId != null && ($roleId == ROLE_ID_COPYEDITOR)) {
$copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $article->getArticleId());
$copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $article->getId());
if ($copyeditFinalSignoff != null && $article->getStatus() != STATUS_PUBLISHED) {
if ($copyeditInitialSignoff->getDateNotified() != null && $copyeditFinalSignoff->getDateCompleted() == null) {
$this->canEdit = true;
......@@ -357,7 +357,7 @@ class MetadataForm extends Form {
import('search.ArticleSearchIndex');
ArticleSearchIndex::indexArticleMetadata($article);
return $article->getArticleId();
return $article->getId();
}
/**
......
......@@ -39,7 +39,7 @@ class SuppFileForm extends Form {
if (isset($suppFileId) && !empty($suppFileId)) {
$suppFileDao =& DAORegistry::getDAO('SuppFileDAO');
$this->suppFile =& $suppFileDao->getSuppFile($suppFileId, $article->getArticleId());
$this->suppFile =& $suppFileDao->getSuppFile($suppFileId, $article->getId());
if (isset($this->suppFile)) {
$this->suppFileId = $suppFileId;
}
......
......@@ -51,7 +51,7 @@ class CommentForm extends Form {
$this->article = $article;
$this->commentType = $commentType;
$this->roleId = $roleId;
$this->assocId = $assocId == null ? $article->getArticleId() : $assocId;
$this->assocId = $assocId == null ? $article->getId() : $assocId;
$this->user =& Request::getUser();
......@@ -74,10 +74,10 @@ class CommentForm extends Form {
$article = $this->article;
$articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
$articleComments =& $articleCommentDao->getArticleComments($article->getArticleId(), $this->commentType, $this->assocId);
$articleComments =& $articleCommentDao->getArticleComments($article->getId(), $this->commentType, $this->assocId);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('articleId', $article->getArticleId());
$templateMgr->assign('articleId', $article->getId());
$templateMgr->assign('commentTitle', strip_tags($article->getLocalizedTitle()));
$user =& $this->user;
$templateMgr->assign('userId', $user->getId());
......@@ -110,7 +110,7 @@ class CommentForm extends Form {
$comment = new ArticleComment();
$comment->setCommentType($this->commentType);
$comment->setRoleId($this->roleId);
$comment->setArticleId($article->getArticleId());