/** * Assigns a track director to a submission. * @param $paperId int * @return boolean true iff ready for redirect */ function assignDirector($paperId, $trackDirectorId, $isDirector = false, $send = false) { $directorSubmissionDao =& DAORegistry::getDAO('DirectorSubmissionDAO'); $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO'); $userDao =& DAORegistry::getDAO('UserDAO'); $user =& Request::getUser(); $conference =& Request::getConference(); $directorSubmission =& $directorSubmissionDao->getDirectorSubmission($paperId); $trackDirector =& $userDao->getUser($trackDirectorId); if (!isset($trackDirector)) { return true; } import('mail.PaperMailTemplate'); $email = new PaperMailTemplate($directorSubmission, 'DIRECTOR_ASSIGN'); if ($user->getId() === $trackDirectorId || !$email->isEnabled() || $send && !$email->hasErrors()) { HookRegistry::call('DirectorAction::assignDirector', array(&$directorSubmission, &$trackDirector, &$isDirector, &$email)); if ($email->isEnabled() && $user->getId() !== $trackDirectorId) { $email->setAssoc(PAPER_EMAIL_DIRECTOR_ASSIGN, PAPER_EMAIL_TYPE_DIRECTOR, $trackDirector->getId()); $email->send(); } $editAssignment = new EditAssignment(); $editAssignment->setPaperId($paperId); // Make the selected director the new director $editAssignment->setDirectorId($trackDirectorId); $editAssignment->setDateNotified(Core::getCurrentDate()); $editAssignment->setDateUnderway(null); $editAssignments =& $directorSubmission->getEditAssignments(); array_push($editAssignments, $editAssignment); $directorSubmission->setEditAssignments($editAssignments); $directorSubmissionDao->updateDirectorSubmission($directorSubmission); // Add log import('paper.log.PaperLog'); import('paper.log.PaperEventLogEntry'); PaperLog::logEvent($paperId, PAPER_LOG_DIRECTOR_ASSIGN, LOG_TYPE_DIRECTOR, $trackDirectorId, 'log.director.directorAssigned', array('directorName' => $trackDirector->getFullName(), 'paperId' => $paperId)); return true; } else { if (!Request::getUserVar('continued')) { $email->addRecipient($trackDirector->getEmail(), $trackDirector->getFullName()); $submissionUrl = Request::url(null, null, $isDirector ? 'director' : 'trackDirector', 'submissionReview', $paperId); $submissionUrl = $submissionUrl . "?u=" . $trackDirector->getUserId(); $paramArray = array('editorialContactName' => $trackDirector->getFullName(), 'directorUsername' => $trackDirector->getUsername(), 'directorPassword' => $trackDirector->getPassword(), 'editorialContactSignature' => $user->getContactSignature(), 'submissionUrl' => $submissionUrl); $email->assignParams($paramArray); } $email->displayEditForm(Request::url(null, null, null, 'assignDirector', 'send'), array('paperId' => $paperId, 'directorId' => $trackDirectorId)); return false; } }
/** * Save changes to paper. */ function execute() { $paperDao =& DAORegistry::getDAO('PaperDAO'); $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $conference = Request::getConference(); $schedConf = Request::getSchedConf(); // Update paper $paper =& $this->paper; $paper->setDateSubmitted(Core::getCurrentDate()); $paper->setSubmissionProgress(0); $paper->stampStatusModified(); // We've collected the paper now -- bump the review progress if ($this->paper->getSubmissionFileId() != null) { $paper->setCurrentStage(REVIEW_STAGE_PRESENTATION); } $paperDao->updatePaper($paper); // Designate this as the review version by default. $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO'); $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($paper->getId()); AuthorAction::designateReviewVersion($authorSubmission); unset($authorSubmission); // Update any review assignments so they may access the file $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($paper->getId()); $reviewAssignments =& $reviewAssignmentDao->getReviewAssignmentsByPaperId($paper->getId(), REVIEW_STAGE_PRESENTATION); foreach ($reviewAssignments as $reviewAssignment) { $reviewAssignment->setReviewFileId($authorSubmission->getReviewFileId()); $reviewAssignmentDao->updateReviewAssignment($reviewAssignment); } $reviewMode = $authorSubmission->getReviewMode(); $user =& Request::getUser(); if ($reviewMode == REVIEW_MODE_BOTH_SIMULTANEOUS || $reviewMode == REVIEW_MODE_PRESENTATIONS_ALONE) { // Editors have not yet been assigned; assign them. $this->assignDirectors($paper); } $this->confirmSubmission($paper, $user, $schedConf, $conference, $reviewMode == REVIEW_MODE_BOTH_SEQUENTIAL ? 'SUBMISSION_UPLOAD_ACK' : 'SUBMISSION_ACK'); // 同時寄一封給大會主席 $this->confirmSubmissionBBC($paper, $user, $schedConf, $conference, $reviewMode == REVIEW_MODE_BOTH_SEQUENTIAL ? 'SUBMISSION_UPLOAD_ACK_BCC' : 'SUBMISSION_ACK_BCC'); import('paper.log.PaperLog'); import('paper.log.PaperEventLogEntry'); PaperLog::logEvent($this->paperId, PAPER_LOG_PRESENTATION_SUBMIT, LOG_TYPE_AUTHOR, $user->getId(), 'log.author.presentationSubmitted', array('submissionId' => $paper->getId(), 'authorName' => $user->getFullName())); return $this->paperId; }
function handlePaperNode(&$conference, &$schedConf, &$paperNode, &$track, &$paper, &$publishedPaper, &$errors, &$user, $isCommandLine, &$dependentItems) { $errors = array(); $conferenceSupportedLocales = array_keys($conference->getSupportedLocaleNames()); // => locales must be set up before $conferencePrimaryLocale = $conference->getPrimaryLocale(); $publishedPaperDao =& DAORegistry::getDAO('PublishedPaperDAO'); $paperDao =& DAORegistry::getDAO('PaperDAO'); $paper = new Paper(); $paper->setSchedConfId($schedConf->getId()); $paper->setUserId($user->getId()); $paper->setTrackId($track->getId()); $paper->setStatus(STATUS_PUBLISHED); $paper->setSubmissionProgress(0); $paper->setCurrentStage(REVIEW_STAGE_ABSTRACT); $paper->setReviewMode(REVIEW_MODE_ABSTRACTS_ALONE); $paper->setDateSubmitted(Core::getCurrentDate()); $paper->stampStatusModified(); $titleExists = false; for ($index = 0; $node = $paperNode->getChildByName('title', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperTitleLocaleUnsupported', array('paperTitle' => $node->getValue(), 'locale' => $locale)); return false; } $paper->setTitle($node->getValue(), $locale); $titleExists = true; } if (!$titleExists || $paper->getTitle($conferencePrimaryLocale) == "") { $errors[] = array('plugins.importexport.native.import.error.paperTitleMissing', array('trackTitle' => $track->getLocalizedTitle())); return false; } for ($index = 0; $node = $paperNode->getChildByName('abstract', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperAbstractLocaleUnsupported', array('paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale)); return false; } $paper->setAbstract($node->getValue(), $locale); } if ($indexingNode = $paperNode->getChildByName('indexing')) { for ($index = 0; $node = $indexingNode->getChildByName('discipline', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperDisciplineLocaleUnsupported', array('paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale)); return false; } $paper->setDiscipline($node->getValue(), $locale); } for ($index = 0; $node = $indexingNode->getChildByName('type', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperTypeLocaleUnsupported', array('paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale)); return false; } $paper->setType($node->getValue(), $locale); } for ($index = 0; $node = $indexingNode->getChildByName('subject', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperSubjectLocaleUnsupported', array('paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale)); return false; } $paper->setSubject($node->getValue(), $locale); } for ($index = 0; $node = $indexingNode->getChildByName('subject_class', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperSubjectClassLocaleUnsupported', array('paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale)); return false; } $paper->setSubjectClass($node->getValue(), $locale); } if ($coverageNode = $indexingNode->getChildByName('coverage')) { for ($index = 0; $node = $coverageNode->getChildByName('geographical', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperCoverageGeoLocaleUnsupported', array('paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale)); return false; } $paper->setCoverageGeo($node->getValue(), $locale); } for ($index = 0; $node = $coverageNode->getChildByName('chronological', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperCoverageChronLocaleUnsupported', array('paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale)); return false; } $paper->setCoverageChron($node->getValue(), $locale); } for ($index = 0; $node = $coverageNode->getChildByName('sample', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperCoverageSampleLocaleUnsupported', array('paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale)); return false; } $paper->setCoverageSample($node->getValue(), $locale); } } } for ($index = 0; $node = $paperNode->getChildByName('sponsor', $index); $index++) { $locale = $node->getAttribute('locale'); if ($locale == '') { $locale = $conferencePrimaryLocale; } elseif (!in_array($locale, $conferenceSupportedLocales)) { $errors[] = array('plugins.importexport.native.import.error.paperSponsorLocaleUnsupported', array('paperTitle' => $paper->getLocalizedTitle(), 'locale' => $locale)); return false; } $paper->setSponsor($node->getValue(), $locale); } if ($node = $paperNode->getChildByName('pages')) { $paper->setPages($node->getValue()); } if ($language = $paperNode->getAttribute('language')) { $paper->setLanguage($language); } /* --- Handle authors --- */ $hasErrors = false; for ($index = 0; $node = $paperNode->getChildByName('author', $index); $index++) { if (!NativeImportDom::handleAuthorNode($conference, $schedConf, $node, $track, $paper, $authorErrors)) { $errors = array_merge($errors, $authorErrors); $hasErrors = true; } } if ($hasErrors) { return false; } $paperDao->insertPaper($paper); $dependentItems[] = array('paper', $paper); // Log the import in the paper event log. import('paper.log.PaperLog'); import('paper.log.PaperEventLogEntry'); PaperLog::logEvent($paper->getId(), PAPER_LOG_PAPER_IMPORT, PAPER_LOG_DEFAULT, 0, 'log.imported', array('userName' => $user->getFullName(), 'paperId' => $paper->getId())); // Insert published paper entry. $publishedPaper = new PublishedPaper(); $publishedPaper->setPaperId($paper->getId()); $publishedPaper->setSchedConfId($schedConf->getId()); if ($node = $paperNode->getChildByName('date_published')) { $publishedDate = strtotime($node->getValue()); if ($publishedDate === -1) { $errors[] = array('plugins.importexport.native.import.error.invalidDate', array('value' => $node->getValue())); return false; } else { $publishedPaper->setDatePublished($publishedDate); } } $node = $paperNode->getChildByName('open_access'); $publishedPaper->setSeq(REALLY_BIG_NUMBER); $publishedPaper->setViews(0); $publishedPaper->setPublicPaperId($paperNode->getAttribute('public_id')); $publishedPaper->setPubId($publishedPaperDao->insertPublishedPaper($publishedPaper)); $publishedPaperDao->resequencePublishedPapers($track->getId(), $schedConf->getId()); /* --- Galleys (html or otherwise handled simultaneously) --- */ import('file.PaperFileManager'); $paperFileManager = new PaperFileManager($paper->getId()); /* --- Handle galleys --- */ $hasErrors = false; $galleyCount = 0; for ($index = 0; $index < count($paperNode->children); $index++) { $node =& $paperNode->children[$index]; if ($node->getName() == 'htmlgalley') { $isHtml = true; } elseif ($node->getName() == 'galley') { $isHtml = false; } else { continue; } if (!NativeImportDom::handleGalleyNode($conference, $schedConf, $node, $track, $paper, $galleyErrors, $isCommandLine, $isHtml, $galleyCount, $paperFileManager)) { $errors = array_merge($errors, $galleyErrors); $hasErrors = true; } $galleyCount++; } if ($hasErrors) { return false; } /* --- Handle supplemental files --- */ $hasErrors = false; for ($index = 0; $node = $paperNode->getChildByName('supplemental_file', $index); $index++) { if (!NativeImportDom::handleSuppFileNode($conference, $schedConf, $node, $track, $paper, $suppFileErrors, $isCommandLine, $paperFileManager)) { $errors = array_merge($errors, $suppFileErrors); $hasErrors = true; } } if ($hasErrors) { return false; } // Index the inserted paper. import('search.PaperSearchIndex'); PaperSearchIndex::indexPaperMetadata($paper); PaperSearchIndex::indexPaperFiles($paper); return true; }
/** * Upload the revised version of a paper. * @param $authorSubmission object */ function uploadRevisedVersion($authorSubmission) { import('file.PaperFileManager'); $paperFileManager = new PaperFileManager($authorSubmission->getPaperId()); $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO'); $fileName = 'upload'; if ($paperFileManager->uploadError($fileName)) { return false; } if (!$paperFileManager->uploadedFileExists($fileName)) { return false; } HookRegistry::call('AuthorAction::uploadRevisedVersion', array(&$authorSubmission)); if ($authorSubmission->getRevisedFileId() != null) { $fileId = $paperFileManager->uploadDirectorDecisionFile($fileName, $authorSubmission->getRevisedFileId()); } else { $fileId = $paperFileManager->uploadDirectorDecisionFile($fileName); } if (!$fileId) { return false; } $authorSubmission->setRevisedFileId($fileId); $authorSubmissionDao->updateAuthorSubmission($authorSubmission); // Add log entry $user =& Request::getUser(); import('paper.log.PaperLog'); import('paper.log.PaperEventLogEntry'); PaperLog::logEvent($authorSubmission->getPaperId(), PAPER_LOG_AUTHOR_REVISION, LOG_TYPE_AUTHOR, $user->getId(), 'log.author.documentRevised', array('authorName' => $user->getFullName(), 'fileId' => $fileId, 'paperId' => $authorSubmission->getPaperId())); }
/** * 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')); for ($i = 0, $count = count($deletedAuthors); $i < $count; $i++) { $paper->removeAuthor($deletedAuthors[$i]); } // Save the paper $paperDao->updatePaper($paper); // Log the submission, even though it may not be "complete" // at this step. This is important because we don't otherwise // capture changes in review process. import('paper.log.PaperLog'); import('paper.log.PaperEventLogEntry'); PaperLog::logEvent($this->paperId, PAPER_LOG_ABSTRACT_SUBMIT, LOG_TYPE_AUTHOR, $user->getId(), 'log.author.abstractSubmitted', array('submissionId' => $paper->getId(), 'authorName' => $user->getFullName())); return $this->paperId; }
/** * Restores a submission to the queue. * @param $trackDirectorSubmission object */ function restoreToQueue($trackDirectorSubmission) { if (HookRegistry::call('TrackDirectorAction::restoreToQueue', array(&$trackDirectorSubmission))) { return; } $trackDirectorSubmissionDao =& DAORegistry::getDAO('TrackDirectorSubmissionDAO'); // Determine which queue to return the paper to: the // scheduling queue or the editing queue. $publishedPaperDao =& DAORegistry::getDAO('PublishedPaperDAO'); $publishedPaper =& $publishedPaperDao->getPublishedPaperByPaperId($trackDirectorSubmission->getPaperId()); if ($publishedPaper) { $trackDirectorSubmission->setStatus(STATUS_PUBLISHED); } else { $trackDirectorSubmission->setStatus(STATUS_QUEUED); } unset($publishedPaper); $trackDirectorSubmission->stampStatusModified(); $trackDirectorSubmissionDao->updateTrackDirectorSubmission($trackDirectorSubmission); // Add log import('paper.log.PaperLog'); import('paper.log.PaperEventLogEntry'); PaperLog::logEvent($trackDirectorSubmission->getPaperId(), PAPER_LOG_DIRECTOR_RESTORE, LOG_TYPE_DIRECTOR, $trackDirectorSubmission->getPaperId(), 'log.director.restored', array('paperId' => $trackDirectorSubmission->getPaperId())); }
/** * Save metadata. * @param $paper object */ function saveMetadata($paper) { if (!HookRegistry::call('Action::saveMetadata', array(&$paper))) { import('classes.submission.form.MetadataForm'); $metadataForm = new MetadataForm($paper); $metadataForm->readInputData(); // Check for any special cases before trying to save if (Request::getUserVar('addAuthor')) { // Add an author $editData = true; $authors = $metadataForm->getData('authors'); array_push($authors, array()); $metadataForm->setData('authors', $authors); } else { if (($delAuthor = Request::getUserVar('delAuthor')) && count($delAuthor) == 1) { // Delete an author $editData = true; list($delAuthor) = array_keys($delAuthor); $delAuthor = (int) $delAuthor; $authors = $metadataForm->getData('authors'); if (isset($authors[$delAuthor]['authorId']) && !empty($authors[$delAuthor]['authorId'])) { $deletedAuthors = explode(':', $metadataForm->getData('deletedAuthors')); array_push($deletedAuthors, $authors[$delAuthor]['authorId']); $metadataForm->setData('deletedAuthors', join(':', $deletedAuthors)); } array_splice($authors, $delAuthor, 1); $metadataForm->setData('authors', $authors); if ($metadataForm->getData('primaryContact') == $delAuthor) { $metadataForm->setData('primaryContact', 0); } } else { if (Request::getUserVar('moveAuthor')) { // Move an author up/down $editData = true; $moveAuthorDir = Request::getUserVar('moveAuthorDir'); $moveAuthorDir = $moveAuthorDir == 'u' ? 'u' : 'd'; $moveAuthorIndex = (int) Request::getUserVar('moveAuthorIndex'); $authors = $metadataForm->getData('authors'); if (!($moveAuthorDir == 'u' && $moveAuthorIndex <= 0 || $moveAuthorDir == 'd' && $moveAuthorIndex >= count($authors) - 1)) { $tmpAuthor = $authors[$moveAuthorIndex]; $primaryContact = $metadataForm->getData('primaryContact'); if ($moveAuthorDir == 'u') { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex - 1]; $authors[$moveAuthorIndex - 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $metadataForm->setData('primaryContact', $moveAuthorIndex - 1); } else { if ($primaryContact == $moveAuthorIndex - 1) { $metadataForm->setData('primaryContact', $moveAuthorIndex); } } } else { $authors[$moveAuthorIndex] = $authors[$moveAuthorIndex + 1]; $authors[$moveAuthorIndex + 1] = $tmpAuthor; if ($primaryContact == $moveAuthorIndex) { $metadataForm->setData('primaryContact', $moveAuthorIndex + 1); } else { if ($primaryContact == $moveAuthorIndex + 1) { $metadataForm->setData('primaryContact', $moveAuthorIndex); } } } } $metadataForm->setData('authors', $authors); } } } if (isset($editData)) { $metadataForm->display(); return false; } else { if (!$metadataForm->validate()) { return $metadataForm->display(); } $metadataForm->execute(); // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $notificationUsers = $paper->getAssociatedUserIds(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, null, $userRole['role'], 'submission', $paper->getId(), null, 'metadata'); $notificationManager->createNotification($userRole['id'], 'notification.type.metadataModified', $paper->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_METADATA_MODIFIED); } // Add log entry $user =& Request::getUser(); import('classes.paper.log.PaperLog'); import('classes.paper.log.PaperEventLogEntry'); PaperLog::logEvent($paper->getId(), PAPER_LOG_METADATA_UPDATE, LOG_TYPE_DEFAULT, 0, 'log.director.metadataModified', array('directorName' => $user->getFullName())); return true; } } }