1 //<script type="text/javascript">
11 success : function(lock) { ..show dialog etc.....
14 ... send _lock=XXX to Roo updated code..
16 lock.unlock() -- we dont care about the result..
24 * baseURL + /Core/Lock/lock?on_id=...&on_table=...
25 * - returns id or an array of who has the locks.
27 * Force an unlock after a warning..
28 * baseURL + /Core/Lock/lock?on_id=...&on_table=...&force=1
31 * Unlock - call when window is closed..
32 * baseURL + /Core/Lock/unlock?on_id=...&on_table=...&force=1
33 * - returns jerr or jok
36 Pman.Lock = function (cfg) {
41 Roo.apply(Pman.Lock.prototype, {
43 callLock : function(force)
48 url : baseURL + 'Core/Lock/lock',
54 failure : function() {
55 Roo.MessageBox.alert("Error", "Lock Request failed, please try again");
57 success : function(data)
61 if (!force && typeof(data) == 'object') {
62 _t.confirmBreak(data);
65 _t.cfg.success(_t); //dont care about scope..
71 confirmBreak : function (ar)
74 var msg = "This Record is Locked by the following people, <br/>" +
75 "Do you want to continue, this will prevent these people from saving their changes<br/>";
77 Roo.each(ar, function(p) {
78 msg += '<br/>' + p.name + ' at ' + p.lock_created ;
81 Roo.messageBox.confirm("Confirm breaking locks", msg, function(r) {
96 url : baseURL + 'Core/Lock/unlock',
101 failure : function() {
102 Roo.MessageBox.alert("Error", "Lock Request failed, please try again");
104 success : function(data)
108 if (typeof(data) == 'object') {
109 _t.confirmBreak(data);
112 _t.cfg.success(_t); //dont care about scope..