* usage:
*
- * new Pman.Lock( {
+ new Pman.Lock( {
table : 'Product',
id : 123,
success : function(lock) { ..show dialog etc.....
*
*/
Pman.Lock = function (cfg) {
- this.cfg = cfg;
- var _t = this;
+ this.cfg = cfg;
+ this.attemptLock();
+}
+
+Roo.apply(Pman.Lock.prototype, {
+
+ attemptLock : function()
+ {
+ var _t = this
Pman.Request({
- url : baseURL + 'Core/Lock.php',
+ url : baseURL + 'Core/Lock/lock',
params : {
on_table : cfg.table,
on_id : cfg.id
{
Roo.log(data);
- _t.cfg.success.call(_t,_t);
+ if (typeof(data) == 'object') {
+ _t.confirmBreak(data);
+ }
+
+ _t.cfg.success(_t); //dont care about scope..
}
})
+ },
+ confirmBreak : function (ar)
+ {
+
+ var msg = '';
+ Roo.each(ar, function(p) {
+
+ }
+
+
+
+ }
- },
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..
+
+
+ }
+ })
}
-}
+});
\ No newline at end of file