MISConfigurator.js 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. function MISConfigurator() {
  2. this.name = "MISConfigurator";
  3. this.__construct = function __construct() {
  4. }
  5. this.__toString = function __toString() {
  6. return MISConfigurator.name;
  7. }
  8. this.dragAndDrop = function dragAndDrop(p_dragType,p_dragID,p_dropType,p_dropID,p_dropOrder) {
  9. CMgr.getMODEL().getRetrieveInput(MISConfigurator.__toString(),"dragAndDrop",p_dragType,p_dragID,p_dropType,p_dropID,p_dropOrder);
  10. }
  11. this.loadTranslation = function loadTranslation(p_app,p_key) {
  12. Ajax.request(MISConfigurator.__toString(),"loadTranslation",p_app,p_key,MISConfigurator.loadTranslationCb);
  13. }
  14. this.loadTranslationCb = function loadTranslationCb(cb) {
  15. k = 0;
  16. for(var i in cb) {
  17. if(k%2>0){k++; continue;}
  18. Browser.getElementById("translation_"+cb[k]).value = cb[k+1];
  19. k++;
  20. }
  21. }
  22. this.selectSection = function selectSection(ev,p_menu) {
  23. if(!ev) ev = window.event;
  24. //Tree.select(ev,p_menu);
  25. ctrlPressed =ev.ctrlKey;
  26. if(!ctrlPressed) {
  27. Cookie.create(Tree.__toString()+"_administrationMenu2_scroll",0);
  28. Cookie.create(Tree.__toString()+"_administrationMenu3_scroll",0);
  29. Cookie.create(Tree.__toString()+"_administrationMenu4_scroll",0);
  30. //CMgr.getMODEL().getMain("MISConfigurator","publishes",p_menu.id);
  31. Ajax.request(MISConfigurator.__toString(),"configReportsForm",p_menu.id,MISConfigurator.configReportsFormCb);
  32. Ajax.request(MISConfigurator.__toString(),"configScorecardsForm",p_menu.id,MISConfigurator.configScorecardsFormCb);
  33. Ajax.request(MISConfigurator.__toString(),"configDashboardsForm",p_menu.id,MISConfigurator.configDashboardsFormCb);
  34. }
  35. }
  36. this.selectEmailSection = function selectEmailSection(ev,p_menu) {
  37. if(!ev) ev = window.event;
  38. //Tree.select(ev,p_menu);
  39. ctrlPressed =ev.ctrlKey;
  40. if(!ctrlPressed) {
  41. Cookie.create(Tree.__toString()+"_administrationMenu11_scroll",0);
  42. //CMgr.getMODEL().getMain("MISConfigurator","publishes",p_menu.id);
  43. Ajax.request(MISConfigurator.__toString(),"createEmailReportsForm",p_menu.id,MISConfigurator.emailReportsFormCb);
  44. }
  45. }
  46. this.emailReportsFormCb = function(p_cb) {
  47. Browser.getElementById("emailReportsForm").innerHTML = p_cb;
  48. Tree.setToUserView(Browser.getElementById("administrationMenu11"));
  49. }
  50. this.submitCreateEmailReport = function submitCreateEmailReport(p_obj){
  51. var selected = Cookie.read("Tree_administrationMenu11_selected");
  52. if(selected != "") {
  53. Browser.getElementById("createEmailReportSelected").value = selected;
  54. return Form.submit(p_obj,"MISConfigurator","saveRetrieveInput");
  55. }else{
  56. alert("Wählen Sie einen Bericht aus.");
  57. return false;
  58. }
  59. }
  60. this.configReportsFormCb = function(p_cb) {
  61. Browser.getElementById("configReportsForm").innerHTML = p_cb;
  62. Tree.setToUserView(Browser.getElementById("administrationMenu2"));
  63. }
  64. this.configScorecardsFormCb = function(p_cb) {
  65. Browser.getElementById("configScorecardsForm").innerHTML = p_cb;
  66. Tree.setToUserView(Browser.getElementById("administrationMenu3"));
  67. }
  68. this.configDashboardsFormCb = function(p_cb) {
  69. Browser.getElementById("configDashboardsForm").innerHTML = p_cb;
  70. Tree.setToUserView(Browser.getElementById("administrationMenu4"));
  71. }
  72. this.selectReport = function selectReport(ev,p_menu) {
  73. Tree.select(ev,p_menu);
  74. }
  75. }
  76. var MISConfigurator = new MISConfigurator();