Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update publication on chapter and representation update #1

Open
wants to merge 2 commits into
base: stable-3_3_0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ function deleteFormat($args, $request) {
$notificationMgr = new NotificationManager();
$notificationMgr->createTrivialNotification($currentUser->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('notification.removedPublicationFormat')));

$publication = Services::get('publication')->edit($publication, [], $request);

return DAO::getDataChangedEvent();
}

Expand Down Expand Up @@ -383,6 +385,8 @@ function setApproved($args, $request) {
$publicationFormatTombstoneMgr->insertTombstoneByPublicationFormat($representation, $request->getContext());
}

$publication = Services::get('publication')->edit($publication, [], $request);

return DAO::getDataChangedEvent($representation->getId());
}

Expand Down Expand Up @@ -425,6 +429,8 @@ function setAvailable($args, $request) {
$publicationFormatTombstoneMgr->insertTombstoneByPublicationFormat($publicationFormat, $context);
}

$publication = Services::get('publication')->edit($publication, [], $request);

return DAO::getDataChangedEvent($publicationFormat->getId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ function readInputData() {
* @see Form::execute()
*/
function execute(...$functionParams) {
parent::execute(...$functionParams);

$publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO'); /* @var $publicationFormatDao PublicationFormatDAO */
$publicationFormat = $this->getPublicationFormat();
if (!$publicationFormat) {
Expand Down Expand Up @@ -188,8 +186,10 @@ function execute(...$functionParams) {
SubmissionLog::logEvent(Application::get()->getRequest(), $this->getMonograph(), SUBMISSION_LOG_PUBLICATION_FORMAT_CREATE, 'submission.event.publicationFormatCreated', array('formatName' => $publicationFormat->getLocalizedName()));
}

parent::execute(...$functionParams);

$publication = Services::get('publication')->edit($publication, [], Application::get()->getRequest());

return $representationId;
}
}


4 changes: 2 additions & 2 deletions controllers/grid/users/chapter/ChapterGridHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ function deleteChapter($args, $request) {

$chapterDao = DAORegistry::getDAO('ChapterDAO'); /* @var $chapterDao ChapterDAO */
$chapterDao->deleteById($chapterId);
$publication = $this->getPublication();
$publication = Services::get('publication')->edit($publication, [], $request);
return DAO::getDataChangedEvent();
}

Expand All @@ -495,5 +497,3 @@ function _getChapterFromRequest($request) {
);
}
}


8 changes: 4 additions & 4 deletions controllers/grid/users/chapter/form/ChapterForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ function readInputData() {
* @see Form::execute()
*/
function execute(...$functionParams) {
parent::execute(...$functionParams);

$chapterDao = DAORegistry::getDAO('ChapterDAO'); /* @var $chapterDao ChapterDAO */
$chapter = $this->getChapter();
$isEdit = !!$chapter;
Expand Down Expand Up @@ -238,8 +236,10 @@ function execute(...$functionParams) {
DAORegistry::getDAO('SubmissionFileDAO')->updateChapterFiles($selectedFiles, $this->getChapter()->getId());
}

parent::execute(...$functionParams);

$publication = Services::get('publication')->edit($publication, [], Application::get()->getRequest());

return true;
}
}


Loading