123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- function setupDialog()
- {
- var oAppFrame = goDialogManager.getApplicationFrame();
- var oMQMgr = goDialogManager.getMiniQueryManager();
- var oTitleArea = oMQMgr.getElementsByTagName("TitleArea");
-
- var bTitleAreaSet = false;
- var oTitle = null;
- var oSubtitle = null;
- var oFilters = null;
- var oSorts = null;
- var oSuppress = null;
- var sReportTitle = "";
- var sReportSubTitle = "";
- if (typeof oTitleArea == "object")
- {
- oTitleArea = oTitleArea[0];
- oTitle = oMQMgr.getElementsByTagName("Title", oTitleArea);
- oSubtitle = oMQMgr.getElementsByTagName("Subtitle", oTitleArea);
-
-
- if(typeof oTitle == "object")
- bTitleAreaSet = true;
-
- oFilters = oMQMgr.getElementsByTagName("Filters", oTitleArea);
- if (typeof oFilters == "object")
- {
- oFilters = oFilters[0];
- }
- oSorts = oMQMgr.getElementsByTagName("Sorts", oTitleArea);
- if (typeof oSorts == "object")
- {
- oSorts = oSorts[0];
- }
- oSuppress = oMQMgr.getElementsByTagName("Suppress", oTitleArea);
- if (typeof oSuppress === "object")
- {
- oSuppress = oSuppress[0];
- }
- }
-
- if(typeof oTitle != "object" || typeof oTitleArea != "object")
- {
- var report=goDialogManager.getWindowManager().getReportFrame();
- var spanObjects=report.document.getElementsByTagName("span");
- for(var i=0;i<spanObjects.length;i++)
- {
- var item=spanObjects.item(i);
- var value= item.getAttribute("lid");
- if(value!==null && value=="reportTitleQS")
- {
- if(item.innerText)
- sReportTitle=item.innerText;
- else
- sReportTitle=item.textContent;
- }
- if(value!==null && value=="reportSubtitleQS")
- {
- if(item.innerText)
- sReportSubTitle=item.innerText;
- else
- sReportSubTitle=item.textContent;
- }
- }
- }
-
- if (oTitle === null)
- {
- if(sReportTitle=="")
- sReportTitle = goDialogManager.getApplicationManager().get("reportTitleDefault");
- }
- else
- {
- var idxTitles;
- for (idxTitles = 0; idxTitles < oTitle.length; idxTitles++)
- {
- if (oTitle[idxTitles].getAttribute("locale") == goDialogManager.getApplicationManager().get("contentLocale"))
- {
- if (oTitle[idxTitles].getAttribute("value") !== null)
- {
- sReportTitle = oTitle[idxTitles].getAttribute("value");
- }
- break;
- }
- }
- if (sReportTitle === "")
- {
- for (idxTitles = 0; idxTitles < oTitle.length; idxTitles++)
- {
- if (oTitle[idxTitles].getAttribute("default") == "true")
- {
- if (oTitle[idxTitles].getAttribute("value") !== null)
- {
- sReportTitle = oTitle[idxTitles].getAttribute("value");
- }
- break;
- }
- }
- }
- }
- document.f.title_text.value = sReportTitle;
-
- if (bTitleAreaSet && typeof oSubtitle == "object")
- {
- var idxSubtitle;
- for (idxSubtitle = 0; idxSubtitle < oSubtitle.length; idxSubtitle++)
- {
- if (oSubtitle[idxSubtitle].getAttribute("locale") == goDialogManager.getApplicationManager().get("contentLocale"))
- {
- sReportSubTitle = oSubtitle[idxSubtitle].getAttribute("value");
- break;
- }
- }
- if (sReportSubTitle === "" || sReportSubTitle === null)
- {
- for (idxSubtitle = 0; idxSubtitle < oSubtitle.length; idxSubtitle++)
- {
- if (oSubtitle[idxSubtitle].getAttribute("default") == "true")
- {
- sReportSubTitle = oSubtitle[idxSubtitle].getAttribute("value");
- break;
- }
- }
- }
- if (sReportSubTitle === "" || sReportSubTitle === null)
- {
- sReportSubTitle = "";
- }
- }
- document.f.subtitle_text.value = sReportSubTitle;
- if (!bTitleAreaSet || (bTitleAreaSet && typeof oFilters == "object" && oFilters.getAttribute("showFilters") == "true"))
- {
- document.f.show_filters.checked = true;
- }
- if (!bTitleAreaSet || (bTitleAreaSet && typeof oSorts == "object" && oSorts.getAttribute("showSorts") == "true"))
- {
- document.f.show_sorts.checked = true;
- }
- if (!bTitleAreaSet || (typeof oSuppress == "object" && oSuppress.getAttribute("show") == "true"))
- {
- document.f.show_suppress.checked = true;
- }
- document.f.title_text.focus();
- };
|