DataObjects/Core_person_signup.php
[Pman.Core] / Pman.Tab.CoreOAuthClient.js
index c48061b..92d36bc 100644 (file)
@@ -84,11 +84,16 @@ Pman.Tab.CoreOAuthClient = new Roo.XComponent({
                                         }
                                         
                                         new Pman.Request({
-                                            url : baseURL + '/Roo/Core_oauth_clients.php',
+                                            url : baseURL + '/Roo/Core_oauth_clients',
                                             method : 'POST',
-                                            params : record.data,
+                                            params : {
+                                                id : record.data.id,
+                                                client_id : record.data.client_id,
+                                                client_secret : record.data.client_secret,
+                                                redirect_uri : record.data.redirect_uri
+                                            },
                                             success : function(res) {
-                                                _this.gird.footer.onClick('refresh');
+                                                _this.grid.footer.onClick('refresh');
                                             }
                                         });
                                         
@@ -109,6 +114,10 @@ Pman.Tab.CoreOAuthClient = new Roo.XComponent({
                                     root : 'data',
                                     totalProperty : 'total',
                                     fields : [
+                                        {
+                                            'name': 'id',
+                                            'type': 'int'
+                                        },
                                         {
                                             'name': 'client_id',
                                             'type': 'string'
@@ -136,6 +145,7 @@ Pman.Tab.CoreOAuthClient = new Roo.XComponent({
                                             {
                                                 
                                                 var nr = _this.grid.ds.reader.newRow({
+                                                    id : 0,
                                                     client_id : '',
                                                     client_secret : '',
                                                     redirect_uri : ''
@@ -143,7 +153,7 @@ Pman.Tab.CoreOAuthClient = new Roo.XComponent({
                                                 
                                                 _this.grid.stopEditing();
                                                 _this.grid.ds.insert(_this.grid.ds.getCount(), nr); 
-                                                _this.grid.startEditing(_this.grid.ds.getCount()-1, 1);
+                                                _this.grid.startEditing(_this.grid.ds.getCount()-1, 0);
                                             }
                                         },
                                         cls : 'x-btn-text-icon',
@@ -165,8 +175,22 @@ Pman.Tab.CoreOAuthClient = new Roo.XComponent({
                                              
                                                 var r = _this.grid.ds.getAt(cs[0]);
                                                 
-                                                _this.grid.ds.remove(r);
-                                               
+                                                Roo.MessageBox.confirm("Confirm", "Are you sure you want to delete this client?", function (v){
+                                                    if (v != 'yes') {
+                                                        return;
+                                                    }
+                                                    
+                                                    new Pman.Request({
+                                                        url : baseURL + '/Roo/Core_oauth_clients',
+                                                        method : 'POST',
+                                                        params : {
+                                                            _delete : r.data.id
+                                                        },
+                                                        success : function(res) {
+                                                            _this.grid.footer.onClick('refresh');
+                                                        }
+                                                    });
+                                                });
                                             }
                                         },
                                         cls : 'x-btn-text-icon',