aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/BasePermissionsController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-03-29 09:06:32 +0500
committerAbyss777 <abyss@fox5.ru>2017-03-29 09:06:32 +0500
commit90863dfff06243e062fa4442245aa210eade198c (patch)
tree2426a533e16e8928d85b1353af72be6dd4334e75 /web/app/view/BasePermissionsController.js
parentf78c547cdda0180a16bf76ddd7395d57dfc49016 (diff)
downloadtrackermap-web-90863dfff06243e062fa4442245aa210eade198c.tar.gz
trackermap-web-90863dfff06243e062fa4442245aa210eade198c.tar.bz2
trackermap-web-90863dfff06243e062fa4442245aa210eade198c.zip
Move permissions windows to subfolder
Diffstat (limited to 'web/app/view/BasePermissionsController.js')
-rw-r--r--web/app/view/BasePermissionsController.js84
1 files changed, 0 insertions, 84 deletions
diff --git a/web/app/view/BasePermissionsController.js b/web/app/view/BasePermissionsController.js
deleted file mode 100644
index 2fb2d873..00000000
--- a/web/app/view/BasePermissionsController.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2016 Anton Tananaev (anton@traccar.org)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-Ext.define('Traccar.view.BasePermissionsController', {
- extend: 'Ext.app.ViewController',
- alias: 'controller.basePermissionsController',
-
- init: function () {
- var params = {}, linkStoreName, storeName;
- params[this.getView().baseObjectName] = this.getView().baseObject;
- linkStoreName = this.getView().linkStoreName;
- storeName = this.getView().storeName;
- linkStoreName = (typeof linkStoreName === 'undefined') ? storeName : linkStoreName;
- this.getView().setStore(Ext.getStore(storeName));
- this.getView().getStore().load({
- scope: this,
- callback: function (records, operation, success) {
- var linkStore = Ext.create('Traccar.store.' + linkStoreName);
- linkStore.load({
- params: params,
- scope: this,
- callback: function (records, operation, success) {
- var i, index;
- if (success) {
- for (i = 0; i < records.length; i++) {
- index = this.getView().getStore().getById(records[i].getId());
- this.getView().getSelectionModel().select(index, true, true);
- }
- }
- }
- });
- }
- });
- },
-
- onBeforeSelect: function (selection, record, index) {
- var data = {};
- data[this.getView().baseObjectName] = this.getView().baseObject;
- data[this.getView().linkObjectName] = record.getId();
- Ext.Ajax.request({
- scope: this,
- url: this.getView().urlApi,
- jsonData: Ext.util.JSON.encode(data),
- callback: function (options, success, response) {
- if (!success) {
- selection.deselect(record);
- Traccar.app.showError(response);
- }
- }
- });
- },
-
- onBeforeDeselect: function (selection, record, index) {
- var data = {};
- data[this.getView().baseObjectName] = this.getView().baseObject;
- data[this.getView().linkObjectName] = record.getId();
- Ext.Ajax.request({
- scope: this,
- method: 'DELETE',
- url: this.getView().urlApi,
- jsonData: Ext.util.JSON.encode(data),
- callback: function (options, success, response) {
- if (!success) {
- selection.select(record);
- Traccar.app.showError(response);
- }
- }
- });
- }
-});