Main.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. MWF.xApplication.process.Work.options.multitask = true;
  2. MWF.xApplication.process.Work.Main = new Class({
  3. Extends: MWF.xApplication.Common.Main,
  4. Implements: [Options, Events],
  5. options: {
  6. "style": "default",
  7. "name": "process.Work",
  8. "icon": "icon.png",
  9. "width": "1200",
  10. "height": "800",
  11. "title": MWF.xApplication.process.Work.LP.title,
  12. "workId": "",
  13. "draftId": "",
  14. "draft": null,
  15. "workCompletedId": "",
  16. "taskId": "",
  17. "jobId": "",
  18. "form": null,
  19. "priorityWork": "",
  20. "isControl": false,
  21. "taskObject": null,
  22. "readonly": false,
  23. "worklogType": "record" //record, worklog
  24. },
  25. onQueryLoad: function(){
  26. debugger;
  27. this.lp = MWF.xApplication.process.Work.LP;
  28. if (!this.status) {
  29. } else {
  30. this.options.workId = this.status.workId;
  31. this.options.workCompletedId = this.status.workCompletedId;
  32. this.options.jobId = this.status.jobId;
  33. this.options.draftId = this.status.draftId;
  34. this.options.priorityWork = this.status.priorityWork;
  35. this.options.readonly = (this.status.readonly === "true");
  36. }
  37. this.action = MWF.Actions.get("x_processplatform_assemble_surface");
  38. },
  39. loadWorkApplication: function(callback, mask){
  40. debugger;
  41. var maskStyle = (Browser.name=="firefox") ? "work_firefox" : "desktop";
  42. //alert(maskStyle);
  43. if (mask) this.mask = new MWF.widget.Mask({"style": maskStyle, "loading": mask});
  44. this.formNode = new Element("div", {"styles": this.css.formNode}).inject(this.node);
  45. if (!this.options.isRefresh){
  46. this.maxSize(function(){
  47. if (mask) this.mask.loadNode(this.content);
  48. this.loadWork();
  49. }.bind(this));
  50. }else{
  51. if (mask) this.mask.loadNode(this.content);
  52. this.loadWork();
  53. }
  54. if (callback) callback();
  55. },
  56. loadApplication: function(callback){
  57. this.node = new Element("div", {"styles": this.css.content}).inject(this.content);
  58. if (layout.mobile){
  59. this.loadWorkApplication(callback, false)
  60. }else{
  61. if (layout.viewMode=="Default"){
  62. MWF.require("MWF.widget.Mask", function(){
  63. this.loadWorkApplication(callback, true);
  64. }.bind(this));
  65. }else{
  66. this.loadWorkApplication(callback, false);
  67. }
  68. }
  69. this.addEvent("postClose", function(){
  70. //this.refreshTaskCenter();
  71. }.bind(this));
  72. this.addKeyboardEvents();
  73. },
  74. refreshTaskCenter: function(){
  75. if (this.desktop.apps){
  76. if (this.desktop.apps["TaskCenter"]){
  77. if(this.desktop.apps["TaskCenter"].content){
  78. this.desktop.apps["TaskCenter"].content.unmask();
  79. }
  80. if(this.desktop.apps["TaskCenter"].refreshAll){
  81. this.desktop.apps["TaskCenter"].refreshAll();
  82. }
  83. }
  84. }
  85. },
  86. addKeyboardEvents: function(){
  87. this.addEvent("keySave", function(e){
  88. this.keySave(e);
  89. }.bind(this));
  90. },
  91. keySave: function(e){
  92. if (this.appForm){
  93. if (!this.options.readonly){
  94. this.appForm.saveWork();
  95. e.preventDefault();
  96. }
  97. }
  98. },
  99. reload: function(data){
  100. if (this.form){
  101. this.formNode.empty();
  102. MWF.release(this.form);
  103. this.form = null;
  104. }
  105. if (data){
  106. this.parseData(data);
  107. this.openWork();
  108. }else{
  109. this.loadWork();
  110. }
  111. },
  112. loadWork: function(){
  113. var id = this.options.workCompletedId || this.options.workId || this.options.workid || this.options.workcompletedid;
  114. // var methods = {
  115. // "loadWork": false,
  116. // "getWorkControl": false,
  117. // "getForm": false
  118. // };
  119. if (id){
  120. this.loadWorkByWork(id);
  121. // }.bind(this), "failure": function(){}}, [id, true, true, true], id);
  122. }else if (this.options.draftId || this.options.draftid){
  123. var draftId = this.options.draftId || this.options.draftid;
  124. MWF.Actions.get("x_processplatform_assemble_surface").getDraft(draftId, function(json){
  125. this.loadWorkByDraft(json.data.work, json.data.data);
  126. }.bind(this));
  127. }else if (this.options.draft){
  128. this.loadWorkByDraft(this.options.draft);
  129. }else if (this.options.jobId || this.options.jobid || this.options.job){
  130. var jobId = this.options.jobId || this.options.jobid || this.options.job;
  131. delete this.options.jobId;
  132. delete this.options.jobid;
  133. delete this.options.job;
  134. this.loadWorkByJob(jobId);
  135. }
  136. },
  137. loadWorkByWork: function(id){
  138. //var getWorkLogMothed = "getWorkLog"; //以前使用worklog,现在改成record了
  139. var getWorkLogMothed = (this.options.worklogType.toLowerCase()==="worklog") ? "getWorkLog" : "getRecordLog";
  140. if (this.options.form && this.options.form.id && this.options.form.app){
  141. o2.Actions.invokeAsync([
  142. {"action": this.action, "name": "getForm"},
  143. {"action": this.action, "name": "loadWork"},
  144. {"action": this.action, "name": "getWorkControl"},
  145. {"action": this.action, "name": "getWorkLog"},
  146. {"action": this.action, "name": "getRecordLog"},
  147. {"action": this.action, "name": "listAttachments"}
  148. ], {"success": function(json_form, json_work, json_control, json_log, json_record, json_att){
  149. if (json_work && json_control && json_form && json_log && json_att){
  150. this.parseData(json_work.data, json_control.data, json_form.data, json_log.data, json_record.data, json_att.data);
  151. if (this.mask) this.mask.hide();
  152. //if (layout.mobile) this.loadMobileActions();
  153. this.openWork();
  154. this.unLoading();
  155. } else{
  156. if (this.options.jobId || this.options.jobid || this.options.job){
  157. delete this.options.workCompletedId;
  158. delete this.options.workId;
  159. delete this.options.workid;
  160. delete this.options.workcompletedid;
  161. this.loadWork();
  162. }else{
  163. this.close();
  164. }
  165. }
  166. }.bind(this), "failure": function(){
  167. //this.close();
  168. }.bind(this)}, [this.options.form.id, this.options.form.app], id);
  169. }else{
  170. o2.Actions.invokeAsync([
  171. {"action": this.action, "name": (layout.mobile) ? "getWorkFormMobile": "getWorkForm"},
  172. {"action": this.action, "name": "loadWork"},
  173. {"action": this.action, "name": "getWorkControl"},
  174. {"action": this.action, "name": "getWorkLog"},
  175. {"action": this.action, "name": "getRecordLog"},
  176. {"action": this.action, "name": "listAttachments"}
  177. ], {"success": function(json_form, json_work, json_control, json_log, json_record, json_att){
  178. if (json_work && json_control && json_form && json_log && json_att){
  179. this.parseData(json_work.data, json_control.data, json_form.data, json_log.data, json_record.data, json_att.data);
  180. if (this.mask) this.mask.hide();
  181. //if (layout.mobile) this.loadMobileActions();
  182. this.openWork();
  183. this.unLoading();
  184. } else{
  185. if (this.options.jobId || this.options.jobid || this.options.job){
  186. delete this.options.workCompletedId;
  187. delete this.options.workId;
  188. delete this.options.workid;
  189. delete this.options.workcompletedid;
  190. this.loadWork();
  191. }else{
  192. this.close();
  193. }
  194. }
  195. }.bind(this), "failure": function(){
  196. //this.close();
  197. }.bind(this)}, id);
  198. }
  199. },
  200. loadWorkByJob: function(jobId){
  201. MWF.Actions.get("x_processplatform_assemble_surface").listWorkByJob(jobId, function(json){
  202. var workCompletedCount = json.data.workCompletedList.length;
  203. var workCount = json.data.workList.length;
  204. var count = workCount+workCompletedCount;
  205. if (count===1){
  206. this.options.workId = (json.data.workList.length) ? json.data.workList[0].id : json.data.workCompletedList[0].id;
  207. this.loadWork();
  208. }else if (count>1){
  209. var id = this.filterId(json.data.workList, json.data.workCompletedList, this.options.priorityWork);
  210. if (id) {
  211. this.options.workId = id;
  212. this.loadWork();
  213. }else{
  214. if (this.options.choice){
  215. var worksAreaNode = this.createWorksArea();
  216. // for (var x=0;x<3;x++){
  217. json.data.workList.each(function(work){
  218. this.createWorkNode(work, worksAreaNode);
  219. }.bind(this));
  220. json.data.workCompletedList.each(function(work){
  221. this.createWorkCompletedNode(work, worksAreaNode);
  222. }.bind(this));
  223. // }
  224. if (this.mask) this.mask.hide();
  225. this.formNode.setStyles(this.css.formNode_bg);
  226. }else{
  227. if (json.data.workList.length){
  228. this.options.workId = json.data.workList[0].id;
  229. }else{
  230. this.options.workId = json.data.workCompletedList[0].id;
  231. }
  232. this.loadWork();
  233. }
  234. }
  235. }else{
  236. this.close();
  237. }
  238. }.bind(this), function(){
  239. this.close();
  240. }.bind(this));
  241. },
  242. loadWorkByDraft: function(work, data){
  243. debugger;
  244. o2.Actions.invokeAsync([
  245. {"action": this.action, "name": (layout.mobile) ? "getFormMobile": "getForm"}
  246. ], {"success": function(json_form){
  247. if (json_form){
  248. var workData = {
  249. "activity": {},
  250. "data": data || {},
  251. "taskList": [],
  252. "work": work
  253. };
  254. var control = {
  255. "allowVisit": true,
  256. "allowProcessing": true,
  257. "allowSave": true,
  258. "allowDelete": true
  259. };
  260. this.parseData(workData, control, json_form.data, [], [], []);
  261. if (this.mask) this.mask.hide();
  262. //if (layout.mobile) this.loadMobileActions();
  263. this.openWork();
  264. this.unLoading();
  265. }
  266. }.bind(this), "failure": function(){}}, [work.form, work.application]);
  267. },
  268. createWorkNode: function(work, node, completed){
  269. var contentNode = node.getLast();
  270. var workNode = new Element("div", {"styles": this.css.workItemNode}).inject(contentNode);
  271. var titleNode = new Element("div", {"styles": this.css.workItemTitleNode}).inject(workNode);
  272. titleNode.set("text", work.title);
  273. var inforNode = new Element("div", {"styles": this.css.workItemInforNode}).inject(workNode);
  274. if (completed){
  275. inforNode.set("text", this.lp.completedWork);
  276. }else{
  277. var activityTitleNode = new Element("div", {"styles": this.css.workItemInforTitleNode, "text": this.lp.currentActivity}).inject(inforNode);
  278. var activityContentNode = new Element("div", {"styles": this.css.workItemInforContentNode, "text": work.activityName}).inject(inforNode);
  279. var userTitleNode = new Element("div", {"styles": this.css.workItemInforTitleNode, "text": this.lp.currentUsers}).inject(inforNode);
  280. var taskUsers = [];
  281. MWF.Actions.get("x_processplatform_assemble_surface").listTaskByWork(work.id, function(json){
  282. json.data.each(function(task){
  283. taskUsers.push(MWF.name.cn(task.person));
  284. }.bind(this));
  285. var activityContentNode = new Element("div", {"styles": this.css.workItemInforContentNode, "text": taskUsers.join(", ")}).inject(inforNode);
  286. }.bind(this));
  287. }
  288. var _self = this;
  289. workNode.store("workId", work.id);
  290. workNode.addEvents({
  291. "mouseover": function(){
  292. this.addClass("mainColor_border");
  293. this.setStyles(_self.css.workItemNode_over);
  294. },
  295. "mouseout": function(){
  296. this.removeClass("mainColor_border");
  297. this.setStyles(_self.css.workItemNode);
  298. },
  299. "click": function(){
  300. var id = this.retrieve("workId");
  301. if (id){
  302. _self.options.workId = id;
  303. _self.loadWork();
  304. }
  305. },
  306. });
  307. },
  308. createWorksArea: function(){
  309. var node = new Element("div", {"styles": this.css.workListArea}).inject(this.formNode);
  310. var titleNode = new Element("div", {"styles": this.css.workListAreaTitle, "text": this.lp.selectWork}).inject(node);
  311. var contentNode = new Element("div", {"styles": this.css.workListContent}).inject(node);
  312. return node;
  313. },
  314. filterId: function(list, completedList, id){
  315. if (!id) return "";
  316. if (!list.length && !completedList.length) return "";
  317. if (list.length){
  318. var o = list.filter(function(work){
  319. return work.id == id;
  320. }.bind(this));
  321. if (o.length) return o[0].id;
  322. }
  323. if (completedList.length) {
  324. o = completedList.filter(function(work){
  325. return work.id == id;
  326. }.bind(this));
  327. return (o.length) ? o[0].id : "";
  328. }
  329. return "";
  330. },
  331. parseData: function(workData, controlData, formData, logData, recordData, attData){
  332. var title = workData.work.title;
  333. //this.setTitle(this.options.title+"-"+title);
  334. this.setTitle(title || this.options.title);
  335. //routeList 等字段放在 properties 中了,这段代码是兼容以前的脚本
  336. //( workData.taskList || [] ).each(function(task){
  337. // if( task.properties && typeOf( task.properties ) === "object"){
  338. // if( !task.routeList )task.routeList = task.properties.routeList;
  339. // if( !task.routeNameList )task.routeNameList = task.properties.routeNameList;
  340. // if( !task.routeOpinionList )task.routeOpinionList = task.properties.routeOpinionList;
  341. // if( !task.routeDecisionOpinionList )task.routeDecisionOpinionList = task.properties.routeDecisionOpinionList;
  342. // }
  343. //});
  344. this.activity = workData.activity;
  345. this.data = workData.data;
  346. this.taskList = workData.taskList;
  347. this.currentTask = this.getCurrentTaskData(workData);
  348. this.taskList = workData.taskList;
  349. this.readList = workData.readList;
  350. this.work = workData.work;
  351. this.workCompleted = (workData.work.completedTime) ? workData.work : null;
  352. this.workLogList = logData;
  353. this.recordList = recordData;
  354. this.attachmentList = attData;
  355. //this.inheritedAttachmentList = data.inheritedAttachmentList;
  356. this.control = controlData;
  357. if (formData){
  358. this.form = (formData.data) ? JSON.decode(MWF.decodeJsonString(formData.data)): null;
  359. delete formData.data;
  360. this.formInfor = formData;
  361. }
  362. },
  363. // loadWork2: function(){
  364. // var method = "";
  365. // var id = "";
  366. //
  367. // if (this.options.workCompletedId){
  368. // method = (layout.mobile) ? "getJobByWorkCompletedMobile" : "getJobByWorkCompleted";
  369. // id = this.options.workCompletedId;
  370. // }else if (this.options.workId) {
  371. // method = (layout.mobile) ? "getJobByWorkMobile" : "getJobByWork";
  372. // id = this.options.workId;
  373. // }
  374. // if (method && id){
  375. // this.action[method](function(json){
  376. // if (this.mask) this.mask.hide();
  377. // this.parseData(json.data);
  378. // if (layout.mobile) this.loadMobileActions();
  379. // this.openWork();
  380. // }.bind(this), function(){
  381. // this.close();
  382. // }.bind(this), id);
  383. // }
  384. // },
  385. loadMobileActions: function(){
  386. if( this.control.allowSave || this.control.allowProcessing ){
  387. this.mobileActionBarNode = new Element("div", {"styles": this.css.mobileActionBarNode}).inject(this.node, "after");
  388. var size = this.content.getSize();
  389. var y = size.y-40;
  390. this.node.setStyles({
  391. "height": ""+y+"px",
  392. "min-height": ""+y+"px",
  393. "overflow": "auto",
  394. "padding-bottom": "40px"
  395. });
  396. //this.node.set("id", "formNode111111111");
  397. }
  398. if( this.control.allowSave ){
  399. this.mobileSaveActionNode = new Element("div", {"styles": this.css.mobileSaveActionNode, "text": this.lp.save}).inject(this.mobileActionBarNode);
  400. this.mobileSaveActionNode.addEvents({
  401. "click": function(){
  402. this.appForm.saveWork();
  403. }.bind(this),
  404. "touchstart": function(){
  405. this.setStyle("background-color", "#EEEEEE");
  406. },
  407. "touchcancel": function(){
  408. this.setStyle("background-color", "#ffffff");
  409. },
  410. "touchend": function(){
  411. this.setStyle("background-color", "#ffffff");
  412. }
  413. });
  414. if (this.control.allowProcessing){
  415. this.mobileSaveActionNode.setStyles({
  416. "width": "49%",
  417. "float": "left"
  418. });
  419. }
  420. }
  421. if( this.control.allowProcessing ){
  422. this.mobileProcessActionNode = new Element("div", {"styles": this.css.mobileSaveActionNode, "text": this.lp.process}).inject(this.mobileActionBarNode);
  423. this.mobileProcessActionNode.addEvents({
  424. "click": function(){
  425. this.appForm.processWork();
  426. }.bind(this),
  427. "touchstart": function(){
  428. this.setStyle("background-color", "#EEEEEE");
  429. },
  430. "touchcancel": function(){
  431. this.setStyle("background-color", "#ffffff");
  432. },
  433. "touchend": function(){
  434. this.setStyle("background-color", "#ffffff");
  435. }
  436. });
  437. if (this.control.allowSave){
  438. this.mobileProcessActionNode.setStyles({
  439. "width": "49%",
  440. "float": "right"
  441. });
  442. }
  443. }
  444. },
  445. errorWork: function(){
  446. if (this.mask) this.mask.hide();
  447. this.node.set("text", "openError");
  448. },
  449. getCurrentTaskData: function(data){
  450. if ((data.currentTaskIndex || data.currentTaskIndex===0) && data.currentTaskIndex != -1){
  451. this.options.taskId = this.taskList[data.currentTaskIndex].id;
  452. return this.taskList[data.currentTaskIndex];
  453. }
  454. //if (this.taskList){
  455. // if (this.taskList.length==1){
  456. // this.options.taskId = this.taskList[0].id;
  457. // return this.taskList[0];
  458. // }
  459. //}
  460. return null;
  461. },
  462. // parseData: function(data){
  463. // var title = "";
  464. // if (this.options.taskId){
  465. // title = data.work.title;
  466. // this.options.workId = data.work.id;
  467. // }else if (this.options.workCompletedId){
  468. // title = data.workCompleted.title;
  469. // this.options.workCompleted = data.workCompleted.id;
  470. // }else if (this.options.workId) {
  471. // title = data.work.title;
  472. // this.options.workId = data.work.id;
  473. // }
  474. //
  475. // this.setTitle(this.options.title+"-"+title);
  476. //
  477. // this.activity = data.activity;
  478. // this.data = data.data;
  479. // this.taskList = data.taskList;
  480. // this.currentTask = this.getCurrentTaskData(data);
  481. // this.taskList = data.taskList;
  482. // this.readList = data.readList;
  483. // this.work = data.work;
  484. // this.workCompleted = data.workCompleted;
  485. // this.workLogList = data.workLogList;
  486. // this.attachmentList = data.attachmentList;
  487. // this.inheritedAttachmentList = data.inheritedAttachmentList;
  488. // this.control = data.control;
  489. // this.form = (data.form) ? JSON.decode(MWF.decodeJsonString(data.form.data)): null;
  490. // this.formInfor = data.form;
  491. // },
  492. openWork: function(){
  493. if (this.form){
  494. //this.readonly = true;
  495. //if (this.currentTask) {
  496. // this.readonly = false;
  497. //}else if(this.options.isControl && this.work){
  498. // this.readonly = false;
  499. //}
  500. // MWF.xDesktop.requireApp("process.Xform", "Package", function(){
  501. // MWF.xApplication.process.Xform.require(function(){
  502. // this.appForm = new MWF.APPForm(this.formNode, this.form, {});
  503. // this.appForm.businessData = {
  504. // "data": this.data,
  505. // "taskList": this.taskList,
  506. // "readList": this.readList,
  507. // "work": this.work,
  508. // "workCompleted": this.workCompleted,
  509. // "control": this.control,
  510. // "activity": this.activity,
  511. // "task": this.currentTask,
  512. // "workLogList": this.workLogList,
  513. // "attachmentList": this.attachmentList,
  514. // "inheritedAttachmentList": this.inheritedAttachmentList,
  515. // "formInfor": this.formInfor,
  516. // "status": {
  517. // //"readonly": (this.options.readonly) ? true : false
  518. // "readonly": this.readonly
  519. // }
  520. // };
  521. // this.appForm.workAction = this.action;
  522. // this.appForm.app = this;
  523. // this.appForm.load();
  524. // }.bind(this));
  525. // }.bind(this));
  526. this.formNode.empty();
  527. this.formNode.setStyles(this.css.formNode);
  528. var uri = window.location.href;
  529. //var cl = (uri.indexOf("$all")!=-1) ? "$all" : "Form";
  530. var cl = "$all";
  531. MWF.xDesktop.requireApp("process.Xform", cl, function(){
  532. //MWF.xDesktop.requireApp("process.Xform", "Form", function(){
  533. this.appForm = new MWF.APPForm(this.formNode, this.form, {});
  534. this.appForm.businessData = {
  535. "data": this.data,
  536. "originalData" : Object.clone( this.data ),
  537. "taskList": this.taskList,
  538. "readList": this.readList,
  539. "work": this.work,
  540. "workCompleted": this.workCompleted,
  541. "control": this.control,
  542. "activity": this.activity,
  543. "task": this.currentTask,
  544. "workLogList": this.workLogList,
  545. "recordList": this.recordList,
  546. "attachmentList": this.attachmentList,
  547. "inheritedAttachmentList": this.inheritedAttachmentList,
  548. "formInfor": this.formInfor,
  549. "status": {
  550. //"readonly": (this.options.readonly) ? true : false
  551. "readonly": this.readonly
  552. }
  553. };
  554. this.appForm.workAction = this.action;
  555. this.appForm.app = this;
  556. if( this.$events && this.$events.queryLoadForm ){
  557. this.appForm.addEvent( "queryLoad", function () {
  558. this.fireEvent("queryLoadForm");
  559. }.bind(this));
  560. }
  561. this.appForm.load(function(){
  562. if (this.mask) this.mask.hide();
  563. if (window.o2android && window.o2android.appFormLoaded){
  564. layout.appForm = this.appForm;
  565. window.o2android.appFormLoaded(JSON.stringify(this.appForm.mobileTools));
  566. }
  567. if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.appFormLoaded){
  568. layout.appForm = this.appForm;
  569. window.webkit.messageHandlers.appFormLoaded.postMessage(JSON.stringify(this.appForm.mobileTools));
  570. }
  571. this.fireEvent("postLoadForm");
  572. }.bind(this));
  573. }.bind(this));
  574. }
  575. },
  576. //errorWork: function(){
  577. //
  578. //},
  579. recordStatus: function(){
  580. debugger;
  581. return {"workId": this.options.workId, "workCompletedId": this.options.workCompletedId, "jobId": this.options.jobId, "draftId": this.options.draftId, "priorityWork": this.options.priorityWork, "readonly": this.readonly};
  582. },
  583. onPostClose: function(){
  584. if (this.appForm){
  585. this.appForm.modules.each(function(module){
  586. MWF.release(module);
  587. });
  588. MWF.release(this.appForm);
  589. }
  590. }
  591. });