summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/statistics')
-rw-r--r--modules-available/statistics/lang/de/permissions.json8
-rw-r--r--modules-available/statistics/lang/en/permissions.json8
-rw-r--r--modules-available/statistics/page.inc.php8
-rw-r--r--modules-available/statistics/permissions/permissions.json2
4 files changed, 13 insertions, 13 deletions
diff --git a/modules-available/statistics/lang/de/permissions.json b/modules-available/statistics/lang/de/permissions.json
index 15303993..7b7db89a 100644
--- a/modules-available/statistics/lang/de/permissions.json
+++ b/modules-available/statistics/lang/de/permissions.json
@@ -1,5 +1,5 @@
{
- "view": "Client Statistiken anschauen.",
- "note": "Client Notizen speichern.",
- "delete": "Client löschen."
-} \ No newline at end of file
+ "view": "Statistiken anschauen.",
+ "machine.note": "Anmerkungen zu einem Rechner speichern.",
+ "machine.delete": "Rechner löschen."
+}
diff --git a/modules-available/statistics/lang/en/permissions.json b/modules-available/statistics/lang/en/permissions.json
index 7be32f22..01acdb8a 100644
--- a/modules-available/statistics/lang/en/permissions.json
+++ b/modules-available/statistics/lang/en/permissions.json
@@ -1,5 +1,5 @@
{
- "view": "View client statistics.",
- "note": "Save client notes.",
- "delete": "Delete client."
-} \ No newline at end of file
+ "view": "View statistics.",
+ "machine.note": "Save client notes.",
+ "machine.delete": "Delete clients."
+}
diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php
index 5fe4ebfa..e89180ed 100644
--- a/modules-available/statistics/page.inc.php
+++ b/modules-available/statistics/page.inc.php
@@ -170,7 +170,7 @@ class Page_Statistics extends Page
$uuid = Request::post('uuid', '', 'string');
$locationid = Database::queryFirst('SELECT locationid FROM machine WHERE machineuuid = :uuid',
array('uuid' => $uuid))['locationid'];
- if (User::hasPermission("note", $locationid)) {
+ if (User::hasPermission("machine.note", $locationid)) {
$text = Request::post('content', '', 'string');
if (empty($text)) {
$text = null;
@@ -207,7 +207,7 @@ class Page_Statistics extends Page
$res = Database::simpleQuery('SELECT machineuuid, locationid FROM machine WHERE machineuuid IN (:ids)', compact('ids'));
$ids = array_flip($ids);
$delete = [];
- $allowedLocations = User::getAllowedLocations("delete");
+ $allowedLocations = User::getAllowedLocations("machine.delete");
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
if (in_array($row['locationid'], $allowedLocations)) {
unset($ids[$row['machineuuid']]);
@@ -629,7 +629,7 @@ class Page_Statistics extends Page
. " $join WHERE $where $sort", $args);
$rows = array();
$singleMachine = 'none';
- $deleteAllowedLocations = User::getAllowedLocations("delete");
+ $deleteAllowedLocations = User::getAllowedLocations("machine.delete");
while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
if ($singleMachine === 'none') {
$singleMachine = $row['machineuuid'];
@@ -1002,7 +1002,7 @@ class Page_Statistics extends Page
));
}
// Notes
- $client["notesAllowed"] = User::hasPermission("note", $client["locationid"]);
+ $client["notesAllowed"] = User::hasPermission("machine.note", $client["locationid"]);
Render::addTemplate('machine-notes', $client);
}
diff --git a/modules-available/statistics/permissions/permissions.json b/modules-available/statistics/permissions/permissions.json
index c9dca9f3..da489998 100644
--- a/modules-available/statistics/permissions/permissions.json
+++ b/modules-available/statistics/permissions/permissions.json
@@ -5,7 +5,7 @@
"machine.note": {
"location-aware": true
},
- "machine.view": {
+ "view": {
"location-aware": true
}
} \ No newline at end of file