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) {
38 Roo.log('ctor-callLock');
42 Roo.apply(Pman.Lock.prototype, {
45 id : false, // the id of the lock..
47 callLock : function(force)
53 url : baseURL + '/Core/Lock/lock',
55 on_table : this.cfg.table,
59 failure : function() {
60 Roo.MessageBox.alert("Error", "Lock Request failed, please try again");
62 success : function(res)
66 if (!force && typeof(data) == 'object') {
67 _t.confirmBreak(data);
71 _t.cfg.success(_t); //dont care about scope..
77 confirmBreak : function (ar)
80 var msg = "This Record is Locked by the following people, <br/>" +
81 "Do you want to continue, this will prevent these people from saving their changes<br/>";
83 Roo.each(ar, function(p) {
84 msg += '<br/>' + p.name + ' at ' + p.lock_created ;
87 Roo.MessageBox.confirm("Confirm breaking locks", msg, function(r) {
100 unlock : function() {
102 url : baseURL + '/Core/Lock/unlock',
106 failure : function() {
107 Roo.MessageBox.alert("Error", "UnLock Request failed, you may get a warning when trying to edit again");
109 success : function(data)