123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- BI and PM: qs
- (C) Copyright IBM Corp. 2001, 2017
- 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 (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <xts:morphlet version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/QSRVUITextPL.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseQueryStudio">
- <xts:block id="page" type="exec" mode="output" processor="XSLT" mimeType="text/html">
- <!-- get the debug logic sheet -->
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <!-- get the new theme stuff -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="qs/logicsheets/dialogs.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
- <!-- apply the form logic -->
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xts="http://developer.cognos.com/schemas/xts/"
- xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
- xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
- xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
- xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
- xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
- xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
- xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
- xmlns:qsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/qs/dialog/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
- exclude-result-prefixes="xsl xts lyt pf dp df cp cf dbg qsdlg xtsext">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <!-- add any theme variables -->
- <df:variables/>
- <pf:variables/>
- <!-- start the output -->
- <xsl:template match="/root">
- <dp:page>
- <dp:script>
- <script type="text/javascript">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/layout.js</xsl:attribute>
- <xsl:text/>//<xsl:text/>
- </script>
- <script type="text/javascript">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/classes/CDialogManager.js</xsl:attribute>
- <xsl:text/>//<xsl:text/>
- </script>
- <script type="text/javascript">
- var cf = getConfigFrame();
- var dlg = cf.dlgGlobalGetParm('xxformatDlgType');
- var goDialogManager = new CDialogManager();
-
- function removeInsert() {
- document.getElementById("formatOK").removeAttribute("href");
- }
- function callFormatDlg()
- {
- if (cf)
- {
- storeCurrentValues();
- var dlg = document.f.formatDlgType.options[document.f.formatDlgType.selectedIndex].value;
- if (dlg == "default")
- cf.cfgSet("formatDlgAdvanced", false);
- cf.cfgSet("formatDlgType", dlg);
- removeInsert();
- cf.format();
- }
- }
- function execute()
- {
- if (cf)
- {
- var addCount = 0;
- var addListArray = new Array();
- var remCount = 6;
- var remListArray = new Array("decimalSize","sign","useTrailingSign","useGrouping","currencyCode","useIntlSymbol");
- var dlg = document.f.formatDlgType.options[document.f.formatDlgType.selectedIndex].value;
- if (!(document.f.positivecb.indeterminate))
- {
- if ((document.f.positivecb.checked && document.f.positive.value == "") || !(document.f.positivecb.checked))
- {
- remCount++;
- remListArray[remListArray.length] = "pattern";
- }
- else
- {
- addCount++;
- addListArray[addListArray.length]= "pattern";
- addListArray[addListArray.length]= cf.escapeParam(document.f.positive.value);
- }
- }
- if (!(document.f.negativecb.indeterminate))
- {
- if ((document.f.negativecb.checked && document.f.negative.value == "") || !(document.f.negativecb.checked))
- {
- remCount++;
- remListArray[remListArray.length]= "whenNegative";
- }
- else
- {
- addCount++;
- addListArray[addListArray.length]= "whenNegative";
- addListArray[addListArray.length]= cf.escapeParam(document.f.negative.value);
- }
- }
- if (!(document.f.zeroscb.indeterminate))
- {
- if ((document.f.zeroscb.checked && document.f.zeros.value == "") || !(document.f.zeroscb.checked))
- {
- remCount++;
- remListArray[remListArray.length]= "whenZero";
- }
- else
- {
- addCount++;
- remListArray[remListArray.length]= "whenZero";
- remListArray[remListArray.length]= cf.escapeParam(document.f.zeros.value);
- }
- }
- if (!(document.f.missingcb.indeterminate))
- {
- if ((document.f.missingcb.checked && document.f.missing.value == "") || !(document.f.missingcb.checked))
- {
- remCount++;
- remListArray[remListArray.length]= "whenMissing";
- }
- else
- {
- addCount++;
- addListArray[addListArray.length]= "whenMissing";
- addListArray[addListArray.length]= cf.escapeParam(document.f.missing.value);
- }
- }
- if (dlg != "scientific")
- {
- remCount+= 4;
- remListArray[remListArray.length]= "exponentSymbol";
- remListArray[remListArray.length]= "exponentSize";
- remListArray[remListArray.length]= "useScientific";
- remListArray[remListArray.length]= (dlg != "percentage") ? "percentSymbol" : "scale";
- var attValue = document.f.scale.options[document.f.scale.selectedIndex].value;
- if (attValue != "mixed")
- {
- addCount++;
- if (dlg != "percentage")
- {
- addListArray[addListArray.length]= "scale";
- addListArray[addListArray.length]= cf.escapeParam(attValue);
- }
- else
- {
- addListArray[addListArray.length]= "percentSymbol";
- addListArray[addListArray.length]= cf.escapeParam(attValue);
- }
- }
- }
- else
- {
- remCount += 2;
- remListArray[remListArray.length]= "percentSymbol";
- remListArray[remListArray.length]= "scale";
- addCount += 3;
- addListArray[addListArray.length]= "exponentSymbol";
- addListArray[addListArray.length]= cf.escapeParam("E");
- addListArray[addListArray.length]= "exponentSize";
- addListArray[addListArray.length]= cf.escapeParam("2");
- addListArray[addListArray.length]= "useScientific";
- addListArray[addListArray.length]= cf.escapeParam("true");
- }
- var cmdArray = new Array(dlg, "advanced", addCount);
- cmdArray = cmdArray.concat(addListArray);
- cmdArray[cmdArray.length] = remCount;
- cmdArray = cmdArray.concat(remListArray);
- for (var i = 0; i < cf.dlgGlobalSize('xxformatSelCols'); i++)
- cmdArray[cmdArray.length] = cf.escapeParam(cf.dlgGlobalGetParmAt('xxformatSelCols', i));
- cf.addColumnsForReselection();
- cf.submitFormat(cmdArray);
- }
- }
- function init()
- {
- attachMouseEvents();
- with (document)
- {
- if (cf)
- {
- if (cf.showDialogFrame) cf.showDialogFrame(410);
- var i = 0;
- document.f.formatDlgType.options[i++] = new Option("<xts:string id="DIALOG_DEFAULT_OPTION" encode="javascript"/>","default", false, false);
- document.f.formatDlgType.options[i++] = new Option("<xts:string id="FORMAT_NUMBER_OPTION" encode="javascript"/>","number", false, false);
- document.f.formatDlgType.options[i++] = new Option("<xts:string id="FORMAT_CURRENCY_OPTION" encode="javascript"/>","currency", false, false);
- document.f.formatDlgType.options[i++] = new Option("<xts:string id="FORMAT_PERCENTAGE_OPTION" encode="javascript"/>","percentage", false, false);
- document.f.formatDlgType.options[i] = new Option("<xts:string id="FORMAT_SCIENTIFIC_OPTION" encode="javascript"/>","scientific", false, false);
- i = 0;
- while ( i < document.f.formatDlgType.options.length)
- {
- if (document.f.formatDlgType.options[i].value == dlg)
- {
- document.f.formatDlgType.selectedIndex = i;
- break;
- }
- i++;
- }
- if (dlg == "default")
- {
- document.f.formatDlgType.focus();
- return;
- }
- var scale = "No scale";
- var percentSymbol = "%";
- var dlgVars = cf.cfgGet("formatDlgVars");
- if (dlgVars == dlg + "A")
- {
- if (cf.dlgGlobalGetParm('xxScale') != null)
- scale = cf.dlgGlobalGetParm('xxScale');
- if (cf.dlgGlobalGetParm('xxPercentSymbol') != null)
- percentSymbol = cf.dlgGlobalGetParm('xxPercentSymbol');
- if (cf.dlgGlobalGetParm('xxPattern') != "mixed")
- document.f.positive.value = cf.dlgGlobalGetParm('xxPattern');
- else
- document.f.positivecb.indeterminate = true;
- if (cf.dlgGlobalGetParm('xxNegative') != "mixed")
- document.f.negative.value = cf.dlgGlobalGetParm('xxNegative');
- else
- document.f.negativecb.indeterminate = true;
- if (cf.dlgGlobalGetParm('xxZero') != "mixed")
- document.f.zeros.value = cf.dlgGlobalGetParm('xxZero');
- else
- document.f.zeroscb.indeterminate = true;
- if (cf.dlgGlobalGetParm('xxMissing') != "mixed")
- document.f.missing.value = cf.dlgGlobalGetParm('xxMissing');
- else
- document.f.missingcb.indeterminate = true;
- }
- scale = (cf.cfgGet("formatCurrentScale") != null) ? cf.cfgGet("formatCurrentScale") : scale;
- percentSymbol = (cf.cfgGet("formatCurrentPercentSymbol") != null) ? cf.cfgGet("formatCurrentPercentSymbol") : percentSymbol;
- if (dlg != "scientific")
- {
- document.getElementById("displayNonScientific").style.display = "inline";
- i = 0;
- if (scale == "mixed" || percentSymbol == "mixed")
- document.f.scale.options[i++] = new Option("<xts:string id="DIALOG_MULTIPLE_SELECTION" encode="javascript"/>","mixed",false,true);
- if (dlg == 'number' || dlg == 'currency')
- {
- document.f.scale.options[i++] = new Option("<xts:string id="FORMAT_NO_SCALE_OPTION" encode="javascript"/>","0",false,false);
- document.f.scale.options[i++] = new Option("100","-2",false,false);
- document.f.scale.options[i++] = new Option("1000","-3",false,false);
- document.f.scale.options[i++] = new Option("1 000 000","-6",false,false);
- document.f.scale.options[i] = new Option("1 000 000 000","-9",false,false);
- }
- else if (dlg == 'percentage')
- {
- document.f.scale.options[i++] = new Option("<xts:string id="FORMAT_PERCENT_100_OPTION" encode="javascript"/>","%",false,false);
- document.f.scale.options[i] = new Option("<xts:string id="FORMAT_PER_THOUSAND_OPTION" encode="javascript"/>","‰",false,false);
- }
- for (var i = 0; i < document.f.scale.options.length; i++)
- {
- if (document.f.scale.options[i].value == scale || document.f.scale.options[i].value == percentSymbol)
- {
- document.f.scale.selectedIndex = i;
- break;
- }
- }
- }
- }
- document.f.formatDlgType.focus();
- }
- }
- function onChangeEdit()
- {
- if (document.f.positive.value != "")
- document.f.positivecb.indeterminate = false;
- if (document.f.negative.value != "")
- document.f.negativecb.indeterminate = false;
- if (document.f.zeros.value != "")
- document.f.zeroscb.indeterminate = false;
- if (document.f.missing.value != "")
- document.f.missingcb.indeterminate = false;
- }
- function basicDlg()
- {
- storeCurrentValues();
- if (cf)
- {
- cf.cfgSet("formatDlgAdvanced", "false");
- removeInsert();
- cf.format();
- }
- }
- function storeCurrentValues()
- {
- if (cf)
- {
- var oldType = cf.dlgGlobalGetParm('xxformatDlgType');
- if (oldType != "default" && oldType != "mixed" && oldType != "scientific")
- {
- cf.cfgSet("formatCurrentScale", document.f.scale.options[document.f.scale.selectedIndex].value);
- if (oldType == "percentage")
- cf.cfgSet("formatCurrentPercentSymbol", document.f.scale.options[document.f.scale.selectedIndex].value);
- }
- }
- }
- </script>
- <script type="text/javascript">
- <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/dialogs/executeButton.js</xsl:attribute>
- <xsl:text/>//<xsl:text/>
- </script>
- </dp:script>
- <form style="margin:0px" name="f" method="POST" onsubmit="execute();return false;">
- <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%">
- <tr>
- <td width="100%" height="0%">
- <!-- dialog header -->
- <dp:header help="false">
- <!-- header titles -->
- <dp:title>
- <xts:string id="FORMAT_ADVANCED_TITLE"/>
- </dp:title>
- <!-- close link for the header -->
- <dp:close>
- <a href="javascript:getConfigFrame().hideDialogFrame()">
- <dp:closeMarker/>
- </a>
- </dp:close>
- <!-- header links -->
- <dp:headerLinks>
- <dp:headerLink>
- <dp:hl_attribute name="href">javascript:basicDlg()</dp:hl_attribute>
- <dp:hl_attribute name="label"><xts:string id="FORMAT_BACK_TO_BASIC_LINK"/></dp:hl_attribute>
- </dp:headerLink>
- </dp:headerLinks>
- <!-- description (hint text) -->
- <dp:description>
- <xts:string id="FORMAT_ADV_NUM_DESCRIPTION"/>
- </dp:description>
- </dp:header>
- </td>
- </tr>
- <tr>
- <td width="100%" height="100%" valign="top">
- <!-- layout -->
- <lyt:layout style="2" border="no">
- <lyt:section height="264">
- <dp:input>
- <dp:section1>
- <xts:string id="FORMAT_CATEGORY_LABEL"/>
- </dp:section1>
- <dp:section2>
- <select name="formatDlgType" onchange="callFormatDlg()"/>
- </dp:section2>
- </dp:input>
- <dp:choice>
- <dp:section1>
- <input name="positivecb" type="checkbox" checked=""/>
- </dp:section1>
- <dp:section2 type="label">
- <xts:string id="FORMAT_POSITIVE_NUMBERS_LABEL"/>
- </dp:section2>
- <dp:section3>
- <input type="text" name="positive" size="16" onKeyDown="javascript:setTimeout(onChangeEdit, 10);" onKeyUp="javascript:if (event.keyCode == 13) execute();"/>
- </dp:section3>
- </dp:choice>
- <dp:choice>
- <dp:section1>
- <input name="negativecb" type="checkbox" checked=""/>
- </dp:section1>
- <dp:section2 type="label">
- <xts:string id="FORMAT_NEGATIVE_NUMBERS_LABEL"/>
- </dp:section2>
- <dp:section3>
- <input type="text" name="negative" size="16" onKeyDown="javascript:setTimeout(onChangeEdit, 10);" onKeyUp="javascript:if (event.keyCode == 13) execute();"/>
- </dp:section3>
- </dp:choice>
- <dp:choice>
- <dp:section1>
- <input name="zeroscb" type="checkbox" checked=""/>
- </dp:section1>
- <dp:section2 type="label">
- <xts:string id="FORMAT_ZEROS_LABEL"/>
- </dp:section2>
- <dp:section3>
- <input type="text" name="zeros" size="16" onKeyDown="javascript:setTimeout(onChangeEdit, 10);" onKeyUp="javascript:if (event.keyCode == 13) execute();"/>
- </dp:section3>
- </dp:choice>
- <dp:choice>
- <dp:section1>
- <input name="missingcb" type="checkbox" checked=""/>
- </dp:section1>
- <dp:section2 type="label">
- <xts:string id="FORMAT_MISSING_VALUES_LABEL"/>
- </dp:section2>
- <dp:section3>
- <input type="text" name="missing" size="16" onKeyDown="javascript:setTimeout(onChangeEdit, 10);" onKeyUp="javascript:if (event.keyCode == 13) execute();"/>
- </dp:section3>
- </dp:choice>
- </lyt:section>
- <lyt:section>
- <div id="displayNonScientific" style="display:none">
- <dp:input>
- <dp:section1>
- <BR/>
- <BR/>
- <BR/>
- <BR/>
- <xts:string id="FORMAT_SCALE_LABEL"/>
- </dp:section1>
- <dp:section2>
- <select name="scale"/>
- </dp:section2>
- </dp:input>
- </div>
- </lyt:section>
- </lyt:layout>
- </td>
- </tr>
- <tr>
- <td width="100%" height="0%">
- <qsdlg:defaultFormatNumButtons/>
- </td>
- </tr>
- <!--dbg:dumpxml select="/"/-->
- </table>
- </form>
- </dp:page>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|