Skip to content

Commit

Permalink
pkp/pkp-lib#8389 Consider submission introducer
Browse files Browse the repository at this point in the history
  • Loading branch information
defstat committed Jan 18, 2023
1 parent e7f99bd commit c2c740c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion QuickSubmitForm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class QuickSubmitForm extends Form {
/** @var SubmissionMetadataFormImplementation */
protected $_metadataFormImplem;

private QuickSubmitPlugin $_plugin;

/**
* Constructor
* @param $plugin object
Expand All @@ -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();

Expand Down Expand Up @@ -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());

Expand Down
11 changes: 10 additions & 1 deletion QuickSubmitPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
}
}

0 comments on commit c2c740c

Please sign in to comment.