Skip to content

Commit

Permalink
pkp/pkp-lib#5716 Separate email template installation from migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr authored and withanage committed Dec 14, 2022
1 parent 4461c8a commit c838a7f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 14 deletions.
6 changes: 6 additions & 0 deletions classes/install/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@

class Upgrade extends Installer
{
protected $appEmailTemplateVariableNames = [
'contextName' => 'journalName',
'contextUrl' => 'journalUrl',
'contextSignature' => 'journalSignature',
];

/**
* Constructor.
*
Expand Down
46 changes: 46 additions & 0 deletions classes/migration/upgrade/v3_4_0/InstallEmailTemplates.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

/**
* @file classes/migration/upgrade/v3_4_0/InstallEmailTemplates.php
*
* Copyright (c) 2014-2022 Simon Fraser University
* Copyright (c) 2000-2022 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class InstallEmailTemplates
* @brief Install new email templates for 3.4
*/

namespace APP\migration\upgrade\v3_4_0;

class InstallEmailTemplates extends \PKP\migration\upgrade\v3_4_0\InstallEmailTemplates
{
protected function getEmailTemplateKeys(): array
{
return [
'EDITOR_DECISION_NOTIFY_OTHER_AUTHORS',
'EDITOR_DECISION_NEW_ROUND',
'EDITOR_DECISION_REVERT_DECLINE',
'EDITOR_DECISION_REVERT_INITIAL_DECLINE',
'EDITOR_DECISION_SKIP_REVIEW',
'EDITORIAL_REMINDER',
'EDITOR_DECISION_BACK_FROM_PRODUCTION',
'EDITOR_DECISION_BACK_FROM_COPYEDITING',
'EDITOR_DECISION_CANCEL_REVIEW_ROUND',
'REVIEW_RESEND_REQUEST',
'DISCUSSION_NOTIFICATION_SUBMISSION',
'DISCUSSION_NOTIFICATION_REVIEW',
'DISCUSSION_NOTIFICATION_COPYEDITING',
'DISCUSSION_NOTIFICATION_PRODUCTION',
];
}

protected function getAppVariableNames(): array
{
return [
'contextName' => 'journalName',
'contextUrl' => 'journalUrl',
'contextSignature' => 'journalSignature',
];
}
}
14 changes: 0 additions & 14 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,6 @@
<migration class="PKP\migration\upgrade\v3_4_0\I7287_RemoveEmailTemplatesDefault"/>
<migration class="APP\migration\upgrade\v3_4_0\I5716_EmailTemplateAssignments"/>
<data file="dbscripts/xml/upgrade/3.4.0_preupdate_email_templates.xml" />
<code function="installEmailTemplate" key="EDITOR_DECISION_NOTIFY_OTHER_AUTHORS" locales="en_US" />
<code function="installEmailTemplate" key="EDITOR_DECISION_NEW_ROUND" locales="en_US" />
<code function="installEmailTemplate" key="EDITOR_DECISION_REVERT_DECLINE" locales="en_US" />
<code function="installEmailTemplate" key="EDITOR_DECISION_REVERT_INITIAL_DECLINE" locales="en_US" />
<code function="installEmailTemplate" key="EDITOR_DECISION_SKIP_REVIEW" locales="en_US" />
<code function="installEmailTemplate" key="EDITORIAL_REMINDER" locales="en_US" />
<code function="installEmailTemplate" key="EDITOR_DECISION_BACK_FROM_PRODUCTION" locales="en_US" />
<code function="installEmailTemplate" key="EDITOR_DECISION_BACK_FROM_COPYEDITING" locales="en_US" />
<code function="installEmailTemplate" key="EDITOR_DECISION_CANCEL_REVIEW_ROUND" locales="en_US" />
<code function="installEmailTemplate" key="REVIEW_RESEND_REQUEST" locales="en_US" />
<code function="installEmailTemplate" key="DISCUSSION_NOTIFICATION_SUBMISSION" locales="en_US" />
<code function="installEmailTemplate" key="DISCUSSION_NOTIFICATION_REVIEW" locales="en_US" />
<code function="installEmailTemplate" key="DISCUSSION_NOTIFICATION_COPYEDITING" locales="en_US" />
<code function="installEmailTemplate" key="DISCUSSION_NOTIFICATION_PRODUCTION" locales="en_US" />
<note file="docs/release-notes/README-3.4.0" />
</upgrade>

Expand Down

0 comments on commit c838a7f

Please sign in to comment.