toolbar.xslt 16 KB

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