calcDateTimeDifference.xts 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. BI and PM: qs
  5. (C) Copyright IBM Corp. 2001, 2017
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!--
  13. Used for datetime and interval difference
  14. -->
  15. <xts:morphlet resolverBase="prompting" version="1.0" xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/QSRVUITextPL.xml,messages/portal.xml,messages/portalRL.xml" requiredCapability="canUseQueryStudio">
  16. <xts:block id="page" type="exec" mode="output" processor="XSLT" mimeType="text/html">
  17. <!-- get the debug logic sheet -->
  18. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  19. <!-- get the new theme stuff -->
  20. <!-- apply the following logicsheets in order -->
  21. <xts:logicsheet path="qs/logicsheets/calc_theme.xsl"/>
  22. <xts:logicsheet path="logicsheets/portal.xsl"/>
  23. <xts:logicsheet path="qs/logicsheets/dialogs.xsl"/>
  24. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  25. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  26. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  27. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  28. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  29. <xts:logicsheet path="logicsheets/cm-logic.xsl"/>
  30. <!-- apply the form logic -->
  31. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  32. <xsl:stylesheet version="1.0"
  33. xmlns:clcdlg="test_calculationDlg"
  34. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  35. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  36. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  37. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  38. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  39. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  40. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  41. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  42. xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
  43. xmlns:qsdlg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/qs/dialog/"
  44. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  45. exclude-result-prefixes="clcdlg xsl xts lyt pf dp df cp cf dbg qsdlg xtsext">
  46. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  47. <!-- Default variables (like skin) and prompt variables -->
  48. <qsdlg:variables/>
  49. <qsdlg:promptVariables/>
  50. <!-- Prompt Control XSL include -->
  51. <xsl:include href="p_include.xsl"/>
  52. <!-- add any theme variables -->
  53. <df:variables/>
  54. <pf:variables/>
  55. <!-- start the output -->
  56. <xsl:template match="/root">
  57. <dp:page>
  58. <dp:script>
  59. <xsl:call-template name="getPromptCommonIncludes"/>
  60. <xsl:call-template name="getselectDateIncludes">
  61. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  62. <xsl:with-param name="promptContentLocale" select="$contentLocale"/>
  63. </xsl:call-template>
  64. <xsl:call-template name="getselectTimeIncludes">
  65. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  66. <xsl:with-param name="promptContentLocale" select="$contentLocale"/>
  67. </xsl:call-template>
  68. <xsl:call-template name="getintervalFieldIncludes">
  69. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  70. <xsl:with-param name="promptContentLocale" select="$contentLocale"/>
  71. </xsl:call-template>
  72. <xsl:call-template name="gettextBoxIncludes">
  73. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  74. <xsl:with-param name="promptContentLocale" select="$contentLocale"/>
  75. </xsl:call-template>
  76. <link href="{$qsdlgskin}/qs/QSRVDialog.css" type="text/css" rel="stylesheet"/>
  77. <script type="text/javascript">
  78. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/layout.js</xsl:attribute>
  79. <xsl:text/>//<xsl:text/>
  80. </script>
  81. <script type="text/javascript">
  82. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/rv/cvConstants.js</xsl:attribute>
  83. <xsl:text/>//<xsl:text/>
  84. </script>
  85. <script type="text/javascript">
  86. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/rv/common.js</xsl:attribute>
  87. <xsl:text/>//<xsl:text/>
  88. </script>
  89. <script type="text/javascript">
  90. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/rv/cvui.js</xsl:attribute>
  91. <xsl:text/>//<xsl:text/>
  92. </script>
  93. <script type="text/javascript">
  94. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/common/framework/notification/CObserver.js</xsl:attribute>
  95. <xsl:text/>//<xsl:text/>
  96. </script>
  97. <script type="text/javascript">
  98. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/classes/CDialogManager.js</xsl:attribute>
  99. <xsl:text/>//<xsl:text/>
  100. </script>
  101. <script type="text/javascript">
  102. <xsl:attribute name="src"><xsl:value-of select="$webRoot"/>/qs/classes/CWindowManager.js</xsl:attribute>
  103. <xsl:text/>//<xsl:text/>
  104. </script>
  105. <script type="text/javascript">&lt;!--
  106. var goDialogManager = new CDialogManager();
  107. <clcdlg:jvs/>
  108. var cf = getConfigFrame();
  109. var calcType = cf.dlgGlobalGetParm('xxCalcType');
  110. var calcParentIds = new Array();
  111. var substVarValue = null;
  112. function execute()
  113. {
  114. var calc = document.f.calcList.options[document.f.calcList.selectedIndex].value;
  115. var before_col_id = cf.dlgGlobalGetParm('xxInsBeforeColid');
  116. var calcFormat = "none", first = "", second = "", calcExpr = "", calcOp;
  117. var calcType = 53;
  118. var usageType = 0;
  119. var listSeparator = goDialogManager.getMiniQueryManager().getListSeparator();
  120. if (document.f.first[0].checked)
  121. {
  122. for (var i = 0; i &lt; cf.dlgGlobalSize('xxColInfo'); i++)
  123. {
  124. if (i == 0)
  125. {
  126. var expr = cf.dlgGlobalGetParmAt('xxColInfo', i);
  127. first = expr[1];
  128. }
  129. if (cf.dlgGlobalSize('xxColInfo') == 1)
  130. {
  131. if (!document.f.inputValueRadio || (document.f.inputValueRadio[0].checked || (document.f.inputValueRadio[1].checked &amp;&amp; substVarValue == null)))
  132. {
  133. if (cf.dlgGlobalGetParm('xxCalcType') == 'date' || cf.dlgGlobalGetParm('xxCalcType') == 'datetime')
  134. {
  135. if(pickerControldateTop.isValid())
  136. second = pickerControldateTop.sGetValue();
  137. else return;
  138. }
  139. if (cf.dlgGlobalGetParm('xxCalcType') == 'datetime')
  140. second += " ";
  141. if (cf.dlgGlobalGetParm('xxCalcType') == 'time' || cf.dlgGlobalGetParm('xxCalcType') == 'datetime')
  142. {
  143. if(timePickertimeTop.isValid())
  144. second += timePickertimeTop.sGetValue();
  145. else return;
  146. }
  147. if (cf.dlgGlobalGetParm('xxCalcType') == 'interval')
  148. {
  149. if(intervalControlintervalFrom.isValid())
  150. second = intervalControlintervalFrom.sGetValue();
  151. else return;
  152. }
  153. }
  154. else
  155. second = substVarValue;
  156. }
  157. else if (i == 1)
  158. {
  159. var expr = cf.dlgGlobalGetParmAt('xxColInfo', i);
  160. second = expr[1];
  161. }
  162. }
  163. }
  164. else
  165. {
  166. for (var i = 0; i &lt; cf.dlgGlobalSize('xxColInfo'); i++)
  167. {
  168. if (i == 0)
  169. {
  170. var expr = cf.dlgGlobalGetParmAt('xxColInfo', i);
  171. second = expr[1];
  172. }
  173. if (cf.dlgGlobalSize('xxColInfo') == 1)
  174. {
  175. if (!document.f.inputValueRadio || (document.f.inputValueRadio[0].checked || (document.f.inputValueRadio[1].checked &amp;&amp; substVarValue == null)))
  176. {
  177. if (cf.dlgGlobalGetParm('xxCalcType') == 'date' || cf.dlgGlobalGetParm('xxCalcType') == 'datetime')
  178. {
  179. if(pickerControldateTop.isValid())
  180. first = pickerControldateTop.sGetValue();
  181. else return;
  182. }
  183. if (cf.dlgGlobalGetParm('xxCalcType') == 'datetime')
  184. first += " ";
  185. if (cf.dlgGlobalGetParm('xxCalcType') == 'time' || cf.dlgGlobalGetParm('xxCalcType') == 'datetime')
  186. {
  187. if(timePickertimeTop.isValid())
  188. first += timePickertimeTop.sGetValue();
  189. else return;
  190. }
  191. if (cf.dlgGlobalGetParm('xxCalcType') == 'interval')
  192. {
  193. if(intervalControlintervalFrom.isValid())
  194. first = intervalControlintervalFrom.sGetFormatValue();
  195. else return;
  196. }
  197. }
  198. else
  199. first = substVarValue;
  200. }
  201. else if (i == 1)
  202. {
  203. var expr = cf.dlgGlobalGetParmAt('xxColInfo', i);
  204. first = expr[1];
  205. }
  206. }
  207. }
  208. switch (calc)
  209. {
  210. case "daysBetween":
  211. calcExpr = "_days_between(" + first + listSeparator + " " + second + ")";
  212. calcOp = "daysBetween";
  213. calcType = -1;
  214. usageType = 2;
  215. break;
  216. case "monthsBetween":
  217. calcExpr = "_months_between(" + first + listSeparator + " " + second + ")";
  218. calcOp = "monthsBetween";
  219. calcType = -1;
  220. usageType = 2;
  221. break;
  222. case "yearsBetween":
  223. calcExpr = "_years_between(" + first + listSeparator + " " + second + ")";
  224. calcOp = "yearsBetween";
  225. calcType = -1;
  226. usageType = 2;
  227. break;
  228. default:
  229. calcExpr = "(" + first + ") - (" + second + ")";
  230. calcOp = "difference";
  231. break;
  232. }
  233. var tempCalcType = cf.dlgGlobalGetParm('xxCalcType');
  234. if (tempCalcType == 'date')
  235. calcOp += "Date";
  236. else if (tempCalcType == 'time')
  237. calcOp += "Time";
  238. else if (tempCalcType == 'interval')
  239. calcOp = "differenceInterval";
  240. else
  241. calcOp += "DateTime";
  242. if (calcExpr != "")
  243. {
  244. var calcName = getCalcName();
  245. getConfigFrame().addCalcColumn(before_col_id, calcExpr, calcExpr, calcName, "none", calcOp, "none", calcFormat, calcType, usageType, "none", -1, "none", calcParentIds);
  246. }
  247. }
  248. function generateName (withQuotes)
  249. {
  250. var calc = document.f.calcList.options[document.f.calcList.selectedIndex].value;
  251. var first = "", second = "", calcName = "";
  252. if (document.f &amp;&amp; document.f.first)
  253. {
  254. if (document.f.first[0].checked)
  255. {
  256. for (var i = 0; i &lt; cf.dlgGlobalSize('xxColInfo'); i++)
  257. {
  258. if (i == 0)
  259. {
  260. var label = cf.dlgGlobalGetParmAt('xxColInfo', i);
  261. first = label[0];
  262. }
  263. if (cf.dlgGlobalSize('xxColInfo') == 1)
  264. {
  265. if (!document.f.inputValueRadio || (document.f.inputValueRadio[0].checked || (document.f.inputValueRadio[1].checked &amp;&amp; substVarValue == null)))
  266. {
  267. if (calcType == 'date' || calcType == 'datetime')
  268. second = pickerControldateTop.sGetFormatValue();
  269. if (calcType == 'datetime')
  270. second += " ";
  271. if (calcType == 'time' || calcType == 'datetime')
  272. second += timePickertimeTop.sGetFormatValue();
  273. if (calcType == 'interval')
  274. second = intervalControlintervalFrom.sGetFormatValue();
  275. }
  276. else
  277. second = textBoxstringValue.m_oForm.value;
  278. }
  279. else if (i == 1)
  280. {
  281. var label = cf.dlgGlobalGetParmAt('xxColInfo', i);
  282. second = label[0];
  283. }
  284. }
  285. }
  286. else
  287. {
  288. for (var i = 0; i &lt; cf.dlgGlobalSize('xxColInfo'); i++)
  289. {
  290. if (i == 0)
  291. {
  292. var label = cf.dlgGlobalGetParmAt('xxColInfo', i);
  293. second = label[0];
  294. }
  295. if (cf.dlgGlobalSize('xxColInfo') == 1)
  296. {
  297. if (!document.f.inputValueRadio || (document.f.inputValueRadio[0].checked || (document.f.inputValueRadio[1].checked &amp;&amp; substVarValue == null)))
  298. {
  299. if (calcType == 'date' || calcType == 'datetime')
  300. first = pickerControldateTop.sGetFormatValue();
  301. if (calcType == 'datetime')
  302. first += " ";
  303. if (calcType == 'time' || calcType == 'datetime')
  304. first += timePickertimeTop.sGetFormatValue();
  305. if (calcType == 'interval')
  306. first = intervalControlintervalFrom.sGetFormatValue();
  307. }
  308. else
  309. first = textBoxstringValue.m_oForm.value;
  310. }
  311. else if (i == 1)
  312. {
  313. var label = cf.dlgGlobalGetParmAt('xxColInfo', i);
  314. first = label[0];
  315. }
  316. }
  317. }
  318. }
  319. switch (calc)
  320. {
  321. case "daysBetween":
  322. calcName = "<xts:string id="CALCULATION_DAYS_BETWEEN_EQUATION" encode="javascript"/>";
  323. break;
  324. case "monthsBetween":
  325. calcName = "<xts:string id="CALCULATION_MONTHS_BETWEEN_EQUATION" encode="javascript"/>";
  326. break;
  327. case "yearsBetween":
  328. calcName = "<xts:string id="CALCULATION_YEARS_BETWEEN_EQUATION" encode="javascript"/>";
  329. break;
  330. default:
  331. calcName = "<xts:string id="CALCULATION_SUBTRACT_EQUATION" encode="javascript"/>";
  332. break;
  333. }
  334. calcName = stringReplace (calcName, "\\^0", first);
  335. calcName = stringReplace (calcName, "\\^1", second);
  336. return calcName;
  337. }
  338. <xsl:if test="/root/env/param[@name='xxSubstVar']='true'">
  339. function datetimeGotFocus()
  340. {
  341. document.f.inputValueRadio[0].checked = true;
  342. }
  343. </xsl:if>
  344. function init()
  345. {
  346. attachMouseEvents();
  347. for (var i = 0; i &lt; cf.dlgGlobalSize('xxCalcParentIds'); i++)
  348. {
  349. var id = cf.dlgGlobalGetParmAt('xxCalcParentIds', i);
  350. calcParentIds[i] = id[0];
  351. }
  352. var validCalcs = new Array();
  353. for (var i = 0; i &lt; cf.dlgGlobalSize('xxValidCalcItem'); i++)
  354. validCalcs[validCalcs.length] = cf.dlgGlobalGetParmAt('xxValidCalcItem', i);
  355. populateCalculationList(calcType, validCalcs);
  356. // select calculation
  357. document.f.calcList.selectedIndex = cf.dlgGlobalGetParm('xxCalcTypeIdx');
  358. setInterval(loadHint, 100);
  359. addInsert();
  360. setGlobals(calcType, false);
  361. loadHint ();
  362. load ();
  363. var oIntervalFrom = [document.f.intervalDaysintervalFrom, document.f.intervalHoursintervalFrom, document.f.intervalMinutesintervalFrom, document.f.intervalSecondsintervalFrom];
  364. if (oIntervalFrom.length > 0)
  365. {
  366. if (oIntervalFrom[0])
  367. {
  368. oIntervalFrom[0].value = "<xts:string id="FILTER_INTERVAL_DEFAULT_VALUE" encode="javascript"/>";
  369. oIntervalFrom[0].onclick = onSelOperation;
  370. oIntervalFrom[0].onkeypress = onSelOperation;
  371. oIntervalFrom[0].onpaste = onSelOperation;
  372. oIntervalFrom[0].onblur = onSelOperation;
  373. }
  374. if (oIntervalFrom[1])
  375. {
  376. oIntervalFrom[1].value = "<xts:string id="FILTER_INTERVAL_DEFAULT_VALUE" encode="javascript"/>";
  377. oIntervalFrom[1].onclick = onSelOperation;
  378. oIntervalFrom[1].onkeypress = onSelOperation;
  379. oIntervalFrom[1].onpaste = onSelOperation;
  380. oIntervalFrom[1].onblur = onSelOperation;
  381. }
  382. if (oIntervalFrom[2])
  383. {
  384. oIntervalFrom[2].value = "<xts:string id="FILTER_INTERVAL_DEFAULT_VALUE" encode="javascript"/>";
  385. oIntervalFrom[2].onclick = onSelOperation;
  386. oIntervalFrom[2].onkeypress = onSelOperation;
  387. oIntervalFrom[2].onpaste = onSelOperation;
  388. oIntervalFrom[2].onblur = onSelOperation;
  389. }
  390. if (oIntervalFrom[3])
  391. {
  392. oIntervalFrom[3].value = "<xts:string id="FILTER_INTERVAL_DEFAULT_VALUE" encode="javascript"/>";
  393. oIntervalFrom[3].onclick = onSelOperation;
  394. oIntervalFrom[3].onkeypress = onSelOperation;
  395. oIntervalFrom[3].onpaste = onSelOperation;
  396. oIntervalFrom[3].onblur = onSelOperation;
  397. }
  398. }
  399. <xsl:if test="/root/env/param[@name='xxSubstVar']='true'">
  400. //choose date and time radio button on focus
  401. var oDateTop = document.getElementById('dateEditBoxdateTop');
  402. var oTimeTop = document.getElementById('timeEditBoxtimeTop');
  403. if (oDateTop)
  404. {
  405. oDateTop.onclick = datetimeGotFocus;
  406. oDateTop.onkeypress = datetimeGotFocus;
  407. oDateTop.onpaste = datetimeGotFocus;
  408. }
  409. if (oTimeTop)
  410. {
  411. oTimeTop.onclick = datetimeGotFocus;
  412. oTimeTop.onkeypress = datetimeGotFocus;
  413. oTimeTop.onpaste = datetimeGotFocus;
  414. }
  415. if (document.dateTopimgPicker)
  416. document.dateTopimgPicker.onmousedown = datetimeGotFocus;
  417. <clcdlg:subst_var/>
  418. </xsl:if>
  419. }
  420. function load() {
  421. var calc = document.f.calcList.options[document.f.calcList.selectedIndex].value;
  422. var calcWord;
  423. switch (calc)
  424. {
  425. case "daysBetween":
  426. calcWord = "<xts:string id="CALCULATION_DAYS_BETWEEN_EQUATION" encode="javascript"/>";
  427. break;
  428. case "monthsBetween":
  429. calcWord = "<xts:string id="CALCULATION_MONTHS_BETWEEN_EQUATION" encode="javascript"/>";
  430. break;
  431. case "yearsBetween":
  432. calcWord = "<xts:string id="CALCULATION_YEARS_BETWEEN_EQUATION" encode="javascript"/>";
  433. break;
  434. default:
  435. calcWord = "<xts:string id="CALCULATION_SUBTRACT_EQUATION" encode="javascript"/>";
  436. break;
  437. }
  438. var calcWord2 = calcWord;
  439. for (var i = 0; i &lt; cf.dlgGlobalSize('xxColInfo'); i++)
  440. {
  441. if (i == 0)
  442. {
  443. var label = cf.dlgGlobalGetParmAt('xxColInfo', i);
  444. var first = label[0];
  445. break;
  446. }
  447. }
  448. if (cf.dlgGlobalSize('xxColInfo') == 1)
  449. {
  450. if (calcType == 'date' || calcType == 'datetime')
  451. var second = "<xts:string id="CALCULATION_DATE_LABEL" encode="javascript"/>";
  452. else if (calcType == 'time')
  453. var second = "<xts:string id="CALCULATION_TIME_LABEL" encode="javascript"/>";
  454. else if (calcType == 'interval')
  455. var second = "<xts:string id="CALCULATION_INTERVAL_LABEL" encode="javascript"/>";
  456. }
  457. else
  458. {
  459. for (var i = 0; i &lt; cf.dlgGlobalSize('xxColInfo'); i++)
  460. {
  461. if (i == 1)
  462. {
  463. var label = cf.dlgGlobalGetParmAt('xxColInfo', i);
  464. var second = label[0];
  465. break;
  466. }
  467. }
  468. }
  469. calcWord = stringReplace (calcWord, "\\^0", first);
  470. calcWord = stringReplace (calcWord, "\\^1", second);
  471. calcWord2 = stringReplace (calcWord2, "\\^1", first);
  472. calcWord2 = stringReplace (calcWord2, "\\^0", second);
  473. // populate calcWord
  474. var calcWordElt = document.getElementById("calcWord");
  475. while (calcWordElt.hasChildNodes())
  476. calcWordElt.removeChild(calcWordElt.firstChild);
  477. calcWordElt.appendChild(document.createTextNode(calcWord));
  478. var calcWordElt2 = document.getElementById("calcWord2");
  479. while (calcWordElt2.hasChildNodes())
  480. calcWordElt2.removeChild(calcWordElt2.firstChild);
  481. calcWordElt2.appendChild(document.createTextNode(calcWord2));
  482. }
  483. function redrawHint()
  484. {
  485. setTimeout(loadHint, 10);
  486. }
  487. //--&gt;</script>
  488. </dp:script>
  489. <form style="margin:0px" name="f" method="POST" onsubmit="execute();return false;">
  490. <table border="0" cellspacing="0" cellpadding="0" height="100%" width="100%">
  491. <tr>
  492. <td width="100%" height="0%">
  493. <!-- dialog header -->
  494. <clcdlg:basic_header/>
  495. </td>
  496. </tr>
  497. <tr>
  498. <td width="100%" height="100%" valign="top">
  499. <lyt:layout style="2" border="no">
  500. <lyt:section>
  501. <clcdlg:calculations/>
  502. <dp:input>
  503. <dp:section1>
  504. <xts:string id="CALCULATION_LABEL_ORDER"/>
  505. </dp:section1>
  506. <dp:section2>
  507. <dp:choice>
  508. <dp:section1>
  509. <input type="radio" name="first" checked="true" onClick="javascript:onSelOperation();"/>
  510. </dp:section1>
  511. <dp:section2>
  512. <span id="calcWord" style="width:240px;"/>
  513. </dp:section2>
  514. <dp:section1>
  515. <input type="radio" name="first" onClick="javascript:onSelOperation();"/>
  516. </dp:section1>
  517. <dp:section2>
  518. <span id="calcWord2" style="width:240px;"/>
  519. </dp:section2>
  520. </dp:choice>
  521. </dp:section2>
  522. </dp:input>
  523. <xsl:if test="/root/env/param[@name='xxColCount']=1">
  524. <dp:input>
  525. <dp:section1>
  526. <xsl:choose>
  527. <xsl:when test="/root/env/param[@name='xxCalcType']='date' or /root/env/param[@name='xxCalcType']='datetime'">
  528. <xts:string id="CALCULATION_DATE"/>
  529. </xsl:when>
  530. <xsl:when test="/root/env/param[@name='xxCalcType']='time' or /root/env/param[@name='xxCalcType']='datetime'">
  531. <xts:string id="CALCULATION_TIME"/>
  532. </xsl:when>
  533. <xsl:when test="/root/env/param[@name='xxCalcType']='interval'">
  534. <xts:string id="CALCULATION_INTERVAL"/>
  535. </xsl:when>
  536. </xsl:choose>
  537. </dp:section1>
  538. <dp:section2>
  539. <table>
  540. <tr>
  541. <xsl:if test="/root/env/param[@name='xxSubstVar']='true'">
  542. <td>
  543. <input type="radio" name="inputValueRadio" checked="true"/>
  544. </td>
  545. </xsl:if>
  546. <td>
  547. <dp:choice>
  548. <xsl:if test="/root/env/param[@name='xxCalcType']='date' or /root/env/param[@name='xxCalcType']='datetime'">
  549. <dp:section1>
  550. <!-- Render a select date prompt-->
  551. <xsl:call-template name="getSelectDate">
  552. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  553. <xsl:with-param name="promptFormName" select="$promptFormName"/>
  554. <xsl:with-param name="promptRequired" select="'false'"/>
  555. <xsl:with-param name="promptStartOfWeek" select="'Sunday'"/>
  556. <xsl:with-param name="promptCalendar" select="'Gregorian'"/>
  557. <xsl:with-param name="promptParameter" select="'dateparameter1'"/>
  558. <xsl:with-param name="promptInputOrder" select="'YMD'"/>
  559. <xsl:with-param name="promptDefaultDate" select="'none'"/>
  560. <xsl:with-param name="promptDateTime" select="'false'"/>
  561. <xsl:with-param name="promptMultiSelect" select="'false'"/>
  562. <xsl:with-param name="promptId" select="'dateTop'"/>
  563. <xsl:with-param name="suppressDisabled" select="'true'"/>
  564. <xsl:with-param name="promptSelectUI" select="'editBox'"/>
  565. </xsl:call-template>
  566. </dp:section1>
  567. <dp:section2/>
  568. </xsl:if>
  569. <xsl:if test="/root/env/param[@name='xxCalcType']='time' or /root/env/param[@name='xxCalcType']='datetime'">
  570. <dp:section1>
  571. <xsl:call-template name="getSelectTime">
  572. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  573. <xsl:with-param name="promptFormName" select="$promptFormName"/>
  574. <xsl:with-param name="promptRequired" select="'false'"/>
  575. <xsl:with-param name="promptDefaultValue" select="'00:00:00.000'"/>
  576. <xsl:with-param name="promptParameter" select="'timeparameter1'"/>
  577. <xsl:with-param name="promptDisplay" select="1"/>
  578. <xsl:with-param name="promptInline" select="'false'"/>
  579. <xsl:with-param name="promptHourFormat" select="'hh'"/>
  580. <xsl:with-param name="promptMinuteFormat" select="'mm'"/>
  581. <xsl:with-param name="promptSecondFormat" select="'ss'"/>
  582. <xsl:with-param name="promptMultiSelect" select="'false'"/>
  583. <xsl:with-param name="promptId" select="'timeTop'"/>
  584. <xsl:with-param name="suppressDisabled" select="'true'"/>
  585. <xsl:with-param name="promptSelectUI" select="'editBox'"/>
  586. </xsl:call-template>
  587. </dp:section1>
  588. <dp:section2/>
  589. </xsl:if>
  590. <xsl:if test="/root/env/param[@name='xxCalcType']='interval'">
  591. <dp:section1>
  592. <xsl:call-template name="getSelectInterval">
  593. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  594. <xsl:with-param name="promptFormName" select="$promptFormName"/>
  595. <xsl:with-param name="promptRequired" select="'false'"/>
  596. <xsl:with-param name="promptDefaultValue" select="''"/>
  597. <xsl:with-param name="suppressDisabled" select="'true'"/>
  598. <xsl:with-param name="promptShowSeconds" select="'true'"/>
  599. <xsl:with-param name="promptId" select="'intervalFrom'"/>
  600. <xsl:with-param name="promptParameter" select="'intervalparameter1'"/>
  601. </xsl:call-template>
  602. </dp:section1>
  603. <dp:section2/>
  604. </xsl:if>
  605. </dp:choice>
  606. </td>
  607. </tr>
  608. <xsl:if test="/root/env/param[@name='xxSubstVar']='true'">
  609. <tr>
  610. <td>
  611. <input type="radio" name="inputValueRadio"/>
  612. </td>
  613. <td>
  614. <table>
  615. <tr>
  616. <td valign="bottom">
  617. <xsl:call-template name="getTextBox">
  618. <xsl:with-param name="promptLocale" select="$promptLocale"/>
  619. <xsl:with-param name="promptFormName" select="$promptFormName"/>
  620. <xsl:with-param name="promptRequired" select="'false'"/>
  621. <xsl:with-param name="promptId" select="'stringValue'"/>
  622. <xsl:with-param name="promptHideText" select="'false'"/>
  623. <xsl:with-param name="promptMultiLine" select="'false'"/>
  624. <xsl:with-param name="promptParameter" select="'stringParam1'"/>
  625. <xsl:with-param name="promptReadOnly" select="'true'"/>
  626. </xsl:call-template>
  627. </td>
  628. <td id="buttonContainer"/>
  629. </tr>
  630. </table>
  631. </td>
  632. </tr>
  633. </xsl:if>
  634. </table>
  635. </dp:section2>
  636. </dp:input>
  637. </xsl:if>
  638. </lyt:section>
  639. <lyt:section>
  640. <clcdlg:calc_hint/>
  641. </lyt:section>
  642. <lyt:section/>
  643. </lyt:layout>
  644. </td>
  645. </tr>
  646. <tr>
  647. <td width="100%" height="0%">
  648. <!-- Use default buttons [ OK = execute() and CANCEL = hideDialogFrame() ] -->
  649. <clcdlg:buttons/>
  650. </td>
  651. </tr>
  652. <!-- <dbg:dumpxml select="/"/> -->
  653. </table>
  654. </form>
  655. </dp:page>
  656. </xsl:template>
  657. </xsl:stylesheet>
  658. </xts:block>
  659. </xts:morphlet>