Pman.Lock.js
authorAlan Knowles <alan@akbkhome.com>
Thu, 18 Nov 2010 09:29:36 +0000 (17:29 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 18 Nov 2010 09:29:36 +0000 (17:29 +0800)
Pman.Lock.js

index 84c42ff..e51c211 100644 (file)
@@ -83,10 +83,7 @@ Pman.Lock = function (cfg) {
                 Roo.log(data);
                 
                 if (typeof(data) == 'object') {
-                    this.confirmBreak();
-                    
-                    
-                    
+                    _t.confirmBreak(data);
                 }
                 
                 _t.cfg.success(_t); //dont care about scope..
@@ -94,11 +91,33 @@ Pman.Lock = function (cfg) {
                 
             }
         })
-    }
+    },
+    confirmBreak : function 
     
     
     unlock : function() {
-        
+        Pman.Request({
+            url : baseURL + 'Core/Lock/unlock',
+            params : {
+                id : this.lock_id,
+                on_id : cfg.id
+            },
+            failure : function() {
+                Roo.MessageBox.alert("Error", "Lock Request failed, please try again");
+            },
+            success : function(data)
+            {
+                Roo.log(data);
+                
+                if (typeof(data) == 'object') {
+                    _t.confirmBreak(data);
+                }
+                
+                _t.cfg.success(_t); //dont care about scope..
+                
+                
+            }
+        })
     }