JonathanM
Here are my cheatsheet instructions for this mod:
1. Add the following to the button row of the detail_cr.htmpl - in the section where buttons are enabled for EDIT mode:
////////////////////////////////////////
<PDM_IF "$args.id" != "0" && "$prop.form_name_3" == "edit" && "$args.status" != "CL"&& "$args.status" != "CAN">
<PDM_MACRO name=button Caption="Change To Incident" Func="document.getElementById('flip').value='I'; detailSave();" hotkey_name="Change To Incident(I)" ID="ITIL_REQUEST">
</PDM_IF>
////////////////////////////////////////////
(When adding to detail_in - change the values to R and "Change to Request")
2. Add the following to the list of HIDDEN variables in the section of the FORM when it in EDIT Mode
////////////////////////////////////////////
<input type="hidden" name="SET.type" id="flip" value="$args.type">
/////////////////////////////////////////////
Example:
detail_cr.htmpl excerpt
///////////////////
......
<script type="text/javascript">
<PDM_IF "$prop.form_name_3" != "edit">
if ( typeof parent.createIncident == "boolean" &&
parent.createIncident ) {
if (typeof ahdframeset.workframe == "object")
ahdframeset.workframe.SkipInitialFocus = "1";
<PDM_IF "$prop.MultiTenancy" != "on">
create_new('cr',0,0,0,'PRESET=type:I','INITFROM=frm002');
<PDM_ELSE>
create_new('cr',0,0,0,'PRESET=type:I@@tenant:'+argTenantId,'INITFROM=frm002');
</PDM_IF>
}
</PDM_IF>
parent.createIncident = void(0);
<PDM_MACRO name=dtlForm factory=cr>
<PDM_IF "$prop.form_name_3" == "edit">
if ( cfgUserAuth \> 1 && ahdtop.cfgNX_KT == "Yes" && ahdtop.cfgEBRVersion == "SEARCH_ENGINE" ) {
//Add the find similar button
<PDM_MACRO name=button Caption="Find Similar" Func="find_similar_tickets('cr')" hotkey_name="Find Similar" ID=FIND_SIMILAR Tooltip="Find Similar">
}
<PDM_MACRO name=button Caption="Quick Profile[Q]" Disabled=yes Func="if ( document.main_form['SET.customer'].value != '' ) edit_profile_browser('id', document.main_form['SET.customer'].value); else edit_profile_browser('combo_name', document.main_form['customer_combo_name'].value)" hotkey_name="Quick Profile[Q]" ID=PROFILE_BROWSER>
<PDM_IF 0> J.W. - 16 Jun 16 - Add Change To Incident button when in Edit mode and not Closed or Cancelled</PDM_IF>
<PDM_IF "$args.id" != "0" && "$prop.form_name_3" == "edit" && "$args.status" != "CL"&& "$args.status" != "CAN">
<PDM_MACRO name=button Caption="Change To Incident" Func="document.getElementById('flip').value='I'; detailSave();" hotkey_name="Change To Incident(I)" ID="ITIL_REQUEST">
</PDM_IF>
<PDM_IF $args.id == 0>
<PDM_MACRO name=button Caption="Use Template[*Q]" Func="apply_template('frm001', 'SET.customer', 'cr')" hotkey_name="Use Template[*Q]" ID=btn010>
</PDM_IF>
<PDM_ELSE>
<PDM_IF "$args.category" != "" >
<PDM_IF "$args.category.auto_assign" == "1" || "$args.category.auto_assign" == "2">
<PDM_MACRO name=button Caption="Re Auto Assign" Func="re_auto_assign('$args.assignee','$args.group','$args.customer','$args.category','$args.auto_assign','$args.persistent_id','$args.affected_resource','$args.category.auto_assign')" hotkey_name="Re Auto Assign" ID=btn010>
</PDM_IF>
</PDM_IF>
<PDM_IF $ACCESS.FAC_chg == 2 && "$args.change" == "">
if ( cfgUserAuth > 1 ) {
<PDM_MACRO name=button Caption="Create Change Order[!ea]" Func="detailSave('NEW_CHANGE')" hotkey_name="Create Change Order[!ea]" ID=btnchg Tooltip="Save and Create Change Order">
}
</PDM_IF>
if ( cfgUserAuth > 1 ) {
<PDM_IF "$prop.MultiTenancy" != "on">
<PDM_MACRO name=button Caption="Create Incident[!eaI]" Func="create_new('cr',0,0,0,'PRESET=type:I','INITFROM=frm002')" hotkey_name="Create Incident[!eaI]" ID=ITIL_INCIDENT>
<PDM_ELSE>
<PDM_MACRO name=button Caption="Create Incident[!eaI]" Func="create_new('cr',0,0,0,'PRESET=type:I@@tenant:'+argTenantId,'INITFROM=frm002')" hotkey_name="Create Incident[!eaI]" ID=ITIL_INCIDENT>
</PDM_IF>
}
if ( cfgUserAuth \> 1 && ahdtop.cfgNX_KT == "Yes" && ahdtop.cfgEBRVersion == "SEARCH_ENGINE" ) {
//Add the find similar button
<PDM_MACRO name=button Caption="Find Similar" Func="find_similar_tickets('cr')" hotkey_name="Find Similar" ID=FIND_SIMILAR Tooltip="Find Similar">
}
<PDM_MACRO name=button Caption="Quick Profile[Q]" Func="profile_browser('$args.customer.persistent_id',void(0),void(0),'$args.persistent_id')" hotkey_name="Quick Profile[Q]" ID=PROFILE_BROWSER>
</PDM_IF>
<PDM_IF "${args.extern_ref:}" != "">
var extern_token = "$args.extern_token";
var extern_ref = "$args.extern_ref";
if ( extern_token.indexOf("http://") != -1) {
if ( extern_ref.indexOf("msgtext") == -1) {
<PDM_MACRO name=button Caption="$args.extern_ref" Func="popupWithURL('$args.extern_token',1)" hotkey_name="$args.extern_ref" ID=btnextlaunch>
}
else {
ImgBtnCreate("btnextlaunch","$args.extern_ref" , "popupWithURL('$args.extern_token',1)", true, 0);
}
}
</PDM_IF>
<PDM_MACRO name=dtlStart scroll=true>
<PDM_IF "$prop.form_name_3" == "edit">
</script>
<input type="hidden" name="change_category" value="0">
<input type="hidden" name="SET.call_back_flag" value="$args.call_back_flag" id="SET.call_back_flag">
<input type="hidden" name="NEW_ATTMNTS" id="NEW_ATTMNTS">
<PDM_IF 0> J.W. - 16 Jun 16 -Added hidden input for type to allow change of type </PDM_IF>
<input type="hidden" name="SET.type" id="flip" value="$args.type">
<script type="text/javascript">
......
(form continues)
/////////////////////////////////////////////////////
Regards,
J.W.