toolbar.xslt.pla 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: HTS
  5. (C) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0"
  9. xmlns:xts="http://developer.cognos.com/schemas/xts/"
  10. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  11. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  12. <xsl:template match="/">
  13. <xsl:variable name="filterLabel"><xts:string id="IDS_FRAG_MENU_LABEL_FILTER"/></xsl:variable>
  14. <xsl:variable name="typeMenuName"><xts:string id="IDS_FRAG_MENU_LABEL_ALL_TYPES"/></xsl:variable>
  15. <xsl:variable name="priorityMenuName"><xts:string id="IDS_FRAG_MENU_LABEL_ALL_PRIORITIES"/></xsl:variable>
  16. <xsl:variable name="statusMenuName"><xts:string id="IDS_FRAG_MENU_LABEL_ALL_STATUSES"/></xsl:variable>
  17. <xsl:variable name="datesMenuName"><xts:string id="IDS_FRAG_MENU_LABEL_ALL_DATES"/></xsl:variable>
  18. <xsl:variable name="taskMenuName"><xts:string id="IDS_FRAG_MENU_LABEL_TASK"/></xsl:variable>
  19. <xsl:variable name="folderMenuName"><xts:string id="IDS_FRAG_MENU_LABEL_APPLICATIONS"/></xsl:variable>
  20. <xsl:variable name="newItemImageAltText"><xts:string id="IDS_FRAG_MENU_NEW_ITEM"/></xsl:variable>
  21. <xsl:variable name="archiveImageAltText"><xts:string id="IDS_FRAG_MENU_BUTTON_ARCHIVE"/></xsl:variable>
  22. <xsl:variable name="moveToImageAltText"><xts:string id="IDS_FRAG_MENU_BUTTON_CTRL_MOVETO"/></xsl:variable>
  23. <xsl:variable name="deleteImageAltText"><xts:string id="IDS_FRAG_MENU_BUTTON_DELETE"/></xsl:variable>
  24. <xsl:variable name="dateStyleLabel"><xts:string id="IDS_FRAG_MENU_LABEL_DATE_STYLE_CREATE"/></xsl:variable>
  25. <xsl:variable name="dateStyleValue"><xsl:value-of select="/root/transients/param[@name='dateStyle']"/></xsl:variable>
  26. <response>
  27. <toolbar id="toolbar">
  28. <item type="button">
  29. <image alt="{$newItemImageAltText}" pre="_THIS?frag-resource=" post="/THIS_">/fragments/myinbox/images/icon_notification_new.gif</image>
  30. <name><xts:string id="IDS_FRAG_MENU_LABEL_NEW_NOTIFICATION"/></name>
  31. <action>_THIS_action('new',$(_THIS_),'notification',1);</action>
  32. </item>
  33. <item type="comboButton" separatorBefore="true">
  34. <menu id="deleteItemMenu" tooltip="{$moveToImageAltText}">
  35. <xsl:choose>
  36. <xsl:when test="/root/customs/param[@name='folderName']='archive'">
  37. <item fullImagePath="true" selected="true">
  38. <image alt="{$moveToImageAltText}" pre="_THIS?frag-resource=" post="/THIS_">/fragments/myinbox/images/action_move_to.png</image>
  39. <name><xts:string id="IDS_FRAG_MENU_BUTTON_UNARCHIVE"/></name>
  40. <value>UNARCHIVE</value>
  41. <action>_THIS_action('unarchive');</action>
  42. </item>
  43. <item fullImagePath="true" enabled="false">
  44. <image alt="{$moveToImageAltText}" pre="_THIS?frag-resource=" post="/THIS_">/fragments/myinbox/images/action_move_to.png</image>
  45. <name><xts:string id="IDS_FRAG_MENU_BUTTON_ARCHIVE"/></name>
  46. <value>ARCHIVE</value>
  47. <action>return true;</action>
  48. </item>
  49. </xsl:when>
  50. <xsl:otherwise>
  51. <item fullImagePath="true" enabled="false">
  52. <image alt="{$moveToImageAltText}" pre="_THIS?frag-resource=" post="/THIS_">/fragments/myinbox/images/action_move_to.png</image>
  53. <name><xts:string id="IDS_FRAG_MENU_BUTTON_UNARCHIVE"/></name>
  54. <value>UNARCHIVE</value>
  55. <action>return true;</action>
  56. </item>
  57. <item selected="true" fullImagePath="true">
  58. <image alt="{$moveToImageAltText}" pre="_THIS?frag-resource=" post="/THIS_">/fragments/myinbox/images/action_move_to.png</image>
  59. <name><xts:string id="IDS_FRAG_MENU_BUTTON_ARCHIVE"/></name>
  60. <value>ARCHIVE</value>
  61. <action>_THIS_action('archive');</action>
  62. </item>
  63. </xsl:otherwise>
  64. </xsl:choose>
  65. </menu>
  66. </item>
  67. <xsl:if test="/root/customs/param[@name='folderName']='archive'">
  68. <item type="button" separatorBefore="true">
  69. <image alt="{$deleteImageAltText}" pre="_THIS?frag-resource=" post="/THIS_">/ps/portal/images/action_delete.gif</image>
  70. <name><xts:string id="IDS_FRAG_MENU_BUTTON_DELETE"/></name>
  71. <action>_THIS_action('delete');</action>
  72. </item>
  73. </xsl:if>
  74. <item type="button" separatorBefore="true">
  75. <name><xts:string id="IDS_FRAG_MENU_BUTTON_REFRESH"/></name>
  76. <image>fragments/myinbox/images/refresh.gif</image>
  77. <action>_THIS_action('refresh');</action>
  78. </item>
  79. <item type="combo" separatorBefore="true">
  80. <menu id="dateStyleMenu" displayName="{$dateStyleLabel}" >
  81. <item selected="true">
  82. <name><xts:string id="IDS_FRAG_MENU_LABEL_DATE_STYLE_CREATE"/></name>
  83. <value>Task.CreateDate</value>
  84. <action>_THIS_action('dateStyle', $(_THIS_), 'dateStyle',0);</action>
  85. </item>
  86. <item>
  87. <name><xts:string id="IDS_FRAG_TASKLIST_HEADER_NEXT_DEADLINE"/></name>
  88. <value>Task.DueDate</value>
  89. <action>_THIS_action('dateStyle', $(_THIS_), 'dateStyle', 1);</action>
  90. </item>
  91. </menu>
  92. </item>
  93. <item type="combo" separatorBefore="true" labelBefore="{$filterLabel}">
  94. <menu id="typeFiltersMenu" displayName="{$typeMenuName}">
  95. <item selected="true">
  96. <name><xts:string id="IDS_FRAG_MENU_LABEL_ALL_TYPES"/></name>
  97. <value>ALL</value>
  98. <action>_THIS_action('filter',$(_THIS_),'Task.Type',0);</action>
  99. </item>
  100. <item>
  101. <name><xts:string id="IDS_FRAG_MENU_LABEL_TASKS"/></name>
  102. <value>TASK</value>
  103. <action>_THIS_action('filter',$(_THIS_),'Task.Type',1);</action>
  104. </item>
  105. <item>
  106. <name><xts:string id="IDS_FRAG_MENU_LABEL_NOTIFICATIONS"/></name>
  107. <value>NOTIFICATION</value>
  108. <action>_THIS_action('filter',$(_THIS_),'Task.Type',2);</action>
  109. </item>
  110. </menu>
  111. </item>
  112. <item type="combo">
  113. <menu id="priorityMenu" displayName="{$priorityMenuName}">
  114. <item selected="true">
  115. <name><xts:string id="IDS_FRAG_MENU_LABEL_ALL_PRIORITIES"/></name>
  116. <value>ALL</value>
  117. <action>_THIS_action('filter',$(_THIS_),'Task.Priority',0);</action>
  118. </item>
  119. <item>
  120. <name><xts:string id="IDS_FRAG_MENU_LABEL_PRIORITY_LOW"/></name>
  121. <value>5</value>
  122. <action>_THIS_action('filter',$(_THIS_),'Task.Priority',1);</action>
  123. </item>
  124. <item>
  125. <name><xts:string id="IDS_FRAG_MENU_LABEL_PRIORITY_MEDIUM"/></name>
  126. <value>3</value>
  127. <action>_THIS_action('filter',$(_THIS_),'Task.Priority',2);</action>
  128. </item>
  129. <item>
  130. <name><xts:string id="IDS_FRAG_MENU_LABEL_PRIORITY_HIGH"/></name>
  131. <value>1</value>
  132. <action>_THIS_action('filter',$(_THIS_),'Task.Priority',3);</action>
  133. </item>
  134. </menu>
  135. </item>
  136. <item type="combo">
  137. <menu id="statusMenu" displayName="{$statusMenuName}">
  138. <item selected="true">
  139. <name><xts:string id="IDS_FRAG_MENU_LABEL_ALL_STATUSES"/></name>
  140. <value>ALL</value>
  141. <action>_THIS_action('filter',$(_THIS_),'Task.Status',0);</action>
  142. </item>
  143. <item>
  144. <name><xts:string id="IDS_FRAG_MENU_LABEL_NOT_STARTED_STATUS"/></name>
  145. <value>NOT_STARTED</value>
  146. <action>_THIS_action('filter',$(_THIS_),'Task.Status',1);</action>
  147. </item>
  148. <item>
  149. <name><xts:string id="IDS_FRAG_MENU_LABEL_IN_PROGRESS_STATUS"/></name>
  150. <value>IN_PROGRESS</value>
  151. <action>_THIS_action('filter',$(_THIS_),'Task.Status',2);</action>
  152. </item>
  153. <item>
  154. <name><xts:string id="IDS_FRAG_MENU_LABEL_COMPLETED_STATUS"/></name>
  155. <value>COMPLETED</value>
  156. <action>_THIS_action('filter',$(_THIS_),'Task.Status',3);</action>
  157. </item>
  158. <item>
  159. <name><xts:string id="IDS_FRAG_MENU_LABEL_CANCELLED_STATUS"/></name>
  160. <value>OBSOLETE</value>
  161. <action>_THIS_action('filter',$(_THIS_),'Task.Status',4);</action>
  162. </item>
  163. <!--item>
  164. <name><xts:string id="IDS_FRAG_MENU_LABEL_SUSPENDED_STATUS"/></name>
  165. <value>SUSPENDED</value>
  166. <action>_THIS_action('filter',$(_THIS_),'Task.Status',6);</action>
  167. </item-->
  168. </menu>
  169. </item>
  170. <item type="combo">
  171. <menu id="datesMenu" displayName="{$datesMenuName}">
  172. <item selected="true">
  173. <name><xts:string id="IDS_FRAG_MENU_LABEL_ALL_DATES"/></name>
  174. <value>ALL</value>
  175. <action>
  176. _THIS_action('filter',$(_THIS_),_THIS_getDateFilterType(),0);
  177. </action>
  178. </item>
  179. <item>
  180. <name>
  181. <xsl:choose>
  182. <xsl:when test="contains($dateStyleValue,'Task.DueDate')"><xts:string id="IDS_FRAG_MENU_LABEL_NEXT_DAY"/></xsl:when>
  183. <xsl:otherwise><xts:string id="IDS_FRAG_MENU_LABEL_LAST_DAY"/></xsl:otherwise>
  184. </xsl:choose>
  185. </name>
  186. <value type="script">
  187. var utils = new hts_utils();
  188. <xsl:choose>
  189. <xsl:when test="contains($dateStyleValue,'Task.DueDate')">
  190. return utils.getDays(1,true);
  191. </xsl:when>
  192. <xsl:otherwise>
  193. return utils.getDays(1,false);
  194. </xsl:otherwise>
  195. </xsl:choose>
  196. </value>
  197. <action>
  198. _THIS_action('filter',$(_THIS_),_THIS_getDateFilterType(),1);
  199. </action>
  200. </item>
  201. <item>
  202. <name>
  203. <xsl:choose>
  204. <xsl:when test="contains($dateStyleValue,'Task.DueDate')"><xts:string id="IDS_FRAG_MENU_LABEL_NEXT_WEEK"/></xsl:when>
  205. <xsl:otherwise><xts:string id="IDS_FRAG_MENU_LABEL_LAST_WEEK"/></xsl:otherwise>
  206. </xsl:choose>
  207. </name>
  208. <value type="script">
  209. var utils = new hts_utils();
  210. <xsl:choose>
  211. <xsl:when test="contains($dateStyleValue,'Task.DueDate')">
  212. return utils.getDays(7,true);
  213. </xsl:when>
  214. <xsl:otherwise>
  215. return utils.getDays(7,false);
  216. </xsl:otherwise>
  217. </xsl:choose>
  218. </value>
  219. <action>
  220. _THIS_action('filter',$(_THIS_),_THIS_getDateFilterType(),2);
  221. </action>
  222. </item>
  223. <item>
  224. <name>
  225. <xsl:choose>
  226. <xsl:when test="contains($dateStyleValue,'Task.DueDate')"><xts:string id="IDS_FRAG_MENU_LABEL_NEXT_MONTH"/></xsl:when>
  227. <xsl:otherwise><xts:string id="IDS_FRAG_MENU_LABEL_LAST_MONTH"/></xsl:otherwise>
  228. </xsl:choose>
  229. </name>
  230. <value type="script">
  231. var utils = new hts_utils();
  232. <xsl:choose>
  233. <xsl:when test="contains($dateStyleValue,'Task.DueDate')">
  234. return utils.getMonths(1,true);
  235. </xsl:when>
  236. <xsl:otherwise>
  237. return utils.getMonths(1,false);
  238. </xsl:otherwise>
  239. </xsl:choose>
  240. </value>
  241. <action>
  242. _THIS_action('filter',$(_THIS_),_THIS_getDateFilterType(),3);
  243. </action>
  244. </item>
  245. <item>
  246. <name>
  247. <xsl:choose>
  248. <xsl:when test="contains($dateStyleValue,'Task.DueDate')"><xts:string id="IDS_FRAG_MENU_LABEL_NEXT_6MONTHS"/></xsl:when>
  249. <xsl:otherwise><xts:string id="IDS_FRAG_MENU_LABEL_LAST_6MONTHS"/></xsl:otherwise>
  250. </xsl:choose>
  251. </name>
  252. <value type="script">
  253. var utils = new hts_utils();
  254. <xsl:choose>
  255. <xsl:when test="contains($dateStyleValue,'Task.DueDate')">
  256. return utils.getMonths(6,true);
  257. </xsl:when>
  258. <xsl:otherwise>
  259. return utils.getMonths(6,false);
  260. </xsl:otherwise>
  261. </xsl:choose>
  262. </value>
  263. <action>
  264. _THIS_action('filter',$(_THIS_),_THIS_getDateFilterType(),4);
  265. </action>
  266. </item>
  267. </menu>
  268. </item>
  269. <item type="combo">
  270. <!-- menu items are dynamically created by calling the createFunction value -->
  271. <menu id="applicationMenu" displayName="{$folderMenuName}">
  272. <item selected="true">
  273. <name><xts:string id="IDS_FRAG_MENU_LABEL_ALL_APPLICATIONS"/></name>
  274. <value>ALL</value>
  275. <action>_THIS_openApplicationDialog('filter',$(_THIS_),'Task.Application',0);</action>
  276. </item>
  277. <item>
  278. <name><xts:string id="IDS_FRAG_MENU_LABEL_SELECT"/></name>
  279. <value><xts:string id="IDS_FRAG_MENU_LABEL_SELECT"/></value>
  280. <action>_THIS_openApplicationDialog('filter',$(_THIS_),'Task.Application',1);</action>
  281. </item>
  282. </menu>
  283. </item>
  284. </toolbar>
  285. </response>
  286. </xsl:template>
  287. </xsl:stylesheet>