123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 |
- <?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="xts hts">
- <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:variable name="skin"><xsl:value-of select="xtsext:javascriptencode(string(/root/preferences/param[@name='skin']))"/></xsl:variable>
-
- <xsl:template match="/">
- <hts:script>
- //register ps dojo library to dojo
- dojo.registerModulePath('com', '../../ps/portal/js/com');
- dojo.require("dijit.Editor");
- dojo.require("com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins");
- var _THIS_dateFrom="";
- var _THIS_dateTo="";
- var _THIS_toggler = new hts_toggler();
- var _THIS_dojoEditor;
-
- //messages used by TablePlugins.js
- var IDS_EMAIL_OPTIONS_BACKGRD = '<xts:string id="IDS_EMAIL_OPTIONS_BACKGRD" encode="javascript"/>';
- var IDS_EMAIL_OPTIONS_BORDER = '<xts:string id="IDS_EMAIL_OPTIONS_BORDER" encode="javascript"/>';
- _THIS_.addEventListener("fragment.load", "_THIS_init");
- _THIS_.parent.addEventListener("cognos.hts.buildNotificationTaskEditor", "_THIS_buildDojoEditor");
- function _THIS_init() {
- //We are running in Planning mode so hide the links.
- if (hts_productMode && hts_productMode.getMode() == hts_productMode.PLANNING) {
- dojo.attr("_THIS_linksDivNot","style",{display:"none"});
- }
- //set the picker to display nothing. this fixes the issue of todays date getting displayed when no deadlines exist
- //also set the correct tab index and the correct label to be read by JAWs screen reader
- var dueDateEle = $('txtDate'+'_THIS_'+'taskOptions_dueDate');
- if (dueDateEle) {
- dijit.setWaiState(dueDateEle,'label','<xts:string id="IDS_FRAG_A11Y_DUE_DATE_LABEL" encode="javascript"/>');
- dueDateEle.value="";
- dueDateEle.tabIndex=11;
- }
-
- var uiStyle = new CUIStyle("CList_li", "CList_over", "CList_selected", "", null);
- // global cList
- cListNotifTask = new CList("myCList",false, "CList_ul",uiStyle);
- if (!_THIS_dojoEditor) {
- _THIS_dojoEditor = new DOJOEditor("_THIS__notificationMessageValue",{height: '150px' ,extraPlugins:['|',{name: 'com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins', command: 'insertTableWithValidation', label:'<xts:string id="IDS_FRAG_TASKVIEWER_DOJO_INSERT_TABLE" encode="javascript"/>'},{name: 'com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins', command: 'modifyTableWithValidation', label:'<xts:string id="IDS_FRAG_TASKVIEWER_DOJO_MODIFY_TABLE" encode="javascript"/>'}]});
- } else {
- //just incase
- _THIS_dojoEditor.destroy();
- }
- }
- function _THIS_buildDojoEditor() {
- _THIS_dojoEditor.create();
- setTimeout(function(){var input = dojo.byId('_THIS__potentialOwners_display');input.focus();}, 500);
-
- var iframe = dojo.byId('_THIS__notificationMessageValue_iframe');
- iframe.tabIndex=5;
-
- if (dojo.isMoz) {
-
- var contentDoc =_THIS_getEditorIFrameDocument();
- dojo.connect(contentDoc, 'onkeydown',_THIS_editor_handleTabKeyDown);
- }
- }
-
- function _THIS_getEditorIFrameDocument() {
- var iframe = dojo.byId('_THIS__notificationMessageValue_iframe');
- var contentDoc =(iframe.contentWindow || iframe.contentDocument);
- if (contentDoc.document) {
- contentDoc=contentDoc.document;
- }
-
- return contentDoc;
- }
- /* HACK alert!! There is a firefox/dojo bug which means that you cannot tab out of the editor and therefore cannot
- * access the ui below the editor using the keyboard. Attach a key listener to the editor iframe
- * and capture tab keys. When tab is pressed focus the element with the next tab index.
- */
- function _THIS_editor_handleTabKeyDown(e) {
- var keyCode = _THIS_getKeyCode(e);
- var iframe = dojo.byId('_THIS__notificationMessageValue_iframe');
- if(keyCode == dojo.keys.TAB && !e.shiftKey && !e.ctrlKey && !e.altKey && iframe){
- //iframe.focus(); //does not work
- //get the control with the next tabindex
- var nextTabIndex = iframe.tabIndex + 1;
- var done=false;
-
- //get all pform controls with a tabIndex
- dojo.query('#_THIS_pform [tabIndex]').forEach(function(ele){
- if (ele.id && ele.tabIndex==nextTabIndex && !done) {
- ele.focus();
- done=true;
- }
- });
- dojo.stopEvent(e);
- }
- }
-
- function _THIS_getKeyCode(e) {
- var keynum;
-
- if(window.event) // IE
- {
- keynum = e.keyCode;
- }
- else if(e.which) // Netscape/Firefox/Opera
- {
- keynum = e.which;
- }
-
- return keynum;
- }
- function _THIS_handleDeleteKeyDown(e) {
-
- //delete key
- var keynum;
- var keychar;
-
- if(window.event) // IE
- {
- keynum = e.keyCode;
- }
- else if(e.which) // Netscape/Firefox/Opera
- {
- keynum = e.which;
- }
- if(keynum == 46) {
- cListNotifTask.removeSelected();
- }
- return true;
- }
- function _THIS_save() {
- var links = new HTSLinks(cListNotifTask,$('linksDivNot'));
- document.getElementById('_THIS__linksList_value').value = links.getValues();
- document.getElementById('_THIS__linksList_display').value = links.getDisplayValues();
- if (hts_createNotificationTask(_THIS_,'_THIS_')) {
- _THIS_done();
- //reload the task list to show new task if need be
- var _THIS_utils = new hts_utils(_THIS_);
- _THIS_utils.refreshCurrentTab('poolTaskList');
- }
- }
- function _THIS_done() {
- _THIS_dojoEditor.destroy();
- _THIS_.raiseEvent('cognos.hts.hideAll');
- }
-
- function _THIS_cancel() {
- // check if user has done some editing and warn before cancel
- var editedInfo = (document.getElementById('_THIS__subject_value').value );
- editedInfo +=(document.getElementById('_THIS__potentialOwners_value').value );
- editedInfo +=(document.getElementById('_THIS__stakeHolders_value').value );
- editedInfo += _THIS_dojoEditor.getValue();
- var links = new HTSLinks(cListNotifTask,$('linksDivNot'));
- editedInfo += links.getValues();
-
- var promptYes ;
- if(editedInfo.length>0){
- promptYes = confirm( '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_TASK_MODIFIED" encode="javascript"/>' );
- if(!promptYes){
- return false;
- }else {
- // Lets manually clean each item on the task page
-
- document.getElementById('_THIS__subject_value').value = '';
- hts_removeAllLinks(cListNotifTask);
-
- var currentUser = new HTSHumanRole("_THIS__stakeHolders");
- currentUser.clear();
-
- var potUser = new HTSHumanRole("_THIS__potentialOwners");
- potUser.clear();
- }
- }
- _THIS_dojoEditor.destroy();
- _THIS_.raiseEvent('cognos.hts.displayPreviousDiv');
- }
-
- function _THIS_checkRecordReadReceiptCheckbox()
- {
- var recordReadReceiptCheckbox = document.getElementById('_THIS_recordReadReceipt');
- var notificationCheckbox = document.getElementById('_THIS_notification');
-
- if(notificationCheckbox.checked==true)
- {
- recordReadReceiptCheckbox.checked = true;
- }
- }
-
- function _THIS_uncheckNotificationCheckbox()
- {
- var recordReadReceiptCheckbox = document.getElementById('_THIS_recordReadReceipt');
- var notificationCheckbox = document.getElementById('_THIS_notification');
-
- if(recordReadReceiptCheckbox.checked==false)
- {
- notificationCheckbox.checked = false;
- }
- }
-
- _THIS_monitor = function (evt) {
- if (evt.eventPhase == evt.AT_TARGET) //only want to execute this on downstream events
- return;
- var sendAndClose = $('_THIS_btnSendAndClose');
- if (sendAndClose){
- if (evt.name == "fragment.retrieve.before"){
- sendAndClose.disabled = true;
- } else {
- sendAndClose.disabled = false;
- }
- }
- }
- _THIS_.parent.addEventListener("fragment.retrieve.before", "_THIS_monitor", true);
- _THIS_.parent.addEventListener("fragment.retrieve.after", "_THIS_monitor", true);
- //declare the error messages
- var _THIS_msg_array = new Array();
- _THIS_msg_array['MSG_ERR_INCOMPATIBLE_DATES'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INCOMPATIBLE_DATES" encode="javascript"/>';
- _THIS_msg_array['MSG_ERR_INVALID_END_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INVALID_END_DATE" encode="javascript"/>';
- _THIS_msg_array['MSG_ERR_INVALID_START_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INVALID_START_DATE" encode="javascript"/>';
- _THIS_msg_array['MSG_ERR_INVALID_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INVALID_DATE" encode="javascript"/>';
- _THIS_msg_array['MSG_ERR_INVALID_ASSIGNMENT'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INVALID_ASSIGNMENT" encode="javascript"/>';
- _THIS_msg_array['MSG_ERR_EQUAL_DATES'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_EQUAL_DATES" encode="javascript"/>';
- //_THIS_msg_array['MSG_ERR_START_CANNOT_USE_CURRENT_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_START_CANNOT_USE_CURRENT_DATE" encode="javascript"/>';
- _THIS_msg_array['MSG_ERR_COMPLETE_CANNOT_USE_CURRENT_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_COMPLETE_CANNOT_USE_CURRENT_DATE" encode="javascript"/>';
- _THIS_msg_array['MSG_ERR_NOTIFICATION_RECIPIENT_NOT_SELECTED'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_NOTIFICATION_RECIPIENT_NOT_SELECTED" encode="javascript"/>';
- _THIS_msg_array['MSG_ERR_NOTIFICATION_DATE_INVALID'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_NOTIFICATION_DATE_INVALID" encode="javascript"/>';
- _THIS_msg_array['MSG_ERR_NOTIFICATION_DATE_IN_PAST'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_NOTIFICATION_DATE_IN_PAST" encode="javascript"/>';
-
- try{
- if (typeof oCV=="undefined") {
- oCV=window;
- }
- } catch(e) {
- oCV=window;
- }
- var G_PM_THIS_ = new C_PromptManager();
- oCV.preProcessControlArray=[];
- p_sSkinFolder=_F_Config.webContent+"/skins/<xsl:value-of select='$skin'/>";
- p_sWebContentURI=_F_Config.webContent;
- oCV.gbPromptRequestSubmitted=false;
- oCV.bCanFinish=true;oCV.bNextPage=true;
- oCV.pageNavigationObserverArray=[];
- oCV.rangeObserverArray=[];
- oCV.multipleObserverArray=[];
- oCV.datePickerObserverArray=[];
- oCV.hasPromptKeyDown=false;
- </hts:script>
- <xsl:call-template name="renderOptions"/>
- </xsl:template>
- <xsl:template name="renderOptions">
- <form name="_THIS_pform" id="_THIS_pform" method="post" action="_THIS?/THIS_">
- <!--render the button bar -->
- <hts:section id="_THIS_footer" class="taskDetailsButtonBar">
- <hts:rowset>
- <hts:row>
- <hts:button id="_THIS_btnSendAndClose" onKeyPress="if (_hts_getKeyCode(event) == 13) _THIS_save();" onclick="_THIS_save();" tabindex="12">
- <hts:value><xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_BUTTON_SEND"/></hts:value>
- </hts:button>
- <hts:button id="_THIS_btnCancel" onKeyPress="if (_hts_getKeyCode(event) == 13) _THIS_cancel();" onclick="_THIS_cancel();" tabindex="13">
- <hts:value><xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_BUTTON_CANCEL"/></hts:value>
- </hts:button>
- </hts:row>
- </hts:rowset>
- </hts:section>
- <!-- Text fields and date fields -->
- <hts:section format="select-dialog" style="width:100%">
- <hts:actionlist>
- <hts:action>
- <hts:rowset>
- <hts:row format="select">
- <xsl:variable name="labelName">
- <xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_LABEL_TO"/>
- </xsl:variable>
- <hts:action style="width:20px">
- <label for="_THIS__potentialOwners_display"><hts:text><xsl:value-of select="$labelName"/></hts:text></label>
- </hts:action>
- <hts:action>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="0px" width="20px"/>
- </hts:action>
- <hts:action>
- <hts:field size="100" type="text" aria-readonly="true" alt="$notification_recipient_to_field" name="_THIS__potentialOwners_display" id="_THIS__potentialOwners_display" readonly="true" tabindex="1"/>
- <hts:hidden id="_THIS__potentialOwners_value" name="_THIS__potentialOwners_value"/>
- </hts:action>
- </hts:row>
- <hts:row>
- <xsl:variable name="labelName">
- <xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_LABEL_CC"/>
- </xsl:variable>
- <hts:action style="width:20px">
- <label for="_THIS__stakeHolders_display"><hts:text><xsl:value-of select="$labelName"/></hts:text></label>
- </hts:action>
- <hts:action>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="0px" width="20px"/>
- </hts:action>
- <hts:action>
- <hts:field size="100" type="text" aria-readonly="true" alt="$notification_recipient_cc_field" name="_THIS__stakeHolders_display" id="_THIS__stakeHolders_display" readonly="true" tabindex="2"/>
- <hts:hidden id="_THIS__stakeHolders_value" name="_THIS__stakeHolders_value"/>
- </hts:action>
- </hts:row>
- <hts:row>
- <hts:div colspan="3" style="padding-bottom:4px;width:100%;text-align:right">
- <hts:link tabindex="3" id="_THIS_AddReceipientLink" onKeyPress="if (_hts_getKeyCode(event) == 13) hts_selectRecipients("",_THIS_msg_array,'_THIS_'+'_stakeHolders','_THIS_'+'_potentialOwners');" onclick="hts_selectRecipients("",_THIS_msg_array,'_THIS_'+'_stakeHolders','_THIS_'+'_potentialOwners');" href="#"><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_ADD_RECIPIENTS"/></hts:link>
- </hts:div>
- <hts:action>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="0px" width="300px"/>
- </hts:action>
- </hts:row>
- <hts:row format="select">
- <hts:action style="width:40px">
- <label for="_THIS__subject_value"><hts:text><xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_LABEL_SUBJECT"/></hts:text></label>
- </hts:action>
- <hts:action>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="0px" width="5px"/>
- </hts:action>
- <hts:action colspan="2">
- <hts:field size="150" tabindex="4" type="text" alt="$subject_input_field" name="_THIS__subject_value" id="_THIS__subject_value"/>
- </hts:action>
- </hts:row>
- </hts:rowset>
- </hts:action>
- </hts:actionlist>
- <!-- Message with link -->
- <hts:actionlist>
- <hts:action>
- <label for="_THIS__notificationMessageValue_iframe"><xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_LABEL_MESSAGE"/></label>
- </hts:action>
- </hts:actionlist>
- <hts:div>
- <xsl:attribute name="id">_THIS__notificationMessageValue</xsl:attribute>
- <xsl:attribute name="style">margin-bottom:3px;width:100%</xsl:attribute>
- <!--xsl:attribute name="dojoType">dijit.Editor</xsl:attribute-->
- </hts:div>
- <hts:hidden id="_THIS__notificationMessageTextValue" name="_THIS__notificationMessageTextValue"/>
- <hts:div id="_THIS_linksDivNot">
- <hts:div id="linksDivNot" class="htsLinkArea" onkeydown="_THIS_handleDeleteKeyDown(event)"/>
- <hts:hidden id="_THIS__linksList_value" name="_THIS__linksList_value"/>
- <hts:hidden id="_THIS__linksList_display" name="_THIS__linksList_display"/>
- <div align="right">
- <hts:link tabindex="6" id="_THIS__removeLinks" onclick="hts_removeLinks(cListNotifTask, '_THIS__removeLinks');" href="#">
- <xts:string id="IDS_FRAG_TASKVIEWER_LABEL_REMOVE_LINKS"/>
- </hts:link>
- <hts:link tabindex="7" id="_THIS__addLinks" onclick="hts_selectLinks(cListNotifTask,'linksDivNot', '_THIS__addLinks', 6);" href="#">
- <xts:string id="IDS_FRAG_TASKVIEWER_LABEL_ADD_LINKS"/>
- </hts:link>
- </div>
- </hts:div>
- <!-- Advanced collapse area -->
- <hts:dynamicexpandcontrol name="_THIS_taskOptions_advanced" tabindex="8">
- <hts:text><xts:string id="IDS_FRAG_TASKVIEWER_SUBSCRIPTION_LABEL_ADVANCED"/></hts:text>
- <hts:dynamicarea>
- <hts:div class="cogstyle-hts-subscription-div-border" id="_THIS_taskOptions_advanced" name="_THIS_taskOptions_advanced">
- <hts:actionlist>
- <hts:action>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="12px"/>
- </hts:action>
- <hts:action>
- <hts:text><xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_LABEL_OPTIONS"/></hts:text>
- <hts:actionlist>
- <hts:action>
- <hts:checkbox id="_THIS_recordReadReceipt" onclick="_THIS_uncheckNotificationCheckbox()" tabindex="9">
- <hts:value>RECORD_READ_RECEIPT</hts:value>
- <hts:text><xts:string id="IDS_FRAG_TASKVIEWER_NOTIFICATIONTASK_LABEL_RECORD_READ_RECEIPT"/></hts:text>
- </hts:checkbox>
- <hts:checkbox id="_THIS_notification" onclick="_THIS_checkRecordReadReceiptCheckbox();" tabindex="10">
- <hts:value>STATE_CHANGE</hts:value>
- <hts:text><xts:string id="IDS_FRAG_TASKVIEWER_SUBSCRIPTION_LABEL_NOTIFY_NOT_READ"/></hts:text>
- </hts:checkbox>
- <xsl:variable name="dueDateAriaLabel">
- <xts:string id="IDS_FRAG_TASKVIEWER_SUBSCRIPTION_LABEL_NOTIFY_NOT_READ"/>
- </xsl:variable>
- <div aria-label="{$dueDateAriaLabel}">
- <hts:actionlist>
- <hts:action>
- <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="15px"/>
- </hts:action>
- <hts:action>
- <hts:section format="select-dialog" id="selectDate_THIS_taskOptions_dueDate">
- <hts:script>
- var _THIS_dueDateId = "_THIS_taskOptions_dueDate";
- hts_clearDatePickersIframe(_THIS_dueDateId);
- genSelectDateHTML({formName:"_THIS_pform",parameterName:"_THIS_taskOptions_dueDate",submitType:"",prmtDefaultDate:_THIS_dateTo,defaultValue:_THIS_dateTo,startOfWeek:"Sunday",calendar:"Gregorian",selectUI:"editBox",selectDateUI:"editBox",inputOrder:"YMD",firstDate:hts_getCurrentDate(),lastDate:"",dateTime:0,initialState:RANGE_NO_VALUE,required:false,suppressDisabled:true,hideAdornments:false,suppressExtraPromptNames:false,multi:false,range:false,style:"",selectDateEditBoxStyle:"",selectDateYearsStyle:"",selectDateMonthsStyle:"",selectDateDaysOfWeekStyle:"",selectDateDaysStyle:"",CVId:"",id:_THIS_dueDateId});
- </hts:script>
- </hts:section>
- </hts:action>
- </hts:actionlist>
- </div>
- </hts:action>
- </hts:actionlist>
- </hts:action>
- </hts:actionlist>
- </hts:div>
- </hts:dynamicarea>
- </hts:dynamicexpandcontrol>
- </hts:section>
- </form>
- </xsl:template>
- </xsl:stylesheet>
|