123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758 |
- <?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="getContent" mode="interpret" processor="XSLT" type="exec" condition=".[/root/env/param[@name='listsLoaded']!='true']" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/" xmlns:cm="http://developer.cognos.com/schemas/cm/1/" xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append>
- <currencyList>
- <xts:request asText="true" href="bus://dispatcher" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/systemService/201404/">
- <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
- <SOAP-ENV:Header>
- <xsl:copy-of select="/root/header/*"/>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <bus:getConfiguration xmlns:bus="http://developer.cognos.com/schemas/bibus/3/">
- <properties xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="bus:configurationDataEnum[]">
- <item xsi:type="bus:configurationDataEnum">supportedCurrencies</item>
- </properties>
- </bus:getConfiguration>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </currencyList>
- </xts:append>
- <xts:append>
- <negativesList>
- <xts:request asText="true" href="bus://dispatcher" protocol="BUS" soapAction="http://www.ibm.com/xmlns/prod/cognos/systemService/201404/">
- <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
- <SOAP-ENV:Header>
- <xsl:copy-of select="/root/header/*"/>
- <ns1:biBusHeader href="#id0" xmlns:ns1="http://developer.cognos.com/schemas/bibus/3/"/>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <ns2:getFormatSamples xmlns:ns2="http://developer.cognos.com/schemas/bibus/3/">
- <name xsi:type="xsd:string">qsnegatives</name>
- </ns2:getFormatSamples>
- <multiRef id="id0" SOAP-ENC:root="0" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:biBusHeader" xmlns:ns3="http://schemas.xmlsoap.org/soap/envelope/:encodingStyle" xmlns:ns4="http://developer.cognos.com/schemas/bibus/3/">
- <ns4:CAM href="#id1"/>
- <ns4:hdrSession xsi:nil="true"/>
- <ns4:providers xsi:nil="true"/>
- <ns4:userPreferenceVars xsi:nil="true"/>
- <ns4:tracking xsi:nil="true"/>
- <ns4:dispatcherTransportVars xsi:nil="true"/>
- <ns4:CAMProtect xsi:nil="true"/>
- </multiRef>
- <multiRef id="id1" SOAP-ENC:root="0" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:CAM" xmlns:ns5="http://developer.cognos.com/schemas/bibus/3/">
- <ns5:action xsi:type="xsd:string">logon</ns5:action>
- <ns5:credential xsi:nil="true"/>
- <ns5:securityBlob xsi:nil="true"/>
- <ns5:CAMPassport xsi:nil="true"/>
- <ns5:CAMCredentialPath xsi:nil="true"/>
- <ns5:exception xsi:nil="true"/>
- <ns5:roles xsi:nil="true"/>
- </multiRef>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
- </xts:request>
- </negativesList>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="appendDocument" mode="interpret" processor="XSLT" type="exec" dependency="getContent" condition=".[/root/env/param[@name='listsLoaded']!='true']" mandatory="false">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
- xmlns:cml="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/cml/1/"
- xmlns:cm="http://developer.cognos.com/schemas/cm/1/"
- xmlns:SOAP-ENV="http://www.w3.org/2001/09/soap-envelope"
- xmlns:bus="http://developer.cognos.com/schemas/bibus/3/"
- xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt">
- <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
- <xsl:template match="/root">
- <xts:sequence>
- <xts:update select="/root/currencyList">
- <currencyList>
- <xsl:for-each select="./currencyList/bus:getConfigurationResponse/configuration/supportedCurrencies/item">
- <currencyFormat>
- <xsl:attribute name="currencyCode">
- <xsl:value-of select="./currency" disable-output-escaping="yes"/>
- </xsl:attribute>
- <xsl:value-of select="./description" disable-output-escaping="yes"/>
- </currencyFormat>
- </xsl:for-each>
- </currencyList>
- </xts:update>
- <xts:update select="/root/negativesList">
- <negativesList>
- <xsl:for-each select="./negativesList/bus:getFormatSamplesResponse/samples/item">
- <xsl:value-of select="." disable-output-escaping="yes"/>
- </xsl:for-each>
- </negativesList>
- </xts:update>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <xts:block id="page" type="exec" mode="output" processor="XSLT" mimeType="text/html" dependency="appendDocument">
- <!-- 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/>
- <xsl:key name="param-name" match="/root/env/param" use="@name"/>
- <!-- start the output -->
- <xsl:template match="/root">
- <xsl:variable name="dlgType" select="key('param-name','xxformatDlgType')"/>
- <xsl:variable name="listsLoaded" select="key('param-name','listsLoaded')"/>
- <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()
- {
- storeCurrentValues();
- if (cf)
- {
- var dlgSelected = document.f.formatDlgType.options[document.f.formatDlgType.selectedIndex].value;
- if (dlgSelected == "default")
- cf.cfgSet("formatDlgAdvanced", false);
- cf.cfgSet("formatDlgType", dlgSelected);
- removeInsert();
- cf.format();
- }
- }
- function execute()
- {
- if (cf)
- {
- var i;
- var cmd = "";
- var cmdArray = new Array();
- var selectedDlg = document.f.formatDlgType.options[document.f.formatDlgType.selectedIndex].value;
- if (selectedDlg == "mixed")
- {
- cf.hideDialogFrame();
- return;
- }
- if (selectedDlg == "default")
- cmdArray[0] = "default";
- else
- {
- var count = 0;
- var remCount = 4;
- var remListArray = new Array("pattern","whenNegative","whenZero","whenMissing");
- var attValue = document.f.numDecimals.options[document.f.numDecimals.selectedIndex].value;
- if (attValue != "mixed")
- {
- count++;
- cmdArray[cmdArray.length] = "decimalSize";
- cmdArray[cmdArray.length] = cf.escapeParam(attValue);
- }
- if (selectedDlg == "scientific")
- {
- remCount += 2;
- remListArray[remListArray.length] = "percentSymbol";
- remListArray[remListArray.length] = "scale";
- count += 3;
- cmdArray[cmdArray.length] = "exponentSymbol";
- cmdArray[cmdArray.length] = cf.escapeParam("E");
- cmdArray[cmdArray.length] = "exponentSize";
- cmdArray[cmdArray.length] = cf.escapeParam("2");
- cmdArray[cmdArray.length] = "useScientific";
- cmdArray[cmdArray.length] = cf.escapeParam("true");
- }
- else
- {
- remCount += 4;
- remListArray[remListArray.length] = "exponentSymbol";
- remListArray[remListArray.length] = "exponentSize";
- remListArray[remListArray.length] = "useScientific";
- remListArray[remListArray.length] = (selectedDlg != "percentage") ? "percentSymbol" : "scale";
- attValue = document.f.scale.options[document.f.scale.selectedIndex].value;
- if (attValue != "mixed")
- {
- count++;
- if (selectedDlg != "percentage")
- {
- cmdArray[cmdArray.length] = "scale";
- cmdArray[cmdArray.length] = cf.escapeParam(attValue);
- }
- else
- {
- cmdArray[cmdArray.length] = "percentSymbol";
- cmdArray[cmdArray.length] = cf.escapeParam(attValue);
- }
- }
- attValue = document.f.negativeSign.options[document.f.negativeSign.selectedIndex].value;
- if (attValue != "mixed")
- {
- var atts = cf.cfgGetAt("negativesList", attValue)
- count++;
- cmdArray[cmdArray.length] = "sign";
- cmdArray[cmdArray.length] = cf.escapeParam(atts[1]);
- if (cf.escapeParam(atts[2]) != "")
- {
- count++;
- cmdArray[cmdArray.length] = "useTrailingSign";
- cmdArray[cmdArray.length] = cf.escapeParam(atts[2]);
- }
- else
- {
- remCount++;
- remListArray[remListArray.length] = "useTrailingSign";
- }
- }
- attValue = document.f.thousandSeparator.options[document.f.thousandSeparator.selectedIndex].value;
- if (attValue != "mixed")
- {
- count++;
- cmdArray[cmdArray.length] = "useGrouping";
- cmdArray[cmdArray.length] = cf.escapeParam(attValue);
- }
- }
- if (selectedDlg == "currency")
- {
- attValue = document.f.curr.options[document.f.curr.selectedIndex].value;
- if (attValue == "defaultCurr")
- {
- remCount++;
- remListArray[remListArray.length] = "currencyCode";
- }
- else if (attValue != "mixed")
- {
- count++;
- cmdArray[cmdArray.length] = "currencyCode";
- cmdArray[cmdArray.length] = cf.escapeParam(attValue);
- }
- attValue = document.f.currdisp.options[document.f.currdisp.selectedIndex].value;
- if (attValue != "mixed")
- {
- count++;
- cmdArray[cmdArray.length] = "useIntlSymbol";
- cmdArray[cmdArray.length] = cf.escapeParam(attValue);
- }
- }
- else
- {
- remCount += 2;
- remListArray[remListArray.length] = "currencyCode";
- remListArray[remListArray.length] = "useIntlSymbol";
- }
- var preCmdArray = new Array(selectedDlg,"basic",count);
- cmdArray = preCmdArray.concat(cmdArray);
- 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();
- var x = document.getElementById("formatDesc");
- if (dlg == 'mixed')
- x.appendChild(document.createTextNode("<xts:string id="FORMAT_BLANK_DESCRIPTION" encode="javascript"/>"));
- else
- {
- x.appendChild(document.createTextNode("<xts:string id="FORMAT_NUMBER_DESCRIPTION" encode="javascript"/>"));
- }
- if (document.getElementById("advLink") && (dlg == 'default' || dlg == 'mixed'))
- document.getElementById("advLink").parentNode.removeChild(document.getElementById("advLink"));
- if (dlg == 'currency')
- document.getElementById("displayCurrency").style.display = "inline";
- if (dlg != 'default')
- {
- document.getElementById("displayNonDefault").style.display = "inline";
- if (dlg != 'mixed')
- {
- document.getElementById("displayNonMixed").style.display = "inline";
- if (dlg != 'scientific')
- document.getElementById("displayNonScientific").style.display = "inline";
- }
- }
- if (cf)
- {
- if (cf.showDialogFrame) cf.showDialogFrame(400);
- if ("<xsl:value-of select="xtsext:javascriptencode(string(key('param-name','listsLoaded')))"/>" != "true")
- {
- var i = 0;
- <xsl:for-each select="/root/currencyList/currencyFormat">
- cf.cfgSetAt("CurrencyList", i++, new Array("<xsl:value-of select="xtsext:javascriptencode(string(./.))"/>","<xsl:value-of select="xtsext:javascriptencode(string(./@currencyCode))"/>"));
- </xsl:for-each>
- i = 0;
- <xsl:for-each select="/root/negativesList/numberFormat">
- cf.cfgSetAt("negativesList", i++, new Array("<xsl:value-of select="xtsext:javascriptencode(string(./.))"/>","<xsl:value-of select="xtsext:javascriptencode(string(./@sign))"/>","<xsl:value-of select="xtsext:javascriptencode(string(./@useTrailingSign))"/>"));
- </xsl:for-each>
- if (i == 0)
- cf.cfgSetAt("negativesList", i++, new Array("-123","-",""));
- cf.cfgSet("formatListsLoaded", true);
- }
- var i = 0;
- if (dlg == "mixed")
- document.f.formatDlgType.options[i++] = new Option("<xts:string id="DIALOG_SELECT_ONE_OPTION" encode="javascript"/>","mixed", false, true);
- 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" || dlg == "mixed")
- {
- document.f.formatDlgType.focus();
- return;
- }
- var numDec = (dlg == "percentage") ? 0 : 2;
- var scale = "No scale";
- var thousandSep = "false";
- var negSign = "-";
- var useTrailing = "";
- var symbol = "";
- var percentSymbol = "%";
- var disp = "symbol";
- if (dlg == cf.cfgGet("formatDlgVars"))
- {
- if (cf.dlgGlobalGetParm('xxDecimalSize') != null)
- numDec = cf.dlgGlobalGetParm('xxDecimalSize');
- if (dlg != "scientific")
- {
- if (cf.dlgGlobalGetParm('xxScale') != null)
- scale = cf.dlgGlobalGetParm('xxScale');
- if (cf.dlgGlobalGetParm('xxGrouped') != null)
- thousandSep = cf.dlgGlobalGetParm('xxGrouped');
- if (cf.dlgGlobalGetParm('xxSign') != null)
- negSign = cf.dlgGlobalGetParm('xxSign');
- if (cf.dlgGlobalGetParm('xxTrailingSign') != null)
- useTrailing = cf.dlgGlobalGetParm('xxTrailingSign');
- if (cf.dlgGlobalGetParm('xxPercentSymbol') != null)
- percentSymbol = cf.dlgGlobalGetParm('xxPercentSymbol');
- if (dlg == "currency")
- {
- symbol = cf.dlgGlobalGetParm('xxCurrencyCode');
- disp = cf.dlgGlobalGetParm('xxIntlSymbol');
- }
- }
- }
- numDec = (cf.cfgGet("formatCurrentNumDecs") != null) ? cf.cfgGet("formatCurrentNumDecs") : numDec;
- scale = (cf.cfgGet("formatCurrentScale") != null) ? cf.cfgGet("formatCurrentScale") : scale;
- percentSymbol = (cf.cfgGet("formatCurrentPercentSymbol") != null) ? cf.cfgGet("formatCurrentPercentSymbol") : percentSymbol;
- thousandSep = (cf.cfgGet("formatCurrentThousandSep") != null) ? cf.cfgGet("formatCurrentThousandSep") : thousandSep;
- symbol = (cf.cfgGet("formatCurrentSymbol") != null) ? cf.cfgGet("formatCurrentSymbol") : symbol;
- disp = (cf.cfgGet("formatCurrentDisp") != null) ? cf.cfgGet("formatCurrentDisp") : disp;
- i = 0;
- if (document.f.numDecimals)
- {
- if (numDec == "mixed")
- document.f.numDecimals.options[i++] = new Option("<xts:string id="DIALOG_MULTIPLE_SELECTION" encode="javascript"/>","mixed", false, true);
- document.f.numDecimals.options[i++] = new Option("0","0",false,false);
- document.f.numDecimals.options[i++] = new Option("1","1",false,false);
- document.f.numDecimals.options[i++] = new Option("2","2",false,false);
- document.f.numDecimals.options[i++] = new Option("3","3",false,false);
- document.f.numDecimals.options[i++] = new Option("4","4",false,false);
- document.f.numDecimals.options[i++] = new Option("5","5",false,false);
- document.f.numDecimals.options[i] = new Option("6","6",false,false);
- i = 0;
- while ( i < document.f.numDecimals.options.length)
- {
- if (document.f.numDecimals.options[i].value == numDec)
- {
- document.f.numDecimals.selectedIndex = i;
- break;
- }
- i++;
- }
- }
- if (dlg != "scientific")
- {
- i = 0;
- if (document.f.scale)
- {
- 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);
- }
- i = 0;
- while ( i < document.f.scale.options.length)
- {
- if (document.f.scale.options[i].value == scale || document.f.scale.options[i].value == percentSymbol)
- {
- document.f.scale.selectedIndex = i;
- break;
- }
- i++;
- }
- }
- i = 0;
- if (document.f.thousandSeparator)
- {
- if (thousandSep == "mixed")
- document.f.thousandSeparator.options[i++] = new Option("<xts:string id="DIALOG_MULTIPLE_SELECTION" encode="javascript"/>","mixed",false,true);
- document.f.thousandSeparator.options[i++] = new Option("<xts:string id="DIALOG_YES_OPTION" encode="javascript"/>","true",false,false);
- document.f.thousandSeparator.options[i] = new Option("<xts:string id="DIALOG_NO_OPTION" encode="javascript"/>","false",false,false);
- i = 0;
- while (i < document.f.thousandSeparator.options.length)
- {
- if (document.f.thousandSeparator.options[i].value == thousandSep)
- {
- document.f.thousandSeparator.selectedIndex = i;
- break;
- }
- i++;
- }
- }
- if (document.f.negativeSign)
- {
- var negList = cf.cfgGet("negativesList");
- var negListSize = cf.cfgSize("negativesList");
- i = 0;
- if (negSign == "mixed" || useTrailing == "mixed")
- document.f.negativeSign.options[i++] = new Option("<xts:string id="DIALOG_MULTIPLE_SELECTION" encode="javascript"/>","mixed",false,true);
- for (var j = 0; j < negListSize; j++)
- document.f.negativeSign.options[i++] = new Option(negList[j][0],j,false,false);
- i = 0;
- while (i < negListSize)
- {
- if (negSign == negList[i][1] && useTrailing == negList[i][2])
- {
- document.f.negativeSign.selectedIndex = i;
- break;
- }
- i++;
- }
- var idx = cf.cfgGet("formatCurrentNegAtts");
- if (idx >= 0)
- document.f.negativeSign.options[idx].selected = true;
- }
- if (dlg == "currency")
- {
- var currList = cf.cfgGet("CurrencyList");
- var listSize = cf.cfgSize("CurrencyList");
- i = 0;
- if (document.f.curr)
- {
- if (symbol == "mixed")
- document.f.curr.options[i++] = new Option("<xts:string id="DIALOG_MULTIPLE_SELECTION" encode="javascript"/>","mixed",false,true);
- document.f.curr.options[i++] = new Option("<xts:string id="FORMAT_DEFAULT_CURRENCY_OPTION" encode="javascript"/>","defaultCurr",false,true);
- for (var j = 0; j < listSize; j++)
- document.f.curr.options[i++] = new Option(currList[j][0],currList[j][1],false,false);
- i = 0;
- while (i < listSize)
- {
- if (symbol == currList[i][1])
- {
- document.f.curr.selectedIndex = i + 1;
- break;
- }
- i++;
- }
- }
- if (document.f.currdisp)
- {
- i = 0;
- if (disp == "mixed")
- document.f.currdisp.options[i++] = new Option("<xts:string id="DIALOG_MULTIPLE_SELECTION" encode="javascript"/>","mixed",false, true);
- document.f.currdisp.options[i++] = new Option("<xts:string id="FORMAT_CURRENCY_SYMBOL_OPTION" encode="javascript"/>","false",false, false);
- document.f.currdisp.options[i] = new Option("<xts:string id="FORMAT_INTERNATIONAL_CODE_OPTION" encode="javascript"/>","true",false, false);
- i =0;
- while (i < document.f.currdisp.options.length)
- {
- if (disp == document.f.currdisp.options[i].value)
- {
- document.f.currdisp.selectedIndex = i;
- break;
- }
- i++;
- }
- }
- }
- }
- }
- document.f.formatDlgType.focus();
- }
- function advancedDlg()
- {
- storeCurrentValues();
- if (cf)
- {
- cf.cfgSet("formatDlgAdvanced", "true");
- removeInsert();
- cf.format();
- }
- }
- function storeCurrentValues()
- {
- if (cf)
- {
- var oldType = cf.dlgGlobalGetParm('xxformatDlgType');
- if (oldType != "default" && oldType != "mixed")
- {
- if (document.f.numDecimals)
- cf.cfgSet("formatCurrentNumDecs", document.f.numDecimals.options[document.f.numDecimals.selectedIndex].value);
- if (oldType != "scientific")
- {
- if (document.f.scale)
- {
- 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);
- }
- if (document.f.thousandSeparator)
- cf.cfgSet("formatCurrentThousandSep", document.f.thousandSeparator.options[document.f.thousandSeparator.selectedIndex].value);
- if (document.f.negativeSign)
- cf.cfgSet("formatCurrentNegAtts", document.f.negativeSign.selectedIndex);
- if (oldType == "currency")
- {
- if (document.f.curr)
- cf.cfgSet("formatCurrentSymbol", document.f.curr.options[document.f.curr.selectedIndex].value);
- if (document.f.currdisp)
- cf.cfgSet("formatCurrentDisp", document.f.currdisp.options[document.f.currdisp.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_TITLE"/>
- </dp:title>
- <!-- close link for the header -->
- <dp:close>
- <a href="javascript:getConfigFrame().hideDialogFrame()">
- <dp:closeMarker/>
- </a>
- </dp:close>
- <!-- header links -->
- <xsl:if test="/root/system/param[@name='enableAdvNumFormat'] = 'true'">
- <dp:headerLinks>
- <dp:headerLink>
- <dp:hl_attribute name="href">javascript:advancedDlg()</dp:hl_attribute>
- <dp:hl_attribute name="label"><xts:string id="DIALOG_ADVANCED"/></dp:hl_attribute>
- <dp:hl_attribute name="id">advLink</dp:hl_attribute>
- </dp:headerLink>
- </dp:headerLinks>
- </xsl:if>
- <!-- description (hint text) -->
- <dp:description>
- <xsl:attribute name="id">formatDesc</xsl:attribute>
- </dp:description>
- </dp:header>
- </td>
- </tr>
- <tr>
- <td width="100%" height="100%" valign="top">
- <!-- layout -->
- <lyt:layout style="2" border="no">
- <lyt:section height="274">
- <dp:input>
- <dp:section1>
- <xts:string id="FORMAT_CATEGORY_LABEL"/>
- </dp:section1>
- <dp:section2>
- <select name="formatDlgType" onchange="callFormatDlg()"/>
- </dp:section2>
- </dp:input>
- <span id="spanhide" style="visibility:hidden">
- <dp:input>
- <dp:section1>
- <BR/>placeholder</dp:section1>
- <dp:section2>
- <select name="placeholder"/>
- </dp:section2>
- </dp:input>
- </span>
- <div id="displayCurrency" style="display:none">
- <dp:input>
- <dp:section1>
- <BR/>
- <xts:string id="FORMAT_CURRENCY_LABEL"/>
- </dp:section1>
- <dp:section2>
- <select name="curr"/>
- </dp:section2>
- </dp:input>
- <dp:input>
- <dp:section1>
- <BR/>
- <xts:string id="FORMAT_CURRENCY_DISPLAY_LABEL"/>
- </dp:section1>
- <dp:section2>
- <select name="currdisp"/>
- </dp:section2>
- </dp:input>
- </div>
- </lyt:section>
- <lyt:section>
- <div id="displayNonDefault" style="display:none">
- <div id="displayNonMixed" style="display:none">
- <dp:input>
- <dp:section1>
- <xts:string id="FORMAT_NUMBER_OF_DECIMALS_LABEL"/>
- </dp:section1>
- <dp:section2>
- <select name="numDecimals"/>
- </dp:section2>
- </dp:input>
- <div id="displayNonScientific" style="display:none">
- <dp:input>
- <dp:section1>
- <BR/>
- <xts:string id="FORMAT_SCALE_LABEL"/>
- </dp:section1>
- <dp:section2>
- <select name="scale"/>
- </dp:section2>
- </dp:input>
- <dp:input>
- <dp:section1>
- <BR/>
- <xts:string id="FORMAT_NEGATIVE_SIGN_LABEL"/>
- </dp:section1>
- <dp:section2>
- <select name="negativeSign"/>
- </dp:section2>
- </dp:input>
- <dp:input>
- <dp:section1>
- <BR/>
- <xts:string id="FORMAT_THOUSANDS_SEPARATOR"/>
- </dp:section1>
- <dp:section2>
- <select name="thousandSeparator"/>
- </dp:section2>
- </dp:input>
- </div>
- </div>
- </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>
|