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-08-10 12:44:25 +0300
committerGitHub <noreply@github.com>2016-08-10 12:44:25 +0300
commita0a2a16a798138715bfc538a96fc3ee646dbc830 (patch)
tree1187d664523fc781d5ab34130f89d17560db6953
parent3f6111294428503675ad5fb4d34ec3f5399b6b40 (diff)
parenta6cef578781257e9e0a3c808a054d496862cbeed (diff)
Merge pull request #2 from nextcloud/get-ready-for-release
small fixes for the Nextcloud 10 release
-rw-r--r--admin.php2
-rw-r--r--appinfo/info.xml1
-rw-r--r--appinfo/install.php4
-rw-r--r--appinfo/update.php4
-rw-r--r--css/admin.css6
-rw-r--r--js/admin.js2
-rw-r--r--lib/AppInfo/Application.php (renamed from appinfo/application.php)0
-rw-r--r--lib/BackgroundJobs/AdminNotification.php (renamed from adminnotification.php)4
-rw-r--r--lib/BackgroundJobs/MonthlyReport.php (renamed from monthlyreport.php)2
-rw-r--r--lib/Categories/Apps.php (renamed from categories/apps.php)2
-rw-r--r--lib/Categories/Database.php (renamed from categories/database.php)2
-rw-r--r--lib/Categories/Encryption.php (renamed from categories/encryption.php)0
-rw-r--r--lib/Categories/FilesSharing.php (renamed from categories/files_sharing.php)4
-rw-r--r--lib/Categories/ICategory.php (renamed from categories/icategory.php)0
-rw-r--r--lib/Categories/Php.php (renamed from categories/php.php)4
-rw-r--r--lib/Categories/Server.php (renamed from categories/owncloud.php)9
-rw-r--r--lib/Categories/Stats.php (renamed from categories/stats.php)0
-rw-r--r--lib/Collector.php (renamed from collector.php)16
-rw-r--r--lib/Controller/EndpointController.php (renamed from controller/endpointcontroller.php)4
-rw-r--r--lib/Notifier.php (renamed from notifier.php)9
-rw-r--r--templates/admin.php13
21 files changed, 51 insertions, 37 deletions
diff --git a/admin.php b/admin.php
index 05d5053..aac0984 100644
--- a/admin.php
+++ b/admin.php
@@ -40,7 +40,7 @@ if ($lastReport !== '') {
}
$template = new Template('survey_client', 'admin');
-$template->assign('is_enabled', \OC::$server->getJobList()->has('OCA\Survey_Client\MonthlyReport', null));
+$template->assign('is_enabled', \OC::$server->getJobList()->has('OCA\Survey_Client\BackgroundJobs\MonthlyReport', null));
$template->assign('last_sent', $lastSentReportDate);
$template->assign('last_report', $lastReport);
$template->assign('categories', $collector->getCategories());
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 9fea4b3..ad5cd40 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -7,6 +7,7 @@
always have full control over he content send to Nextcloud and can disable
it again at any time.
</description>
+ <namespace>Survey_Client</namespace>
<licence>AGPL</licence>
<author>Joas Schilling, Björn Schiessle</author>
<version>0.1.5</version>
diff --git a/appinfo/install.php b/appinfo/install.php
index 0608a2b..1020531 100644
--- a/appinfo/install.php
+++ b/appinfo/install.php
@@ -19,6 +19,6 @@
*
*/
-if (!\OC::$server->getJobList()->has('OCA\Survey_Client\MonthlyReport', null)) {
- \OC::$server->getJobList()->add('OCA\Survey_Client\AdminNotification');
+if (!\OC::$server->getJobList()->has('OCA\Survey_Client\BackgroundJobs\MonthlyReport', null)) {
+ \OC::$server->getJobList()->add('OCA\Survey_Client\BackgroundJobs\AdminNotification');
}
diff --git a/appinfo/update.php b/appinfo/update.php
index 0608a2b..1020531 100644
--- a/appinfo/update.php
+++ b/appinfo/update.php
@@ -19,6 +19,6 @@
*
*/
-if (!\OC::$server->getJobList()->has('OCA\Survey_Client\MonthlyReport', null)) {
- \OC::$server->getJobList()->add('OCA\Survey_Client\AdminNotification');
+if (!\OC::$server->getJobList()->has('OCA\Survey_Client\BackgroundJobs\MonthlyReport', null)) {
+ \OC::$server->getJobList()->add('OCA\Survey_Client\BackgroundJobs\AdminNotification');
}
diff --git a/css/admin.css b/css/admin.css
index fac7de0..a54414f 100644
--- a/css/admin.css
+++ b/css/admin.css
@@ -1,4 +1,8 @@
#survey_client textarea {
- height: 400px;
+ height: 150px;
width: 300px;
}
+
+#survey_client button {
+ margin: 20px 0;
+}
diff --git a/js/admin.js b/js/admin.js
index dbecd8c..8f5da93 100644
--- a/js/admin.js
+++ b/js/admin.js
@@ -6,7 +6,7 @@ $(document).ready(function() {
OC.AppConfig.postCall('setValue', {
app: 'survey_client',
- key: $(this).attr('name').substring(24),
+ key: $(this).attr('name').substring(14),
value: $(this).attr('checked') ? 'yes' : 'no'
}, function() {
$button.attr('disabled', false);
diff --git a/appinfo/application.php b/lib/AppInfo/Application.php
index a610dfc..a610dfc 100644
--- a/appinfo/application.php
+++ b/lib/AppInfo/Application.php
diff --git a/adminnotification.php b/lib/BackgroundJobs/AdminNotification.php
index 4e225be..5aeeb51 100644
--- a/adminnotification.php
+++ b/lib/BackgroundJobs/AdminNotification.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\Survey_Client;
+namespace OCA\Survey_Client\BackgroundJobs;
use OC\BackgroundJob\QueuedJob;
@@ -33,7 +33,7 @@ class AdminNotification extends QueuedJob {
->setDateTime(new \DateTime())
->setSubject('updated')
->setObject('dummy', 23)
- ->setLink($urlGenerator->getAbsoluteURL('index.php/settings/admin#goto-usage-report'));
+ ->setLink($urlGenerator->getAbsoluteURL('index.php/settings/admin#usage-report'));
$enableAction = $notification->createAction();
$enableAction->setLabel('enable')
diff --git a/monthlyreport.php b/lib/BackgroundJobs/MonthlyReport.php
index d05f865..ccb0cc1 100644
--- a/monthlyreport.php
+++ b/lib/BackgroundJobs/MonthlyReport.php
@@ -19,7 +19,7 @@
*
*/
-namespace OCA\Survey_Client;
+namespace OCA\Survey_Client\BackgroundJobs;
use OC\BackgroundJob\TimedJob;
use OCA\Survey_Client\AppInfo\Application;
diff --git a/categories/apps.php b/lib/Categories/Apps.php
index 5d52787..b5b3333 100644
--- a/categories/apps.php
+++ b/lib/Categories/Apps.php
@@ -58,7 +58,7 @@ class Apps implements ICategory {
* @return string
*/
public function getDisplayName() {
- return (string) $this->l->t('App list <em>(For each app: name, version, is enabled?)</em>');
+ return (string) $this->l->t('App list <em>(for each app: name, version, is enabled?)</em>');
}
/**
diff --git a/categories/database.php b/lib/Categories/Database.php
index 891f0e2..fe2d4c1 100644
--- a/categories/database.php
+++ b/lib/Categories/Database.php
@@ -63,7 +63,7 @@ class Database implements ICategory {
* @return string
*/
public function getDisplayName() {
- return (string) $this->l->t('Database Environment <em>(type, version, database size)</em>');
+ return (string) $this->l->t('Database environment <em>(type, version, database size)</em>');
}
/**
diff --git a/categories/encryption.php b/lib/Categories/Encryption.php
index 72334d4..72334d4 100644
--- a/categories/encryption.php
+++ b/lib/Categories/Encryption.php
diff --git a/categories/files_sharing.php b/lib/Categories/FilesSharing.php
index 939b373..16164d8 100644
--- a/categories/files_sharing.php
+++ b/lib/Categories/FilesSharing.php
@@ -26,11 +26,11 @@ use OCP\IDBConnection;
use OCP\IL10N;
/**
- * Class Files_Sharing
+ * Class FilesSharing
*
* @package OCA\Survey_Client\Categories
*/
-class Files_Sharing implements ICategory {
+class FilesSharing implements ICategory {
/** @var IDBConnection */
protected $connection;
diff --git a/categories/icategory.php b/lib/Categories/ICategory.php
index c5a7f5d..c5a7f5d 100644
--- a/categories/icategory.php
+++ b/lib/Categories/ICategory.php
diff --git a/categories/php.php b/lib/Categories/Php.php
index f3e9636..cd30ab4 100644
--- a/categories/php.php
+++ b/lib/Categories/Php.php
@@ -30,7 +30,7 @@ use OCP\IL10N;
*
* @package OCA\Survey_Client\Categories
*/
-class php implements ICategory {
+class Php implements ICategory {
/** @var IniGetWrapper */
protected $phpIni;
@@ -57,7 +57,7 @@ class php implements ICategory {
* @return string
*/
public function getDisplayName() {
- return (string) $this->l->t('php Environment <em>(version, memory limit, max. execution time, max. file size)</em>');
+ return (string) $this->l->t('PHP environment <em>(version, memory limit, max. execution time, max. file size)</em>');
}
/**
diff --git a/categories/owncloud.php b/lib/Categories/Server.php
index 8c5d702..c3307a1 100644
--- a/categories/owncloud.php
+++ b/lib/Categories/Server.php
@@ -26,11 +26,11 @@ use OCP\IConfig;
use OCP\IL10N;
/**
- * Class OwnCloud
+ * Class Server
*
* @package OCA\Survey_Client\Categories
*/
-class OwnCloud implements ICategory {
+class Server implements ICategory {
/** @var \OCP\IConfig */
protected $config;
@@ -50,14 +50,14 @@ class OwnCloud implements ICategory {
* @return string
*/
public function getCategory() {
- return 'owncloud';
+ return 'server';
}
/**
* @return string
*/
public function getDisplayName() {
- return (string) $this->l->t('ownCloud Instance Details <em>(version, theme, memcache used, locking/previews/avatars enabled?)</em>');
+ return (string) $this->l->t('Server instance details <em>(version, memcache used, locking/previews/avatars enabled?)</em>');
}
/**
@@ -66,7 +66,6 @@ class OwnCloud implements ICategory {
public function getData() {
return [
'version' => $this->config->getSystemValue('version'),
- 'theme' => $this->config->getSystemValue('theme', 'none'),
'code' => $this->codeLocation(),
'enable_avatars' => $this->config->getSystemValue('enable_avatars', true) ? 'yes' : 'no',
'enable_previews' => $this->config->getSystemValue('enable_previews', true) ? 'yes' : 'no',
diff --git a/categories/stats.php b/lib/Categories/Stats.php
index 08df7a7..08df7a7 100644
--- a/categories/stats.php
+++ b/lib/Categories/Stats.php
diff --git a/collector.php b/lib/Collector.php
index 9b2f33e..89e4a4d 100644
--- a/collector.php
+++ b/lib/Collector.php
@@ -25,10 +25,10 @@ use bantu\IniGetWrapper\IniGetWrapper;
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\FilesSharing;
use OCA\Survey_Client\Categories\ICategory;
-use OCA\Survey_Client\Categories\OwnCloud;
-use OCA\Survey_Client\Categories\php;
+use OCA\Survey_Client\Categories\Php;
+use OCA\Survey_Client\Categories\Server;
use OCA\Survey_Client\Categories\Stats;
use OCP\AppFramework\Http;
use OCP\Http\Client\IClientService;
@@ -38,7 +38,7 @@ use OCP\IL10N;
class Collector {
- const SURVEY_SERVER_URL = 'http://localhost/ownCloud/master/core/';
+ const SURVEY_SERVER_URL = 'https://surveyserver.nextcloud.com/';
/** @var ICategory[] */
protected $categories;
@@ -76,7 +76,7 @@ class Collector {
}
protected function registerCategories() {
- $this->categories[] = new OwnCloud(
+ $this->categories[] = new Server(
$this->config,
$this->l
);
@@ -97,7 +97,7 @@ class Collector {
$this->connection,
$this->l
);
- $this->categories[] = new Files_Sharing(
+ $this->categories[] = new FilesSharing(
$this->connection,
$this->l
);
@@ -157,8 +157,6 @@ class Collector {
$report = $this->getReport();
$client = $this->clientService->newClient();
- $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/survey_server/api/v1/survey', [
@@ -175,6 +173,8 @@ class Collector {
}
if ($response->getStatusCode() === Http::STATUS_OK) {
+ $this->config->setAppValue('survey_client', 'last_sent', time());
+ $this->config->setAppValue('survey_client', 'last_report', json_encode($report));
return new \OC_OCS_Result(
$report,
100// HTTP::STATUS_OK, TODO: <status>failure</status><statuscode>200</statuscode>
diff --git a/controller/endpointcontroller.php b/lib/Controller/EndpointController.php
index 0e81f6d..6b21ddf 100644
--- a/controller/endpointcontroller.php
+++ b/lib/Controller/EndpointController.php
@@ -58,7 +58,7 @@ class EndpointController extends Controller {
* @return \OC_OCS_Result
*/
public function enableMonthly() {
- $this->jobList->add('OCA\Survey_Client\MonthlyReport');
+ $this->jobList->add('OCA\Survey_Client\BackgroundJobs\MonthlyReport');
$notification = $this->manager->createNotification();
$notification->setApp('survey_client');
@@ -71,7 +71,7 @@ class EndpointController extends Controller {
* @return \OC_OCS_Result
*/
public function disableMonthly() {
- $this->jobList->remove('OCA\Survey_Client\MonthlyReport');
+ $this->jobList->remove('OCA\Survey_Client\BackgroundJobs\MonthlyReport');
$notification = $this->manager->createNotification();
$notification->setApp('survey_client');
diff --git a/notifier.php b/lib/Notifier.php
index ad054d6..995551f 100644
--- a/notifier.php
+++ b/lib/Notifier.php
@@ -54,13 +54,14 @@ class Notifier implements INotifier {
// Read the language from the notification
$l = $this->l10nFactory->get('survey_client', $languageCode);
- $notification->setParsedSubject((string) $l->t('Do you want to send monthly usage statistics to ownCloud?'));
+ $notification->setParsedSubject((string) $l->t(
+ 'Do you want to help us to improve Nextcloud by providing some anonymized data about your setup and usage? You can disable it at any time in the admin settings again.'));
foreach ($notification->getActions() as $action) {
- if ($action->getLabel() === 'enable') {
- $action->setParsedLabel((string) $l->t('Yes'));
- } else if ($action->getLabel() === 'disable') {
+ if ($action->getLabel() === 'disable') {
$action->setParsedLabel((string) $l->t('Not now'));
+ } else if ($action->getLabel() === 'enable') {
+ $action->setParsedLabel((string) $l->t('Send usage'));
}
$notification->addParsedAction($action);
}
diff --git a/templates/admin.php b/templates/admin.php
index 033d828..9e909ad 100644
--- a/templates/admin.php
+++ b/templates/admin.php
@@ -26,7 +26,11 @@
<h2><?php p($l->t('Usage report')); ?></h2>
<p>
- <?php p($l->t('When the server receives a new report of your instance, all entries from previous reports are removed. So in case you disable one of the settings below, you can send a new report, to delete the data, that is currently stored on the server.')); ?>
+ <?php p($l->t('You can help us to improve Nextcloud be sending us some data about your current setup and usage.')); ?>
+ </p>
+
+ <p>
+ <?php p($l->t('We take your privacy seriously. The data are anonymized and you can enable/disable it at any time, by default it is always disabled. Below you can also adjust what kind of data are send and always see the last report send to us. When the server receives a new report of your instance, all entries from previous reports are removed. In case you disable one of the settings below, you can send a new report, to delete the data, that is currently stored on the server.')); ?>
</p>
<button><?php p($l->t('Send new report now')); ?></button>
@@ -37,7 +41,7 @@
<label for="survey_client_monthly_report"><?php p($l->t('Send "Usage report" monthly')); ?></label>
</p>
- <h3><?php p($l->t('Data Control')); ?></h3>
+ <h3><?php p($l->t('Data to send')); ?></h3>
<?php
foreach ($_['categories'] as $category => $data) {
?>
@@ -50,9 +54,14 @@
}
?>
+ <?php if (!empty($_['last_report'])): ?>
+
<h3><?php p($l->t('Last report')); ?></h3>
<p><textarea title="<?php p($l->t('Last report')); ?>" class="last_report" readonly="readonly"><?php p($_['last_report']);?></textarea></p>
<em class="last_sent"><?php p($l->t('Sent on: %s', [$_['last_sent']])); ?></em>
+
+ <?php endif; ?>
+
</div>