From: Alan Knowles Date: Thu, 18 Nov 2010 09:28:45 +0000 (+0800) Subject: Pman.Lock.js X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=8ee9e91213d57a9f8bdaa7f843c967d5834760fc Pman.Lock.js --- diff --git a/Pman.Lock.js b/Pman.Lock.js index cb8eb283..84c42ffa 100644 --- a/Pman.Lock.js +++ b/Pman.Lock.js @@ -37,7 +37,7 @@ Pman.Lock = function (cfg) { this.cfg = cfg; var _t = this; Pman.Request({ - url : baseURL + 'Core/Lock.php', + url : baseURL + 'Core/Lock/lock', params : { on_table : cfg.table, on_id : cfg.id @@ -49,6 +49,13 @@ Pman.Lock = function (cfg) { { Roo.log(data); + if (typeof(data) == 'object') { + this.confirmBreak(); + + + + } + _t.cfg.success.call(_t,_t); @@ -57,6 +64,39 @@ Pman.Lock = function (cfg) { }, + + + attempt : function() + { + var _t = this + Pman.Request({ + url : baseURL + 'Core/Lock/lock', + params : { + on_table : cfg.table, + 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') { + this.confirmBreak(); + + + + } + + _t.cfg.success(_t); //dont care about scope.. + + + } + }) + } + + unlock : function() { }