123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: HTS
- (C) Copyright IBM Corp. 2005, 2010
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/">
- <xsl:import href="../../common/render-outputs.xslt"/>
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:variable name="btn_value">
- <xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_BUTTON_ACKNOWLEDGE"/>
- </xsl:variable>
- <xsl:template match="/">
- <xsl:variable name="ackText">
- <xsl:choose>
- <xsl:when test="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='acknowledgeText']">
- <xsl:value-of select="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='acknowledgeText']"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_FRAG_DEFAULT_ACKNOWLEDGE_TEXT"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="taskid" select="/root/interactions/param[@name='taskid']"/>
- <script type="text/javascript">
- _THIS_.addEventListener('fragment.load','_THIS_init', false);
- _THIS_.addEventListener('fragment.unload','_THIS_unload', false);
- function _THIS_init(evt) {
- <!-- Do not include if not needed. -->
- <xsl:if test="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='recordReadReceipt'] = 'true'">
- dojo.require("dijit.form.Button");
- </xsl:if>
- <xsl:if test="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='recordReadReceipt'] = 'true'">
- //check if we have the button
- var btn = dijit.byId('_THIS_buttonComplete');
- //create a new one, destroy the old one first
- if (btn) {
- btn.destroy();
- }
- //create a dojo button
- var btn = hts_createButton('<xsl:value-of select="xtsext:javascriptencode(string($ackText))"/>',_THIS_completeNotification,'_THIS_buttonComplete');
- </xsl:if>
- //Distribute to children. Pass it down further.
- //Parent is explicitly passing the event here,
- //so cascade it further down.
- var _THIS_distList = new Array();
- var _THIS_children = _THIS_.getChildren();
- var i, l = _THIS_children.length;
- for (i = 0; i < l; i++) {
- _THIS_distList[i] = _THIS_children[i].id;
- }
- _F_Event.distribute(_THIS_distList,evt);
- }
- /**
- * Just pass it on.
- */
- function _THIS_unload(evt){
- var _THIS_distList = new Array();
- var _THIS_children = _THIS_.getChildren();
- var i, l = _THIS_children.length;
- for (i = 0; i < l; i++) {
- _THIS_distList[i] = _THIS_children[i].id;
- }
- //do not bubble.
- evt.bubbles = false;
- _F_Event.distribute(_THIS_distList,evt);
- }
- <xsl:if test="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='recordReadReceipt'] = 'true'">
- //this function is called when the acknowledge button is pressed
- function _THIS_completeNotification(btn) {
- var acknowledgeReadReceipt = dijit.byId('_THIS_buttonComplete');
- if (acknowledgeReadReceipt){
- acknowledgeReadReceipt.attr("disabled",true);
- }
- //_THIS_.addEventListener("fragment.load", "_THIS_init");
- var params='action=completeNotification&taskid=<xsl:value-of select="$taskid"/>';
- _THIS_.retrieve(params,null,true);
- //reload the task list to show new task if need be
- var _THIS_utils = new hts_utils(_THIS_);
- _THIS_utils.refreshCurrentTab('poolTaskList');
- }
- </xsl:if>
- </script>
- <form name="_THIS_form" action="_THIS?/THIS_" method="POST">
- <xsl:if test="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='recordReadReceipt'] = 'true'">
- <div id="_THIS_buttonComplete"></div>
- </xsl:if>
- </form>
- <xsl:if test="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='taskLinksList' or local-name()='linksList']">
- <xsl:call-template name="renderTaskLinks"/>
- </xsl:if>
- <!--div tabindex="0" class="viewer" id="_THIS_viewercontent">_THIS?frag-subfragment=viewer/THIS_</div-->
- </xsl:template>
- <xsl:template name="renderTaskLinks">
- <xsl:variable name="description">
- <xsl:value-of select="./taskLink/display"/>
- </xsl:variable>
- <xsl:call-template name="renderUI">
- <xsl:with-param name="path" select="/root/input/queryResponse/*[local-name()='manualTask']/*[local-name()='preview']/*[local-name()='tsePreview']/*[local-name()='agentPreview']"/>
- <xsl:with-param name="channel" select="'notifcationViewer'"/>
- </xsl:call-template>
- </xsl:template>
- </xsl:stylesheet>
|