D_ppesAdminPDFPaginationDialog_async.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. // Licensed Materials - Property of IBM
  2. //
  3. // IBM Cognos Products: pps
  4. //
  5. // (C) Copyright IBM Corp. 2005, 2017
  6. //
  7. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. /**
  9. * @type Object
  10. */
  11. D_ppesAdminPDFPaginationDialog.F_GetValue = function()
  12. {
  13. return this.m_sCurrentValue;
  14. };
  15. /**
  16. * @private
  17. */
  18. D_ppesAdminPDFPaginationDialog.F_Dialog_OnInit = function()
  19. {
  20. /**
  21. * @private
  22. */
  23. this.m_oTab = new C_Tab( this.F_GetDlgItem( "ppesAdminPDFPaginationTabs" ).id );
  24. };
  25. D_ppesAdminPDFPaginationDialog.f_setRadioButtonVal = function( v_sName, v_iVal ) {
  26. //All radio buttons in 3s
  27. for (var i = 0; i < 3; i++) {
  28. this.F_GetDlgItem( v_sName + i).checked = (i == v_iVal);
  29. }
  30. }
  31. D_ppesAdminPDFPaginationDialog.f_getRadioButtonVal = function( v_sName ) {
  32. //All radio buttons in 3s
  33. for (var i = 0; i < 3; i++) {
  34. if (this.F_GetDlgItem( v_sName + i).checked)
  35. return i;
  36. }
  37. }
  38. /**
  39. * @private
  40. */
  41. D_ppesAdminPDFPaginationDialog.f_SetDialogControls = function()
  42. {
  43. //Set the values of the various controls
  44. var props = null;
  45. if (this.m_sCurrentValue != "") {
  46. props = this.m_sCurrentValue.split(";");
  47. } else {
  48. props = this.m_sDefaultValue.split(";");
  49. }
  50. for (var i = 0; i < props.length; i++) {
  51. if (props[i].indexOf("=") != -1) {
  52. var com = props[i].substr(0,props[i].indexOf("="));
  53. var val = props[i].substr(props[i].indexOf("=") + 1);
  54. if (com.length && val.length) {
  55. switch(com) {
  56. case "CT_RPT":
  57. case "CT_CPT":
  58. case "CH_PT":
  59. case "NC_RPT":
  60. case "NC_CPT": this.f_setRadioButtonVal(com,val); break;
  61. case "CT_ENR":
  62. case "CT_RONG":
  63. case "CT_ENC":
  64. case "CT_CONG":
  65. case "SV_ROP":
  66. this.F_GetDlgItem(com).checked = (val == "1"); break;
  67. case "CT_NOR":
  68. case "CT_NOC":
  69. case "CH_NCA":
  70. case "NC_NBR":
  71. case "NC_NBC":
  72. this.F_GetDlgItem(com).value = val; break;
  73. }
  74. }
  75. }
  76. }
  77. }
  78. /**
  79. * @private
  80. */
  81. D_ppesAdminPDFPaginationDialog.f_GetValueString = function()
  82. {
  83. var valuesStr = "CT_RPT=" + this.f_getRadioButtonVal("CT_RPT") + ";";
  84. valuesStr += "CT_ENR=" + ((this.F_GetDlgItem("CT_ENR").checked)? "1" : "0") + ";";
  85. valuesStr += "CT_NOR=" + this.F_GetDlgItem("CT_NOR").value + ";";
  86. valuesStr += "CT_RONG=" + ((this.F_GetDlgItem("CT_RONG").checked)? "1" : "0") + ";";
  87. valuesStr += "CT_CPT=" + this.f_getRadioButtonVal("CT_CPT") + ";";
  88. valuesStr += "CT_ENC=" + ((this.F_GetDlgItem("CT_ENC").checked)? "1" : "0") + ";";
  89. valuesStr += "CT_NOC=" + this.F_GetDlgItem("CT_NOC").value + ";";
  90. valuesStr += "CT_CONG=" + ((this.F_GetDlgItem("CT_CONG").checked)? "1" : "0") + ";";
  91. valuesStr += "CH_PT=" + this.f_getRadioButtonVal("CH_PT") + ";";
  92. valuesStr += "CH_NCA=" + this.F_GetDlgItem("CH_NCA").value + ";";
  93. valuesStr += "NC_RPT=" + this.f_getRadioButtonVal("NC_RPT") + ";";
  94. valuesStr += "NC_NBR=" + this.F_GetDlgItem("NC_NBR").value + ";";
  95. valuesStr += "NC_CPT=" + this.f_getRadioButtonVal("NC_CPT") + ";";
  96. valuesStr += "NC_NBC=" + this.F_GetDlgItem("NC_NBC").value + ";";
  97. valuesStr += "SV_ROP=" + ((this.F_GetDlgItem("SV_ROP").checked)? "1" : "0") + ";";
  98. return valuesStr;
  99. }
  100. /**
  101. * @private
  102. */
  103. D_ppesAdminPDFPaginationDialog.F_Dialog_OnBeforeVisible = function()
  104. {
  105. this.f_SetDialogControls();
  106. }
  107. /**
  108. * @private
  109. */
  110. D_ppesAdminPDFPaginationDialog.F_OnOk = function()
  111. {
  112. this.m_sCurrentValue = this.f_GetValueString();
  113. this.M_fnSuper_OnOK();
  114. };
  115. /**
  116. * @private
  117. */
  118. D_ppesAdminPDFPaginationDialog.F_OnReset = function()
  119. {
  120. this.m_sCurrentValue = this.m_sDefaultValue;
  121. this.f_SetDialogControls();
  122. };