Skip to content

Commit

Permalink
pkp/pkp-lib#9678 removed scheduled_task config usage
Browse files Browse the repository at this point in the history
  • Loading branch information
touhidurabir committed Jul 2, 2024
1 parent 7f6a28f commit 05c635b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
[submodule "plugins/generic/crossref"]
path = plugins/generic/crossref
url = https://github.com/pkp/crossref-ojs
[submodule "plugins/generic/acron"]
path = plugins/generic/acron
url = https://github.com/pkp/acron
[submodule "plugins/generic/webFeed"]
path = plugins/generic/webFeed
url = https://github.com/pkp/webFeed.git
2 changes: 0 additions & 2 deletions classes/subscription/form/SubscriptionPolicyForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use APP\core\Application;
use APP\journal\JournalDAO;
use APP\template\TemplateManager;
use PKP\config\Config;
use PKP\db\DAORegistry;
use PKP\form\Form;

Expand Down Expand Up @@ -105,7 +104,6 @@ public function fetch($request, $template = null, $display = false)
'validNumWeeksBeforeExpiry' => $this->validNumWeeksBeforeExpiry,
'validNumMonthsAfterExpiry' => $this->validNumMonthsAfterExpiry,
'validNumWeeksAfterExpiry' => $this->validNumWeeksAfterExpiry,
'scheduledTasksEnabled' => (bool) Config::getVar('general', 'scheduled_tasks'),
'paymentsEnabled' => $paymentManager->isConfigured(),
]);

Expand Down
11 changes: 4 additions & 7 deletions config.TEMPLATE.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@
; To set the "Secure" attribute for the cookie see the setting force_ssl at the [security] group
session_samesite = Lax

; Enable support for running scheduled tasks
; Set this to On if you have set up the scheduled tasks script to
; execute periodically
scheduled_tasks = Off

; Site time zone
; Please refer to https://www.php.net/timezones for a full list of supported
; time zones.
Expand Down Expand Up @@ -593,7 +588,6 @@
; * * * * * cd /path-to-your-project && php lib/pkp/tools/scheduler.php run >> /dev/null 2>&1
;
; See: <link-to-documentation>
;
task_runner = On

; How often should be built in schedule task runner should run schedule tasks at the
Expand All @@ -604,9 +598,12 @@
;
; The default value set to 60 seconds and it is recommened not to to set any value less
; that it to avoid making possibility of application beign slow.
;
task_runner_interval = 60

; This allow to sent the schedule task result notification mail only when there is an
; error has occurred.
scheduled_tasks_report_error_only = On

[invitations]
expiration_days = 3

Expand Down
5 changes: 0 additions & 5 deletions pages/payments/PaymentsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use APP\subscription\form\PaymentTypesForm;
use APP\subscription\form\SubscriptionPolicyForm;
use APP\template\TemplateManager;
use PKP\config\Config;
use PKP\core\JSONMessage;
use PKP\core\PKPApplication;
use PKP\security\authorization\PKPSiteAccessPolicy;
Expand Down Expand Up @@ -142,10 +141,6 @@ public function subscriptionPolicies($args, $request)

$templateMgr = TemplateManager::getManager($request);

if (Config::getVar('general', 'scheduled_tasks')) {
$templateMgr->assign('scheduledTasksEnabled', true);
}

$paymentManager = Application::getPaymentManager($request->getJournal());
$templateMgr->assign('acceptSubscriptionPayments', $paymentManager->isConfigured());

Expand Down
14 changes: 5 additions & 9 deletions templates/payments/subscriptionPolicyForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,10 @@

{fbvFormSection label="manager.subscriptionPolicies.expiryReminders"}
<p>{translate key="manager.subscriptionPolicies.expiryRemindersDescription"}</p>
{fbvElement type="select" id="numMonthsBeforeSubscriptionExpiryReminder" name="numMonthsBeforeSubscriptionExpiryReminder" selected=$numMonthsBeforeSubscriptionExpiryReminder from=$validNumMonthsBeforeExpiry label="manager.subscriptionPolicies.expiryReminderBeforeMonths" disabled=$scheduledTasksEnabled|compare:0 size=$fbvStyles.size.MEDIUM translate=false inline=true}
{fbvElement type="select" id="numWeeksBeforeSubscriptionExpiryReminder" name="numWeeksBeforeSubscriptionExpiryReminder" selected=$numWeeksBeforeSubscriptionExpiryReminder from=$validNumWeeksBeforeExpiry label="manager.subscriptionPolicies.expiryReminderBeforeWeeks" disabled=$scheduledTasksEnabled|compare:0 size=$fbvStyles.size.MEDIUM translate=false inline=true}
{fbvElement type="select" id="numMonthsAfterSubscriptionExpiryReminder" name="numMonthsAfterSubscriptionExpiryReminder" selected=$numMonthsAfterSubscriptionExpiryReminder from=$validNumMonthsAfterExpiry label="manager.subscriptionPolicies.expiryReminderAfterMonths" disabled=$scheduledTasksEnabled|compare:0 size=$fbvStyles.size.MEDIUM translate=false inline=true}
{fbvElement type="select" id="numWeeksAfterSubscriptionExpiryReminder" name="numWeeksAfterSubscriptionExpiryReminder" selected=$numWeeksAfterSubscriptionExpiryReminder from=$validNumWeeksAfterExpiry label="manager.subscriptionPolicies.expiryReminderAfterWeeks" disabled=$scheduledTasksEnabled|compare:0 size=$fbvStyles.size.MEDIUM translate=false inline=true}

{if !$scheduledTasksEnabled}
<span>{translate key="manager.subscriptionPolicies.expiryRemindersDisabled"}</span>
{/if}
{fbvElement type="select" id="numMonthsBeforeSubscriptionExpiryReminder" name="numMonthsBeforeSubscriptionExpiryReminder" selected=$numMonthsBeforeSubscriptionExpiryReminder from=$validNumMonthsBeforeExpiry label="manager.subscriptionPolicies.expiryReminderBeforeMonths" size=$fbvStyles.size.MEDIUM translate=false inline=true}
{fbvElement type="select" id="numWeeksBeforeSubscriptionExpiryReminder" name="numWeeksBeforeSubscriptionExpiryReminder" selected=$numWeeksBeforeSubscriptionExpiryReminder from=$validNumWeeksBeforeExpiry label="manager.subscriptionPolicies.expiryReminderBeforeWeeks" size=$fbvStyles.size.MEDIUM translate=false inline=true}
{fbvElement type="select" id="numMonthsAfterSubscriptionExpiryReminder" name="numMonthsAfterSubscriptionExpiryReminder" selected=$numMonthsAfterSubscriptionExpiryReminder from=$validNumMonthsAfterExpiry label="manager.subscriptionPolicies.expiryReminderAfterMonths" size=$fbvStyles.size.MEDIUM translate=false inline=true}
{fbvElement type="select" id="numWeeksAfterSubscriptionExpiryReminder" name="numWeeksAfterSubscriptionExpiryReminder" selected=$numWeeksAfterSubscriptionExpiryReminder from=$validNumWeeksAfterExpiry label="manager.subscriptionPolicies.expiryReminderAfterWeeks" size=$fbvStyles.size.MEDIUM translate=false inline=true}
{/fbvFormSection}

{fbvFormSection label="manager.subscriptionPolicies.onlinePaymentNotifications" list=true}
Expand All @@ -67,7 +63,7 @@
{/if}
{/fbvFormSection}
{fbvFormSection label="manager.subscriptionPolicies.openAccessOptions" list=true}
{fbvElement type="checkbox" id="enableOpenAccessNotification" name="enableOpenAccessNotification" value=1 checked=$enableOpenAccessNotification label="manager.subscriptionPolicies.openAccessNotificationDescription" disabled=$scheduledTasksEnabled|compare:0}
{fbvElement type="checkbox" id="enableOpenAccessNotification" name="enableOpenAccessNotification" value=1 checked=$enableOpenAccessNotification label="manager.subscriptionPolicies.openAccessNotificationDescription"}
{/fbvFormSection}

{fbvFormButtons hideCancel=true submitText="common.save"}
Expand Down

0 comments on commit 05c635b

Please sign in to comment.