//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 = ''; var IDS_EMAIL_OPTIONS_BORDER = ''; _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',''); 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:''},{name: 'com.ibm.cognos.ps.dojo.editor.plugins.TablePlugins', command: 'modifyTableWithValidation', label:''}]}); } 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( '' ); 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'] = ''; _THIS_msg_array['MSG_ERR_INVALID_END_DATE'] = ''; _THIS_msg_array['MSG_ERR_INVALID_START_DATE'] = ''; _THIS_msg_array['MSG_ERR_INVALID_DATE'] = ''; _THIS_msg_array['MSG_ERR_INVALID_ASSIGNMENT'] = ''; _THIS_msg_array['MSG_ERR_EQUAL_DATES'] = ''; //_THIS_msg_array['MSG_ERR_START_CANNOT_USE_CURRENT_DATE'] = ''; _THIS_msg_array['MSG_ERR_COMPLETE_CANNOT_USE_CURRENT_DATE'] = ''; _THIS_msg_array['MSG_ERR_NOTIFICATION_RECIPIENT_NOT_SELECTED'] = ''; _THIS_msg_array['MSG_ERR_NOTIFICATION_DATE_INVALID'] = ''; _THIS_msg_array['MSG_ERR_NOTIFICATION_DATE_IN_PAST'] = ''; 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/"; 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;
_THIS__notificationMessageValue margin-bottom:3px;width:100%
RECORD_READ_RECEIPT STATE_CHANGE
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});