diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-12-17 18:10:20 +0300 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-12-17 18:10:20 +0300 |
commit | 21aa1e90d5ffe59bcc15402406f9ffcfa1ca5811 (patch) | |
tree | 09d74acdaf6488a25817ddaa6312d8f6bddd9aee /appinfo | |
parent | a6dcb4628d0ed2fc51263f3e05597903364350cc (diff) |
Add a notification for the admins to enable the monthly report
Diffstat (limited to 'appinfo')
-rw-r--r-- | appinfo/app.php | 12 | ||||
-rw-r--r-- | appinfo/application.php | 3 | ||||
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | appinfo/install.php | 24 | ||||
-rw-r--r-- | appinfo/update.php | 24 |
5 files changed, 55 insertions, 10 deletions
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 @@ <description/> <licence>AGPL</licence> <author>Joas Schilling, Björn Schiessle</author> - <version>0.1.0</version> + <version>0.1.5</version> <namespace>PopularityContestClient</namespace> <category>other</category> <dependencies> 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 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @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 <http://www.gnu.org/licenses/> + * + */ + +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 @@ +<?php +/** + * @author Joas Schilling <nickvergessen@owncloud.com> + * + * @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 <http://www.gnu.org/licenses/> + * + */ + +if (!\OC::$server->getJobList()->has('OCA\PopularityContestClient\MonthlyReport', null)) { + \OC::$server->getJobList()->add('OCA\PopularityContestClient\AdminNotification'); +} |