123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <?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/" xmlns:hts="http://developer.cognos.com/myinbox/common/hts_ui" exclude-result-prefixes="xtsext xts hts">
- <xsl:import href="../../common/task-tooltip.xslt"/>
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:variable name="notification_recipient_to_field">
- <xts:string id="IDS_FRAG_TASKVIEWER_LABEL_NOTIFICAION_RECIPIENT_TO_ALT_TXT"/>
- </xsl:variable>
- <xsl:variable name="notification_recipient_cc_field">
- <xts:string id="IDS_FRAG_TASKVIEWER_LABEL_NOTIFICAION_RECIPIENT_CC_ALT_TXT"/>
- </xsl:variable>
- <xsl:variable name="subject_input_field">
- <xts:string id="IDS_FRAG_TASKVIEWER_LABEL_SUBJECT_ALT_TXT"/>
- </xsl:variable>
- <xsl:template match="/">
- <xsl:apply-templates select="/" mode="common"/>
- <hts:script type="text/javascript">
- _THIS_.addEventListener("fragment.load", "_THIS_init");
- function _THIS_init() {
- _THIS_.parent.addEventListener('cognos.hts.notification_info', '_THIS_handleTaskInfoEvent', false);
- //the message has already been set so just show the info pane
- _THIS_.raiseEvent('cognos.hts.hideAll');
- }
-
- function _THIS_handleTaskInfoEvent(evt)
- {
- if (!evt.reflected) {
- var taskInfo = evt.payload;
- if (taskInfo!=null) {
- try {
- //set the localized alt and title attributes
- var img = dojo.byId('_THIS_taskImage');
- var srcPath = "_THIS?frag-resource=${0}/THIS_";
- var src = dojo.string.substitute(srcPath,["fragments/common/images/space.gif"]);
- var alt = _THIS_getLocalisedTaskTooltip(taskInfo.presentationName);
- var title = alt;
-
- //update the image src
- if (taskInfo.taskIconPath && taskInfo.taskIconPath != '') {
- src = dojo.string.substitute(srcPath,[escape(taskInfo.taskIconPath)]);
- } else {
- if (taskInfo.taskType == 'TASK') {
- src = dojo.string.substitute(srcPath,["fragments/myinbox/images/icon_task.gif"]);
- } else if (taskInfo.taskType == 'NOTIFICATION') {
- src = dojo.string.substitute(srcPath,["fragments/myinbox/images/icon_notification.gif"]);
- }
- }
- dojo.attr(img, {src: src,alt: alt,title: title,style: {cursor: "default"}});
-
- var subjectSpan = $("_THIS_subject");
- hts_setText(subjectSpan,taskInfo.presentationSubject);
-
- var to = new HTSHumanRole("_THIS_TO");
- to.parse(taskInfo.formattedNotificationRecipients);
- to.commit();
-
- var cc = new HTSHumanRole("_THIS_CC");
- cc.parse(taskInfo.formattedTaskStakeholders);
- cc.commit();
- hts_setNotificationDeadline(taskInfo,$(_THIS_DEADLINE));
- } catch(ex) {
- alert('<xts:string id="IDS_FRAG_ERROR_MESSAGE" encode="javascript"/>' + ex);
- }
- }
- }
- //only react once to this event. the booklet sends it twice, once for each tab in the booklet.
- // this needs to be sorted out properly i.e. a change to the booklet code
- //The default distributor of notification details fragment fires this event and the
- //event is also fired through normal event processing, where this fragment
- //has registered as interested in this event.
- evt.reflected=true;
- }
-
- </hts:script>
- <!-- Text fields and date fields -->
- <hts:section format="select-dialog" style="width:100%;">
- <table>
- <tbody>
- <tr>
- <td>
- <img id="_THIS_taskImage" width="16" src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_"/>
- </td>
- <td>
- <span id="_THIS_subject" class="subject_line">
- <xsl:value-of select="/root/input[@name='dep']/queryResponse/*[local-name()='getTaskInfoResponse']/*[local-name()='task']/*[local-name()='presentationSubject']"/>
- </span>
- </td>
- </tr>
- </tbody>
- </table>
- <hts:rowset >
- <hts:row format="select">
- <hts:img colspan="3" src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="5px"/>
- </hts:row>
- <hts:row format="select">
- <hts:span>
- <hts:value>
- <xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_LABEL_TO"/>
- </hts:value>
- </hts:span>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="5px"/>
- <hts:span id="_THIS_TO_display"/>
- </hts:row>
- <hts:row>
- <hts:img colspan="3" src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="5px"/>
- </hts:row>
- <hts:row>
- <hts:span>
- <hts:value>
- <xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_LABEL_CC"/>
- </hts:value>
- </hts:span>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="5px"/>
- <hts:span id="_THIS_CC_display"/>
- </hts:row>
- <hts:row>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="5px"/>
- </hts:row>
- <hts:row>
- <hts:span>
- <hts:value>
- <xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_LABEL_DEADLINE"/>
- </hts:value>
- </hts:span>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="5px"/>
- <hts:span id="_THIS_DEADLINE"/>
- </hts:row>
- </hts:rowset>
- </hts:section>
- </xsl:template>
- </xsl:stylesheet>
|