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

pkp/pkp-lib#8389 Consider submission introducer #63

Closed
wants to merge 1 commit into from
Closed
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
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);
}
}