Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/survey_client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2016-07-11 15:37:14 +0300
committerGitHub <noreply@github.com>2016-07-11 15:37:14 +0300
commit113321ab249b0943f94dc86d04cbce0f82490de5 (patch)
tree57e6bb4d5e51c42e5fc1d52b94de72a392debe8b
parent13d93c9381e4c1ab18ecc80829e2e706ff3bcf05 (diff)
parent89b761bc40d4c81d5684b2f9ab51cc304db92aae (diff)
Merge pull request #1 from nextcloud/change-app-name
change app name from popularity contest client to survey client
-rw-r--r--admin.php18
-rw-r--r--adminnotification.php8
-rw-r--r--appinfo/app.php23
-rw-r--r--appinfo/application.php14
-rw-r--r--appinfo/info.xml14
-rw-r--r--appinfo/install.php4
-rw-r--r--appinfo/routes.php14
-rw-r--r--appinfo/update.php4
-rw-r--r--categories/apps.php4
-rw-r--r--categories/database.php4
-rw-r--r--categories/encryption.php4
-rw-r--r--categories/files_sharing.php4
-rw-r--r--categories/icategory.php4
-rw-r--r--categories/owncloud.php4
-rw-r--r--categories/php.php4
-rw-r--r--categories/stats.php4
-rw-r--r--collector.php30
-rw-r--r--controller/endpointcontroller.php14
-rw-r--r--css/admin.css2
-rw-r--r--js/admin.js16
-rw-r--r--monthlyreport.php8
-rw-r--r--notifier.php10
-rw-r--r--templates/admin.php12
23 files changed, 119 insertions, 104 deletions
diff --git a/admin.php b/admin.php
index 14742fe..05d5053 100644
--- a/admin.php
+++ b/admin.php
@@ -21,26 +21,26 @@
use OCP\Template;
-\OCP\Util::addScript('popularitycontestclient', 'admin');
-\OCP\Util::addStyle('popularitycontestclient', 'admin');
+\OCP\Util::addScript('survey_client', 'admin');
+\OCP\Util::addStyle('survey_client', 'admin');
-$application = new \OCA\PopularityContestClient\AppInfo\Application();
-$collector = $application->getContainer()->query('OCA\PopularityContestClient\Collector');
+$application = new \OCA\Survey_Client\AppInfo\Application();
+$collector = $application->getContainer()->query('OCA\Survey_Client\Collector');
-$lastSentReportTime = (int) \OC::$server->getConfig()->getAppValue('popularitycontestclient', 'last_sent', 0);
+$lastSentReportTime = (int) \OC::$server->getConfig()->getAppValue('survey_client', 'last_sent', 0);
if ($lastSentReportTime === 0) {
- $lastSentReportDate = \OC::$server->getL10NFactory()->get('popularitycontestclient')->t('Never');
+ $lastSentReportDate = \OC::$server->getL10NFactory()->get('survey_client')->t('Never');
} else {
$lastSentReportDate = \OC::$server->getDateTimeFormatter()->formatDate($lastSentReportTime);
}
-$lastReport = \OC::$server->getConfig()->getAppValue('popularitycontestclient', 'last_report', '');
+$lastReport = \OC::$server->getConfig()->getAppValue('survey_client', 'last_report', '');
if ($lastReport !== '') {
$lastReport = json_encode(json_decode($lastReport, true), JSON_PRETTY_PRINT);
}
-$template = new Template('popularitycontestclient', 'admin');
-$template->assign('is_enabled', \OC::$server->getJobList()->has('OCA\PopularityContestClient\MonthlyReport', null));
+$template = new Template('survey_client', 'admin');
+$template->assign('is_enabled', \OC::$server->getJobList()->has('OCA\Survey_Client\MonthlyReport', null));
$template->assign('last_sent', $lastSentReportDate);
$template->assign('last_report', $lastReport);
$template->assign('categories', $collector->getCategories());
diff --git a/adminnotification.php b/adminnotification.php
index 722157c..4e225be 100644
--- a/adminnotification.php
+++ b/adminnotification.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\PopularityContestClient;
+namespace OCA\Survey_Client;
use OC\BackgroundJob\QueuedJob;
@@ -29,7 +29,7 @@ class AdminNotification extends QueuedJob {
$urlGenerator = \OC::$server->getURLGenerator();
$notification = $manager->createNotification();
- $notification->setApp('popularitycontestclient')
+ $notification->setApp('survey_client')
->setDateTime(new \DateTime())
->setSubject('updated')
->setObject('dummy', 23)
@@ -37,13 +37,13 @@ class AdminNotification extends QueuedJob {
$enableAction = $notification->createAction();
$enableAction->setLabel('enable')
- ->setLink($urlGenerator->getAbsoluteURL('ocs/v2.php/apps/popularitycontestclient/api/v1/monthly'), 'POST')
+ ->setLink($urlGenerator->getAbsoluteURL('ocs/v2.php/apps/survey_client/api/v1/monthly'), 'POST')
->setPrimary(true);
$notification->addAction($enableAction);
$disableAction = $notification->createAction();
$disableAction->setLabel('disable')
- ->setLink($urlGenerator->getAbsoluteURL('ocs/v2.php/apps/popularitycontestclient/api/v1/monthly'), 'DELETE')
+ ->setLink($urlGenerator->getAbsoluteURL('ocs/v2.php/apps/survey_client/api/v1/monthly'), 'DELETE')
->setPrimary(false);
$notification->addAction($disableAction);
diff --git a/appinfo/app.php b/appinfo/app.php
index 99ded9e..0f4801b 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -19,10 +19,21 @@
*
*/
-\OCP\App::registerAdmin('popularitycontestclient', 'admin');
+\OCP\App::registerAdmin('survey_client', 'admin');
-\OC::$server->getNotificationManager()->registerNotifier(function() {
- return new \OCA\PopularityContestClient\Notifier(
- \OC::$server->getL10NFactory()
- );
-});
+$l = \OC::$server->getL10N('survey_client');
+
+$notificationManager = \OC::$server->getNotificationManager();
+$notificationManager->registerNotifier(
+ function() {
+ return new \OCA\Survey_Client\Notifier(
+ \OC::$server->getL10NFactory()
+ );
+ },
+ function() use ($l) {
+ return [
+ 'id' => 'survey_client',
+ 'name' => $l->t('Survey Client'),
+ ];
+ }
+);
diff --git a/appinfo/application.php b/appinfo/application.php
index 142b580..a610dfc 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -19,16 +19,16 @@
*
*/
-namespace OCA\PopularityContestClient\AppInfo;
+namespace OCA\Survey_Client\AppInfo;
-use OCA\PopularityContestClient\Controller\EndpointController;
-use OCA\PopularityContestClient\Collector;
+use OCA\Survey_Client\Controller\EndpointController;
+use OCA\Survey_Client\Collector;
use OCP\AppFramework\App;
use OCP\IContainer;
class Application extends App {
public function __construct (array $urlParams = array()) {
- parent::__construct('popularitycontestclient', $urlParams);
+ parent::__construct('survey_client', $urlParams);
$container = $this->getContainer();
$container->registerService('EndpointController', function(IContainer $c) {
@@ -38,13 +38,13 @@ class Application extends App {
return new EndpointController(
$c->query('AppName'),
$server->getRequest(),
- $c->query('OCA\PopularityContestClient\Collector'),
+ $c->query('OCA\Survey_Client\Collector'),
$server->getJobList(),
$server->getNotificationManager()
);
});
- $container->registerService('OCA\PopularityContestClient\Collector', function(IContainer $c) {
+ $container->registerService('OCA\Survey_Client\Collector', function(IContainer $c) {
/** @var \OCP\IServerContainer $server */
$server = $c->query('ServerContainer');
@@ -53,7 +53,7 @@ class Application extends App {
$server->getConfig(),
$server->getDatabaseConnection(),
$server->getIniWrapper(),
- $server->getL10NFactory()->get('popularitycontestclient')
+ $server->getL10NFactory()->get('survey_client')
);
});
diff --git a/appinfo/info.xml b/appinfo/info.xml
index ac8e8a1..c90563e 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -1,14 +1,18 @@
<?xml version="1.0"?>
<info>
- <id>popularitycontestclient</id>
- <name>Popularity Contest Client</name>
- <description/>
+ <id>survey_client</id>
+ <name>Survey Client</name>
+ <description>
+ Sends anonymized data to Nextcloud to help us to improve Nextcloud. You
+ always have full control over he content send to Nextcloud and can disable
+ it again at any time.
+ </description>
<licence>AGPL</licence>
<author>Joas Schilling, Björn Schiessle</author>
<version>0.1.5</version>
- <namespace>PopularityContestClient</namespace>
+ <namespace></namespace>
<category>other</category>
<dependencies>
- <owncloud min-version="9.0" />
+ <owncloud min-version="9.1" />
</dependencies>
</info>
diff --git a/appinfo/install.php b/appinfo/install.php
index 3295584..0608a2b 100644
--- a/appinfo/install.php
+++ b/appinfo/install.php
@@ -19,6 +19,6 @@
*
*/
-if (!\OC::$server->getJobList()->has('OCA\PopularityContestClient\MonthlyReport', null)) {
- \OC::$server->getJobList()->add('OCA\PopularityContestClient\AdminNotification');
+if (!\OC::$server->getJobList()->has('OCA\Survey_Client\MonthlyReport', null)) {
+ \OC::$server->getJobList()->add('OCA\Survey_Client\AdminNotification');
}
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 76458c2..1a3bde6 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -19,28 +19,28 @@
*
*/
-$application = new \OCA\PopularityContestClient\AppInfo\Application();
+$application = new \OCA\Survey_Client\AppInfo\Application();
\OCP\API::register(
'post',
- '/apps/popularitycontestclient/api/v1/report',
+ '/apps/survey_client/api/v1/report',
[$application->getContainer()->query('EndpointController'), 'sendReport'],
- 'popularitycontestclient',
+ 'survey_client',
\OCP\API::ADMIN_AUTH
);
\OCP\API::register(
'post',
- '/apps/popularitycontestclient/api/v1/monthly',
+ '/apps/survey_client/api/v1/monthly',
[$application->getContainer()->query('EndpointController'), 'enableMonthly'],
- 'popularitycontestclient',
+ 'survey_client',
\OCP\API::ADMIN_AUTH
);
\OCP\API::register(
'delete',
- '/apps/popularitycontestclient/api/v1/monthly',
+ '/apps/survey_client/api/v1/monthly',
[$application->getContainer()->query('EndpointController'), 'disableMonthly'],
- 'popularitycontestclient',
+ 'survey_client',
\OCP\API::ADMIN_AUTH
);
diff --git a/appinfo/update.php b/appinfo/update.php
index 3295584..0608a2b 100644
--- a/appinfo/update.php
+++ b/appinfo/update.php
@@ -19,6 +19,6 @@
*
*/
-if (!\OC::$server->getJobList()->has('OCA\PopularityContestClient\MonthlyReport', null)) {
- \OC::$server->getJobList()->add('OCA\PopularityContestClient\AdminNotification');
+if (!\OC::$server->getJobList()->has('OCA\Survey_Client\MonthlyReport', null)) {
+ \OC::$server->getJobList()->add('OCA\Survey_Client\AdminNotification');
}
diff --git a/categories/apps.php b/categories/apps.php
index 90b6dc2..5d52787 100644
--- a/categories/apps.php
+++ b/categories/apps.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\PopularityContestClient\Categories;
+namespace OCA\Survey_Client\Categories;
use Doctrine\DBAL\Connection;
@@ -29,7 +29,7 @@ use OCP\IL10N;
/**
* Class Apps
*
- * @package OCA\PopularityContestClient\Categories
+ * @package OCA\Survey_Client\Categories
*/
class Apps implements ICategory {
/** @var IDBConnection */
diff --git a/categories/database.php b/categories/database.php
index 67c3e73..891f0e2 100644
--- a/categories/database.php
+++ b/categories/database.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\PopularityContestClient\Categories;
+namespace OCA\Survey_Client\Categories;
use OCP\IConfig;
@@ -29,7 +29,7 @@ use OCP\IL10N;
/**
* Class Database
*
- * @package OCA\PopularityContestClient\Categories
+ * @package OCA\Survey_Client\Categories
*/
class Database implements ICategory {
/** @var \OCP\IConfig */
diff --git a/categories/encryption.php b/categories/encryption.php
index eaeb07d..72334d4 100644
--- a/categories/encryption.php
+++ b/categories/encryption.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\PopularityContestClient\Categories;
+namespace OCA\Survey_Client\Categories;
use OCP\IConfig;
@@ -28,7 +28,7 @@ use OCP\IL10N;
/**
* Class Encryption
*
- * @package OCA\PopularityContestClient\Categories
+ * @package OCA\Survey_Client\Categories
*/
class Encryption implements ICategory {
/** @var \OCP\IConfig */
diff --git a/categories/files_sharing.php b/categories/files_sharing.php
index c68c7bc..939b373 100644
--- a/categories/files_sharing.php
+++ b/categories/files_sharing.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\PopularityContestClient\Categories;
+namespace OCA\Survey_Client\Categories;
use OCP\IDBConnection;
@@ -28,7 +28,7 @@ use OCP\IL10N;
/**
* Class Files_Sharing
*
- * @package OCA\PopularityContestClient\Categories
+ * @package OCA\Survey_Client\Categories
*/
class Files_Sharing implements ICategory {
/** @var IDBConnection */
diff --git a/categories/icategory.php b/categories/icategory.php
index 16a839f..c5a7f5d 100644
--- a/categories/icategory.php
+++ b/categories/icategory.php
@@ -19,14 +19,14 @@
*
*/
-namespace OCA\PopularityContestClient\Categories;
+namespace OCA\Survey_Client\Categories;
/**
* Interface ICategory
*
* TODO Move to core public API?
*
- * @package OCA\PopularityContestClient\Categories
+ * @package OCA\Survey_Client\Categories
*/
interface ICategory {
/**
diff --git a/categories/owncloud.php b/categories/owncloud.php
index 45703e5..8c5d702 100644
--- a/categories/owncloud.php
+++ b/categories/owncloud.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\PopularityContestClient\Categories;
+namespace OCA\Survey_Client\Categories;
use OCP\IConfig;
@@ -28,7 +28,7 @@ use OCP\IL10N;
/**
* Class OwnCloud
*
- * @package OCA\PopularityContestClient\Categories
+ * @package OCA\Survey_Client\Categories
*/
class OwnCloud implements ICategory {
/** @var \OCP\IConfig */
diff --git a/categories/php.php b/categories/php.php
index 10482bd..f3e9636 100644
--- a/categories/php.php
+++ b/categories/php.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\PopularityContestClient\Categories;
+namespace OCA\Survey_Client\Categories;
use bantu\IniGetWrapper\IniGetWrapper;
@@ -28,7 +28,7 @@ use OCP\IL10N;
/**
* Class php
*
- * @package OCA\PopularityContestClient\Categories
+ * @package OCA\Survey_Client\Categories
*/
class php implements ICategory {
/** @var IniGetWrapper */
diff --git a/categories/stats.php b/categories/stats.php
index a51bfb2..08df7a7 100644
--- a/categories/stats.php
+++ b/categories/stats.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\PopularityContestClient\Categories;
+namespace OCA\Survey_Client\Categories;
use OCP\IDBConnection;
@@ -28,7 +28,7 @@ use OCP\IL10N;
/**
* Class Stats
*
- * @package OCA\PopularityContestClient\Categories
+ * @package OCA\Survey_Client\Categories
*/
class Stats implements ICategory {
/** @var IDBConnection */
diff --git a/collector.php b/collector.php
index a28cc20..9b2f33e 100644
--- a/collector.php
+++ b/collector.php
@@ -19,17 +19,17 @@
*
*/
-namespace OCA\PopularityContestClient;
+namespace OCA\Survey_Client;
use bantu\IniGetWrapper\IniGetWrapper;
-use OCA\PopularityContestClient\Categories\Apps;
-use OCA\PopularityContestClient\Categories\Database;
-use OCA\PopularityContestClient\Categories\Encryption;
-use OCA\PopularityContestClient\Categories\Files_Sharing;
-use OCA\PopularityContestClient\Categories\ICategory;
-use OCA\PopularityContestClient\Categories\OwnCloud;
-use OCA\PopularityContestClient\Categories\php;
-use OCA\PopularityContestClient\Categories\Stats;
+use OCA\Survey_Client\Categories\Apps;
+use OCA\Survey_Client\Categories\Database;
+use OCA\Survey_Client\Categories\Encryption;
+use OCA\Survey_Client\Categories\Files_Sharing;
+use OCA\Survey_Client\Categories\ICategory;
+use OCA\Survey_Client\Categories\OwnCloud;
+use OCA\Survey_Client\Categories\php;
+use OCA\Survey_Client\Categories\Stats;
use OCP\AppFramework\Http;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
@@ -48,7 +48,7 @@ class Collector {
/** @var IConfig */
protected $config;
-
+
/** @var IDBConnection */
protected $connection;
@@ -118,7 +118,7 @@ class Collector {
foreach ($this->categories as $category) {
$categories[$category->getCategory()] = [
'displayName' => $category->getDisplayName(),
- 'enabled' => $this->config->getAppValue('popularitycontestclient', $category->getCategory(), 'yes') === 'yes',
+ 'enabled' => $this->config->getAppValue('survey_client', $category->getCategory(), 'yes') === 'yes',
];
}
@@ -133,7 +133,7 @@ class Collector {
$tuples = [];
foreach ($this->categories as $category) {
- if ($this->config->getAppValue('popularitycontestclient', $category->getCategory(), 'yes') === 'yes') {
+ if ($this->config->getAppValue('survey_client', $category->getCategory(), 'yes') === 'yes') {
foreach ($category->getData() as $key => $value) {
$tuples[] = [
$category->getCategory(),
@@ -157,11 +157,11 @@ class Collector {
$report = $this->getReport();
$client = $this->clientService->newClient();
- $this->config->setAppValue('popularitycontestclient', 'last_sent', time());
- $this->config->setAppValue('popularitycontestclient', 'last_report', json_encode($report));
+ $this->config->setAppValue('survey_client', 'last_sent', time());
+ $this->config->setAppValue('survey_client', 'last_report', json_encode($report));
try {
- $response = $client->post(self::SURVEY_SERVER_URL . 'ocs/v2.php/apps/popularitycontestserver/api/v1/survey', [
+ $response = $client->post(self::SURVEY_SERVER_URL . 'ocs/v2.php/apps/survey_server/api/v1/survey', [
'timeout' => 5,
'query' => [
'data' => json_encode($report),
diff --git a/controller/endpointcontroller.php b/controller/endpointcontroller.php
index 936cf94..0e81f6d 100644
--- a/controller/endpointcontroller.php
+++ b/controller/endpointcontroller.php
@@ -19,14 +19,14 @@
*
*/
-namespace OCA\PopularityContestClient\Controller;
+namespace OCA\Survey_Client\Controller;
-use OC\Notification\IManager;
-use OCA\PopularityContestClient\Collector;
+use OCA\Survey_Client\Collector;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\BackgroundJob\IJobList;
use OCP\IRequest;
+use OCP\Notification\IManager;
class EndpointController extends Controller {
@@ -58,10 +58,10 @@ class EndpointController extends Controller {
* @return \OC_OCS_Result
*/
public function enableMonthly() {
- $this->jobList->add('OCA\PopularityContestClient\MonthlyReport');
+ $this->jobList->add('OCA\Survey_Client\MonthlyReport');
$notification = $this->manager->createNotification();
- $notification->setApp('popularitycontestclient');
+ $notification->setApp('survey_client');
$this->manager->markProcessed($notification);
return new \OC_OCS_Result();
@@ -71,10 +71,10 @@ class EndpointController extends Controller {
* @return \OC_OCS_Result
*/
public function disableMonthly() {
- $this->jobList->remove('OCA\PopularityContestClient\MonthlyReport');
+ $this->jobList->remove('OCA\Survey_Client\MonthlyReport');
$notification = $this->manager->createNotification();
- $notification->setApp('popularitycontestclient');
+ $notification->setApp('survey_client');
$this->manager->markProcessed($notification);
return new \OC_OCS_Result();
diff --git a/css/admin.css b/css/admin.css
index 527b961..fac7de0 100644
--- a/css/admin.css
+++ b/css/admin.css
@@ -1,4 +1,4 @@
-#popularitycontestclient textarea {
+#survey_client textarea {
height: 400px;
width: 300px;
}
diff --git a/js/admin.js b/js/admin.js
index 1bad24b..dbecd8c 100644
--- a/js/admin.js
+++ b/js/admin.js
@@ -1,11 +1,11 @@
$(document).ready(function() {
- var $section = $('#popularitycontestclient');
- $section.find('.popularitycontestclient_category').change(function() {
+ var $section = $('#survey_client');
+ $section.find('.survey_client_category').change(function() {
var $button = $(this);
$button.attr('disabled', true);
OC.AppConfig.postCall('setValue', {
- app: 'popularitycontestclient',
+ app: 'survey_client',
key: $(this).attr('name').substring(24),
value: $(this).attr('checked') ? 'yes' : 'no'
}, function() {
@@ -13,12 +13,12 @@ $(document).ready(function() {
});
});
- $section.find('#popularitycontestclient_monthly_report').change(function() {
+ $section.find('#survey_client_monthly_report').change(function() {
var $button = $(this);
$button.attr('disabled', true);
$.ajax({
- url: OC.linkToOCS('apps/popularitycontestclient/api/v1/', 2) + 'monthly?format=json',
+ url: OC.linkToOCS('apps/survey_client/api/v1/', 2) + 'monthly?format=json',
type: $(this).attr('checked') ? 'POST' : 'DELETE',
success: function() {
$button.attr('disabled', false);
@@ -30,19 +30,19 @@ $(document).ready(function() {
var $button = $(this);
$button.attr('disabled', true);
$.ajax({
- url: OC.linkToOCS('apps/popularitycontestclient/api/v1/', 2) + 'report?format=json',
+ url: OC.linkToOCS('apps/survey_client/api/v1/', 2) + 'report?format=json',
type: 'POST',
success: function(response) {
$button.attr('disabled', false);
$section.find('.last_report').text(JSON.stringify(response.ocs.data, undefined, 4));
- $section.find('.last_sent').text(t('popularitycontestclient', 'Sent on: {on}', {
+ $section.find('.last_sent').text(t('survey_client', 'Sent on: {on}', {
on: moment().format('LL')
}));
},
error: function(xhr) {
$button.attr('disabled', false);
- OC.Notification.showTemporary(t('popularitycontestclient', 'An error occurred while sending your report.'));
+ OC.Notification.showTemporary(t('survey_client', 'An error occurred while sending your report.'));
var response = xhr.responseJSON;
$section.find('.last_report').text(JSON.stringify(response.ocs.data, undefined, 4));
diff --git a/monthlyreport.php b/monthlyreport.php
index 28f53d6..d05f865 100644
--- a/monthlyreport.php
+++ b/monthlyreport.php
@@ -19,10 +19,10 @@
*
*/
-namespace OCA\PopularityContestClient;
+namespace OCA\Survey_Client;
use OC\BackgroundJob\TimedJob;
-use OCA\PopularityContestClient\AppInfo\Application;
+use OCA\Survey_Client\AppInfo\Application;
class MonthlyReport extends TimedJob {
@@ -36,8 +36,8 @@ class MonthlyReport extends TimedJob {
protected function run($argument) {
$application = new Application();
- /** @var \OCA\PopularityContestClient\Collector $collector */
- $collector = $application->getContainer()->query('OCA\PopularityContestClient\Collector');
+ /** @var \OCA\Survey_Client\Collector $collector */
+ $collector = $application->getContainer()->query('OCA\Survey_Client\Collector');
$result = $collector->sendReport();
if (!$result->succeeded()) {
diff --git a/notifier.php b/notifier.php
index 8d7f6b4..ad054d6 100644
--- a/notifier.php
+++ b/notifier.php
@@ -19,11 +19,11 @@
*
*/
-namespace OCA\PopularityContestClient;
+namespace OCA\Survey_Client;
-use OC\Notification\INotification;
-use OC\Notification\INotifier;
use OCP\L10N\IFactory;
+use OCP\Notification\INotification;
+use OCP\Notification\INotifier;
class Notifier implements INotifier {
@@ -46,13 +46,13 @@ class Notifier implements INotifier {
* @throws \InvalidArgumentException When the notification was not prepared by a notifier
*/
public function prepare(INotification $notification, $languageCode) {
- if ($notification->getApp() !== 'popularitycontestclient') {
+ if ($notification->getApp() !== 'survey_client') {
// Not my app => throw
throw new \InvalidArgumentException();
}
// Read the language from the notification
- $l = $this->l10nFactory->get('popularitycontestclient', $languageCode);
+ $l = $this->l10nFactory->get('survey_client', $languageCode);
$notification->setParsedSubject((string) $l->t('Do you want to send monthly usage statistics to ownCloud?'));
diff --git a/templates/admin.php b/templates/admin.php
index 1fd17f7..033d828 100644
--- a/templates/admin.php
+++ b/templates/admin.php
@@ -22,7 +22,7 @@
/** @var $l \OCP\IL10N */
/** @var $_ array */
?>
-<div id="popularitycontestclient" class="section">
+<div id="survey_client" class="section">
<h2><?php p($l->t('Usage report')); ?></h2>
<p>
@@ -32,9 +32,9 @@
<button><?php p($l->t('Send new report now')); ?></button>
<p>
- <input id="popularitycontestclient_monthly_report" name="popularitycontestclient_monthly_report"
+ <input id="survey_client_monthly_report" name="survey_client_monthly_report"
type="checkbox" class="checkbox" value="1" <?php if ($_['is_enabled']): ?> checked="checked"<?php endif; ?> />
- <label for="popularitycontestclient_monthly_report"><?php p($l->t('Send "Usage report" monthly')); ?></label>
+ <label for="survey_client_monthly_report"><?php p($l->t('Send "Usage report" monthly')); ?></label>
</p>
<h3><?php p($l->t('Data Control')); ?></h3>
@@ -42,9 +42,9 @@
foreach ($_['categories'] as $category => $data) {
?>
<p>
- <input id="popularitycontestclient_<?php p($category); ?>" name="popularitycontestclient_<?php p($category); ?>"
- type="checkbox" class="checkbox popularitycontestclient_category" value="1" <?php if ($data['enabled']): ?> checked="checked"<?php endif; ?> />
- <label for="popularitycontestclient_<?php p($category); ?>"><?php print_unescaped($data['displayName']); ?></label>
+ <input id="survey_client_<?php p($category); ?>" name="survey_client_<?php p($category); ?>"
+ type="checkbox" class="checkbox survey_client_category" value="1" <?php if ($data['enabled']): ?> checked="checked"<?php endif; ?> />
+ <label for="survey_client_<?php p($category); ?>"><?php print_unescaped($data['displayName']); ?></label>
</p>
<?php
}