DataObjects/Core_person_signup.php
[Pman.Core] / Pman.Tab.CoreOAuthClient.bjs
index d3d4f05..d39efd6 100644 (file)
@@ -51,7 +51,7 @@
                                         {
                                             "listeners": {
                                                 "beforeload": "function (_self, o){\n    o.params = o.params || {};\n\n}\n",
-                                                "update": "function (_self, record, operation)\n{\n    if (operation != Roo.data.Record.COMMIT) {\n        return;\n    }\n    Roo.log(record);\n\n    if (typeof(_this.data._hide_name) != 'undefined') {\n        record.set('name', record.data.display_name);\n    }\n    if (!record.data.client_id.length || !record.data.client_secret.length) {\n        return;\n    }\n    /*\n    new Pman.Request({\n        url : baseURL + '/Roo/Core_enum.php',\n        method : 'POST',\n        params : {\n            id : record.data.id,\n            etype : _this.data.etype,\n            name :  record.data.name,\n            active : record.data.active,\n            seqid : record.data.seqid,\n            display_name : record.data.display_name\n        }, \n        success : function(res) {\n            //Roo.log(data);\n            // update the ID if it's not set..\n            if (record.data.id * 1 < 1) {\n                record.set('id', res.data.id);\n            }\n        }\n    });\n */   \n}"
+                                                "update": "function (_self, record, operation)\n{\n    if (operation != Roo.data.Record.COMMIT) {\n        return;\n    }\n\n    if (!record.data.client_id.length || !record.data.client_secret.length) {\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Core_oauth_clients',\n        method : 'POST',\n        params : {\n            id : record.data.id,\n            client_id : record.data.client_id,\n            client_secret : record.data.client_secret,\n            redirect_uri : record.data.redirect_uri\n        },\n        success : function(res) {\n            _this.grid.footer.onClick('refresh');\n        }\n    });\n    \n}"
                                             },
                                             "*prop": "dataSource",
                                             "remoteSort": true,
@@ -72,7 +72,7 @@
                                                     "root": "data",
                                                     "totalProperty": "total",
                                                     "xtype": "JsonReader",
-                                                    "|fields": "[\n    {\n        'name': 'client_id',\n        'type': 'string'\n    },\n    {\n        'name': 'client_secret',\n        'type': 'string'\n    },\n    {\n        'name': 'redirect_uri',\n        'type': 'string'\n    }\n]",
+                                                    "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id',\n        'type': 'string'\n    },\n    {\n        'name': 'client_secret',\n        'type': 'string'\n    },\n    {\n        'name': 'redirect_uri',\n        'type': 'string'\n    }\n]",
                                                     "|xns": "Roo.data"
                                                 }
                                             ]
@@ -84,7 +84,7 @@
                                             "items": [
                                                 {
                                                     "listeners": {
-                                                        "|click": "function()\n{\n    \n    var nr = _this.grid.ds.reader.newRow({\n        client_id : '',\n        client_secret : '',\n        redirect_uri : ''\n    });\n    \n    _this.grid.stopEditing();\n    _this.grid.ds.insert(_this.grid.ds.getCount(), nr); \n    _this.grid.startEditing(_this.grid.ds.getCount()-1, 1);\n}\n"
+                                                        "|click": "function()\n{\n    \n    var nr = _this.grid.ds.reader.newRow({\n        id : 0,\n        client_id : '',\n        client_secret : '',\n        redirect_uri : ''\n    });\n    \n    _this.grid.stopEditing();\n    _this.grid.ds.insert(_this.grid.ds.getCount(), nr); \n    _this.grid.startEditing(_this.grid.ds.getCount()-1, 0);\n}\n"
                                                     },
                                                     "cls": "x-btn-text-icon",
                                                     "text": "Add",
@@ -94,7 +94,7 @@
                                                 },
                                                 {
                                                     "listeners": {
-                                                        "|click": "function ()\n{\n    var status = _this.form.findField('pohead_status').getValue();\n    \n    if(status == 'C'){\n        Roo.MessageBox.alert(\"Error\", \"This PO has been closed\");\n        return;\n    }\n    \n    var cs = _this.grid.getSelectionModel().getSelectedCell();\n    if (!cs) {\n        Roo.MessageBox.alert(\"Error\", \"Select a cell\");\n        return;\n    }\n    _this.grid.stopEditing();\n    var r = _this.grid.ds.getAt(cs[0]);\n    \n    if(r.data.poitem_qty_received * 1 > 0){\n        Roo.MessageBox.alert(\"Error\", \"This item has been receipted\");\n        return;\n    }\n    \n    \n    _this.grid.ds.remove(r);\n   \n}"
+                                                        "|click": "function ()\n{   \n    var cs = _this.grid.getSelectionModel().getSelectedCell();\n    if (!cs) {\n        Roo.MessageBox.alert(\"Error\", \"Select a cell\");\n        return;\n    }\n    _this.grid.stopEditing();\n \n    var r = _this.grid.ds.getAt(cs[0]);\n    \n    Roo.MessageBox.confirm(\"Confirm\", \"Are you sure you want to delete this client?\", function (v){\n        if (v != 'yes') {\n            return;\n        }\n        \n        new Pman.Request({\n            url : baseURL + '/Roo/Core_oauth_clients',\n            method : 'POST',\n            params : {\n                _delete : r.data.id\n            },\n            success : function(res) {\n                _this.grid.footer.onClick('refresh');\n            }\n        });\n    });\n}"
                                                     },
                                                     "cls": "x-btn-text-icon",
                                                     "text": "Remove",