-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathSendAdminNotification.php
More file actions
39 lines (31 loc) · 948 Bytes
/
SendAdminNotification.php
File metadata and controls
39 lines (31 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Survey_Client\Migration;
use OCA\Survey_Client\BackgroundJobs\AdminNotification;
use OCA\Survey_Client\BackgroundJobs\MonthlyReport;
use OCP\AppFramework\Services\IAppConfig;
use OCP\BackgroundJob\IJobList;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
class SendAdminNotification implements IRepairStep {
public function __construct(
protected IJobList $jobList,
protected IAppConfig $appConfig,
) {
}
public function getName(): string {
return 'Send an admin notification if monthly report is disabled';
}
public function run(IOutput $output): void {
if ($this->appConfig->getAppValueBool('never_again')) {
return;
}
if (!$this->jobList->has(MonthlyReport::class, null)) {
$this->jobList->add(AdminNotification::class);
}
}
}