Difference between revisions of "Add Personalized Response to Manual Notification"
Agegeleruvy (Talk | contribs) |
m (Reverted edits by Agegeleruvy (Talk); changed back to last version by Gityerfix) |
||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
__NOTOC__ | __NOTOC__ | ||
[[Category:Change Orders]] | [[Category:Change Orders]] | ||
| Line 25: | Line 17: | ||
=== Step 1. Edit the nf.htmpl form === | === Step 1. Edit the nf.htmpl form === | ||
Add the following code to the HEAD of the form: | Add the following code to the HEAD of the form: | ||
| − | + | <source lang="javascript"><SCRIPT LANGUAGE="JavaScript"> | |
var resp_sym = new Array(); | var resp_sym = new Array(); | ||
var resp_ids = new Array(); | var resp_ids = new Array(); | ||
| − | resp_sym[0] = | + | resp_sym[0] = ""; |
| − | resp_ids[0] = | + | resp_ids[0] = ""; |
| − | resp_field= | + | resp_field="KEEP.msgtxt"; |
resp_persid='$args.persistent_id'; | resp_persid='$args.persistent_id'; | ||
| − | resp_title= | + | resp_title="KEEP.msgtitle"; |
| − | + | <PDM_IF "$prop.factory" == "chg"> | |
| − | var title_strg = | + | var title_strg = "Change order $args.chg_ref_num Manual Notify"; |
| − | + | <PDM_ELIF "$prop.factory" == "iss"> | |
| − | var title_strg = | + | var title_strg = "Issue $args.ref_num Manual Notify"; |
| − | + | <PDM_ELSE> | |
| − | + | <PDM_IF "$env.NX_OTB_MARKET" == "itil"> | |
| − | var title_strg = | + | var title_strg = "$args.type.sym $args.ref_num Manual Notify"; |
| − | + | <PDM_ELSE> | |
| − | var title_strg = | + | var title_strg = "Request $args.ref_num Manual Notify"; |
| − | + | </PDM_IF> | |
| − | + | </PDM_IF> | |
| − | + | <PDM_IF "$prop.factory" == "chg"> | |
| − | + | <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND chg_flag=1"> | |
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); | resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); | ||
resp_ids[resp_ids.length] = '$list.id'; | resp_ids[resp_ids.length] = '$list.id'; | ||
| − | + | </PDM_LIST> | |
| − | + | <PDM_ELSE> | |
| − | + | <PDM_IF "$args.type" == "R" || "$args.type" == ""> | |
| − | + | <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND cr_flag=1"> | |
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); | resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); | ||
resp_ids[resp_ids.length] = '$list.id'; | resp_ids[resp_ids.length] = '$list.id'; | ||
| − | + | </PDM_LIST> | |
| − | + | <PDM_ELIF "$args.type" == "I"> | |
| − | + | <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND in_flag=1"> | |
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); | resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); | ||
resp_ids[resp_ids.length] = '$list.id'; | resp_ids[resp_ids.length] = '$list.id'; | ||
| − | + | </PDM_LIST> | |
| − | + | <PDM_ELIF "$args.type" == "P"> | |
| − | + | <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND pr_flag=1"> | |
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); | resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); | ||
resp_ids[resp_ids.length] = '$list.id'; | resp_ids[resp_ids.length] = '$list.id'; | ||
| − | + | </PDM_LIST> | |
| − | + | </PDM_IF> | |
| − | + | </PDM_IF> | |
function add_response_nf(i) | function add_response_nf(i) | ||
{ | { | ||
| − | if(ahdframe.currentAction==0& | + | if(ahdframe.currentAction==0&&i>0) |
{ | { | ||
| − | var url=cfgCgi+ | + | var url=cfgCgi+"?SID="+cfgSID+"+FID="+fid_generator()+ |
| − | + | "+OP=PERSRESP_EXPAND+MSG_ID="+resp_ids[i]+ | |
| − | + | "+PERSID="+resp_persid+ | |
| − | + | "+CALLBACK=parent.ahdframe.add_response_callback_nf"; | |
display_new_page(url,ahdframeset.workframe); | display_new_page(url,ahdframeset.workframe); | ||
set_action_in_progress(ACTN_AUTOFILL); | set_action_in_progress(ACTN_AUTOFILL); | ||
| Line 85: | Line 77: | ||
function add_response_callback_nf(msg){ | function add_response_callback_nf(msg){ | ||
set_action_in_progress(0); | set_action_in_progress(0); | ||
| − | if (document.main_form.elements[ | + | if (document.main_form.elements["KEEP.msgtxt"].value == "") { |
document.main_form.elements[resp_title].value=unescape(title_strg); | document.main_form.elements[resp_title].value=unescape(title_strg); | ||
} | } | ||
| Line 91: | Line 83: | ||
// document.main_form.elements[resp_field].value=unescape(msg); // Use to replace Message Text content | // document.main_form.elements[resp_field].value=unescape(msg); // Use to replace Message Text content | ||
} | } | ||
| − | + | </SCRIPT></source> | |
Add the following code to the BODY of the form: | Add the following code to the BODY of the form: | ||
| − | + | <source lang="javascript"> | |
| − | if (resp_ids.length | + | if (resp_ids.length > 1) |
{ | { | ||
| − | + | <PDM_MACRO NAME=dtlStartRow> | |
| − | detailRowHdr( | + | detailRowHdr("Personalized Response",1,0); |
| − | docWriteln(' | + | docWriteln('<TR><TD ALIGN=LEFT>'); |
| − | _dtl.eventHandler = 'onBlur= | + | _dtl.eventHandler = 'onBlur="add_response_nf(selectedIndex)"'; |
| − | docWriteln(' | + | docWriteln('<SELECT' + detailNextID(true) + '>'); |
| − | for (i = 0; i | + | for (i = 0; i < resp_ids.length; i++) |
{ | { | ||
| − | docWrite(' | + | docWrite('<OPTION VALUE="' + resp_ids[i] + '" '); |
| − | docWriteln(' | + | docWriteln('>' + resp_sym[i] +'</OPTION>'); |
} | } | ||
| − | docWriteln(' | + | docWriteln('</SELECT></TD></TR>'); |
} | } | ||
| − | + | </source> | |
=== Step 2. Clear the web cache === | === Step 2. Clear the web cache === | ||
Publish your changes via the [[Web Screen Painter]]. The process of publishing automatically initiates a [[pdm_webcache]]. | Publish your changes via the [[Web Screen Painter]]. The process of publishing automatically initiates a [[pdm_webcache]]. | ||
Latest revision as of 05:41, 24 November 2010
To discuss or ask questions about this article, select the discussion tab above.
Overview
This article provides instructions on how to add Personalized Responses to a Manual Notification. Surprisingly, Manual Notifications are one Activity that does not utilize Personalized Responses. The code that follows provides an option for appending the field content (which is the standard system-wide behavior) or replacing the field content.
Procedures
Step 1. Edit the nf.htmpl form
Add the following code to the HEAD of the form: <source lang="javascript"><SCRIPT LANGUAGE="JavaScript"> var resp_sym = new Array(); var resp_ids = new Array(); resp_sym[0] = ""; resp_ids[0] = ""; resp_field="KEEP.msgtxt"; resp_persid='$args.persistent_id'; resp_title="KEEP.msgtitle";
<PDM_IF "$prop.factory" == "chg"> var title_strg = "Change order $args.chg_ref_num Manual Notify"; <PDM_ELIF "$prop.factory" == "iss"> var title_strg = "Issue $args.ref_num Manual Notify"; <PDM_ELSE> <PDM_IF "$env.NX_OTB_MARKET" == "itil"> var title_strg = "$args.type.sym $args.ref_num Manual Notify"; <PDM_ELSE> var title_strg = "Request $args.ref_num Manual Notify"; </PDM_IF> </PDM_IF>
<PDM_IF "$prop.factory" == "chg"> <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND chg_flag=1"> resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); resp_ids[resp_ids.length] = '$list.id'; </PDM_LIST> <PDM_ELSE> <PDM_IF "$args.type" == "R" || "$args.type" == ""> <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND cr_flag=1"> resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); resp_ids[resp_ids.length] = '$list.id'; </PDM_LIST> <PDM_ELIF "$args.type" == "I"> <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND in_flag=1"> resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); resp_ids[resp_ids.length] = '$list.id'; </PDM_LIST> <PDM_ELIF "$args.type" == "P"> <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND pr_flag=1"> resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); resp_ids[resp_ids.length] = '$list.id'; </PDM_LIST> </PDM_IF> </PDM_IF>
function add_response_nf(i) { if(ahdframe.currentAction==0&&i>0) { var url=cfgCgi+"?SID="+cfgSID+"+FID="+fid_generator()+ "+OP=PERSRESP_EXPAND+MSG_ID="+resp_ids[i]+ "+PERSID="+resp_persid+ "+CALLBACK=parent.ahdframe.add_response_callback_nf"; display_new_page(url,ahdframeset.workframe); set_action_in_progress(ACTN_AUTOFILL); } }
function add_response_callback_nf(msg){ set_action_in_progress(0); if (document.main_form.elements["KEEP.msgtxt"].value == "") {
document.main_form.elements[resp_title].value=unescape(title_strg);
} document.main_form.elements[resp_field].value+=unescape(msg); // Use to append Message Text content // document.main_form.elements[resp_field].value=unescape(msg); // Use to replace Message Text content } </SCRIPT></source>
Add the following code to the BODY of the form: <source lang="javascript"> if (resp_ids.length > 1) { <PDM_MACRO NAME=dtlStartRow> detailRowHdr("Personalized Response",1,0); docWriteln('<TR><TD ALIGN=LEFT>'); _dtl.eventHandler = 'onBlur="add_response_nf(selectedIndex)"'; docWriteln('<SELECT' + detailNextID(true) + '>'); for (i = 0; i < resp_ids.length; i++) { docWrite('<OPTION VALUE="' + resp_ids[i] + '" '); docWriteln('>' + resp_sym[i] +'</OPTION>'); } docWriteln('</SELECT></TD></TR>'); } </source>
Step 2. Clear the web cache
Publish your changes via the Web Screen Painter. The process of publishing automatically initiates a pdm_webcache.