set-priority.xslt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/">
  9. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
  10. <xsl:template match="/" mode="common">
  11. <script type="text/javascript">
  12. function _THIS_showPriorityDialog(tProperty,value) {
  13. var dlg = new ui_dialog(this.fragID + "editProperties", PFM.JS.IDS_JS_DETAILS, ui_dialog.style.BTN_OKCANCEL | ui_dialog.style.CENTER | ui_dialog.style.RESIZABLE, -1, -1, 500, 300);
  14. dlg.processCommand = function(cmd) {
  15. if ((cmd == ui_dialog.button.OK)) {
  16. var priorityValue = hts_getSelectedComboValue(dlg.dlg,&quot;_THIS_priority&quot;);
  17. _THIS_.retrieve("action=setPriority&amp;value=" + priorityValue ,null,true);
  18. _THIS_.transientUpdate('cognosTaskChanged',new Date().toUTCString());
  19. }
  20. this.destroy();
  21. return true;
  22. };
  23. if (tProperty != null || tProperty != undefined) {
  24. var markup = "&lt;table border=\&quot;0\&quot; cellspacing=\&quot;0\&quot; cellpadding=\&quot;4\&quot;&gt;";
  25. markup += "&lt;tr&gt;";
  26. markup += "&lt;td valign=\&quot;top\&quot;&gt;";
  27. markup += "&lt;select tabindex=\&quot;0\&quot; class=\&quot;taskOptionsSelectText\&quot; name=\&quot;_THIS_priority\&quot; id=\&quot;_THIS_priority\&quot;&gt;";
  28. markup += _THIS_createOption(5,&quot;<xts:string id="IDS_FRAG_PRIORITY_LABEL_LOW" encode="javascript"/>&quot;,value);
  29. markup += _THIS_createOption(3,&quot;<xts:string id="IDS_FRAG_PRIORITY_LABEL_MEDIUM" encode="javascript"/>&quot;,value);
  30. markup += _THIS_createOption(1,&quot;<xts:string id="IDS_FRAG_PRIORITY_LABEL_HIGH" encode="javascript"/>&quot;,value);
  31. markup += "&lt;/select&gt;";
  32. markup += "&lt;/td&gt;";
  33. markup += "&lt;/tr&gt;";
  34. markup += "&lt;/table&gt;";
  35. dlg.setContent(markup);
  36. dlg.show();
  37. }
  38. }
  39. function _THIS_createOption(cboValue, cboLabel, selectedValue) {
  40. comboStr = "&lt;option value=\&quot;"+cboValue+"\&quot;";
  41. if (selectedValue==cboValue) {
  42. comboStr+=" selected=\&quot;true\&quot;";
  43. }
  44. comboStr += "&gt;"+cboLabel;
  45. comboStr += "&lt;/option&gt;"
  46. return comboStr;
  47. }
  48. </script>
  49. </xsl:template>
  50. </xsl:stylesheet>