From 21aa1e90d5ffe59bcc15402406f9ffcfa1ca5811 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 17 Dec 2015 16:10:20 +0100 Subject: Add a notification for the admins to enable the monthly report --- appinfo/app.php | 12 ++++-------- appinfo/application.php | 3 ++- appinfo/info.xml | 2 +- appinfo/install.php | 24 ++++++++++++++++++++++++ appinfo/update.php | 24 ++++++++++++++++++++++++ 5 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 appinfo/install.php create mode 100644 appinfo/update.php (limited to 'appinfo') diff --git a/appinfo/app.php b/appinfo/app.php index 989c921..534d3e3 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -21,12 +21,8 @@ \OCP\App::registerAdmin('popularitycontestclient', 'admin'); -if (\OC::$server->getRequest()->getParam('popularitycontestclient')) { - $collector = new \OCA\PopularityContestClient\Collector( - \OC::$server->getConfig(), - \OC::$server->getDatabaseConnection(), - \OC::$server->getIniWrapper(), - \OC::$server->getL10NFactory()->get('popularitycontestclient') +\OC::$server->getNotificationManager()->registerNotifier(function() { + return new \OCA\PopularityContestClient\Notifier( + \OC::$server->getL10NFactory() ); - throw new \OC\HintException(json_encode($collector->getReport(), JSON_PRETTY_PRINT)); -} +}); diff --git a/appinfo/application.php b/appinfo/application.php index 5007cdc..2b784aa 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -39,7 +39,8 @@ class Application extends App { $c->query('AppName'), $server->getRequest(), $c->query('OCA\PopularityContestClient\Collector'), - $server->getJobList() + $server->getJobList(), + $server->getNotificationManager() ); }); diff --git a/appinfo/info.xml b/appinfo/info.xml index 65f1a11..ac8e8a1 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ AGPL Joas Schilling, Björn Schiessle - 0.1.0 + 0.1.5 PopularityContestClient other diff --git a/appinfo/install.php b/appinfo/install.php new file mode 100644 index 0000000..29c6ea6 --- /dev/null +++ b/appinfo/install.php @@ -0,0 +1,24 @@ + + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +if (!\OC::$server->getJobList()->has('OCA\PopularityContestClient\MonthlyReport', null)) { + \OC::$server->getJobList()->add('OCA\PopularityContestClient\AdminNotification'); +} diff --git a/appinfo/update.php b/appinfo/update.php new file mode 100644 index 0000000..29c6ea6 --- /dev/null +++ b/appinfo/update.php @@ -0,0 +1,24 @@ + + * + * @copyright Copyright (c) 2015, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +if (!\OC::$server->getJobList()->has('OCA\PopularityContestClient\MonthlyReport', null)) { + \OC::$server->getJobList()->add('OCA\PopularityContestClient\AdminNotification'); +} -- cgit v1.2.3