_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('' + 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;
}