From c2c740c445d07c6f16936bb1eeaf9aaeb90a167f Mon Sep 17 00:00:00 2001 From: Dimitris Efstathiou Date: Wed, 18 Jan 2023 18:48:09 +0200 Subject: [PATCH] pkp/pkp-lib#8389 Consider submission introducer --- QuickSubmitForm.inc.php | 6 +++++- QuickSubmitPlugin.inc.php | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/QuickSubmitForm.inc.php b/QuickSubmitForm.inc.php index a38124e..092804d 100644 --- a/QuickSubmitForm.inc.php +++ b/QuickSubmitForm.inc.php @@ -36,6 +36,8 @@ class QuickSubmitForm extends Form { /** @var SubmissionMetadataFormImplementation */ protected $_metadataFormImplem; + private QuickSubmitPlugin $_plugin; + /** * Constructor * @param $plugin object @@ -44,6 +46,8 @@ class QuickSubmitForm extends Form { function __construct($plugin, $request) { parent::__construct($plugin->getTemplateResource('index.tpl')); + $this->_plugin = $plugin; + $this->_request = $request; $this->_context = $request->getContext(); @@ -236,7 +240,7 @@ function initData() { $publication->setData('status', STATUS_QUEUED); $publication->setData('version', 1); - Repo::submission()->add($this->_submission, $publication); + Repo::submission()->add($this->_submission, $publication, $this->_context, $this->_plugin); $this->_submission = Repo::submission()->get($this->_submission->getId()); $this->setData('submissionId', $this->_submission->getId()); diff --git a/QuickSubmitPlugin.inc.php b/QuickSubmitPlugin.inc.php index 29aec6a..e5448e9 100644 --- a/QuickSubmitPlugin.inc.php +++ b/QuickSubmitPlugin.inc.php @@ -14,8 +14,10 @@ */ use PKP\core\JSONMessage; +use PKP\log\contracts\iSubmissionIntroducer; +use PKP\log\contracts\SubmissionIntroducerEventEntry; -class QuickSubmitPlugin extends \PKP\plugins\ImportExportPlugin { +class QuickSubmitPlugin extends \PKP\plugins\ImportExportPlugin implements iSubmissionIntroducer { /** * @copydoc Plugin::register() @@ -235,5 +237,12 @@ public function usage($scriptName) { public function executeCLI($scriptName, &$args) { fatalError('Not implemented'); } + + /** + * @return SubmissionIntroducerEventEntry + */ + public function getSubmissionIntroducerEventEntry(): SubmissionIntroducerEventEntry { + return new SubmissionIntroducerEventEntry($this); + } }