aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-07-14 15:21:43 +0500
committerAbyss777 <abyss@fox5.ru>2016-07-14 15:21:43 +0500
commite910d9337a35fad663c978ff9121ed64ca28af91 (patch)
treeebc6c6c964f09da40e3775db759c95524eb27ad3
parent82fd4d09aa7ac37bf2eb1857b12efbd3bc773a94 (diff)
downloadtraccar-server-e910d9337a35fad663c978ff9121ed64ca28af91.tar.gz
traccar-server-e910d9337a35fad663c978ff9121ed64ca28af91.tar.bz2
traccar-server-e910d9337a35fad663c978ff9121ed64ca28af91.zip
- Fixed saving parent group when creating new group.
- Fixed storing device and group if parent group is not defined. - Fixed Warning in browser console about missed requirements.
-rw-r--r--debug.xml2
-rw-r--r--setup/unix/traccar.xml2
-rw-r--r--setup/windows/traccar.xml2
-rw-r--r--src/org/traccar/database/QueryBuilder.java6
-rw-r--r--web/app/view/GroupsController.js1
5 files changed, 9 insertions, 4 deletions
diff --git a/debug.xml b/debug.xml
index 73ddacc6a..09a575450 100644
--- a/debug.xml
+++ b/debug.xml
@@ -187,7 +187,7 @@
</entry>
<entry key='database.insertGroup'>
- INSERT INTO groups (name) VALUES (:name);
+ INSERT INTO groups (name, groupId) VALUES (:name, :groupId);
</entry>
<entry key='database.updateGroup'>
diff --git a/setup/unix/traccar.xml b/setup/unix/traccar.xml
index 83abb48fd..a8bf9c334 100644
--- a/setup/unix/traccar.xml
+++ b/setup/unix/traccar.xml
@@ -139,7 +139,7 @@
</entry>
<entry key='database.insertGroup'>
- INSERT INTO groups (name) VALUES (:name);
+ INSERT INTO groups (name, groupId) VALUES (:name, :groupId);
</entry>
<entry key='database.updateGroup'>
diff --git a/setup/windows/traccar.xml b/setup/windows/traccar.xml
index 72f04d0a0..a67d8c53c 100644
--- a/setup/windows/traccar.xml
+++ b/setup/windows/traccar.xml
@@ -139,7 +139,7 @@
</entry>
<entry key='database.insertGroup'>
- INSERT INTO groups (name) VALUES (:name);
+ INSERT INTO groups (name, groupId) VALUES (:name, :groupId);
</entry>
<entry key='database.updateGroup'>
diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java
index 73569ac2a..477434fb5 100644
--- a/src/org/traccar/database/QueryBuilder.java
+++ b/src/org/traccar/database/QueryBuilder.java
@@ -175,7 +175,11 @@ public final class QueryBuilder {
public QueryBuilder setLong(String name, long value) throws SQLException {
for (int i : indexes(name)) {
try {
- statement.setLong(i, value);
+ if (value == 0) {
+ statement.setNull(i, Types.INTEGER);
+ } else {
+ statement.setLong(i, value);
+ }
} catch (SQLException error) {
statement.close();
connection.close();
diff --git a/web/app/view/GroupsController.js b/web/app/view/GroupsController.js
index 1764423d7..4cf1459a6 100644
--- a/web/app/view/GroupsController.js
+++ b/web/app/view/GroupsController.js
@@ -19,6 +19,7 @@ Ext.define('Traccar.view.GroupsController', {
alias: 'controller.groups',
requires: [
+ 'Traccar.view.GroupDialog',
'Traccar.view.GroupGeofences'
],