123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- /****************************************************************
- ** Licensed Materials - Property of IBM
- **
- ** BI and PM: qs
- **
- ** (C) Copyright IBM Corp. 2001, 2015
- **
- ** US Government Users Restricted Rights - Use, duplication or
- ** disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *****************************************************************/
- // Copyright (C) 2008 Cognos ULC, an IBM Company. All Rights Reserved.
- // Cognos and the Cognos logo are trademarks of Cognos ULC (formerly Cognos Incorporated) in the United States and/or other countries. IBM and the IBM logo are trademarks of International Business Machines Corporation in the United States, or other countries, or both. Other company, product, or service names may be trademarks or service marks of others.
- var dialogFormValues = new Array();
- var dialogGlobalValues = new Array();
- function dlgSubmit(tgt, usePost, forceRun)
- {
- var reportState = goApplicationManager.getReportManager().get("reportState");
- if (reportState != "complete" && (typeof forceRun == "undefined" || (typeof forceRun != "undefined" && forceRun == false)))
- return;
- if ((typeof usePost == "undefined") || (typeof usePost != "undefined" && usePost == false))
- {
- var df;
- if (tgt !== "" && typeof tgt !== "undefined" && tgt !== null)
- {
- df = getFrame(tgt);
- }
- if (!df)
- {
- df = getDialogFrame();
- }
- if (!df)
- {
- df=this;
- }
-
- var url = goApplicationManager.get("scriptEngine") + "?";
- var urlParams = "";
- for (var n in dialogFormValues)
- {
- if (urlParams != "")
- urlParams += "&";
- if (typeof dialogFormValues[n] == "object" && dialogFormValues[n] != null)
- {
- var first = true;
- for (var v in dialogFormValues[n])
- {
- if (!first)
- urlParams += "&";
- if (typeof dialogFormValues[n][v] == "undefined")
- urlParams += n + "=null";
- else
- urlParams += n + "=" + dialogFormValues[n][v];
- first = false;
- }
- }
- else
- {
- if (typeof dialogFormValues[n] == "undefined")
- urlParams += n + "=null";
- else
- urlParams += n + "=" + dialogFormValues[n];
- }
- }
- url += constructGETRequestParamsString(urlParams);
-
-
-
-
- var iFrameElement = document.getElementById("dialogIFrame");
- if(document.all)
- {
- iFrameElement.attachEvent("onload", openDialogFrameIfNotInitialized);
- }
- else
- {
- iFrameElement.addEventListener("load", openDialogFrameIfNotInitialized, true);
- }
- df.document.location.replace(url);
- }
- else
- {
-
- var df = getDialogFrame();
- if (!df)
- df = this;
- var f = df.document.createElement("FORM");
- f.method = "POST";
- f.action = goApplicationManager.get("scriptEngine");
- if (tgt != null)
- f.target = tgt;
- else
- f.target = df.name;
- f.style.margin = "0px";
- var b = df.document.getElementsByTagName("BODY");
- if (b != null && b[0] != null)
- b = b[0];
- else
- b = df.document.documentElement;
- b.appendChild(f);
-
- while (f.hasChildNodes())
- f.removeChild(f.childNodes.item(0));
-
- if (cafContextId != "")
- dlgSetParm("ui.cafcontextid", cafContextId);
-
- for (var n in dialogFormValues) {
- var values = makeArray(dialogFormValues[n]);
- for (var v in values)
- {
- createHiddenInput(df, f, n, values[v]);
- }
- }
-
-
- var oldUnload = window.onbeforeunload;
- window.onbeforeunload = null;
-
-
-
-
-
- if (typeof f.document == "undefined")
- {
- f.setAttribute("accept-charset", "UTF-8");
- }
- else
- {
- if (typeof f.document.characterSet != "undefined")
- {
- f.document.characterSet="UTF-8";
- }
- else if (typeof f.document.charset != "undefined")
- {
- f.document.charset="utf-8";
- }
- }
-
- f.submit();
- window.onbeforeunload = oldUnload;
- }
- };
- function openDialogFrameIfNotInitialized()
- {
- var oWindowManager = goApplicationManager.getWindowManager();
- if (! oWindowManager.isDialogFrameOpen() && oWindowManager.getDialogFrame().g_PS_isQS)
- {
-
- oWindowManager.showDialogFrame(235);
- }
- };
- function dlgGetParm(n) {
- if (dlgContains(n))
- return dialogFormValues[n];
- else
- return null;
- };
- function dlgSetParm(n, v)
- {
- dialogFormValues[n] = v;
- };
- function dlgRemoveParm(n)
- {
- if (dlgContains(n)) delete dialogFormValues[n];
- };
- function dlgReset(bNoParam) {
- dialogFormValues = new Array();
- if (!bNoParam)
- dlgSetParm("b_action", "xts.run");
- var productLocale = goApplicationManager.get("productLocale");
- if (productLocale != null && productLocale != "" && !bNoParam)
- dlgSetParm("productLocale", productLocale);
- var contentLocale = goApplicationManager.get("contentLocale");
- if (contentLocale != null && contentLocale != "" && !bNoParam)
- dlgSetParm("contentLocale", contentLocale);
- };
- function dlgAddParm(n, v) {
- if (!isArray(dialogFormValues[n]))
- dialogFormValues[n] = makeArray(dialogFormValues[n]);
- addToArray(dialogFormValues[n], v);
- };
- function dlgAddPairParm(n, v1, v2) {
- var first = "genX";
- var second = "genY";
-
- var ii=0;
- while (dlgContains(first+ii))
- ii++;
- first = first + ii;
- ii=0;
- while (dlgContains(second+ii))
- ii++;
- second = second + ii;
- dlgAddParm(n, first + "," + second);
- dlgSetParm(first, v1);
- dlgSetParm(second, v2);
- };
- function dlgContains(n) {
- return containsByIndice(dialogFormValues, n);
- };
- function dlgShowMessage(p1, p2, p3) {
- dlgReset();
- dlgSetParm("m", "/" + qs_dir + "/message.xts");
- if (p1 != null && p1 != "") dlgSetParm("xxTitle", p1);
- if (p2 != null && p2 != "") dlgSetParm("xxDesc", p2);
- if (p3 != null && p3 != "") dlgSetParm("xxMsg", p3);
- dlgSubmit();
- };
- function dlgSize(a) {
- if (isArray(dialogFormValues[a])) return dialogFormValues[a].length;
- return 0;
- };
- function dlgGlobalGetParm(n) {
- if (dlgGlobalContains(n))
- return dialogGlobalValues[n];
- else
- return null;
- };
- function dlgGlobalKeys(n) {
- var aKeys = [];
- for (var idxKey in dialogGlobalValues)
- {
- aKeys.push(idxKey);
- }
- return aKeys;
- };
- function dlgGlobalSetParm(n, v) {
- dialogGlobalValues[n] = v;
- };
- function dlgGlobalRemoveParm(n) {
- if (dlgGlobalContains(n))
- delete dialogGlobalValues[n];
- };
- function dlgGlobalReset(aValuesToKeep)
- {
- var aBackup = new Array();
- if (typeof aValuesToKeep == "object")
- {
- for (var idx = 0; idx < aValuesToKeep.length; idx++)
- {
- if (dlgGlobalContains(aValuesToKeep[idx]))
- {
- aBackup[aValuesToKeep[idx]] = dlgGlobalGetParm(aValuesToKeep[idx]);
- }
- }
- }
- dialogGlobalValues = new Array();
- for (var sKey in aBackup)
- {
- dlgGlobalSetParm(sKey, aBackup[sKey]);
- }
- };
- function dlgGlobalGetParmAt(n, v) {
- if (!dlgGlobalIsArray(n))
- return null;
- return dialogGlobalValues[n][v];
- };
- function dlgGlobalSetParmAt(n, i, v) {
- if (!dlgGlobalIsArray(n))
- dialogGlobalValues[n] = dlgGlobalMakeArray(n);
- insertInArrayAt(dialogGlobalValues[n], i, v);
- };
- function dlgGlobalMakeArray(a) {
- return makeArray(cfgValues[a]);
- };
- function dlgGlobalIsArray(a) {
- return isArray(dialogGlobalValues[a]);
- };
- function dlgGlobalContains(n) {
- return containsByIndice(dialogGlobalValues, n);
- };
- function dlgGlobalSize(a) {
- if (isArray(dialogGlobalValues[a]))
- return dialogGlobalValues[a].length;
- return 0;
- };
- function dlgGlobalConstructPairParm(url, v1, v2) {
- var first = "genX";
- var second = "genY";
-
- var ii=0;
- while (url.indexOf(first+ii) > -1)
- ii++;
- first = first + ii;
- ii=0;
- while (url.indexOf(second+ii) > -1)
- ii++;
- second = second + ii;
- return (first + "," + second + "&" + first + "=" + v1 + "&" + second + "=" + v2);
- };
|