intervals.xslt 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: cogadmin
  5. (C) Copyright IBM Corp. 2005, 2014
  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. <xsl:stylesheet version="1.0"
  13. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  14. xmlns:uic="http://developer.cognos.com/schemas/uic/presentation/markup/"
  15. xmlns:flt="http://developer.cognos.com/schemas/uic/presentation/filters/"
  16. xmlns:itrv="http://developer.cognos.com/schemas/uic/presentation/intervals/"
  17. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  18. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  19. xmlns:out="dummy-uri"
  20. exclude-result-prefixes="xsl itrv flt xts uic">
  21. <xsl:output method="xml" encoding="UTF-8" indent="no"/>
  22. <xsl:namespace-alias stylesheet-prefix="out" result-prefix="xsl"/>
  23. <xsl:template match="itrv:Date">
  24. <xsl:variable name="mode">
  25. <xsl:choose>
  26. <xsl:when test="@mode"><xsl:value-of select="@mode"/></xsl:when>
  27. <xsl:otherwise>editBox</xsl:otherwise>
  28. </xsl:choose>
  29. </xsl:variable>
  30. <out:call-template name="getSelectDate">
  31. <out:with-param name="promptLocale" select="$promptLocale"/>
  32. <out:with-param name="promptTimeZone" select="$timeZone"/>
  33. <out:with-param name="promptFormName" select="'_THIS_pform'"/>
  34. <out:with-param name="promptRequired" select="'false'"/>
  35. <out:with-param name="promptStartOfWeek" select="'Sunday'"/>
  36. <out:with-param name="promptCalendar" select="'Gregorian'"/>
  37. <out:with-param name="promptParameter" select="{@promptParameter}"/>
  38. <out:with-param name="promptSelectDateUI" select="'{$mode}'"/>
  39. <out:with-param name="promptInputOrder" select="'YMD'"/>
  40. <xsl:if test="@firstDate != ''">
  41. <out:with-param name="promptFirstDate" select="{@firstDate}"/>
  42. </xsl:if>
  43. <xsl:if test="@popupIndex != ''">
  44. <out:with-param name="popupZindex" select="{@popupIndex}"/>
  45. </xsl:if>
  46. <out:with-param name="promptDefaultDate" select="{@date}"/>
  47. <out:with-param name="promptDateTime" select="'true'"/>
  48. <out:with-param name="promptMultiSelect" select="'false'"/>
  49. <out:with-param name="promptId" select="{@promptID}"/>
  50. <out:with-param name="suppressDisabled" select="'true'"/>
  51. <out:with-param name="promptBrowserMode" select="$promptBrowserMode"/>
  52. <out:with-param name="promptSelectUI" select="'{$mode}'"/>
  53. </out:call-template>
  54. </xsl:template>
  55. <xsl:template match="itrv:Time">
  56. <out:call-template name="getSelectTime">
  57. <out:with-param name="promptLocale" select="$promptLocale"/>
  58. <out:with-param name="promptFormName" select="'_THIS_pform'"/>
  59. <out:with-param name="promptRequired" select="'false'"/>
  60. <out:with-param name="promptDefaultValue" select="{@time}"/>
  61. <out:with-param name="promptParameter" select="{@promptParameter}"/>
  62. <out:with-param name="promptShowSeconds" select="'false'"/>
  63. <out:with-param name="promptInline" select="'false'"/>
  64. <out:with-param name="promptTimeZone" select="$timeZone"/>
  65. <out:with-param name="promptHourFormat" select="'hh'"/>
  66. <out:with-param name="promptMinuteFormat" select="'mm'"/>
  67. <out:with-param name="promptSecondFormat" select="'ss'"/>
  68. <out:with-param name="promptMode" select="@mode"/>
  69. <out:with-param name="promptMultiSelect" select="'false'"/>
  70. <out:with-param name="promptId" select="{@promptID}"/>
  71. <out:with-param name="suppressDisabled" select="'true'"/>
  72. <out:with-param name="promptBrowserMode" select="$promptBrowserMode"/>
  73. <out:with-param name="promptSelectUI" select="'editBox'"/>
  74. </out:call-template>
  75. </xsl:template>
  76. <xsl:template match="itrv:promptControls">
  77. <out:variable name="skin" select="key('user-param', 'skin')"/>
  78. <out:include href="p_include.xsl"/>
  79. <out:variable name="promptLocale" select="$productLocale"/>
  80. <out:variable name="promptFormName" select="@form"/>
  81. <out:variable name="promptBrowserMode">
  82. <out:choose>
  83. <out:when test="$browser = 'ie' ">IE5</out:when>
  84. <out:when test="$browser = 'moz' ">NS6</out:when>
  85. <out:when test="$browser = 'safari' ">safari</out:when>
  86. <out:otherwise>NS4</out:otherwise>
  87. </out:choose>
  88. </out:variable>
  89. </xsl:template>
  90. <xsl:template match="itrv:promptControlsScript">
  91. <script>
  92. var m_datetime_msg_array = new Array();
  93. m_datetime_msg_array['MSG_ERR_INCOMPATIBLE_DATES'] = "<xts:string id="IDS_FLT_MSG_INCOMPATIBLE_DATES" encode="javascript"/>";
  94. m_datetime_msg_array['MSG_ERR_INVALID_END_DATE'] = "<xts:string id="IDS_FLT_MSG_INVALID_END_DATE" encode="javascript"/>";
  95. m_datetime_msg_array['MSG_ERR_INVALID_END_TIME'] = "<xts:string id="IDS_FLT_MSG_INVALID_END_TIME" encode="javascript"/>";
  96. m_datetime_msg_array['MSG_ERR_INVALID_START_DATE'] = "<xts:string id="IDS_FLT_MSG_INVALID_START_DATE" encode="javascript"/>";
  97. m_datetime_msg_array['MSG_ERR_INVALID_START_TIME'] = "<xts:string id="IDS_FLT_MSG_INVALID_START_TIME" encode="javascript"/>";
  98. m_datetime_msg_array['MSG_ERR_INVALID_DATE'] = "<xts:string id="IDS_FLT_MSG_INVALID_DATE" encode="javascript"/>";
  99. m_datetime_msg_array['MSG_ERR_INVALID_TIME'] = "<xts:string id="IDS_FLT_MSG_INVALID_TIME" encode="javascript"/>";
  100. function getFormattedSummary(dFrom, tFrom, dTo, tTo) {
  101. return '<xts:string id="IDS_FLT_PERIOD_SUMMARY" encode="javascript"><xts:param name="from">' + dFrom + ' ' + tFrom + '</xts:param><xts:param name="to">' + dTo + ' ' + tTo + '</xts:param></xts:string>';
  102. }
  103. </script>
  104. <!-- bring in our js file -->
  105. <library type="text/javascript" href="$WEB$/ps/cogadmin/js/datetime.js"/>
  106. <!-- create some hidden inputs needed by our js file -->
  107. <input name="_THIS_hidden_date_periodFrom" id="_THIS_hidden_date_periodFrom" type="hidden" value=""/>
  108. <input name="_THIS_hidden_time_periodFrom" id="_THIS_hidden_time_periodFrom" type="hidden" value=""/>
  109. <input name="_THIS_hidden_date_periodTo" id="_THIS_hidden_date_periodTo" type="hidden" value=""/>
  110. <input name="_THIS_hidden_time_periodTo" id="_THIS_hidden_time_periodTo" type="hidden" value=""/>
  111. <xts:transform src="/cogadmin/transforms/switchScriptToLibrary.xslt" processor="XSLT">
  112. <root>
  113. <out:call-template name="getPromptCommonIncludes">
  114. <out:with-param name="promptBrowserMode" select="$promptBrowserMode"/>
  115. </out:call-template>
  116. <out:call-template name="getselectDateTimeIncludes">
  117. <out:with-param name="promptLocale" select="$promptLocale"/>
  118. <out:with-param name="promptContentLocale" select="$contentLocale"/>
  119. <out:with-param name="promptBrowserMode" select="$promptBrowserMode"/>
  120. </out:call-template>
  121. </root>
  122. </xts:transform>
  123. </xsl:template>
  124. <xsl:template match="*">
  125. <xsl:copy>
  126. <xsl:copy-of select="@*"/>
  127. <xsl:apply-templates/>
  128. </xsl:copy>
  129. </xsl:template>
  130. </xsl:stylesheet>