render-options.xslt 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: HTS
  5. (C) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xts="http://developer.cognos.com/schemas/xts/" xmlns:hts="http://developer.cognos.com/myinbox/common/hts_ui" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xts hts xtsext">
  9. <xsl:import href="../../common/task-tooltip.xslt"/>
  10. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
  11. <xsl:variable name="creator_input_field"><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_CREATOR_ALT_TXT"/></xsl:variable>
  12. <xsl:variable name="assignedTo_input_field"><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_ASSIGNED_TO_ALT_TXT"/></xsl:variable>
  13. <xsl:variable name="potentialOwners_input_field"><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_POTENTIAL_OWNERS_ALT_TXT"/></xsl:variable>
  14. <xsl:variable name="stakeholder_input_field"><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_STAKEHOLDERS_ALT_TXT"/></xsl:variable>
  15. <xsl:variable name="skin"><xsl:value-of select="xtsext:javascriptencode(string(/root/preferences/param[@name='skin']))"/></xsl:variable>
  16. <xsl:variable name="btnSaveTooltip"><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_SAVE"/></xsl:variable>
  17. <xsl:variable name="btnRevertTooltip"><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_REVERT"/></xsl:variable>
  18. <xsl:variable name="btnClaimTooltip"><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_CLAIM"/></xsl:variable>
  19. <xsl:variable name="btnRemoveMeTooltip"><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_REMOVE_ME"/></xsl:variable>
  20. <xsl:variable name="btnCompleteTooltip"><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_COMPLETE"/></xsl:variable>
  21. <xsl:variable name="btnCancelTooltip"><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_CANCEL"/></xsl:variable>
  22. <xsl:template match="/">
  23. <xsl:apply-templates select="/" mode="common"/>
  24. <hts:script>
  25. dojo.require("dojo.string");
  26. var _THIS_dateFrom="";
  27. var _THIS_dateTo="";
  28. var _THIS_toggler = new hts_toggler();
  29. var _THIS_changedParams;
  30. var _THIS_utils = new hts_utils();
  31. var _THIS_menu_strings = new Object();
  32. var _THIS_revert_taskInfo_evt;
  33. _THIS_menu_strings["CREATED"] = '<xts:string id="IDS_FRAG_TASK_STATUS_CREATED" encode="javascript"/>';
  34. _THIS_menu_strings["READY"] = '<xts:string id="IDS_FRAG_TASK_STATUS_RESERVED" encode="javascript"/>';
  35. _THIS_menu_strings["RESERVED"] = '<xts:string id="IDS_FRAG_TASK_STATUS_RESERVED" encode="javascript"/>';
  36. _THIS_menu_strings["IN_PROGRESS"] = '<xts:string id="IDS_FRAG_TASK_STATUS_IN_PROGRESS" encode="javascript"/>';
  37. _THIS_menu_strings["SUSPENDED"] = '<xts:string id="IDS_FRAG_TASK_STATUS_SUSPENDED" encode="javascript"/>';
  38. _THIS_menu_strings["COMPLETED"] = '<xts:string id="IDS_FRAG_TASK_STATUS_COMPLETED" encode="javascript"/>';
  39. _THIS_menu_strings["FAILED"] = '<xts:string id="IDS_FRAG_TASK_STATUS_FAILED" encode="javascript"/>';
  40. _THIS_menu_strings["ERROR"] = '<xts:string id="IDS_FRAG_TASK_STATUS_ERROR" encode="javascript"/>';
  41. _THIS_menu_strings["EXITED"] = '<xts:string id="IDS_FRAG_TASK_STATUS_CANCELLED" encode="javascript"/>';
  42. _THIS_menu_strings["OBSOLETE"] = '<xts:string id="IDS_FRAG_TASK_STATUS_CANCELLED" encode="javascript"/>';
  43. //Default all to true
  44. var _THIS_properties = new Array();
  45. _THIS_properties.push({name:"showSubject",value:'true'});
  46. _THIS_properties.push({name:"showCreator",value:'true'});
  47. _THIS_properties.push({name:"showOwner",value:'true'});
  48. _THIS_properties.push({name:"allowOwnerEdits",value:'true'});
  49. _THIS_properties.push({name:"showHumanRoles",value:'true'});
  50. _THIS_properties.push({name:"allowHumaneRoleEdits",value:'true'});
  51. _THIS_properties.push({name:"showDueDate",value:'true'});
  52. _THIS_properties.push({name:"showStartBy",value:'true'});
  53. _THIS_properties.push({name:"showStatus",value:'true'});
  54. _THIS_properties.push({name:"showPriority",value:'true'});
  55. _THIS_properties.push({name:"showGenericComplete",value:'false'});
  56. _THIS_.addEventListener("fragment.load", "_THIS_init");
  57. function _THIS_init() {
  58. //HACK alert, shouldn't have to do this but the booklet subfragment does not send the event so we need to add it to the parent
  59. _THIS_.parent.addEventListener('cognos.hts.task_info', '_THIS_handleTaskInfoEvent', false);
  60. _THIS_.parent.addEventListener('cognos.hts.changed_subscriptions', '_THIS_handleChangedSubscriptions', false);
  61. //the message has already been set so just show the info pane
  62. _THIS_.raiseEvent('cognos.hts.hideAll');
  63. }
  64. function _THIS_handleChangedSubscriptions(evt) {
  65. _THIS_changedParams = evt.payload;
  66. }
  67. function _THIS_handleTaskInfoEvent(evt) {
  68. if (!evt.reflected)
  69. {
  70. var taskStatus="";
  71. if (evt.payload!=null)
  72. {
  73. var taskInfo = evt.payload;
  74. //keep a ref. of original event, for revert
  75. if(_THIS_revert_taskInfo_evt==null) {
  76. _THIS_revert_taskInfo_evt = evt;
  77. } else if (_THIS_revert_taskInfo_evt.payload.id != taskInfo.payload) {
  78. //is possible that we are now dealing with a different payload.
  79. //If so cache the new evt details for the revert.
  80. _THIS_revert_taskInfo_evt = evt;
  81. }
  82. _THIS_updateUI(taskInfo);
  83. var _THIS_infoButtons = hts_getButtonsInfo(taskInfo);
  84. //check to see whether any buttons should be disabled for current user.
  85. hts_hideButtons($("_THIS_btnCancel"), _THIS_infoButtons.skip == 'false'); //"cancel" is internally mapped to "skip" on the server side
  86. hts_hideButtons($("_THIS_btnCancel_disabled"), _THIS_infoButtons.skip == 'true'); //"cancel" is internally mapped to "skip" on the server side
  87. hts_hideButtons($("_THIS_btnComplete"), _THIS_infoButtons.complete == 'false');
  88. hts_hideButtons($("_THIS_btnComplete_disabled"), _THIS_infoButtons.complete == 'true');
  89. hts_hideButtons($("_THIS_btnSaveAndClose"), _THIS_infoButtons.updateTaskDetails == 'false');
  90. hts_hideButtons($("_THIS_btnSaveAndClose_disabled"), _THIS_infoButtons.updateTaskDetails == 'true');
  91. hts_hideButtons($("_THIS_revertTask_disabled"), 'true');
  92. var userName = '<xsl:value-of select="xtsext:javascriptencode(string(/root/interactions/param[@name='user_name']))"/>';
  93. var taskStatus = taskInfo.status;
  94. if (taskInfo.formattedActualOwner == userName) {
  95. if (taskStatus==undefined || taskStatus=='COMPLETED' || taskStatus=='ERROR' || taskStatus=='EXITED' || taskStatus=='OBSOLETE') {
  96. hts_hideButtons($("_THIS_btnRelease"), true);
  97. hts_hideButtons($("_THIS_btnRelease_disabled"), false);
  98. //disable the save button
  99. //hts_hideButtons($("_THIS_btnSaveAndClose"), true);
  100. //hts_hideButtons($("_THIS_btnSaveAndClose_disabled"), false);
  101. //disable the revert button
  102. hts_hideButtons($("_THIS_revertTask"), true);
  103. hts_hideButtons($("_THIS_revertTask_disabled"), false);
  104. //disable the startdate and due date
  105. hts_disableDatePicker('_THIS_taskOptions_startBy');
  106. hts_disableDatePicker('_THIS_taskOptions_dueDate');
  107. //disable the priority and status select controls
  108. $("_THIS_taskOptions_status").disabled = true;
  109. $("_THIS_taskOptions_priority").disabled = true;
  110. } else {
  111. if (taskStatus=='IN_PROGRESS') {
  112. hts_hideButtons($("_THIS_btnRelease"), true);
  113. hts_hideButtons($("_THIS_btnRelease_disabled"), false);
  114. } else {
  115. hts_hideButtons($("_THIS_btnRelease"), false);
  116. hts_hideButtons($("_THIS_btnRelease_disabled"), true);
  117. }
  118. //enable the save button
  119. //hts_hideButtons($("_THIS_btnSaveAndClose"), false);
  120. //hts_hideButtons($("_THIS_btnSaveAndClose_disabled"), true);
  121. //enable the revert button
  122. hts_hideButtons($("_THIS_revertTask"), false);
  123. hts_hideButtons($("_THIS_revertTask_disabled"), true);
  124. //enable the startdate and due date
  125. if (taskStatus=='IN_PROGRESS') {
  126. //in this special case, disable the startDate
  127. hts_disableDatePicker('_THIS_taskOptions_startBy');
  128. } else {
  129. hts_enableDatePicker('_THIS_taskOptions_startBy');
  130. }
  131. hts_enableDatePicker('_THIS_taskOptions_dueDate');
  132. //enable the priority and status select controls
  133. $("_THIS_taskOptions_status").disabled = false;
  134. $("_THIS_taskOptions_priority").disabled = false;
  135. }
  136. hts_hideButtons($("_THIS_btnClaim"), true);
  137. hts_hideButtons($("_THIS_btnClaim_disabled"), true);
  138. } else {
  139. hts_hideButtons($("_THIS_btnRelease"), true);
  140. hts_hideButtons($("_THIS_btnRelease_disabled"), true);
  141. hts_hideButtons($("_THIS_btnClaim"), _THIS_infoButtons.claim == 'false');
  142. hts_hideButtons($("_THIS_btnClaim_disabled"), _THIS_infoButtons.claim == 'true');
  143. //hts_hideButtons($("_THIS_btnSaveAndClose"), false);
  144. //hts_hideButtons($("_THIS_btnSaveAndClose_disabled"), true);
  145. if (taskStatus==undefined || taskStatus=='COMPLETED' || taskStatus=='ERROR' || taskStatus=='EXITED' || taskStatus=='OBSOLETE') {
  146. //disable the revert button
  147. hts_hideButtons($("_THIS_revertTask"), true);
  148. hts_hideButtons($("_THIS_revertTask_disabled"), false);
  149. //disable the priority and status select controls
  150. $("_THIS_taskOptions_status").disabled = true;
  151. $("_THIS_taskOptions_priority").disabled = true;
  152. //disable the startdate and due date
  153. hts_disableDatePicker('_THIS_taskOptions_startBy');
  154. hts_disableDatePicker('_THIS_taskOptions_dueDate');
  155. } else {
  156. //enable the revert button
  157. hts_hideButtons($("_THIS_revertTask"), false);
  158. hts_hideButtons($("_THIS_revertTask_disabled"), true);
  159. //enable the startdate and due date
  160. if (taskStatus=='IN_PROGRESS') {
  161. //in this special case, disable the startDate
  162. hts_disableDatePicker('_THIS_taskOptions_startBy');
  163. } else {
  164. hts_enableDatePicker('_THIS_taskOptions_startBy');
  165. }
  166. hts_enableDatePicker('_THIS_taskOptions_dueDate');
  167. //enable the priority and status select controls
  168. $("_THIS_taskOptions_status").disabled = false;
  169. $("_THIS_taskOptions_priority").disabled = false;
  170. }
  171. }
  172. var utils = new hts_utils();
  173. var content =$('_THIS__ownerEditDisabled');
  174. utils.setUIState(content,_THIS_infoButtons.delegate == 'false');
  175. hts_hideButtons(content, _THIS_infoButtons.delegate == 'true');
  176. hts_hideButtons($("_THIS__ownerEdit"), _THIS_infoButtons.delegate == 'false');
  177. //show the enabled or disabled potential owners link (add/remove recipients)
  178. var humanRolesDisabled =$('_THIS_humanRolesDisabled');
  179. utils.setUIState(humanRolesDisabled,_THIS_infoButtons.delegate == 'false');
  180. hts_hideButtons(humanRolesDisabled, _THIS_infoButtons.delegate == 'true');
  181. hts_hideButtons($("_THIS_humanRoles"), _THIS_infoButtons.delegate == 'false');
  182. //Hide parts we should not show. This is done here becuase the lines above
  183. //may hide/show parts that user is not allowed to see based on properties
  184. //settings. So we do this last to make sure properties are applied last.
  185. //effing xsltjsonifier doesnt work when theres only one
  186. if(!taskInfo.properties || !taskInfo.properties.length){
  187. //probable only one
  188. var temp = new Array();
  189. if(taskInfo.properties &amp;&amp; !taskInfo.properties.length){
  190. temp.push(taskInfo.properties);
  191. }
  192. taskInfo.properties = temp;
  193. }
  194. dojo.forEach(_THIS_properties, function(node) {
  195. var filtered = dojo.filter(taskInfo.properties, function(item){
  196. return node &amp;&amp; item &amp;&amp; item.property &amp;&amp; item.property.name === node.name;
  197. });
  198. node.value = (filtered &amp;&amp; filtered.length &gt; 0 )?filtered[0].property.value:'true';
  199. var display = node.value==='true'?'':'none';
  200. var visibility = node.value==='true'?'visible':'hidden';
  201. dojo.query('[id^= \"_THIS__'+ node.name +'\"]').style({"display":display,"visibility":visibility});
  202. });
  203. setTimeout(_THIS_setInitialFocus, 200);
  204. }
  205. }
  206. //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
  207. evt.reflected=true;
  208. }
  209. function _THIS_setInitialFocus() {
  210. var input = null;
  211. try {
  212. input = dojo.byId('_THIS_btnSaveAndCloseImage');
  213. if (input.parentNode.parentNode.style.visibility!= 'visible') {
  214. setTimeout(_THIS_setInitialFocus, 200);
  215. }
  216. else {
  217. input.focus();
  218. }
  219. }
  220. catch(exception) {
  221. //swallow it
  222. }
  223. }
  224. function _THIS_save() {
  225. //save the task
  226. if (hts_saveTaskOptions(_THIS_,&apos;_THIS_&apos;) ) {
  227. //if we have changed subscription params do the call.
  228. if (_THIS_changedParams) {
  229. _THIS_.retrieve(_THIS_changedParams,null,true);
  230. }
  231. //the poolTaskList is the subbook that contains the inbox and archive tabs, reload the current tab only
  232. var _THIS_utils = new hts_utils(_THIS_);
  233. _THIS_utils.refreshCurrentTab('poolTaskList');
  234. }
  235. }
  236. function _THIS_revert() {
  237. if(_THIS_revert_taskInfo_evt!=null) {
  238. //call the event handling code with the cached original taskInfo
  239. _THIS_revert_taskInfo_evt.reflected=false;
  240. _THIS_handleTaskInfoEvent(_THIS_revert_taskInfo_evt);
  241. }
  242. }
  243. function _THIS_skip() {
  244. if (hts_skipTask(_THIS_,&apos;_THIS_&apos;)) {
  245. //reload the task viewer to reflect the changes
  246. var _THIS_utils = new hts_utils(_THIS_);
  247. _THIS_utils.refreshCurrentTab('poolTaskList');
  248. }
  249. }
  250. function _THIS_claim() {
  251. if (hts_claimTask(_THIS_,&apos;_THIS_&apos;)) {
  252. //reload the task viewer to reflect the changes
  253. var _THIS_utils = new hts_utils(_THIS_);
  254. _THIS_utils.refreshCurrentTab('poolTaskList');
  255. }
  256. }
  257. function _THIS_complete() {
  258. if (hts_complete(_THIS_,&apos;_THIS_&apos;)) {
  259. //reload the task viewer to reflect the changes
  260. var _THIS_utils = new hts_utils(_THIS_);
  261. _THIS_utils.refreshCurrentTab('poolTaskList');
  262. }
  263. }
  264. function _THIS_release() {
  265. if (hts_releaseTask(_THIS_,&apos;_THIS_&apos;)) {
  266. //reload the task viewer to reflect the changes
  267. var _THIS_utils = new hts_utils(_THIS_);
  268. _THIS_utils.refreshCurrentTab('poolTaskList');
  269. }
  270. }
  271. function _THIS_delegate() {
  272. ccModalCallBack = function(cmd,sResponse) {
  273. if (cmd == "ok") {
  274. var xmlDoc = XMLBuilderLoadXMLFromString(xmldecode(sResponse));
  275. var userTokenNode = _F_DOM.selectSingleNode(xmlDoc,"//item[./name[.='searchPath']]/value");
  276. var userNameNode = _F_DOM.selectSingleNode(xmlDoc,"//item[./name[.='defaultName']]/value");
  277. hts_setText($("_THIS__assingnedTo_value"),_F_DOM.text(userNameNode));
  278. hts_setText($("_THIS__assingnedTo_token"),_F_DOM.text(userTokenNode));
  279. }
  280. ui_modal_dialog.close();
  281. dojo.query('div#_THIS__ownerEdit a').forEach(
  282. function(node, index, arr) {
  283. node.focus();
  284. }
  285. );
  286. }
  287. var sHeaderTitle = '<xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_CHANGE_OWNER" encode="javascript"/>';
  288. ui_modal_dialog.open('?b_action=xts.run&amp;m=portal/select/select.xts&amp;so.select=adminconsole.users&amp;md.callBack=data&amp;md.callBackMode=&amp;m_name=' + sHeaderTitle, false, true, true);
  289. }
  290. function _THIS_updateUI(taskInfo) {
  291. try{
  292. //set the pickers to the current date
  293. _THIS_dateFrom="";
  294. _THIS_dateTo="";
  295. hts_clearDatePickers(&apos;_THIS_&apos;);
  296. //the picker text boxes by default are set to the current date. set them to display nothing.
  297. //this fixes the issue of todays date getting displayed when no deadlines exist
  298. //also set the correct tab index and the correct label to be read by JAWs screen reader
  299. var dueDateEle = $('txtDate'+&apos;_THIS_&apos;+'taskOptions_dueDate');
  300. if (dueDateEle) {
  301. dueDateEle.value="";
  302. dijit.setWaiState(dueDateEle,'label','<xts:string id="IDS_FRAG_A11Y_DUE_DATE_LABEL" encode="javascript"/>');
  303. }
  304. var startByEle = $('txtDate'+&apos;_THIS_&apos;+'taskOptions_startBy');
  305. if (startByEle) {
  306. startByEle.value="";
  307. dijit.setWaiState(startByEle,'label','<xts:string id="IDS_FRAG_A11Y_START_BY_DATE_LABEL" encode="javascript"/>');
  308. }
  309. //set the deadlines into the date pickers
  310. var deadlines;
  311. if (taskInfo.formattedDeadlines) {
  312. if(taskInfo.formattedDeadlines &amp;&amp; taskInfo.formattedDeadlines.length){
  313. deadlines = taskInfo.formattedDeadlines;
  314. }else if(taskInfo.formattedDeadlines){
  315. deadlines = new Array();
  316. deadlines.push(taskInfo.formattedDeadlines);
  317. }
  318. for (var i=0; i &lt;deadlines.length;i++) {
  319. var deadlineInstance = deadlines[i].deadlineInstance;
  320. if (deadlineInstance.type=="START") {
  321. _THIS_dateFrom = deadlineInstance.formattedDateForDatePicker;
  322. }
  323. else if (deadlineInstance.type=="COMPLETE") {
  324. _THIS_dateTo = deadlineInstance.formattedDateForDatePicker;
  325. }
  326. }
  327. hts_setDatePickers(&apos;_THIS_&apos;,_THIS_dateFrom,_THIS_dateTo);
  328. }
  329. var subjectSpan = $("_THIS__subject_value");
  330. if (subjectSpan.childNodes.length == 0) {
  331. var subjectText = document.createTextNode(taskInfo.presentationSubject);
  332. subjectSpan.appendChild(subjectText)
  333. } else {
  334. subjectSpan.firstChild.nodeValue = taskInfo.presentationSubject;
  335. }
  336. hts_setText($("_THIS__creator_value"),taskInfo.formattedCreatedBy);
  337. var owner = taskInfo.formattedActualOwner &amp;&amp; taskInfo.formattedActualOwner != ''?taskInfo.formattedActualOwner:'<xts:string id="IDS_FRAG_TASKVIEWER_OWNER_NONE" encode="javascript"/>';
  338. hts_setText($("_THIS__assingnedTo_value"),owner);
  339. //set the potential owners. if none exist commit will set empty list.
  340. var potentialOwners = new HTSHumanRole("_THIS__potentialOwners");
  341. potentialOwners.parse(taskInfo.formattedPotentialOwners,taskInfo.potentialOwners);
  342. potentialOwners.commit();
  343. //set the stakeholders. if none exist commit will set empty list.
  344. var stakeHolders = new HTSHumanRole("_THIS__stakeHolders");
  345. stakeHolders.parse(taskInfo.formattedTaskStakeholders,taskInfo.taskStakeholders);
  346. stakeHolders.commit();
  347. //set the tasks priority into the combo
  348. hts_selectComboItem($("_THIS_taskOptions_priority"),taskInfo.priority);
  349. //set the status into the combo
  350. hts_populateStatusComboItem($("_THIS_taskOptions_status"),taskInfo, _THIS_menu_strings);
  351. //alert('updating the task details UI, pri:'+taskInfo.priority+', stakes:'+taskInfo.formattedTaskStakeholders+', groups:'+taskInfo.taskStakeholders.groups+', owner:'+taskInfo.formattedActualOwner+', name:'+taskInfo.presentationName+', dateFrom:'+_THIS_dateFrom+', dateTo:'+_THIS_dateTo);
  352. var img = dojo.byId('_THIS_taskImage');
  353. var srcPath = "_THIS?frag-resource=${0}/THIS_";
  354. var src = dojo.string.substitute(srcPath,["fragments/common/images/space.gif"]);
  355. var alt = _THIS_getLocalisedTaskTooltip(taskInfo.presentationName);
  356. var title = alt;
  357. if (taskInfo.taskIconPath &amp;&amp; taskInfo.taskIconPath != '') {
  358. src = dojo.string.substitute(srcPath,[escape(taskInfo.taskIconPath)]);
  359. } else {
  360. if (taskInfo.taskType == 'TASK') {
  361. src = dojo.string.substitute(srcPath,["fragments/myinbox/images/icon_task.gif"]);
  362. } else if (taskInfo.taskType == 'NOTIFICATION') {
  363. src = dojo.string.substitute(srcPath,["fragments/myinbox/images/icon_notification.gif"]);
  364. }
  365. }
  366. dojo.attr(img, {src: src,alt: alt,title: title,style: {cursor: "default"}});
  367. }catch(ex){
  368. alert('<xts:string id="IDS_FRAG_UPDATEUI_ERROR_MESSAGE" encode="javascript"/>' + ex.description);
  369. }
  370. }
  371. //declare the error messages
  372. var _THIS_msg_array = new Array();
  373. _THIS_msg_array['MSG_ERR_INCOMPATIBLE_DATES'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INCOMPATIBLE_DATES" encode="javascript"/>';
  374. _THIS_msg_array['MSG_ERR_INVALID_END_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INVALID_END_DATE" encode="javascript"/>';
  375. _THIS_msg_array['MSG_ERR_INVALID_START_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INVALID_START_DATE" encode="javascript"/>';
  376. _THIS_msg_array['MSG_ERR_INVALID_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INVALID_DATE" encode="javascript"/>';
  377. _THIS_msg_array['MSG_ERR_INVALID_ASSIGNMENT'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_INVALID_ASSIGNMENT" encode="javascript"/>';
  378. _THIS_msg_array['MSG_ERR_EQUAL_DATES'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_EQUAL_DATES" encode="javascript"/>';
  379. //_THIS_msg_array['MSG_ERR_START_CANNOT_USE_CURRENT_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_START_CANNOT_USE_CURRENT_DATE" encode="javascript"/>';
  380. _THIS_msg_array['MSG_ERR_COMPLETE_CANNOT_USE_CURRENT_DATE'] = '<xts:string id="IDS_FRAG_TASKVIEWER_WARN_COMPLETE_CANNOT_USE_CURRENT_DATE" encode="javascript"/>';
  381. try{
  382. if (typeof oCV=="undefined") {
  383. oCV=window;
  384. }
  385. } catch(e) {
  386. oCV=window;
  387. }
  388. var G_PM_THIS_ = new C_PromptManager();
  389. oCV.preProcessControlArray=[];
  390. p_sSkinFolder=_F_Config.webContent+"/skins/<xsl:value-of select='$skin'/>";
  391. p_sWebContentURI=_F_Config.webContent;
  392. oCV.gbPromptRequestSubmitted=false;
  393. oCV.bCanFinish=true;
  394. oCV.bNextPage=true;
  395. oCV.pageNavigationObserverArray=[];
  396. oCV.rangeObserverArray=[];
  397. oCV.multipleObserverArray=[];
  398. oCV.datePickerObserverArray=[];
  399. oCV.hasPromptKeyDown=false;
  400. _THIS_monitor = function (evt) {
  401. //only want to execute this on downstream events
  402. if (evt.eventPhase == evt.AT_TARGET)
  403. return;
  404. var saveAndClose = $('_THIS_btnSaveAndClose');
  405. var revert = $('_THIS_btnRevert');
  406. var cancel = $('_THIS_btnCancel');
  407. if (evt.name == "fragment.retrieve.before"){
  408. if (saveAndClose) {saveAndClose.disabled = true;}
  409. if (cancel) {cancel.disabled = true;}
  410. } else {
  411. if (saveAndClose) {saveAndClose.disabled = false;}
  412. if (cancel) {cancel.disabled = false;}
  413. }
  414. }
  415. _THIS_.parent.addEventListener("fragment.retrieve.before", "_THIS_monitor", true);
  416. _THIS_.parent.addEventListener("fragment.retrieve.after", "_THIS_monitor", true);
  417. </hts:script>
  418. <!--hts:div id="_THIS_wrapperDiv" style="height:200px;"-->
  419. <xsl:call-template name="renderOptions"/>
  420. <!--/hts:div-->
  421. </xsl:template>
  422. <xsl:template name="renderOptions">
  423. <form name="_THIS_pform" id="_THIS_pform" method="post" action="_THIS?/THIS_">
  424. <!--render the button bar -->
  425. <hts:section id="_THIS_footer" class="taskDetailsButtonBar">
  426. <hts:rowset>
  427. <hts:row>
  428. <hts:link nowrap="true" id="_THIS_btnSaveAndClose" type="button" onKeyPress="if (_hts_getKeyCode(event) == 13) _THIS_save();" onclick="_THIS_save();">
  429. <hts:img id="_THIS_btnSaveAndCloseImage" alt="" title="" tabindex="0" src="_THIS?frag-resource=/fragments/myinbox/images/action_save.gif/THIS_" style="vertical-align:middle;margin-right:3px"/>
  430. <hts:img id="_THIS_btnSaveAndCloseImgDisabled" alt="" title="" disabled="true" src="_THIS?frag-resource=/fragments/myinbox/images/action_save_d.gif/THIS_" style="vertical-align:middle;margin-right:3px"/>
  431. <hts:value><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_SAVE"/></hts:value>
  432. </hts:link>
  433. <hts:link nowrap="true" id="_THIS_revertTask" type="button" onKeyPress="if (_hts_getKeyCode(event) == 13) _THIS_revert();" onclick="_THIS_revert();">
  434. <hts:img id="_THIS_revertTaskImage" tabindex="0" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_revert.gif/THIS_" style="vertical-align:middle;margin-right:3px"/>
  435. <hts:img id="_THIS_revertTaskImgDisabed" disabled="true" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_revert_d.gif/THIS_" style="vertical-align:middle;margin-right:3px"/>
  436. <hts:value><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_REVERT"/></hts:value>
  437. </hts:link>
  438. <hts:separator type="vertical"/>
  439. <hts:link nowrap="true" id="_THIS_btnClaim" type="button" onKeyPress="if (_hts_getKeyCode(event) == 13) _THIS_claim();" onclick="_THIS_claim();">
  440. <hts:img id="_THIS_btnClaimImage" tabindex="0" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_claim.gif/THIS_" style="vertical-align: middle;margin-right:3px"/>
  441. <hts:img id="_THIS_btnClaimImgDisabled" disabled="true" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_claim_d.gif/THIS_" style="vertical-align: middle;margin-right:3px"/>
  442. <hts:value><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_CLAIM"/></hts:value>
  443. </hts:link>
  444. <hts:link nowrap="true" display="none" id="_THIS_btnRelease" type="button" onKeyPress="if (_hts_getKeyCode(event) == 13) _THIS_release();" onclick="_THIS_release();">
  445. <hts:img id="_THIS_btnReleaseImage" tabindex="0" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_return.gif/THIS_" style="vertical-align: middle;margin-right:3px"/>
  446. <hts:img id="_THIS_btnReleaseImageDisabled" disabled="true" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_return_d.gif/THIS_" style="vertical-align: middle;margin-right:3px"/>
  447. <hts:value><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_REMOVE_ME"/></hts:value>
  448. </hts:link>
  449. <hts:separator type="vertical"/>
  450. <hts:span id="_THIS__showGenericComplete" nowrap="true">
  451. <hts:link nowrap="true" id="_THIS_btnComplete" type="button" onKeyPress="if (_hts_getKeyCode(event) == 13) _THIS_complete();" onclick="_THIS_complete();">
  452. <hts:img id="_THIS_btnCompleteImage" tabindex="0" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_complete.gif/THIS_" style="vertical-align:middle;margin-right:3px"/>
  453. <hts:img id="_THIS_btnCompleteImgDisabled" disabled="true" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_complete_d.gif/THIS_" style="vertical-align: middle;margin-right:3px"/>
  454. <hts:value><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_COMPLETE"/></hts:value>
  455. </hts:link>
  456. </hts:span>
  457. <hts:link nowrap="true" id="_THIS_btnCancel" type="button" onKeyPress="if (_hts_getKeyCode(event) == 13) _THIS_skip();" onclick="_THIS_skip();">
  458. <hts:img id="_THIS_btnCancelImage" tabindex="0" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_cancel.gif/THIS_" style="vertical-align:middle;margin-right:3px"/>
  459. <hts:img id="_THIS_btnCancelImgDisabled" disabled="true" alt="" title="" src="_THIS?frag-resource=/fragments/myinbox/images/action_task_cancel_d.gif/THIS_" style="vertical-align: middle;margin-right:3px"/>
  460. <hts:value><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_CANCEL"/></hts:value>
  461. </hts:link>
  462. </hts:row>
  463. </hts:rowset>
  464. </hts:section>
  465. <!-- Text fields and date fields -->
  466. <hts:section format="select-dialog" style="width:100%">
  467. <hts:rowset>
  468. <hts:row format="select">
  469. <hts:div id="_THIS__showSubject">
  470. <hts:actionlist colspan="2">
  471. <hts:action>
  472. <hts:img id="_THIS_taskImage" width="16" src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_"/>
  473. </hts:action>
  474. <hts:action>
  475. <!-- Add space inside span so that we have a first child - see related javascript -->
  476. <hts:span class="subject_line" name="_THIS__subject_value" id="_THIS__subject_value"/>
  477. </hts:action>
  478. </hts:actionlist>
  479. </hts:div>
  480. </hts:row>
  481. <hts:row format="select">
  482. <hts:div id="_THIS__showCreator">
  483. <hts:actionlist>
  484. <hts:action style="width:100px">
  485. <hts:text><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_CREATOR"/></hts:text>
  486. </hts:action>
  487. <hts:action>
  488. <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="12px" width="0px"/>
  489. </hts:action>
  490. <hts:action>
  491. <hts:div style="overflow-y:auto;background:none;outline:none;border:none" type="text" alt="{$creator_input_field}" name="_THIS__creator_value" id="_THIS__creator_value"></hts:div>
  492. </hts:action>
  493. </hts:actionlist>
  494. </hts:div>
  495. </hts:row>
  496. <hts:row format="select">
  497. <hts:div id="_THIS__showOwner">
  498. <hts:actionlist>
  499. <hts:action style="width:100px">
  500. <hts:text><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_ASSIGNED_TO"/></hts:text>
  501. </hts:action>
  502. <hts:action>
  503. <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="12px" width="0px"/>
  504. </hts:action>
  505. <hts:action>
  506. <hts:div style="overflow-y:auto;background:none;outline:none;border:none" type="text" alt="{$assignedTo_input_field}" name="_THIS__assingnedTo_value" id="_THIS__assingnedTo_value"></hts:div>
  507. <hts:hidden id="_THIS__assingnedTo_token" name="_THIS__assingnedTo_token"/>
  508. </hts:action>
  509. <hts:action>
  510. <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="0px" width="20px"/>
  511. </hts:action>
  512. <hts:action id="_THIS__allowOwnerEdits">
  513. <hts:link id="_THIS__ownerEdit" onKeyPress="if (_hts_getKeyCode(event) == 13) _THIS_delegate();" onclick="_THIS_delegate();" href="#"><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_CHANGE_OWNER"/></hts:link>
  514. <hts:link id="_THIS__ownerEditDisabled" href="javascript:void(0)"><xts:string id="IDS_FRAG_TASKVIEWER_BUTTON_CHANGE_OWNER"/></hts:link>
  515. </hts:action>
  516. </hts:actionlist>
  517. </hts:div>
  518. </hts:row>
  519. <hts:row format="select">
  520. <hts:div id="_THIS__showHumanRolesPO">
  521. <xsl:variable name="labelName">
  522. <xts:string id="IDS_FRAG_TASKVIEWER_LABEL_POTENTIAL_OWNERS"/>
  523. </xsl:variable>
  524. <hts:actionlist>
  525. <hts:action style="width:100px">
  526. <hts:text><xsl:value-of select="$labelName"/></hts:text>
  527. </hts:action>
  528. <hts:action>
  529. <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="12px" width="0px"/>
  530. </hts:action>
  531. <hts:action>
  532. <hts:div style="overflow-y:auto;background:none;outline:none;border:none" type="text" alt="{$potentialOwners_input_field}" name="_THIS__potentialOwners_display" id="_THIS__potentialOwners_display"></hts:div>
  533. <hts:hidden id="_THIS__potentialOwners_value" name="_THIS__potentialOwners_value"/>
  534. </hts:action>
  535. <hts:action>
  536. <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="0px" width="20px"/>
  537. </hts:action>
  538. <hts:action id="_THIS__allowHumanRoleEdits">
  539. <hts:link id="_THIS_humanRoles" onKeyPress="if (_hts_getKeyCode(event) == 13) hts_selectRecipients(&quot;&quot;,_THIS_msg_array,&apos;_THIS_&apos;+'_stakeHolders',&apos;_THIS_&apos;+'_potentialOwners','humanTask', '_THIS_humanRoles');" onclick="hts_selectRecipients(&quot;&quot;,_THIS_msg_array,&apos;_THIS_&apos;+'_stakeHolders',&apos;_THIS_&apos;+'_potentialOwners','humanTask', '_THIS_humanRoles');" href="#"><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_ADD_RECIPIENTS"/></hts:link>
  540. <hts:link id="_THIS_humanRolesDisabled" href="javascript:void(0)"><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_ADD_RECIPIENTS"/></hts:link>
  541. </hts:action>
  542. </hts:actionlist>
  543. </hts:div>
  544. </hts:row>
  545. <hts:row format="select">
  546. <hts:div id="_THIS__showHumanRolesSH">
  547. <xsl:variable name="labelName">
  548. <xts:string id="IDS_FRAG_TASKVIEWER_LABEL_STAKEHOLDERS"/>
  549. </xsl:variable>
  550. <hts:actionlist>
  551. <hts:action style="width:100px">
  552. <hts:text><xsl:value-of select="$labelName"/></hts:text>
  553. </hts:action>
  554. <hts:action>
  555. <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" height="12px" width="0px"/>
  556. </hts:action>
  557. <hts:action>
  558. <hts:div style="overflow-y:auto;background:none;outline:none;border:none" type="text" alt="{$stakeholder_input_field}" name="_THIS__stakeHolders_display" id="_THIS__stakeHolders_display"></hts:div>
  559. <hts:hidden id="_THIS__stakeHolders_value" name="_THIS__stakeHolders_value"/>
  560. </hts:action>
  561. </hts:actionlist>
  562. </hts:div>
  563. </hts:row>
  564. </hts:rowset>
  565. <!-- date fields -->
  566. <hts:actionlist>
  567. <hts:action id="_THIS__showStartBy">
  568. <hts:text label-for="txtDate_THIS_taskOptions_startBy">
  569. <xsl:attribute name="style">margin-left:2px</xsl:attribute>
  570. <hts:text><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_START_BY"/></hts:text>
  571. </hts:text>
  572. <hts:section format="select-dialog" id="selectDate_THIS_taskOptions_startBy">
  573. <hts:script>
  574. var _THIS_startById = '_THIS_taskOptions_startBy';
  575. hts_clearDatePickersIframe(_THIS_startById);
  576. genSelectDateHTML({formName:"_THIS_pform",parameterName:"_THIS_taskOptions_startBy",submitType:"",prmtDefaultDate:_THIS_dateFrom,defaultValue:_THIS_dateFrom,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_startById});
  577. </hts:script>
  578. </hts:section>
  579. </hts:action>
  580. <hts:action id="_THIS__showDueDateSpacer">
  581. <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="24px"/>
  582. </hts:action>
  583. <hts:action id="_THIS__showDueDate">
  584. <hts:text label-for="txtDate_THIS_taskOptions_dueDate">
  585. <xsl:attribute name="style">margin-left:2px</xsl:attribute>
  586. <hts:text><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_DUE_DATE"/></hts:text>
  587. </hts:text>
  588. <hts:section format="select-dialog" id="selectDate_THIS_taskOptions_dueDate">
  589. <hts:script>
  590. var _THIS_dueDateId = "_THIS_taskOptions_dueDate";
  591. hts_clearDatePickersIframe(_THIS_dueDateId);
  592. 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});
  593. </hts:script>
  594. </hts:section>
  595. </hts:action>
  596. <hts:action id="_THIS__showStartBySpacer">
  597. <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="24px"/>
  598. </hts:action>
  599. <hts:action id="_THIS__showStatus">
  600. <hts:text label-for="_THIS_taskOptions_status">
  601. <xsl:attribute name="style">margin-left:3px</xsl:attribute>
  602. <xsl:text><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_STATUS"/></xsl:text>
  603. </hts:text>
  604. <hts:section format="select-dialog">
  605. <hts:select name="_THIS_taskOptions_status" id="_THIS_taskOptions_status" disabled="false"/>
  606. </hts:section>
  607. </hts:action>
  608. <hts:action id="_THIS__showStatusSpacer">
  609. <hts:img src="_THIS?frag-resource=/fragments/common/images/space.gif/THIS_" alt="" width="24px"/>
  610. </hts:action>
  611. <hts:action id="_THIS__showPriority">
  612. <hts:text label-for="_THIS_taskOptions_priority">
  613. <xsl:attribute name="style">margin-left:3px</xsl:attribute>
  614. <xsl:text><xts:string id="IDS_FRAG_TASKVIEWER_LABEL_PRIORITY"/></xsl:text>
  615. </hts:text>
  616. <hts:section format="select-dialog">
  617. <hts:select name="_THIS_taskOptions_priority" id="_THIS_taskOptions_priority" disabled="false">
  618. <hts:option value="5"><xts:string id="IDS_FRAG_PRIORITY_LABEL_LOW"/></hts:option>
  619. <hts:option value="3">
  620. <xsl:attribute name="selected">true</xsl:attribute>
  621. <xts:string id="IDS_FRAG_PRIORITY_LABEL_MEDIUM"/>
  622. </hts:option>
  623. <hts:option value="1"><xts:string id="IDS_FRAG_PRIORITY_LABEL_HIGH"/></hts:option>
  624. </hts:select>
  625. </hts:section>
  626. </hts:action>
  627. </hts:actionlist>
  628. </hts:section>
  629. </form>
  630. </xsl:template>
  631. </xsl:stylesheet>