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, {
44 callLock : function(force)
49 url : baseURL + 'Core/Lock/lock',
51 on_table : this.cfg.table,
55 failure : function() {
56 Roo.MessageBox.alert("Error", "Lock Request failed, please try again");
58 success : function(data)
62 if (!force && typeof(data) == 'object') {
63 _t.confirmBreak(data);
66 _t.cfg.success(_t); //dont care about scope..
72 confirmBreak : function (ar)
75 var msg = "This Record is Locked by the following people, <br/>" +
76 "Do you want to continue, this will prevent these people from saving their changes<br/>";
78 Roo.each(ar, function(p) {
79 msg += '<br/>' + p.name + ' at ' + p.lock_created ;
82 Roo.messageBox.confirm("Confirm breaking locks", msg, function(r) {
97 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..