5.1 Analyst
detail_alg.htmpl
<PDM_IF 0>
detail_alg.htmpl
WHEN PRESENTED:
    When we need to display a detail of a single Activity Log
INTENT:
    Display the detail info for the Activity Log
VARIABLES:
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110>
<PDM_WSP mode=general preview="detail_alg.htmpl+PERSID={alg:}+FACTORY=alg+OP=UPDATE" factory=alg>
<PDM_INCLUDE FILE=styles.htmpl>
<script type="text/javascript" src="$CAisd/scripts/window_manager.js"></script>
<SCRIPT LANGUAGE="JavaScript">
<PDM_IF "$prop.form_name_3" == "edit" && "$args.ACTIVITY_LOG_TYPE" != "">
   <PDM_IF "$env.NX_OTB_MARKET" == "itil">
var form_title ="Create New Activity for $args.type.sym $args.ref_num";
   <PDM_ELSE>
var form_title ="Create New Activity for Request $args.ref_num";
   </PDM_IF>
<PDM_ELIF "$prop.form_name_3" == "ro">
   <PDM_IF "$args.call_req_id" == "">
      <PDM_IF "$env.NX_OTB_MARKET" == "itil" >
var form_title ="Display Activity for $args.type.sym $args.ref_num";
      <PDM_ELSE>
var form_title ="Display Activity for Request $args.ref_num";
      </PDM_IF>
   <PDM_ELSE>
      <PDM_IF "$env.NX_OTB_MARKET" == "itil" >
var form_title ="Display Activity for $args.call_req_id.type.sym $args.call_req_id.ref_num";
      <PDM_ELSE>
var form_title ="Display Activity for Request $args.call_req_id.ref_num";
      </PDM_IF>
   </PDM_IF>
<PDM_ELSE>
   <PDM_IF "$args.call_req_id" == "">
      <PDM_IF "$env.NX_OTB_MARKET" == "itil" >
var form_title ="Update Activity for $args.type.sym $args.ref_num";
      <PDM_ELSE>
var form_title ="Update Activity for Request $args.ref_num";
      </PDM_IF>
   <PDM_ELSE>
      <PDM_IF "$env.NX_OTB_MARKET" == "itil" >
var form_title ="Update Activity for $args.call_req_id.type.sym $args.call_req_id.ref_num";
      <PDM_ELSE>
var form_title ="Update Activity for Request $args.call_req_id.ref_num";
      </PDM_IF>
   </PDM_IF>
</PDM_IF>
</SCRIPT>
<PDM_INCLUDE FILE=std_head.htmpl wm=no wm=no>
<SCRIPT LANGUAGE="JavaScript">
var alg_factory = "alg";
var cfgMachineName = "$SESSION.MachineName";
var argPersistentID = "$args.persistent_id";
var argCstID = "$cst.id";
var cfgDateFormat = "$date_format";
var argRefNum = "$args.ref_num";
var argID = "$args.id";
var hiddenSubmit = 1;
if("$env.NX_OPEN_SUBMIT_FORM_ON_TICKET" == "1")
     hiddenSubmit = 0;
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/arrow_button.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/check_submit.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/detail_formDP.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<PDM_IF "$args.ACTIVITY_LOG_TYPE" != "SOLN">
var resp_sym = new Array();
var resp_ids = new Array();
resp_sym[0] = "";
resp_ids[0] = "";
resp_field="SET.alg.description";
resp_persid='$args.persistent_id';
<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 loadActions()
{
   if ( _dtl.edit )
      load_from_scratchpad("0");
}
function unloadActions()
{
   if ( _dtl.edit )
   {
      unload_check();
   }
}
var form_vars = new Array();
       
function save_and_submit_knowledge() {
//////////////
<PDM_IF "$args.ACTIVITY_LOG_TYPE" == "">
     var parentID = "$args.call_req_id.id";
<PDM_ELSE>
     var parentID = "$args.id";
</PDM_IF>
     
     
     //   Now we go looking for all detail instances of
     //   the owning ticket
     var dtlWin = void(0);
     if ( typeof ahdtop == "object" && ahdtop != null ) {
          for ( var window_name in ahdtop.AHD_Windows ) {
               var ahdwin = ahdtop.AHD_Windows[window_name];
               
               if ( typeof ahdwin == "object" &&
               typeof ahdwin.closed == "boolean" &&
               ! ahdwin.closed ) {
              
                    var cai_main = ahdwin.cai_main;
                    if ( typeof cai_main != "object" || cai_main == null )
                         cai_main = ahdwin.content;
               
                    if ( typeof cai_main == "object" &&
                  cai_main != null &&
                  typeof cai_main.argID != "undefined" &&
                  cai_main.argID == parentID &&
                  typeof cai_main.top.workframe == "object" )
                    {
                    
                         cai_main.top.workframe.SkipInitialFocus = 1; 
                         ahdwin.top.workframe.SkipInitialFocus = 1;
                    }
               }
          }  // FOR loop end    
     }
  
//////////////
<PDM_IF "$prop.form_name_3" == "ro" || "$args.ACTIVITY_LOG_TYPE" == "">
     document.main_form.elements["SET.submit_knowledge"].value = hiddenSubmit;
<PDM_ELSE>
     document.main_form.elements["SET.alg.submit_knowledge"].value = hiddenSubmit;
</PDM_IF>
     if(hiddenSubmit)
     {
          if (_dtl.edit)
          {
               detailSave();
          }    
          else
          {
               var url=cfgCgi+"?SID="+cfgSID+"+FID="+fid_generator()+"+OP=ALG_SUBMIT_KD"+
               "+alg_factory=alg+alg_id=" +$args.id;
               var divsubmitKD = document.getElementById("divsubmitKD"); 
               divsubmitKD.innerHTML = "<IFRAME id=submitKD name=submitKD title='Hidden frame -  do not navigate here' src='" + url + "'></IFRAME>";  
               set_action_in_progress(ACTN_SAVE);
          }
          return;
     }
     if (_dtl.edit) {  
         form_vars["RESOLUTION"] =
<PDM_IF "$args.ACTIVITY_LOG_TYPE" == "">
              document.main_form.elements["SET.description"].value;
<PDM_ELSE>
              document.main_form.elements["SET.alg.description"].value;
</PDM_IF>
     }
     // Get the latest from the parent Request, which should
     //   be our opener.  This is necessary to get the latest
     //   values from the editable ticket.  Combo boxes require
     //   special handling - see below.
     if (null != top.opener && !top.opener.closed)
     {
         if (typeof top.opener._dtl != "undefined" && top.opener._dtl.edit)
         {
          
          var func = top.opener.detailValueOf;
          form_vars["SD_CATEGORY"] = func("KEY.category");
          form_vars["ITEM"] = func("KEY.affected_resource");
          form_vars["SD_ASSET_ID"] = func("SET.affected_resource");
          form_vars["SD_ROOTCAUSE"] = func("KEY.rootcause");
          form_vars["SD_ROOTCAUSE_ID"] = func("SET.rootcause");
          form_vars["PROBLEM"] = func("SET.description");
          form_vars["SUMMARY"] = func("SET.summary");
     
          // If parent was editable, we might've been passed some
          //   unique, non-id values so we can lookup their ids for KT.
          //   These attributes are usually SRELs represented by a SELECT
          //   element, which doesn't store their ids.
          //   See logSolution() in menubar.js
          // note: pdm_if seems to have trouble with the string "0" in
          //   comparisons...
          {
               <PDM_IF "$args.KEEP.pri_enum" : "[0-9]+">
                   form_vars["SD_PRIORITY_ID"] = "$args.KEEP.pri_enum";
               <pdm_else>
                   form_vars["SD_PRIORITY_ID"] = "";
               </pdm_if>
               
               <PDM_IF "$args.KEEP.urg_enum" : "[0-9]+">
                   form_vars["SD_URGENCY_ID"] = "$args.KEEP.urg_enum";
               <pdm_else>
                   form_vars["SD_URGENCY_ID"] = "";
               </pdm_if>
               
               <PDM_IF "$args.KEEP.sev_enum" : "[0-9]+">
                   form_vars["SD_SEVERITY_ID"] = "$args.KEEP.sev_enum";
               <pdm_else>
                   form_vars["SD_SEVERITY_ID"] = "";
               </pdm_if>
               
               <PDM_IF "$args.KEEP.imp_enum" : "[0-9]+">
                   form_vars["SD_IMPACT_ID"] = "$args.KEEP.imp_enum";
               <pdm_else>
                   form_vars["SD_IMPACT_ID"] = "";
               </pdm_if>
          }
         }
     
     var features="directories=no"+
          ",location=no"+
          ",height=" + popupHeight(LARGE_POPUP) +
          ",width=" + popupWidth(LARGE_POPUP)+
          ",status=no";
ahdtop.SetSolutionText(form_vars["RESOLUTION"],form_vars["SD_OBJECT_PERSID"]);
<PDM_IF "$prop.form_name_3" == "ro">
         popup_window(
<PDM_ELSE>
         top.opener.popup_window(
</PDM_IF> 
                        "", "CREATE_NEW", popupWidth(LARGE_POPUP), popupHeight(MEDIUM_POPUP),
                        features, "FACTORY=KD",
                        "PRESET=SD_OBJECT_PERSID:" + form_vars["SD_OBJECT_PERSID"],
                        "PRESET=SUMMARY:" + form_vars["SUMMARY"],
                        "PRESET=PROBLEM:" + form_vars["PROBLEM"],
                        "PRESET=SD_CATEGORY:" + form_vars["SD_CATEGORY"],
                        "PRESET=SD_ASSET_ID:" + form_vars["SD_ASSET_ID"],
                        "PRESET=SD_ROOTCAUSE_ID:" + form_vars["SD_ROOTCAUSE_ID"],
                        "PRESET=SD_SEVERITY_ID:" + form_vars["SD_SEVERITY_ID"],
                        "PRESET=SD_PRIORITY_ID:" + form_vars["SD_PRIORITY_ID"],
                        "PRESET=SD_URGENCY_ID:" + form_vars["SD_URGENCY_ID"],
                        "PRESET=SD_IMPACT_ID:" + form_vars["SD_IMPACT_ID"]);
          
     /*   if(action_in_progress())
          {
               return;
          }
          else
          {
               set_action_in_progress(ACTN_SAVE);
          }*/
     }
     else
     {
         alertmsg(666);
     }
     if (_dtl.edit)
         detailSave();
}
function KT_REPLY(sOP,msg)
{
     set_action_in_progress(ACTN_COMPLETE);
     if (msg[0] == "ERROR")
     {
          alert (msg[1]);
     }
     else
     {
          alert ("Knowledge Document Created.");
     }
}
var canUpdate = 1;
<PDM_IF "$prop.form_name_3" == "ro" || "$args.ACTIVITY_LOG_TYPE" == "">
     <pdm_if "$env.NX_EDIT_INACTIVE" == "No" && $args.call_req_id.active == 0>
          canUpdate = 0;
     </pdm_if>
<pdm_else>
     <pdm_if "$env.NX_EDIT_INACTIVE" == "No" && $args.active == 0>
          canUpdate = 0;
     </pdm_if>
</pdm_if>
</SCRIPT>
</HEAD>
<BODY class=detailro onLoad="loadActions()" onUnload="unloadActions()">
<PDM_IF "$env.NX_OTB_MARKET" == "itil" >
     <PDM_INCLUDE FILE=std_body.htmpl filename="$args.type.sym Activity">
<PDM_ELSE>
     <PDM_INCLUDE FILE=std_body.htmpl filename="Request Activity">
</PDM_IF>
<CENTER>
<SCRIPT LANGUAGE="JavaScript">
<PDM_IF "$prop.form_name_3" == "ro" || "$args.ACTIVITY_LOG_TYPE" == "">
<!-- Existing activity log - factory is alg -->
     <PDM_IF "${args.type.code:}" == "SOLN">
form_vars["SD_OBJECT_PERSID"] = "${args.call_req_id.persistent_id:}";
form_vars["SUMMARY"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.call_req_id.summary:}</PDM_FMT>');
form_vars["PROBLEM"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.call_req_id.description:}</PDM_FMT>');
          <PDM_IF "$prop.form_name_3" == "ro">
form_vars["RESOLUTION"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.description:}</PDM_FMT>');
          </PDM_IF>
form_vars["SD_CATEGORY"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.call_req_id.category.sym:}</PDM_FMT>');
form_vars["ITEM"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.call_req_id.affected_resource.name:}</PDM_FMT>');
form_vars["SD_ASSET_ID"] = "${args.call_req_id.affected_resource.id:}";
form_vars["SD_ROOTCAUSE"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.call_req_id.rootcause.sym:}</PDM_FMT>');
form_vars["SD_ROOTCAUSE_ID"] = "${args.call_req_id.rootcause.id:}";
form_vars["SD_SEVERITY_ID"] = "${args.call_req_id.severity.enum:}";
form_vars["SD_PRIORITY_ID"] = "${args.call_req_id.priority.enum:}";
form_vars["SD_URGENCY_ID"] = "${args.call_req_id.urgency.enum:}";
form_vars["SD_IMPACT_ID"] = "${args.call_req_id.impact.enum:}";
     </PDM_IF>
ahdframeset.top_splash.next_persid = "$args.call_req_id";
<PDM_MACRO NAME=dtlForm factory=alg>
     <PDM_IF "$prop.form_name_3" == "edit">
          <PDM_IF "$args.type.code" == "SOLN">
if (canUpdate) {
     if ( typeof propGLType != "string" ||
          propGLType != "secondary" )
          ImgBtnCreate("btn004", msgtext(428), 'save_and_submit_knowledge()', true, 0);
     else
          ImgBtnCreate("btn004",msgtext(429), 'save_and_submit_knowledge()', true, 0);
}
          </PDM_IF>
     <PDM_ELSE>
          <PDM_IF $args.type.code == "SOLN">
               <PDM_IF "$args.session" == "">
if (canUpdate) {
     ImgBtnCreate("btn006",msgtext(432), 'save_and_submit_knowledge()', true, 0);
}
               <PDM_ELSE>
ImgBtnCreate("btn006",msgtext(433), "popup_window('','SHOW_DETAIL', 0, 0, 'directories=no,location=no,menubar=no,status=no,gobutton=no,menubar=no','PERSID=KD:$args.session', 'HTMPL=kt_document_view.htmpl', 'opener=search_tools', 'open_mode=2', 'reload=1')", true, 0);
               </PDM_IF>
          </PDM_IF>
     </PDM_IF>
<PDM_MACRO NAME=dtlStart>
if ( _dtl.edit ) {
   docWriteln("<INPUT TYPE=hidden NAME=HTMPL VALUE='show_main_detail.htmpl'>");
}
docWriteln("<INPUT TYPE=hidden NAME=KEEP.IsModified VALUE='1'>");
     <PDM_IF $args.type.code == "SOLN">
docWriteln("<INPUT TYPE=HIDDEN NAME=SET.submit_knowledge VALUE='0'>");
     </PDM_IF>
if (_dtl && _dtl.next_persid == "")
    _dtl.next_persid = 'show_main_detail.htmpl';
     <PDM_IF "$args.call_req_id" == "">
          <PDM_MACRO NAME=dtlStartRow>
          <PDM_IF "$env.NX_OTB_MARKET" == "itil" >
               <PDM_MACRO NAME=dtlReadonly hdr="$args.type.sym Number" attr="ref_num">
               <PDM_MACRO NAME=dtlReadonly hdr="$args.type.sym Summary" attr="summary" colspan=2>
          <PDM_ELSE>
               <PDM_MACRO NAME=dtlReadonly hdr="Request Number" attr="ref_num">
               <PDM_MACRO NAME=dtlReadonly hdr="Request Summary" attr="summary" colspan=2>
          </PDM_IF>
     <PDM_ELSE>
          <PDM_MACRO NAME=dtlStartRow>
          <PDM_IF "$env.NX_OTB_MARKET" == "itil" >
               <PDM_MACRO NAME=dtlReadonly hdr="$args.call_req_id.type.sym Number" attr="call_req_id.ref_num">
               <PDM_MACRO NAME=dtlReadonly hdr="$args.call_req_id.type.sym Summary" attr="call_req_id.summary" colspan=2>
          <PDM_ELSE>
               <PDM_MACRO NAME=dtlReadonly hdr="Request Number" attr="call_req_id.ref_num">
               <PDM_MACRO NAME=dtlReadonly hdr="Request Summary" attr="call_req_id.summary" colspan=2>
          </PDM_IF>
     </PDM_IF>
     <PDM_MACRO NAME=dtlStartRow>
     <PDM_MACRO NAME=dtlReadonly hdr="Activity Type" attr="type">
     <PDM_MACRO NAME=dtlReadonly hdr=Analyst attr="analyst">
     <PDM_IF "$prop.view_internal" == "1">
          <PDM_MACRO NAME=dtlCheckbox hdr=Internal? attr="internal" on=Yes off=No>
     </PDM_IF>
     <PDM_MACRO NAME=dtlStartRow>
     <PDM_MACRO NAME=dtlDateReadonly hdr="System Time Stamp" attr="system_time">
     <PDM_MACRO NAME=dtlDate hdr="Date of Activity" attr="time_stamp">
     <PDM_MACRO NAME=dtlTextbox hdr="Time Spent" attr="time_spent" evt="onBlur='validate_duration_ts(this)'">
     <PDM_MACRO NAME=dtlStartRow>
     <PDM_MACRO NAME=dtlTextbox hdr="User Description" attr="description" size=80 colspan=3 rows=8 keeplinks=yes spellchk=yes>
     <PDM_MACRO NAME=dtlStartRow>
     <PDM_MACRO NAME=dtlReadonly hdr="System Description" attr="action_desc" colspan=3>
<PDM_ELSE>
<!-- New activity log - factory is cr -->
     <PDM_IF "${args.alg.type.code:}" == "SOLN">
form_vars["SD_OBJECT_PERSID"] = "${args.persistent_id:}";
form_vars["SUMMARY"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.summary:}</PDM_FMT>');
form_vars["PROBLEM"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.description:}</PDM_FMT>');
form_vars["SD_CATEGORY"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.category.sym:}</PDM_FMT>');
form_vars["ITEM"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.affected_resource.name:}</PDM_FMT>');
form_vars["SD_ASSET_ID"] = "${args.affected_resource.id:}";
form_vars["SD_ROOTCAUSE"] = unescape('<PDM_FMT ESC_STYLE=JS2>${args.rootcause.sym:}</PDM_FMT>');
form_vars["SD_ROOTCAUSE_ID"] = "${args.rootcause.id:}";
form_vars["SD_SEVERITY_ID"] = "${args.severity.enum:}";
form_vars["SD_PRIORITY_ID"] = "${args.priority.enum:}";
form_vars["SD_URGENCY_ID"] = "${args.urgency.enum:}";
form_vars["SD_IMPACT_ID"] = "${args.impact.enum:}";
     </PDM_IF>
ahdframeset.top_splash.next_persid = "$args.persistent_id";
editing = 0;
<PDM_MACRO NAME=dtlForm factory=cr>
     <PDM_IF "$args.alg.type.code" == "SOLN">
if (canUpdate) {
     ImgBtnEndRow();
     ImgBtnRow();
     if ( typeof propGLType != "string" ||
          propGLType != "secondary" )
          ImgBtnCreate("btn004", msgtext(428), 'save_and_submit_knowledge()', true, 0);
     else
          ImgBtnCreate("btn004", msgtext(429), 'save_and_submit_knowledge()', true, 0);
}
     </PDM_IF>
<PDM_MACRO NAME=dtlStart>
docWriteln("<INPUT TYPE=hidden NAME=HTMPL VALUE='show_main_detail.htmpl'>");
docWriteln("<INPUT TYPE=hidden NAME=SET.alg.call_req_id VALUE='$args.alg.call_req_id'>");
docWriteln("<INPUT TYPE=hidden NAME=SET.alg.analyst VALUE='$cst.id'>");
docWriteln("<INPUT TYPE=hidden NAME=SET.alg.type VALUE='$args.ACTIVITY_LOG_TYPE'>");
     <PDM_IF $args.alg.type.code == "SOLN">
docWriteln("<INPUT TYPE=HIDDEN NAME=SET.alg.submit_knowledge VALUE='0'>");
     </PDM_IF>
if (_dtl && _dtl.next_persid == "")
    _dtl.next_persid = 'show_main_detail.htmpl';
     <PDM_MACRO NAME=dtlStartRow>
     <PDM_IF "$env.NX_OTB_MARKET" == "itil" >
          <PDM_MACRO NAME=dtlReadonly hdr="$args.type.sym Number" attr="ref_num">
          <PDM_MACRO NAME=dtlReadonly hdr="$args.type.sym Summary" attr="summary" colspan=3>
          <PDM_IF "$args.type" == "P" && "$args.alg.type" == "SOLN">
               <PDM_MACRO NAME=dtlStartRow>
               <PDM_MACRO NAME=dtlReadonly hdr="Current Status" attr="status">
               <PDM_MACRO NAME=dtlDropdown hdr="New Status" attr="status" lookup=no factory=crs_pr evt="onBlur=\\\"detailSyncEditForms(this)\\\"" initial="KE">
          </PDM_IF>
     <PDM_ELSE>
          <PDM_MACRO NAME=dtlReadonly hdr="Request Number" attr="ref_num">
          <PDM_MACRO NAME=dtlReadonly hdr="Request Summary" attr="summary" colspan=3>
     </PDM_IF>
     <PDM_MACRO NAME=dtlStartRow>
detailRowHdr("Activity Type");
<PDM_LIST PREFIX=list FACTORY=aty WHERE="code='$args.ACTIVITY_LOG_TYPE'">
detailSetReadonlyRowData("$list.sym");
</PDM_LIST>
detailRowHdr("Analyst");
detailSetReadonlyRowData("$cst.combo_name");
     <PDM_IF "$prop.view_internal" == "1">
          <PDM_MACRO NAME=dtlCheckbox hdr=Internal? attr="alg.internal" on=Yes off=No>
     </PDM_IF>
     <PDM_MACRO NAME=dtlStartRow>
     <PDM_MACRO NAME=dtlDateReadonly hdr="Time Stamp" attr="alg.system_time">
     <PDM_MACRO NAME=dtlDate hdr="Date of Activity" attr="alg.time_stamp">
     <PDM_MACRO NAME=dtlTextbox hdr="Time Spent" attr="alg.time_spent" evt="onBlur='validate_duration_ts(this)'">
detailSetValidate("Time Spent", $args.alg.REQUIRED_time_spent, 100);
     <PDM_MACRO NAME=dtlStartRow>
     <PDM_MACRO NAME=dtlTextbox hdr="User Description" attr="alg.description" size=80 colspan=3 rows=8 keeplinks=yes spellchk=yes>
detailSetValidate("User Description", $args.alg.REQUIRED_description,
                  $args.alg.LENGTH_description);
     <PDM_IF "$args.ACTIVITY_LOG_TYPE" != "SOLN">
if (resp_ids.length > 1)
{          
          <PDM_MACRO NAME=dtlStartRow>
detailRowHdr("Personalized Response",1,0);
docWriteln('<TR><TD ALIGN=LEFT>');
_dtl.eventHandler = 'onBlur="add_response(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>');
}
     </PDM_IF>
</PDM_IF>
</SCRIPT>
<PDM_MACRO NAME=dtlEnd>
<PDM_INCLUDE FILE=std_footer.htmpl>
<div style="display:none" id=divsubmitKD></div>
</BODY>
</HTML>
<PDM_IF 0>
@(#)$Id: detail_alg.htmpl,v 1.84.1.1 2006/05/03 23:43:22 tooda01 Exp $
</PDM_IF>
detail_chg.htmpl
<PDM_IF 0>
detail_chg.htmpl
WHEN PRESENTED:
    When we need to display a detail of a single Change
INTENT:
    Display the detail info for the Change
VARIABLES:
    string      image   The location of the image directory as specified in    
                            in the config file.
    object  chg  args   The Change object we are displaying.
                        See $NX_ROOT/bopcfg/majic/cm
/opt/CApdm/bopcfg/majic/writer.maj:OBJECT chg {.maj for the
                        definition of attributes for 'OBJECT chg'
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110>
<PDM_INCLUDE FILE=styles.htmpl>
<style type="text/css">
#invisible{
visibility: hidden;
}
</style>
<script type="text/javascript">
var hdrTitle = "$args.chg_ref_num Change Detail";
var hdrTitleUpd = "$args.chg_ref_num Update Change";
var hdrTitleNew = "Create New Change $args.chg_ref_num";
var hdrTitleTempl = "$args.chg_ref_num Change Template <PDM_FMT ESC_STYLE=C PAD=NO>$args.template_name</PDM_FMT> Detail";
</script>
<PDM_INCLUDE FILE=std_head.htmpl>
<script type="text/javascript">
var argHumantouchLog = "$args.KEEP.humantouch_log";
var argPersistentID = "$args.persistent_id";
var argCstID = "$cst.id";
var cfgDateFormat = "$date_format";
var argChgRefNum = "$args.chg_ref_num";
var argID = "$args.id";
var argActive = "$args.active";
var cfgCgiReportScript = '<PDM_FMT PAD=NO ESC_STYLE=C>$SESSION.CGIREPORT_SCRIPT</PDM_FMT>';
<PDM_IF "itil" == "$env.NX_OTB_MARKET">
var rptName = new Array("chgsum.rpt", "chg_itildtl.rpt");
<PDM_ELSE>
var rptName = new Array("chgsum.rpt", "chgdtl.rpt");
</PDM_IF>
var argSearchSqlClause = "id = $args.id";
var formEnduser = new Array("main_form","requestor");
var prop_ref = "${prop_ref:}";
var cawf_defid = "";
var cawf_set;
</script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/arrow_button.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/change_cat.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/check_submit.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/detail_form.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/img_link.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/upload.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/update_lrel.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/timer.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/attevts.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/track_asset.js"></script>
<script LANGUAGE="JavaScript" SRC="$CAisd/scripts/wf_visible.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/attmnt_upload.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/attmnt_lib.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></script>
<script type="text/javascript">
function loadActions()
{
   if ( _dtl.edit ) {
      save_initial_vals();
   }

   // SDT 22046 get around IE 5.5 problem by delaying call
    if ( _dtl.edit ) {
                load_from_scratchpad("$args.id", "$args.KEEP.FROM_PROF_BRWS");
        }
   // SDT 22898 need to fill in affected_contact if requestor is pre_loaded from scratchpad
   if (  _dtl.edit && "$args.id" == 0  ) {
      backfill_cnt_event();
   }
}

function unloadActions()
{
   if ( _dtl.edit )
      unload_check();
   cancel_any_lrel_update();
}

var aff_cnt_value = "";
function backfill_cnt_event( form_name, base_name, lname, fname, mname,
                             cntID, caller_type )
{
   if ( typeof base_name != "string" ) {
      form_name = "main_form";
      base_name = "requestor";
      caller_type = "";
   }
   if ( base_name == "requestor" ) {
      var f = document.main_form;
      if ( typeof f == "object" &&
           typeof f.affected_contact_combo_name == "object" &&
           typeof f.requestor_combo_name == "object" &&
           f.affected_contact_combo_name.value == aff_cnt_value ) {
         aff_cnt_value = f.requestor_combo_name.value;
         f.affected_contact_combo_name.value = aff_cnt_value;
         f.affected_contact_fname.value = f.requestor_fname.value;
         f.affected_contact_mname.value = f.requestor_mname.value;
         f.affected_contact_lname.value = f.requestor_lname.value;
         f.elements["SET.affected_contact"].value = f.elements["SET.requestor"].value;
         f.elements["KEY.affected_contact"].value = f.elements["KEY.requestor"].value;

      }
   }
   if (_dtl.edit && !_dtl.skip_agt_check)
   {
        var f = void(0);
        var r = form_name.match(/main_form([0-9]*)/);
        if ( r != null ) {
            if ( r[1].length == 0 )
                f = _dtl.form[0];
            else
                f = _dtl.form[r[1]-0];
        }
        detailAgtCheck(f, base_name, cntID, prop_ref);
   }
   detailCntBackfill( form_name, base_name, lname, fname, mname,
                      cntID, caller_type );
             
     // Contract enforcement:                 
     if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes' &&
     base_name == "affected_contact" && typeof cntID != "undefined" && cntID.length > 1) {
       
        upd_workframe("GET_SVC_CONTRACT", "new_customer=cnt:" + cntID,
                 "func=parent.ahdframe.get_svc_callback");
     }
}

function autofillTrigger( e, obj_type, is_contact, common_name_attr )
{
   var suppress = ( e.name == "affected_contact_combo_name" &&
                    e.value == aff_cnt_value );
   return ! suppress;
}

function reset_field(target, newvalue ) {
     
     // Reset a field on the main form to the newvalue passed in
     if ( typeof document.main_form.elements[target]  == "object" ) {  
                    if ( typeof newvalue == "undefined") 

               document.main_form.elements[target].value = "";
          else
               document.main_form.elements[target].value = newvalue;
               
          detailClearSetField(document.main_form.elements[target]);

     }
          
}


function copy_from_chg()
{
    if ("$args.KEEP.MAKE_COPY" == "1")
    {
     var exceptions = new Array();
     exceptions[0] = "SET.affected_contact";
     exceptions[0] = "SET.requestor";
     detailCopyEditForm(exceptions);
    }
}

</script>
</HEAD>
<BODY class=detailro onLoad="loadActions()" onUnload="unloadActions()">

<PDM_INCLUDE FILE=std_body.htmpl menubar=sd>
<CENTER>

<script type="text/javascript">
<PDM_MACRO NAME=dtlForm factory=chg>

<PDM_IF "$prop.form_name_3" == "edit">
ImgBtnCreate("PROFILE_BROWSER", msgtext(91), "edit_profile_browser(" +
             '"combo_name", document.main_form["affected_contact_combo_name"].value)',
             false, 0);      
<PDM_ELSE>
ImgBtnCreate("PROFILE_BROWSER", msgtext(91),
             "profile_browser('$args.affected_contact.persistent_id')", true, 0);
</PDM_IF>

<PDM_IF "$prop.form_name_3" == "edit" && $args.id == 0>
ImgBtnCreate("btn010", msgtext(435) , "apply_template('frm001', 'SET.affected_contact', 'chg')", 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">
<script type="text/javascript">
</PDM_IF>

<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlLookup hdr=Requester attr="requestor" evt="onChange=\\\"backfill_cnt_event()\\\"">
<PDM_MACRO NAME=dtlLookup hdr="Affected End User" attr="affected_contact">
<PDM_MACRO NAME=dtlHier hdr=Category attr="category" autofill=no evt="onChange=\\\"change_category_func('chg')\\\"">
<PDM_MACRO NAME=dtlDropdown hdr=Status attr="status" lookup=no>
<PDM_MACRO NAME=dtlDropdown hdr=Priority attr="priority" lookup=no evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlStartExpRow form_name="detail_chg" label="Detail" exp_rows="1,2" colspan=5>
<PDM_MACRO NAME=dtlReadonly hdr="Created By" attr="log_agent">
<PDM_MACRO NAME=dtlLookup hdr=Assignee attr="assignee" evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlLookup hdr=Group attr="group" evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlDropdown hdr=Impact attr="impact" lookup=no>
<PDM_MACRO NAME=dtlReadonly hdr=Active? attr="active">
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlDate hdr="Need By Date" attr="need_by">
var cbDateCheck = 0;
if ( _dtl.edit)
    cbDateCheck = 1;
   
if ( "$args.call_back_date_INT_DATE" != "" || ! _dtl.edit ) {
  
<PDM_MACRO NAME=dtlDate hdr="Call Back Date/Time" attr="call_back_date">
}
else {
   detailDateDropdown("Call Back Date/Time", "call_back_date", 1, 20,
                      "$args.REQUIRED_call_back_date",
                      "SET.call_back_flag",
                      86400, msgtext(287),   // In one day
                      172800, msgtext(288),  // In two days
                      604800, msgtext(289)); // In one week
}
<PDM_MACRO NAME=dtlHier hdr="Root Cause" attr="rootcause" evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlDropdown hdr=Organization attr="organization">
<PDM_MACRO NAME=dtlLookup hdr=Project attr="project">
<PDM_MACRO NAME=dtlStartExpRow form_name="detail_chg" label="Summary Information" exp_rows="1,2,3" colspan=5>
<PDM_MACRO NAME=dtlTextbox hdr="Order Summary" attr="summary" size=60 colspan=4 keeplinks=yes spellchk=yes>
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlTextbox hdr="Order Description" attr="description" size=80 colspan=4 rows=4 keeplinks=yes
spellchk=yes>
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlDateReadonly hdr="Open Date" attr="open_date">
<PDM_MACRO NAME=dtlDateReadonly hdr="Actual Start Date" attr="start_date">
<PDM_MACRO NAME=dtlDateReadonly hdr="Resolve Date" attr="resolve_date">
<PDM_MACRO NAME=dtlDateReadonly hdr="Close Date" attr="close_date">
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlTextbox hdr="External Reference" attr="ext_ref" size=20>
<PDM_MACRO NAME=dtlDropdown hdr="Resolving Version" attr="zRes_Ver" size=20 autofill=no>
</script>

<!-- Must in in the main_form form -->
<INPUT TYPE=hidden NAME=catg_cawf_defid VALUE="" SIZE="20">

<script type="text/javascript">

<PDM_MACRO NAME=dtlEndTable>

</script>

<PDM_NOTEBOOK name=chg_nb>
     <PDM_TAB name=Properties file="xx_prop_tab.htmpl">
<PDM_IF "$ProductID" != "htcs">
<PDM_IF "$args.cawf_procid" != "">
     <PDM_TAB name="Workflow Tasks" src="OP=INVOKE_SOAP+DAEMON_OP=CallStaticSOAPOperation+CLASSNAME=com.ca.ServicePlus.pdm_rpc.CAWorkflow+ARG0=getWorkflowInstance+ARG1=+ARG2=$args.category.cawf_defid+ARG3=$args.cawf_procid+ARG4=1+ARG5=1+HTMPL=list_workitems.htmpl">
     </PDM_TAB>
<PDM_ELSE>
     <PDM_TAB name="Workflow Tasks" file="xx_wf_tab.htmpl">
</PDM_IF>
<PDM_IF "$env.NX_OTB_MARKET" == "itil">
      
     <PDM_TAB name="Config. Items" file="xx_nr_tab.htmpl">
<PDM_ELSE>
      
     <PDM_TAB name=Assets file="xx_nr_tab.htmpl">
</PDM_IF>
</PDM_IF>
<PDM_IF "$prop.view_internal" == "0">
     <PDM_TAB name=Activities src="OP=SEARCH+FACTORY=chgalg+QBE.EQ.change_id=$args.id+QBE.EQ.internal=0" id=alg height=300></pdm_tab>
<PDM_ELSE>
     <PDM_TAB name=Activities src="OP=SEARCH+FACTORY=chgalg+QBE.EQ.change_id=$args.id" id=alg height=300></pdm_tab></PDM_IF>
     <PDM_TAB name="Related Orders" file="chg_relchg_tab.htmpl" id=rel>
<PDM_IF $ProductID != "htcs">
     <PDM_TAB name="Service Type" file="xx_stype_tab.htmpl" id=stype new_row=Yes>
</PDM_IF>
<PDM_IF "$env.NX_OTB_MARKET" == "itil">
       
     <PDM_TAB name="Incidents / Problems" file="chg_relreq_tab.htmpl" id=rel>
<PDM_ELSE>
       
     <PDM_TAB name=Requests file="chg_relreq_tab.htmpl" id=rel>
</PDM_IF>
     <PDM_TAB name="Event Log" src="OP=SEARCH+FACTORY=event_log+QBE.EQ.sd_obj_type=chg+QBE.EQ.sd_obj_id=$args.id" height=300></pdm_tab>
     <PDM_TAB name="Costs / Plans" file="xx_candp_tab.htmpl">
     <PDM_TAB name=Attachments src="OP=SHOW_DETAIL+HTMPL=xx_attmnt_tab.htmpl+FACTORY=chg+PERSID=$args.persistent_id" id=attmnt height=300></pdm_tab>
<PDM_IF "$prop.form_name_3" == "edit" || "$args.template_name" != "">
     <PDM_TAB name=Template file="xx_template_tab.htmpl" filename=change>
</PDM_IF>

     <PDM_TAB name="Business Impact" file="xx_businessimpact_tab.htmpl" new_row=yes>
</PDM_NOTEBOOK>

<!-- must be in the main form-->
<INPUT TYPE=HIDDEN NAME=category_contract VALUE="$args.category.owning_contract">
<INPUT TYPE=HIDDEN NAME=user_contract VALUE="$args.affected_contact.organization.owning_contract">
<INPUT TYPE=HIDDEN NAME=org_id VALUE="$args.affected_contact.organization.id">

<PDM_MACRO NAME=dtlEnd>
<PDM_INCLUDE FILE=std_footer.htmpl>
</BODY>
</HTML>
<PDM_IF 0>
@(#)$Id: detail_chg.htmpl,v 1.109 2006/03/15 16:51:13 siwst01 Exp $
</PDM_IF>

<PDM_WSP>
detail_cnt.htmpl
<PDM_IF 0>
detail_cnt.htmpl
WHEN PRESENTED:
    When we need to display a detail of a single Call Req
INTENT:
    Display the detail info for the Call Req
VARIABLES:
    string   image The location of the image directory as specified in
                       in the config file.
    object  cnt  args   The Call Req object we are displaying.
                        See $NX_ROOT/bopcfg/majic/cm
/opt/CApdm/bopcfg/majic/writer.maj:OBJECT cnt {.maj for the
                        definition of attributes for 'OBJECT cnt'
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110>
<PDM_INCLUDE FILE=styles.htmpl>
<SCRIPT LANGUAGE="JavaScript">
<PDM_IF "$args.type" == "2305">
var hdrTitle = "$args.combo_name Employee Detail";
var hdrTitleUpd = "$args.combo_name Update Employee";
var hdrTitleNew = "Create New Employee";
<PDM_ELIF "$args.type" == "2307">
var hdrTitle = "$args.combo_name Analyst Detail";
var hdrTitleUpd = "$args.combo_name Update Analyst";
var hdrTitleNew = "Create New Analyst";
<PDM_ELIF "$args.type" == "2308">
var hdrTitle = "$args.combo_name Group Detail";
var hdrTitleUpd = "$args.combo_name Update Group";
var hdrTitleNew = "Create New Group";
<PDM_ELIF "$args.type" == "2310">
var hdrTitle = "$args.combo_name Customer Detail";
var hdrTitleUpd = "$args.combo_name Update Customer";
var hdrTitleNew = "Create New Customer";
<PDM_ELSE>
var hdrTitle = "$args.combo_name Contact Detail";
var hdrTitleUpd = "$args.combo_name Update Contact";
var hdrTitleNew = "Create New Contact";
</PDM_IF>
</SCRIPT>
<PDM_INCLUDE FILE=std_head.htmpl>
<SCRIPT LANGUAGE="JavaScript">
var argPersistentID = "$args.persistent_id";
var argID = "$args.id";
var rptName = new Array("cntsum.rpt", "cntdtl.rpt");
var argSearchSqlClause = "id = U'$args.id'";
var cfgUserAuth = "$UserAuth";
var enableBtns = true;
var prop_ref = "${prop_ref:}";
if (cfgUserAuth < 2) enableBtns = false;
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/arrow_button.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/check_submit.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/detail_form.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/update_lrel.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></SCRIPT>
<PDM_IF "$prop.form_name_3" == "ro">
<SCRIPT LANGUAGE="JavaScript">
profile_reset_if_necessary('$args.persistent_id')
</SCRIPT>
</PDM_IF>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function copy_from_parent()
{}
function loadActions()
{
    detailFocus1st();
}
function unloadActions()
{
   if ( _dtl.edit )
      unload_check();
   cancel_any_lrel_update();
}


function check_for_member_flags_and_save() {
          <PDM_IF "$args.type.id" == "2308">
          mbs.update_flags();
          //detailSave is called in update_flags_cb() which is the callback function
          // for update_flags()
          <PDM_ELSE>
          detailSave();
          </PDM_IF>
          }

function pop_ldap()
{
     var e=document.main_form.elements;
     var fn="";
     var mn="";
     var ln="";
     var ui="";

     if(typeof e["SET.first_name"]=="object" && e["SET.first_name"].value.length)
     {
          fn="QBE.IN.first_name="+e["SET.first_name"].value;
     }

     if(typeof e["SET.middle_name"]=="object" && e["SET.middle_name"].value.length>0)
     {
          mn="QBE.IN.middle_name="+e["SET.middle_name"].value;
     }

     if(typeof e["SET.last_name"]=="object" && e["SET.last_name"].value.length>0)
     {
          ln="QBE.IN.last_name="+e["SET.last_name"].value;
     }

     if(typeof e["SET.userid"]=="object" && e["SET.userid"].value.length>0)
     {
          ui="QBE.IN.userid="+e["SET.userid"].value;
     }

     ahdtop.merge_ldap=new Object();
     ahdtop.merge_ldap=window;

     popup_window('', 'SEARCH', 0, 0, '', '', 'FACTORY=ldap', ln, fn, mn, ui, 'KEEP.merge_ldap='+argPersistentID, 'KEEP.prop_ref='+prop_ref);
   
}

function pop_ldap_callback(l)
{
     // merge_ldap() returns attr/value pairs in the form:
     //   attr1:value,attr2:value, ... attrx:value
     // split them apart and stuff them in the form
     var pairs=l.split(",");

     for(var i=0; i<pairs.length; i++)
     {
          var vals=pairs[i].split(":");
          var attr=vals[0];
          var val=unescape(vals[1]);

          if(attr.indexOf("#")<0) {
               if(typeof document.main_form.elements["SET."+attr]=="object")
               {
                    document.main_form.elements["SET."+attr].value=val;
               }
          } else {
               var attrvals=attr.split("#");
               var attr1=attrvals[0];
               var tag=attrvals[1];
               
               if(typeof document.main_form.elements[tag+"."+attr1]=="object")
               {
                    document.main_form.elements[tag+"."+attr1].value=val;
                    if(tag=="KEY") {
                         document.main_form.elements["KEY."+attr1].onchange();
                         document.main_form.elements["KEY."+attr1].onblur();
                    }
               }
          }
     }

     ahdtop.merge_ldap=void(0);
}

</SCRIPT>
</HEAD>
<BODY class=detailro onLoad="loadActions()" onUnload="unloadActions()">
<PDM_IF "$args.KEEP.analyst_tab" == 1>
<PDM_INCLUDE FILE=std_body.htmpl menubar=sd>
<PDM_ELSE>
<PDM_INCLUDE FILE=std_body.htmpl>
</PDM_IF>
<CENTER>
<SCRIPT LANGUAGE="JavaScript">
<PDM_MACRO NAME=dtlForm factory=cnt button=false>
if (_dtl.edit)
{
  try {
     var pb_window_name = popup_window_name("profile_browser");
    if ( typeof pb_window_name == "string" &&
         pb_window_name.length > 0 ) {
      var _p = window.parent;
      if ( typeof _p.opener == "object" &&
          _p.opener != null &&
          !_p.opener.closed ) {
        var opPar = _p.opener;
        while ( opPar != opPar.parent &&
                opPar != ahdtop ) {
          opPar = opPar.parent;
          if ( opPar.name == pb_window_name ) {
            opPar.closePopup = 1;
            break;
          }
        }
      }
    }
  }
  catch(e) {}
}
var combo_name = '<PDM_FMT ESC_STYLE=C>$args.combo_name</PDM_FMT><BR>';

ImgBtnRow();
if (_dtl.edit)
{
ImgBtnCreate("btn001", msgtext(208), "check_for_member_flags_and_save()", true,0);
ImgBtnCreate("btncncl", msgtext(209), "cancel_update('$prop.form_name_2','$args.id','$args.NEXT_PERSID')", true, 120);
ImgBtnCreate("btn004", msgtext(400), "pdm_reset()", true, 120);
}
else
{
ImgBtnCreate("btn001", msgtext(513), "detailEdit()", // Edit
                         true);
}

if (propIsITIL)
    ImgBtnCreate("UPDATE_LREL", msgtext(436), "update_lrel('cnt', '$args.persistent_id', 'nr', 'cenv',  'Configuration Items',
msgtext(556, combo_name), '')", enableBtns, 0);
else
    ImgBtnCreate("UPDATE_LREL", msgtext(436), "update_lrel('cnt', '$args.persistent_id', 'nr', 'cenv',  'Assets', msgtext(556,
combo_name), '')", enableBtns, 0);

<PDM_IF "$args.type.id" == "2308">
ImgBtnCreate("UPDATE_MEM",msgtext(437), "update_mem('cnt', '$args.persistent_id', 'cnt', 'member_list',  'Members',
msgtext(558, combo_name))", enableBtns, 0);
<PDM_ELSE>
ImgBtnCreate("UPDATE_GRP", msgtext(438), "update_grp('cnt', '$args.persistent_id', 'cnt', 'group_list',  'Groups', msgtext(557,
combo_name))", enableBtns, 0);
</PDM_IF>

if (_dtl.edit)
{
     if ( typeof cfgLdapEnabled == "string" && cfgLdapEnabled == "yes" )
     {
          ImgBtnCreate("btn005", msgtext(773), "pop_ldap()", true);
     }
}
ImgBtnEndRow();
<PDM_MACRO NAME=dtlStart scroll=true>

<PDM_MACRO NAME=dtlStartRow>
<PDM_IF "$args.type.id" == "2308">
     <PDM_MACRO NAME=dtlTextbox hdr="Group Name" attr="last_name" size=30 colspan=3>
<PDM_ELSE>
     <PDM_MACRO NAME=dtlTextbox hdr="Last Name" attr="last_name">
     <PDM_MACRO NAME=dtlTextbox hdr="First Name" attr="first_name">
     <PDM_MACRO NAME=dtlTextbox hdr="Middle Name" attr="middle_name">
</PDM_IF>
<PDM_MACRO NAME=dtlDropdown hdr=Status attr="delete_flag" lookup=no>
<PDM_MACRO NAME=dtlStartRow>
<PDM_IF "$args.type.id" == "2308">
     <PDM_MACRO NAME=dtlTextbox hdr="Contact ID" attr="contact_num" colspan=2>
<PDM_ELSE>
     <PDM_MACRO NAME=dtlTextbox hdr="Contact ID" attr="contact_num">
     <PDM_MACRO NAME=dtlTextbox hdr="System Login" attr="userid">
</PDM_IF>
<PDM_IF "$args.type.id" == "2308">
     <PDM_MACRO NAME=dtlReadonly hdr="Contact Type" attr="type">
<PDM_ELSE>
     <PDM_MACRO NAME=dtlDropdown hdr="Contact Type" attr="type" lookup=no>
</PDM_IF>

<!-- Search only service types that are public, with no service contract -->
<PDM_MACRO NAME=dtlLookup hdr="Service Type" attr="service_type" extraURL="ADDITIONAL_WHERE=owning_contract IS NULL+KEEP.SVC_CONTRACT_ID=0+KEEP.SVC_CONTRACT_SYM=(empty)">
<PDM_MACRO NAME=dtlStartRow
<PDM_MACRO NAME=dtlDropdown hdr="Time Zone" attr="timezone" lookup=no>
<PDM_MACRO NAME=dtlDropdown hdr="Job Title" attr="position">
<PDM_MACRO NAME=dtlDropdown hdr="Data Partition" attr="domain">
<PDM_MACRO NAME=dtlDropdown hdr="Access Type" attr="access_type" lookup=no>
<PDM_IF $args.type == 2307 || $args.type == 2308>
     <PDM_MACRO NAME=dtlStartRow>
     <PDM_MACRO NAME=dtlDropdown hdr="Work Schedule" attr="schedule">
     <PDM_IF $args.type == 2307>
          <PDM_MACRO NAME=dtlCheckbox hdr=Available attr="available" on=Yes off=No>
     </PDM_IF>
     <PDM_IF $args.type.id == 2308>
          <PDM_MACRO NAME=dtlDropdown hdr="Global Queue" attr="global_queue_id">
     </PDM_IF>
</PDM_IF>
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlDropdown hdr="Contact Language" attr="zLang" size=20 autofill=no>

<PDM_MACRO NAME=dtlEndTable>
</SCRIPT>

<PDM_NOTEBOOK name=cnt_nb>
     <PDM_TAB name=Notification file="cnt_notif_tab.htmpl">
     <PDM_TAB name=Address file="cnt_addr_tab.htmpl">
     <PDM_TAB name="Organizational Info" file="cnt_org_tab.htmpl">
     <PDM_TAB name=Environment file="cnt_env_tab.htmpl">
     <PDM_TAB name=Remarks file="cnt_rem_tab.htmpl" new_row=Yes>
<PDM_IF "$args.type.id" == "2308">
     <PDM_TAB name=Members file="cnt_mem_tab.htmpl">
<PDM_ELSE>
     <PDM_TAB name=Groups file="cnt_grp_tab.htmpl">
</PDM_IF>
<PDM_IF $ACCESS.admin \> 0>
     <PDM_TAB name="Service Contracts" file="mapped_contracts_tab.htmpl">
     <PDM_IF "$args.type.id" == "2308">
          <PDM_IF "$env.NX_CMDB" != "STANDALONE">
          
     <PDM_TAB name="Auto Assignment" file="cnt_auto_assignment_tab.htmpl">
          </PDM_IF>
     </PDM_IF>
</PDM_IF>
</PDM_NOTEBOOK>

<PDM_MACRO NAME=dtlEnd>

<PDM_INCLUDE FILE=std_footer.htmpl>
</BODY>
</HTML>
<PDM_IF 0>
@(#)$Id: detail_cnt.htmpl,v 1.68.1.2 2006/05/08 15:31:59 poibr01 Exp $
</PDM_IF>

<PDM_WSP>
detail_in.htmpl
<PDM_IF 0>
detail_in.htmpl
WHEN PRESENTED:
    When we need to display a detail of a single Call Req
INTENT:
    Display the detail info for the Call Req
VARIABLES:
    string   image The location of the image directory as specified in    
                   in the config file.
    object  cr  args    The Call Req object we are displaying.
                        See $NX_ROOT/bopcfg/majic/cm
/opt/CApdm/bopcfg/majic/writer.maj:OBJECT cr {.maj for the
                        definition of attributes for 'OBJECT cr'
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110 OVERRIDE=YES>
<PDM_INCLUDE FILE=styles.htmpl>
<script type="text/javascript">
var hdrTitle = "$args.ref_num Incident Detail";
var hdrTitleUpd = "$args.ref_num Update Incident";
var hdrTitleNew = "Create New Incident $args.ref_num";
var hdrTitleTempl = "$args.ref_num Incident Template <PDM_FMT ESC_STYLE=C PAD=NO>$args.template_name</PDM_FMT> Detail";
</script>
<PDM_INCLUDE FILE=std_head.htmpl DebugSource=1>
<script type="text/javascript">
var argHumantouchLog = "$args.KEEP.humantouch_log";
var argPersistentID = "$args.persistent_id";
var argCstID = "$cst.id";
var argRefNum = "$args.ref_num";
var argID = "$args.id";
var argChange = "$args.change";
var argActive = "$args.active";
var rptName = new Array("insum.rpt", "indtl.rpt");
var argSearchSqlClause = "id = $args.id";
var formAsset = new Array("main_form","KEY.affected_resource");
var formEnduser = new Array("main_form","customer");
var propSearchConfig="$prop.SD_SEARCH_CONFIG_CR";
var prop_ref = "${prop_ref:}";
var cfgCheckAgtInAreaDef = "$env.NX_CHECK_ASSIGNEE_IN_AREA_DEFAULTS";
var requestType="$args.type";
var requestTypeSym="$args.type.sym";

propFormName = "detail_in.htmpl";
propFormName2 = "in";
disable_right_click();
</script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/arrow_button.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/change_cat.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/check_submit.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/detail_form.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/img_link.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/upload.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/update_lrel.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/timer.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/attevts.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></script>
<script type="text/javascript">
var w_name = get_popup_window_name("ci_window");
var loadFilterArr=new Array();

function backfill_cnt_event( form_name, base_name, lname, fname, mname,
                             cntID, caller_type )
{
     // Contract enforcement:                 
     if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes' &&
     base_name == "customer" && typeof cntID != "undefined" && cntID.length > 1) {
       
        upd_workframe("GET_SVC_CONTRACT", "new_customer=cnt:" + cntID,
                 "func=parent.ahdframe.get_svc_callback");
     }
}

function loadActions()
{
   if ( _dtl.edit ) {
      save_initial_vals();
       <PDM_LIST PREFIX=list WHERE="delete_flag = 0" FACTORY=ctimer>
            addctimer("$list.threshold", "$list.color", $list.beep, "$list.text");
      </PDM_LIST>
          if ('$args.KEEP.use_kd_values_fromahdtop' == '1' && "0" == "$args.id")
          {
               //This code used when creating a request from a link that was created by the HTML Editor. SDT 32942
               ahdframe.detailExtUpdate (ahdtop.KDValuesToUse);
               ahdtop.KDValuesToUse = null;
          }     
      StartTheTimer("main_form","timer");
      loadFilterArray();
   } else {
     loadFilterArr["summary"]=<PDM_FMT ESC_STYLE=C>"$args.summary"</PDM_FMT>;
     loadFilterArr["description"]=<PDM_FMT ESC_STYLE=C>"$args.description"</PDM_FMT>;
     loadFilterArr["affected_resource"]="$args.affected_resource.COMMON_NAME";
     loadFilterArr["severity"]="$args.severity";
     loadFilterArr["impact"]="$args.impact";
     loadFilterArr["urgency"]="$args.urgency";
     loadFilterArr["priority"]="$args.priority";
     loadFilterArr["category"]="$args.category.COMMON_NAME";
     loadFilterArr["rootcause"]="$args.rootcause.COMMON_NAME";
   }
  
     // SDT 22046 get around IE 5.5 repaint problem by delaying call
   window.setTimeout('default_scratchpad()', 1000);
}

function default_scratchpad() {
     if ( _dtl.edit ) {
          load_from_scratchpad("$args.id", "$args.KEEP.FROM_PROF_BRWS");
     }
     detailFocus1st();
}

function unloadActions()
{
   if ( _dtl.edit )
      unload_check();
   cancel_any_lrel_update();
}

function copy_from_cr()
{
    if ("$args.KEEP.MAKE_COPY" == "1")
    {
     var exceptions = new Array();
     exceptions[0] = "SET.customer";
     detailCopyEditForm(exceptions);
    }
}

// detailExtraSaveButtons()
// Provide extra save buttons for edit form
function detailExtraSaveButtons(generate)
{
  var count = 0;
<PDM_IF $ACCESS.change_mgr == 2 && "$args.change" == "">
  count++;
  if ( generate )
    ImgBtnCreate("btnchg", msgtext(441), "detailSave('NEW_CHANGE')",
                 true, 0, msgtext(440)); // Save and Create Change Order
</PDM_IF>
<PDM_IF "$args.problem" == "">
  count++;
  if ( generate )
    ImgBtnCreate("ITIL_PROBLEM", msgtext(489), "itil_problem()",
                 true, 0, msgtext(931)); // Save and Create Problem
</PDM_IF>
  return count;
}
  
function itil_problem()
{
  parent.createProblem = true;
  detailSave();
}

</script>
</HEAD>
<BODY class=detailro onLoad="loadActions()" onUnload="unloadActions()">
<PDM_INCLUDE FILE=std_body.htmpl filename="Incident" key="$args.ref_num" menubar=sd>
<CENTER>

<FORM NAME="frm002">
<INPUT TYPE=hidden NAME=SET.customer VALUE="$args.customer">
<INPUT TYPE=hidden NAME=customer_combo_name VALUE="$args.customer.combo_name">
<INPUT TYPE=hidden NAME=SET.assignee VALUE="$args.assignee">
<INPUT TYPE=hidden NAME=assignee_combo_name VALUE="$args.assignee.combo_name">
<INPUT TYPE=hidden NAME=SET.group VALUE="$args.group">
<INPUT TYPE=hidden NAME=group_combo_name VALUE="$args.group.combo_name">
<INPUT TYPE=hidden NAME=SET.priority VALUE="$args.priority">
<INPUT TYPE=hidden NAME=SET.severity VALUE="$args.severity">
<INPUT TYPE=hidden NAME=SET.urgency VALUE="$args.urgency">
<INPUT TYPE=hidden NAME=SET.impact VALUE="$args.impact">
<INPUT TYPE=hidden NAME=SET.change VALUE="$args.change">
<INPUT TYPE=hidden NAME=KEY.change VALUE="$args.change.chg_ref_num">
<INPUT TYPE=hidden NAME=SET.affected_resource VALUE="$args.affected_resource">
<INPUT TYPE=hidden NAME=KEY.affected_resource VALUE="$args.affected_resource.COMMON_NAME">
<INPUT TYPE=hidden NAME=SET.summary VALUE=<PDM_FMT ESC_STYLE=JS2>"$args.summary"</PDM_FMT>>
<INPUT TYPE=hidden NAME=SET.description VALUE=<PDM_FMT ESC_STYLE=JS2>"$args.description (created from Incident $args.ref_num)"</PDM_FMT>>

</FORM>

<script type="text/javascript">
<PDM_IF "$prop.form_name_3" != "edit">
if ( typeof parent.createProblem == "boolean" &&
     parent.createProblem ) {
  if (typeof ahdframeset.workframe == "object")
    ahdframeset.workframe.SkipInitialFocus = "1";
  create_new('cr',0,0,0,'PRESET=type:P','INITFROM=frm002', 'PRESET=from_incident:$args.persistent_id');
}
</PDM_IF>
parent.createProblem = void(0);

<PDM_MACRO NAME=dtlForm factory=cr>
<PDM_IF "$prop.form_name_3" == "edit">
ImgBtnCreate("PROFILE_BROWSER", msgtext(91), "edit_profile_browser(" +
             '"combo_name", document.main_form["customer_combo_name"].value)',
             false, 0);            
<PDM_ELSE>
<PDM_IF $ACCESS.change_mgr == 2 && "$args.change" == "">
   ImgBtnCreate("btnchg", msgtext(441), "detailSave('NEW_CHANGE')", true, 0);
</PDM_IF>
<PDM_IF "$args.problem" == "">
ImgBtnCreate("ITIL_PROBLEM", msgtext(489), "create_new('cr',0,0,0,'PRESET=type:P','INITFROM=frm002',
'PRESET=from_incident:$args.persistent_id')", true, 0);
</PDM_IF>
ImgBtnCreate("PROFILE_BROWSER", msgtext(91),
             "profile_browser('$args.customer.persistent_id',void(0),void(0),'$args.persistent_id')", true, 0);
</PDM_IF>

<PDM_IF "$prop.URL_CI" != "">
ImgBtnCreate("btn005", msgtext(442),
             'do_kt_search();', true, 0);

</PDM_IF>
<PDM_IF "$prop.form_name_3" == "edit" && $args.id == 0>
ImgBtnCreate("btn010", msgtext(435), "apply_template('frm001', 'SET.customer', 'in')", 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">
<script type="text/javascript">
</PDM_IF>

<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlLookup hdr="Affected End User" attr="customer">
<PDM_MACRO NAME=dtlHier hdr="Incident Area" attr="category" factory=pcat_in autofill=no evt="onChange=\\\"change_category_func('in')\\\"">
<PDM_MACRO NAME=dtlDropdown hdr=Status attr="status" lookup=no factory=crs_in>
<PDM_MACRO NAME=dtlDropdown hdr=Priority attr="priority" lookup=no>
<PDM_MACRO NAME=dtlStartExpRow form_name="detail_in" label="Detail" exp_rows="1,2,3" colspan=4>
<PDM_MACRO NAME=dtlLookupReadonly hdr="Reported By" attr="log_agent">
<PDM_MACRO NAME=dtlLookup hdr=Assignee attr="assignee" evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlLookup hdr=Group attr="group" evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlLookup hdr="Configuration Item" attr="affected_resource">
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlDropdown hdr=Severity attr="severity" lookup=no>
<PDM_MACRO NAME=dtlDropdown hdr=Urgency attr="urgency" lookup=no>
<PDM_MACRO NAME=dtlDropdown hdr=Impact attr="impact" lookup=no>
<PDM_MACRO NAME=dtlReadonly hdr=Active? attr="active">
<PDM_MACRO NAME=dtlStartRow>
<PDM_IF "$args.id" == "0">
     <PDM_MACRO NAME=dtlLookup hdr=Change attr="change">
<PDM_ELSE>
     <PDM_MACRO NAME=dtlLookupReadonly hdr=Change attr="change">
</PDM_IF>
<PDM_MACRO NAME=dtlLookup hdr=Problem attr="problem" factory=pr>

var cbDateCheck = 0;
if ( _dtl.edit)
    cbDateCheck = 1;
   
if ( "$args.call_back_date_INT_DATE" != "" || ! _dtl.edit ) {
  
<PDM_MACRO NAME=dtlDate hdr="Call Back Date/Time" attr="call_back_date">
} else {
   detailDateDropdown("Call Back Date/Time", "call_back_date", 1, 20,
                      "$args.REQUIRED_call_back_date",
                      "SET.call_back_flag",
                      86400, msgtext(287),   // In one day
                      172800, msgtext(288),  // In two days
                      604800, msgtext(289)); // In one week
}
<PDM_MACRO NAME=dtlHier hdr="Root Cause" attr="rootcause" evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlStartExpRow form_name="detail_in" label="Summary Information" exp_rows="1,2,3" colspan=4>

if(propSearchConfig.indexOf("summary*") > -1)
{
     
<PDM_MACRO NAME=dtlTextbox hdr=Summary attr="summary" size=60 colspan=3 keeplinks=yes spellchk=yes srchknow=yes>
} else {
     
<PDM_MACRO NAME=dtlTextbox hdr=Summary attr="summary" size=60 colspan=3 keeplinks=yes spellchk=yes srchknow=no>
}
<PDM_MACRO NAME=dtlReadonly hdr="Total Activity Time" attr="time_spent_sum">
<PDM_MACRO NAME=dtlStartRow>
if(propSearchConfig.indexOf("description*") > -1)
{
     
<PDM_MACRO NAME=dtlTextbox hdr=Description attr="description" size=80 colspan=3 rows=4 keeplinks=yes spellchk=yes srchknow=yes>
} else {       
     
<PDM_MACRO NAME=dtlTextbox hdr=Description attr="description" size=80 colspan=3 rows=4 keeplinks=yes spellchk=yes srchknow=no>
}
<PDM_IF "$prop.form_name_3" == "edit">
   detailRowHdr("Timer");
   detailSetRowData("<input type=text " + detailNextID() +
                    " name='timer' value='' size=8 readonly>");
<PDM_ELSE>
     <PDM_MACRO NAME=dtlReadonly hdr="Incident Priority" attr="incident_priority">
</PDM_IF>
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlDateReadonly hdr="Open Date/Time" attr="open_date">
<PDM_MACRO NAME=dtlDateReadonly hdr="Last Modified" attr="last_mod_dt">
<PDM_MACRO NAME=dtlDateReadonly hdr="Resolve Date/Time" attr="resolve_date">
<PDM_MACRO NAME=dtlDateReadonly hdr="Close Date/Time" attr="close_date">
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlTextbox hdr="External Reference" attr="ext_ref" size=20>
<PDM_MACRO NAME=dtlDropdown hdr="Resolving Version" attr="zRes_Ver" size=20 autofill=no>
<PDM_MACRO NAME=dtlHier hdr="Final Incident Area" attr="zcategory" size=20 factory=pcat_in autofill=no>
<PDM_MACRO NAME=dtlDropdown hdr="Problem Candidate" attr="zpb_flag" size=20 autofill=no>
<PDM_MACRO NAME=dtlDropdown hdr="Work Around" attr="zWorkAround" size=20 default=0>

<PDM_MACRO NAME=dtlEndTable>
</script>

<PDM_NOTEBOOK name=inro_nb>
<PDM_IF "$prop.view_internal" == "0">
     <PDM_TAB name=Activities src="OP=SEARCH+FACTORY=alg+QBE.EQ.call_req_id=$args.persistent_id+QBE.EQ.internal=0" id=alg height=300></pdm_tab>
<PDM_ELSE>
     <PDM_TAB name=Activities src="OP=SEARCH+FACTORY=alg+QBE.EQ.call_req_id=$args.persistent_id" id=alg height=300></pdm_tab>
</PDM_IF>

     <PDM_TAB name="Event Log" src="OP=SEARCH+FACTORY=event_log+QBE.EQ.sd_obj_type=cr+QBE.EQ.sd_obj_id=$args.id" height=300></pdm_tab>
     <PDM_TAB name=Attachments src="OP=SHOW_DETAIL+HTMPL=xx_attmnt_tab.htmpl+FACTORY=cr+PERSID=$args.persistent_id" id=attmnt height=300></pdm_tab>
     <PDM_TAB name="Service Type" file="xx_stype_tab.htmpl" id=stype>
     <PDM_TAB name="Parent / Child" file="in_relreq_tab.htmpl">
     <PDM_TAB name=Knowledge src="LAUNCHED_ITIL=I+OP=SEARCH+FACTORY=KD+SD_LAUNCHED=$args.persistent_id+KEEP.DISPLAY_FROM=cr" height=300 new_row=Yes></PDM_TAB>
     <PDM_TAB name=Solutions file="xx_solnalg_tab.htmpl" id=soln>
     <PDM_TAB name=Properties file="xx_prop_tab.htmpl">
<PDM_IF "$prop.form_name_3" == "edit" || "$args.template_name" != "">
     <PDM_TAB name=Template file="xx_template_tab.htmpl" filename=incident>
</PDM_IF>
</PDM_NOTEBOOK>

<!-- must be in the main form-->
<INPUT TYPE=HIDDEN NAME=category_contract VALUE="$args.category.owning_contract">
<INPUT TYPE=HIDDEN NAME=user_contract VALUE="$args.customer.organization.owning_contract">
<INPUT TYPE=HIDDEN NAME=org_id VALUE="$args.customer.organization.id">

<PDM_MACRO NAME=dtlEnd>

<script type="text/javascript">
<PDM_IF "$args.itg_url_name" != "">
function launchIntegrateUrl() {
url="$args.itg_url_name";
system_name="$args.affected_resource.system_name";
alarm_id="$args.affected_resource.alarm_id";
host=system_name?system_name:alarm_id;
   if(typeof host == "string" && host.length) {
      url+="?"+"HOST="+host;
   }
   window.open(url,"","width=850,height=600,location,alwaysRaised");
}
// necessary for focus on itg popup window
window.setTimeout('launchIntegrateUrl()',0);
</PDM_IF>
</script>

<PDM_INCLUDE FILE=std_footer.htmpl>
</BODY>
</HTML>
<PDM_IF 0>
@(#)$Id: detail_in.htmpl,v 1.114.1.2 2006/05/02 09:48:25 raies01 Exp $
</PDM_IF>

<PDM_WSP>
detail_pr.htmpl
<PDM_IF 0>
detail_pr.htmpl
WHEN PRESENTED:
    When we need to display a detail of a single Call Req
INTENT:
    Display the detail info for the Call Req
VARIABLES:
    string   image The location of the image directory as specified in    
                   in the config file.
    object  cr  args    The Call Req object we are displaying.
                        See $NX_ROOT/bopcfg/majic/cm
/opt/CApdm/bopcfg/majic/writer.maj:OBJECT cr {.maj for the
                        definition of attributes for 'OBJECT cr'
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110 OVERRIDE=YES>
<PDM_INCLUDE FILE=styles.htmpl>
<script type="text/javascript">
var hdrTitle = "$args.ref_num Problem Detail";
var hdrTitleUpd = "$args.ref_num Update Problem";
var hdrTitleNew = "Create New Problem $args.ref_num";
var hdrTitleTempl = "$args.ref_num Problem Template <PDM_FMT ESC_STYLE=C PAD=NO>$args.template_name</PDM_FMT> Detail";
</script>
<PDM_INCLUDE FILE=std_head.htmpl DebugSource=1>
<script type="text/javascript">
var argHumantouchLog = "$args.KEEP.humantouch_log";
var argPersistentID = "$args.persistent_id";
var argCstID = "$cst.id";
var cfgDateFormat = "$date_format";
var argRefNum = "$args.ref_num";
var argID = "$args.id";
var argChange = "$args.change";
var argActive = "$args.active";
var rptName = new Array("prsum.rpt", "prdtl.rpt");
var argSearchSqlClause = "id = $args.id";
var formAsset = new Array("main_form","KEY.affected_resource");
var formEnduser = new Array("main_form","customer");
var propSearchConfig="$prop.SD_SEARCH_CONFIG_CR";
var prop_ref = "${prop_ref:}";
var cfgCheckAgtInAreaDef = "$env.NX_CHECK_ASSIGNEE_IN_AREA_DEFAULTS";
var requestType="$args.type";
var requestTypeSym="$args.type.sym";

propFormName = "detail_pr.htmpl";
propFormName2 = "pr";
disable_right_click();
</script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/arrow_button.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/change_cat.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/check_submit.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/detail_form.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/img_link.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/upload.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/update_lrel.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/timer.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/attevts.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/itil.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></script>

<script type="text/javascript">
var w_name = get_popup_window_name("ci_window");
var loadFilterArr=new Array();

function backfill_cnt_event( form_name, base_name, lname, fname, mname,
                             cntID, caller_type )
{

     // Contract enforcement:                 
     if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes' &&
     base_name == "customer" && typeof cntID != "undefined" && cntID.length > 1) {
       

        upd_workframe("GET_SVC_CONTRACT", "new_customer=cnt:" + cntID,
                 "func=parent.ahdframe.get_svc_callback");
     }
}

function loadActions()
{
   if ( _dtl.edit ) {
      save_initial_vals();
       <PDM_LIST PREFIX=list WHERE="delete_flag = 0" FACTORY=ctimer>
            addctimer("$list.threshold", "$list.color", $list.beep, "$list.text");
      </PDM_LIST>
      StartTheTimer("main_form","timer");
      loadFilterArray();
   } else {
     loadFilterArr["summary"]=<PDM_FMT ESC_STYLE=C>"$args.summary"</PDM_FMT>;
     loadFilterArr["description"]=<PDM_FMT ESC_STYLE=C>"$args.description"</PDM_FMT>;
     loadFilterArr["affected_resource"]="$args.affected_resource.COMMON_NAME";
     loadFilterArr["severity"]="$args.severity";
     loadFilterArr["impact"]="$args.impact";
     loadFilterArr["urgency"]="$args.urgency";
     loadFilterArr["priority"]="$args.priority";
     loadFilterArr["category"]="$args.category.COMMON_NAME";
     loadFilterArr["rootcause"]="$args.rootcause.COMMON_NAME";
   }

 
     // SDT 22046 get around IE 5.5 repaint problem by delaying call
   window.setTimeout('default_scratchpad()', 1000);
}

function default_scratchpad() {
     if ( _dtl.edit ) {
          load_from_scratchpad("$args.id", "$args.KEEP.FROM_PROF_BRWS");
     }
     detailFocus1st();
}

function unloadActions()
{
   if ( _dtl.edit )
      unload_check();
   cancel_any_lrel_update();
}

function copy_from_cr()
{
    if ("$args.KEEP.MAKE_COPY" == "1")
    {
     var exceptions = new Array();
     exceptions[0] = "SET.customer";
     detailCopyEditForm(exceptions);
    }
}

// detailExtraSaveButtons()
// Provide extra save buttons for edit form
function detailExtraSaveButtons(generate)
{
  var count = 0;
<PDM_IF $ACCESS.change_mgr == 2 && "$args.change" == "">
  count++;
  if ( generate )
    ImgBtnCreate("btnchg", msgtext(441), "detailSave('NEW_CHANGE')",
                 true, 0, msgtext(440)); // Save and Create Change Order
</PDM_IF>
  return count;
}

</script>
</HEAD>
<BODY class=detailro onLoad="loadActions()" onUnload="unloadActions()">
<PDM_INCLUDE FILE=std_body.htmpl filename="Problem" key="$args.ref_num" menubar=sd>
<CENTER>

<FORM NAME="frm002">
<INPUT TYPE=hidden NAME=SET.customer VALUE="$args.customer">
<INPUT TYPE=hidden NAME=customer_combo_name VALUE="$args.customer.combo_name">
<INPUT TYPE=hidden NAME=SET.assignee VALUE="$args.assignee">
<INPUT TYPE=hidden NAME=assignee_combo_name VALUE="$args.assignee.combo_name">
<INPUT TYPE=hidden NAME=SET.group VALUE="$args.group">
<INPUT TYPE=hidden NAME=group_combo_name VALUE="$args.group.combo_name">
<INPUT TYPE=hidden NAME=SET.priority VALUE="$args.priority">
<INPUT TYPE=hidden NAME=SET.severity VALUE="$args.severity">
<INPUT TYPE=hidden NAME=SET.urgency VALUE="$args.urgency">
<INPUT TYPE=hidden NAME=SET.impact VALUE="$args.impact">
<INPUT TYPE=hidden NAME=SET.change VALUE="$args.change">
<INPUT TYPE=hidden NAME=KEY.change VALUE="$args.change.chg_ref_num">
<INPUT TYPE=hidden NAME=SET.affected_resource VALUE="$args.affected_resource">
<INPUT TYPE=hidden NAME=KEY.affected_resource VALUE="$args.affected_resource.COMMON_NAME">
<INPUT TYPE=hidden NAME=SET.problem VALUE="$args.persistent_id">
<INPUT TYPE=hidden NAME=KEY.problem VALUE="$args.ref_num">
<INPUT TYPE=hidden NAME=SET.summary VALUE='<PDM_FMT ESC_STYLE=C>$args.summary</PDM_FMT>'>
<INPUT TYPE=hidden NAME=SET.description VALUE='<PDM_FMT ESC_STYLE=C>$args.description</PDM_FMT>
(created from Problem $args.ref_num)'>
</FORM>

<script type="text/javascript">
<PDM_MACRO NAME=dtlForm factory=cr>
<PDM_IF "$prop.form_name_3" == "edit">
ImgBtnCreate("PROFILE_BROWSER", msgtext(91), "edit_profile_browser(" +
             '"combo_name", document.main_form["customer_combo_name"].value)',
             false, 0);
<PDM_ELSE>
<PDM_IF $ACCESS.change_mgr == 2 && "$args.change" == "">
ImgBtnCreate("btnchg", msgtext(441), "detailSave('NEW_CHANGE')", true, 0);
</PDM_IF>
ImgBtnCreate("PROFILE_BROWSER", msgtext(91),
             "profile_browser('$args.customer.persistent_id',void(0),void(0),'$args.persistent_id')", true, 0);
</PDM_IF>

<PDM_IF "$prop.URL_CI" != "">
ImgBtnCreate("btn005",  msgtext(442), 'do_kt_search();', true, 0);
</PDM_IF>
<PDM_IF "$prop.form_name_3" == "edit" && $args.id == 0>
ImgBtnCreate("btn010",  msgtext(435), "apply_template('frm001', 'SET.customer', 'pr')", 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">
<script type="text/javascript">
</PDM_IF>

<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlLookup hdr="Affected End User" attr="customer">
<PDM_MACRO NAME=dtlHier hdr="Problem Area" attr="category" factory=pcat_pr autofill=no evt="onChange=\\\"change_category_func('pr')\\\"">
<PDM_MACRO NAME=dtlDropdown hdr=Status attr="status" lookup=no factory=crs_pr>
<PDM_MACRO NAME=dtlDropdown hdr=Priority attr="priority" lookup=no>
<PDM_MACRO NAME=dtlStartExpRow form_name="detail_pr" label="Detail" exp_rows="1,2,3" colspan=4>
<PDM_MACRO NAME=dtlLookupReadonly hdr="Reported By" attr="log_agent">
<PDM_MACRO NAME=dtlLookup hdr=Assignee attr="assignee" evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlLookup hdr=Group attr="group" evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlLookup hdr="Configuration Item" attr="affected_resource">
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlDropdown hdr=Severity attr="severity" lookup=no>
<PDM_MACRO NAME=dtlDropdown hdr=Urgency attr="urgency" lookup=no>
<PDM_MACRO NAME=dtlDropdown hdr=Impact attr="impact" lookup=no>
<PDM_MACRO NAME=dtlReadonly hdr=Active? attr="active">
<PDM_MACRO NAME=dtlStartRow>
<PDM_IF "$args.id" == "0">
     <PDM_MACRO NAME=dtlLookup hdr=Change attr="change">
<PDM_ELSE>
     <PDM_MACRO NAME=dtlLookupReadonly hdr=Change attr="change">
</PDM_IF>
<PDM_MACRO NAME=dtlTextbox hdr="Charge Back ID" attr="charge_back_id">

var cbDateCheck = 0;
if ( _dtl.edit)
    cbDateCheck = 1;
   
if ( "$args.call_back_date_INT_DATE" != "" || ! _dtl.edit ) {
  
<PDM_MACRO NAME=dtlDate hdr="Call Back Date/Time" attr="call_back_date">
} else {
   detailDateDropdown("Call Back Date/Time", "call_back_date", 1, 20,
                      "$args.REQUIRED_call_back_date",
                      "SET.call_back_flag",
                      86400, msgtext(287),   // In one day
                      172800, msgtext(288),  // In two days
                      604800, msgtext(289)); // In one week
}
<PDM_MACRO NAME=dtlHier hdr="Root Cause" attr="rootcause" evt="onBlur=\\\"detailSyncEditForms(this)\\\"">
<PDM_MACRO NAME=dtlStartExpRow form_name="detail_pr" label="Summary Information" exp_rows="1,2,3" colspan=4>
if(propSearchConfig.indexOf("summary*") > -1)
{
     
<PDM_MACRO NAME=dtlTextbox hdr=Summary attr="summary" size=60 colspan=3 keeplinks=yes spellchk=yes
srchknow=yes>
} else {       
     
<PDM_MACRO NAME=dtlTextbox hdr=Summary attr="summary" size=60 colspan=3 keeplinks=yes spellchk=yes srchknow=no>
}     
<PDM_MACRO NAME=dtlReadonly hdr="Total Activity Time" attr="time_spent_sum">
<PDM_MACRO NAME=dtlStartRow>
if(propSearchConfig.indexOf("description*") > -1)
{
     
<PDM_MACRO NAME=dtlTextbox hdr=Description attr="description" size=80 colspan=3 rows=4 keeplinks=yes spellchk=yes srchknow=yes>
} else {      
     
<PDM_MACRO NAME=dtlTextbox hdr=Description attr="description" size=80 colspan=3 rows=4 keeplinks=yes spellchk=yes srchknow=no>
}
if ( _dtl.edit ) {
   detailRowHdr("Timer");
   detailSetRowData("<input type=text " + detailNextID() +
                    " name='timer' value='' size=8 readonly>");
}

<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlDateReadonly hdr="Open Date/Time" attr="open_date">
<PDM_MACRO NAME=dtlDateReadonly hdr="Last Modified" attr="last_mod_dt">
<PDM_MACRO NAME=dtlDateReadonly hdr="Resolve Date/Time" attr="resolve_date">
<PDM_MACRO NAME=dtlDateReadonly hdr="Close Date/Time" attr="close_date">
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlTextbox hdr="External Reference" attr="ext_ref" size=20>
<PDM_MACRO NAME=dtlDropdown hdr="Resolving Version" attr="zRes_Ver" size=20 autofill=no>
<PDM_MACRO NAME=dtlHier hdr="Final Incident Area" attr="zcategory" size=20 factory=pcat_pr autofill=no>
<PDM_MACRO NAME=dtlDropdown hdr="Work Around" attr="zWorkAround" size=20 default=0>

<PDM_MACRO NAME=dtlEndTable>
</script>

<script type="text/javascript">
<PDM_IF "$args.itg_url_name" != "">
function launchIntegrateUrl() {
url="$args.itg_url_name";
system_name="$args.affected_resource.system_name";
alarm_id="$args.affected_resource.alarm_id";
host=system_name?system_name:alarm_id;
if(typeof host == "string" && host.length)
{
url+="?"+"HOST="+host;
}
alert("this is window name "+window.name);
window.open(url,"","width=850,height=600,location,alwaysRaised");
}
// necessary for focus on itg popup window
window.setTimeout('launchIntegrateUrl()',0);
</PDM_IF>
</script>

<PDM_NOTEBOOK name=prro_nb>
<PDM_IF "$prop.view_internal" == "0">
     <PDM_TAB name=Activities src="OP=SEARCH+FACTORY=alg+QBE.EQ.call_req_id=$args.persistent_id+QBE.EQ.internal=0" id=alg height=300></pdm_tab>
<PDM_ELSE>
     <PDM_TAB name=Activities src="OP=SEARCH+FACTORY=alg+QBE.EQ.call_req_id=$args.persistent_id" id=alg height=300></pdm_tab>
</PDM_IF>
     <PDM_TAB name="Event Log" src="OP=SEARCH+FACTORY=event_log+QBE.EQ.sd_obj_type=cr+QBE.EQ.sd_obj_id=$args.id" height=300></pdm_tab>
     <PDM_TAB name=Attachments src="OP=SHOW_DETAIL+HTMPL=xx_attmnt_tab.htmpl+FACTORY=cr+PERSID=$args.persistent_id" id=attmnt height=300></pdm_tab>
     <PDM_TAB name="Service Type" file="xx_stype_tab.htmpl" id=stype>
     <PDM_TAB name="Attached Incidents" file="pr_attinc_tab.htmpl">
     <PDM_TAB name=Knowledge src="OP=SEARCH+FACTORY=KD+SD_LAUNCHED=$args.persistent_id+KEEP.DISPLAY_FROM=cr+LAUNCHED_ITIL=P" height=300 new_row=Yes></PDM_TAB>
     <PDM_TAB name=Solutions file="xx_solnalg_tab.htmpl" id=soln>
     <PDM_TAB name="Parent / Child" file="pr_relreq_tab.htmpl" id=rel>
     <PDM_TAB name=Properties file="xx_prop_tab.htmpl">
<PDM_IF "$prop.form_name_3" == "edit" || "$args.template_name" != "">
     <PDM_TAB name=Template file="xx_template_tab.htmpl" filename=problem>
</PDM_IF>
</PDM_NOTEBOOK>

<!-- must be in the main form-->
<INPUT TYPE=HIDDEN NAME=category_contract VALUE="$args.category.owning_contract">
<INPUT TYPE=HIDDEN NAME=user_contract VALUE="$args.customer.organization.owning_contract">
<INPUT TYPE=HIDDEN NAME=org_id VALUE="$args.customer.organization.id">

<PDM_MACRO NAME=dtlEnd>

<PDM_INCLUDE FILE=std_footer.htmpl>
</BODY>
</HTML>
<PDM_IF 0>
@(#)$Id: detail_pr.htmpl,v 1.106.1.2 2006/05/02 09:48:26 raies01 Exp $
</PDM_IF>

<PDM_WSP>
list_chg.htmpl
<PDM_IF 0>
$Id: list_chg.htmpl,v 1.125 2005/09/01 22:02:26 jenji01 Exp $
list_chg.htmpl
WHEN PRESENTED:
     When we need to display a list of Change Orders.
     
     Pass in KEEP.PARENT_SEARCH when searching for releated tickets.  It should be
     set to the potential child's persistent_id.
     
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110>
<PDM_INCLUDE FILE=styles.htmpl>
<SCRIPT LANGUAGE="JavaScript">
<PDM_IF "$args.KEEP.ForChild" == "1">
var hdrTitle = "Change Order Children Search";
var hdrTitleList = "Change Order Children List";
var hdrTitleTempl = "Change Order Children Template Search";
<PDM_ELSE>
var hdrTitle = "Change Order Search";
var hdrTitleList = "Change Order List";
var hdrTitleTempl = "Change Order Template Search";
</PDM_IF>
</SCRIPT>
<PDM_INCLUDE FILE=std_head.htmpl>
<SCRIPT LANGUAGE="JavaScript">
<PDM_IF "$env.NX_OTB_MARKET" == "itil">
var rptName = new Array("chgsum.rpt", "chg_itildtl.rpt");
<PDM_ELSE>
var rptName = new Array("chgsum.rpt", "chgdtl.rpt");
</PDM_IF>
var cfgCanEdit = true;
var cfgUserAuth = parseInt("$UserAuth",10);
var from_detail = "$args.KEEP.from_detail";
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></SCRIPT>
<PDM_INCLUDE FILE=std_list_include.htmpl>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/comboname.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
</HEAD>
<BODY CLASS="list">
<PDM_INCLUDE FILE=std_body.htmpl filename="Change Order">
<SCRIPT LANGUAGE="JavaScript">
<pdm_macro name=sfStart factory=chg create=false>
<PDM_IF "$args.KEEP.ForChild" == "1">
document.writeln('<INPUT TYPE=hidden NAME=HTMPL VALUE=update_lrel_chg.htmpl>');
</PDM_IF>
<PDM_IF "" != "$args.KEEP.exclude_chg_ref_num">
document.write('<INPUT TYPE=hidden NAME=QBE.NE.chg_ref_num VALUE="$args.KEEP.exclude_chg_ref_num">');
</PDM_IF>
var argCreateAlg = "${args.CREATE_ALG:}";
if ( argCreateAlg.length > 0 ) {
   var argAlgPreset = "${args.ALG_PRESET:}";
   var argAlgPresetRel = "${args.ALG_PRESET_REL:}";
   document.write('<INPUT TYPE=hidden NAME=CREATE_ALG VALUE="' + argCreateAlg + '">');
   if ( argAlgPreset.length > 0 )
      document.write('<INPUT TYPE=hidden NAME=ALG_PRESET VALUE="$args.ALG_PRESET">');
   if ( argAlgPresetRel.length > 0 )
      document.write('<INPUT TYPE=hidden NAME=ALG_PRESET_REL VALUE="$args.ALG_PRESET_REL">');
}
     
<PDM_MACRO NAME=sfStartRow>
searchFilterDropdown("Assignment Status","","",
"Has assignee","(assignee IS NOT NULL)",
"Has group","(group IS NOT NULL)",
"Assignee or group","(assignee IS NOT NULL OR group IS NOT NULL)",
"Assignee and group","(assignee IS NOT NULL AND group IS NOT NULL)",
"Assignee; no group","(assignee IS NOT NULL AND group IS NULL)",
"Group; no assignee","(assignee IS NULL AND group IS NOT NULL)",
"No assignee","(assignee IS NULL)",
"No group","(group IS NULL)",
"No assignee; no group","(assignee IS NULL AND group IS NULL)",2);
<PDM_MACRO NAME=sfLookup hdr=Assignee attr="assignee" factory=agt>
<PDM_MACRO NAME=sfLookup hdr=Group attr="group" factory=grp>
<PDM_MACRO NAME=sfDropdown hdr=Status attr="status" factory=chgstat>
<PDM_IF "$args.KEEP.PARENT_SEARCH" != "">
     <PDM_MACRO NAME=sfTextbox hdr=" " attr="category.children_ok" qbe_condition=EQ display_value=" " value="1" disabled=yes>
     <PDM_MACRO NAME=sfTextbox hdr=" " attr="persistent_id" qbe_condition=NE display_value=" " value="$args.KEEP.PARENT_SEARCH" disabled=yes>
</PDM_IF>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDropdown hdr=Priority attr="priority" factory=pri>
<PDM_IF "$args.use_template" == "1">
var passval = searchFilterDropdown("Active","active","","noempty","< empty >","(active = 0 OR active = 1)","<selected>","Active","1","Inactive","0");
<PDM_ELSE>
var passval = searchFilterDropdown("Active","active","","Active","1","Inactive","0");
</PDM_IF>
<PDM_MACRO NAME=sfHier hdr=Category attr="category.sym" factory=chgcat>
<PDM_MACRO NAME=sfLookup hdr="Affected End User" attr="affected_contact" factory=cnt>
<PDM_MACRO NAME=sfLookup hdr="Requester Name" attr="requestor" factory=cnt>
<PDM_MACRO NAME=sfTextbox hdr="External Reference" attr="ext_ref" size=20>
<PDM_MACRO NAME=sfStartRow type=Set>
<PDM_IF "$args.use_template" == "1">
searchFilterDropdown("Template","template_name.template_name","","noempty",
"Yes","(template_name != ' ' AND template_name IS NOT NULL)");
searchFilterDropdown("Template Active","template_name.delete_flag","","noempty",
"Active","(template_name.delete_flag = 0)");
     <PDM_MACRO NAME=sfTextbox hdr="Template Name" attr="template_name" size=20>
     <PDM_MACRO NAME=sfTextbox hdr="Template Class" attr="template_name.template_class" size=12>
<PDM_ELSE>
searchFilterDropdown("Template","template_name","",
"Yes","(template_name != ' ' AND template_name IS NOT NULL)",
"No","(template_name = ' ' OR template_name IS NULL)");
     <PDM_MACRO NAME=sfDropdown hdr="Template Active" attr="template_name.delete_flag">
</PDM_IF>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfLookup hdr="Created By" attr="log_agent" factory=cnt>
searchFilterDropdown("Child Type","child_type","","Not A Child","0","Child","1");
<PDM_MACRO NAME=sfDropdown hdr=Impact attr="impact" factory=imp>
<PDM_MACRO NAME=sfStartRow>
searchFilterDropdown("SLA Violation","sla_violation","",
"Yes", "(sla_violation > 0)",
"No",  "(sla_violation = 0 OR sla_violation IS NULL)");
<PDM_IF "$env.NX_TTV_ENABLED" != "">
     <PDM_MACRO NAME=sfDate hdr="Earliest Time To Violation" attr="attached_slas.time_to_violation" qbe_condition=GE>
     <PDM_MACRO NAME=sfDate hdr="Latest Time To Violation" attr="attached_slas.time_to_violation" qbe_condition=LE>
</PDM_IF>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfTextbox hdr="Order Summary" attr="summary" size=35 colspan=2>
<PDM_MACRO NAME=sfTextbox hdr="Order Description" attr="description" size=42 colspan=2>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfTextbox hdr=Justification attr="justification" size=20>
<PDM_MACRO NAME=sfTextbox hdr=Effort attr="effort" size=20>
<PDM_MACRO NAME=sfTextbox hdr="Backout Plan" attr="backout_plan" size=42 colspan=2>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfLookup hdr="Parent Change" attr="parent.chg_ref_num" factory=chg>
<PDM_MACRO NAME=sfHier hdr="Root Cause" attr="rootcause.sym" factory=rc>
<PDM_IF "$env.NX_CLASSIC_SLA_PROCESSING" == "Yes">
     <PDM_MACRO NAME=sfDropdown hdr="Service Type" attr="support_lev" factory=sdsc>
<PDM_ELSE>
     <PDM_MACRO NAME=sfLookup hdr="Service Type" attr="attached_slas.map_sdsc.sym" factory=sdsc>
     <PDM_MACRO NAME=sfDropdown hdr="Legacy Service Type" attr="support_lev" factory=sdsc>
</PDM_IF>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDate hdr="Earliest Need By Date" attr="need_by" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Need By Date" attr="need_by" qbe_condition=LE>
<PDM_MACRO NAME=sfDate hdr="Earliest Open Date" attr="open_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Open Date" attr="open_date" qbe_condition=LE>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDate hdr="Earliest Resolve Date" attr="resolve_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Resolve Date" attr="resolve_date" qbe_condition=LE>
<PDM_MACRO NAME=sfDate hdr="Earliest Close Date" attr="close_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Close Date" attr="close_date" qbe_condition=LE>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDate hdr="Earliest Est Comp Date" attr="est_comp_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Est Comp Date" attr="est_comp_date" qbe_condition=LE>
<PDM_MACRO NAME=sfDate hdr="Earliest Actual Comp Date" attr="actual_comp_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Actual Comp Date" attr="actual_comp_date" qbe_condition=LE>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfTextbox hdr="Least Est Cost" attr="QBE.GE.est_cost" size=20>
<PDM_MACRO NAME=sfTextbox hdr="Greatest Est Cost" attr="QBE.LE.est_cost" size=20>
<PDM_MACRO NAME=sfTextbox hdr="Least Est Duration" attr="QBE.GE.est_total_time" size=20>
<PDM_MACRO NAME=sfTextbox hdr="Greatest Est Duration" attr="QBE.LE.est_total_time" size=20>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfTextbox hdr="Least Actual Cost" attr="QBE.GE.cost" size=20>
<PDM_MACRO NAME=sfTextbox hdr="Greatest Actual Cost" attr="QBE.LE.cost" size=20>
<PDM_MACRO NAME=sfTextbox hdr="Least Actual Duration" attr="QBE.GE.actual_total_time" size=20>
<PDM_MACRO NAME=sfTextbox hdr="Greatest Actual Duration" attr="QBE.LE.actual_total_time" size=20>
<pdm_macro name=sfEnd>
</SCRIPT>
<PDM_FORM NAME="frmFID">
</PDM_FORM>
<PDM_IF "${current:n/a}" != "n/a">
<SCRIPT LANGUAGE="JavaScript">
<pdm_jscript file=list_edit.js>
startListEdit(__search_filter);
listEditStartRow();
listEditReadonly("chg_ref_num","Change #");
listEditField("status");
listEditField("priority");
listEditField("parent.chg_ref_num");
listEditField("assignee");
listEditEndRow();
listEditReadonly("summary",4);
listEditField("affected_contact", "End User");
endListEdit();
var msgFoundNone = "No change orders found";
var msgFound1 = "1 change order found";
var msgFound = "%1 change orders found";
var msgFoundMore = "%1 change orders found.  Displaying %2 through %3";
var msgSelect = "Click to select desired change order";
var msgSelectAlg = "Click to select desired change order and add a %1 activity log";
var msgSelectTempl = "Click to select desired change order template";
var show_template_name = ("$args.use_template" == "1");
if ( searchFilterValueOf("template_name").indexOf("NOT NULL") != -1 )
   show_template_name = true;
var summary_colspan = 4;
var ref_num_style;
<PDM_MACRO NAME=lsStart>
<pdm_macro name=lsWrite text="pdm_if \"@{list.sla_violation:0}\" != '0'"> 
<pdm_macro name=lsWrite text="ref_num_style = 'listHilite';">
<pdm_macro name=lsWrite text="pdm_elif \"@{list.macro_predicted_violation:0}\" != '0' ||  \"@{list.predicted_sla_violation:0}\" != '0'"> 
<pdm_macro name=lsWrite text="ref_num_style = 'listWarning';">
<pdm_if "$env.NX_TTV_HIGHLIGHT" == 'Yes' && "$env.NX_TTV_ENABLED" != "">
     <pdm_macro name=lsWrite text="pdm_elif @{list.ttv_att_slas.length:0} != 0">
     <pdm_macro name=lsWrite text="ref_num_style = 'listWarning';">
</pdm_if>
<pdm_macro name=lsWrite text="pdm_else">
<pdm_macro name=lsWrite text="ref_num_style = '';">
<pdm_macro name=lsWrite text="/pdm_if">
     <PDM_MACRO NAME=lsCol hdr="Change #" attr=chg_ref_num link=yes style=ref_num_style>
<pdm_macro name=lsWrite both=yes text="if (show_template_name) {">
  summary_colspan++;
     <PDM_MACRO NAME=lsCol hdr=Template attr=template_name link=yes>
<pdm_macro name=lsWrite both=yes text="}">
     <PDM_MACRO NAME=lsCol hdr=Status attr=status>
     <PDM_MACRO NAME=lsCol hdr="Open Date" attr=open_date>
     <PDM_MACRO NAME=lsCol hdr=Priority attr=priority>
     <PDM_MACRO NAME=lsCol hdr=Category/Related attr=category colspan=2>
     <PDM_MACRO NAME=lsCol hdr=Contacts label=Assignee attr=assignee>
     <PDM_MACRO NAME=lsCol attr=summary startrow=yes colspan=summary_colspan>
     <PDM_MACRO NAME=lsCol label=Parent attr=parent.chg_ref_num>
     <PDM_MACRO NAME=lsCol label=#Child attr=children display_attr=length>
     <PDM_MACRO NAME=lsCol label="End User" attr=affected_contact>
     <PDM_MACRO NAME=lsCol attr=category startrow=yes nowrap=yes justify=left>
     <PDM_MACRO NAME=lsCol label="Ext Ref" attr=ext_ref justify=left>
<PDM_MACRO NAME=lsEnd isTicketFactory=1>
</PDM_IF>
</SCRIPT>
<BASE TARGET="_top">
<PDM_INCLUDE FILE="std_footer.htmpl">
</BODY>
</HTML>
<PDM_WSP>
list_cr.htmpl
<PDM_IF 0>
$Id: list_cr.htmpl,v 1.159 2006/03/21 00:41:03 tooda01 Exp $
list_cr.htmpl
WHEN PRESENTED:
     When we need to display a list of Call Requests.
</PDM_IF>
<PDM_IF "$args.search_sql_clause" : "type =.*'[Ii]'" && "itil" == "$env.NX_OTB_MARKET">
     <!-- Added for ITIL Incidents -->
     <!-- Stored query can use all of the following '=','LIKE', 'like' and 'LiKe' -->
     <PDM_INCLUDE FILE=list_in.htmpl>
<PDM_ELIF "$args.search_sql_clause" : "type =.*'[Pp]'" && "itil" == "$env.NX_OTB_MARKET">
     <!-- Added for ITIL Problems -->
     <PDM_INCLUDE FILE=list_pr.htmpl>
<PDM_ELSE>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110 OVERRIDE=YES>
<PDM_INCLUDE FILE=styles.htmpl>
<SCRIPT LANGUAGE="JavaScript">
     <PDM_IF "$args.KEEP.ForChild" == "1" && "$args.KEEP.exclude_chg_ref_num" == "">
var hdrTitle = "Request Children Search";
var hdrTitleList = "Request Children List";
var hdrTitleTempl = "Request Children Template Search";
     <PDM_ELSE>
var hdrTitle = "Request Search";
var hdrTitleList = "Request List";
var hdrTitleTempl = "Request Template Search";
     </PDM_IF>
</SCRIPT>
<PDM_INCLUDE FILE=std_head.htmpl>
<SCRIPT LANGUAGE="JavaScript">
var rptName = new Array("crsum.rpt", "crdtl.rpt");
var cfgCanEdit = true;
var from_detail = "$args.KEEP.from_detail";
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></SCRIPT>
<PDM_INCLUDE FILE=std_list_include.htmpl>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/comboname.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
</HEAD>
<BODY CLASS="list">
<PDM_INCLUDE FILE=std_body.htmpl filename="Request">
<SCRIPT LANGUAGE="JavaScript">
<pdm_macro name=sfStart factory=cr create=false>
     <PDM_IF "$args.KEEP.ForChild" == "1">
document.writeln('<INPUT TYPE=hidden NAME=HTMPL VALUE=update_lrel_cr.htmpl>');
     </PDM_IF>
     <PDM_IF "" != "$args.KEEP.exclude_ref_num">
document.write('<INPUT TYPE=hidden NAME=QBE.NE.ref_num VALUE="$args.KEEP.exclude_ref_num">');
     </PDM_IF>
var argCreateAlg = "${args.CREATE_ALG:}";
if ( argCreateAlg.length > 0 ) {
   var argAlgPreset = "${args.ALG_PRESET:}";
   var argAlgPresetRel = "${args.ALG_PRESET_REL:}";
  
   document.write('<INPUT TYPE=hidden NAME=CREATE_ALG VALUE="' + argCreateAlg + '">');
   if ( argAlgPreset.length > 0 )
      document.write('<INPUT TYPE=hidden NAME=ALG_PRESET VALUE="$args.ALG_PRESET">');
    if ( argAlgPresetRel.length > 0 )
      document.write('<INPUT TYPE=hidden NAME=ALG_PRESET_REL VALUE="$args.ALG_PRESET_REL">');
}
     <PDM_IF "$env.NX_OTB_MARKET" == "itil">
          <PDM_IF "$args.KEEP.backfill_field" == "KEY.PARENT_CR">
               <PDM_MACRO NAME=sfStartRow>
   searchFilterDropdown("Request Type","type","",
    "Incident","(type = 'I')",
    "Problem","(type = 'P')",
    "Request","( type = 'R' OR type = '' OR type IS NULL )", "<selected>");
          <PDM_ELSE>
    rExp = /type is null/gi;
    if(argSearchWhereClause.search(rExp)==-1) {
     var awc="( type = 'R' OR type = '' OR type IS NULL )";
     document.write('<INPUT TYPE=hidden ID=ADDL_WHERE_HARDCODE NAME=ADDL_WHERE_HARDCODE VALUE="'+awc+'">');
    }
          </PDM_IF>
     </PDM_IF>
     <PDM_MACRO NAME=sfStartRow>
searchFilterDropdown("Assignment Status","","",
"Has assignee","(assignee IS NOT NULL)",
"Has group","(group IS NOT NULL)",
"Assignee or group","(assignee IS NOT NULL OR group IS NOT NULL)",
"Assignee and group","(assignee IS NOT NULL AND group IS NOT NULL)",
"Assignee; no group","(assignee IS NOT NULL AND group IS NULL)",
"Group; no assignee","(assignee IS NULL AND group IS NOT NULL)",
"No assignee","(assignee IS NULL)",
"No group","(group IS NULL)",
"No assignee; no group","(assignee IS NULL AND group IS NULL)",2);
     <PDM_MACRO NAME=sfLookup hdr=Assignee attr="assignee" factory=agt>
     <PDM_MACRO NAME=sfLookup hdr=Group attr="group" factory=grp>
     <PDM_IF "$env.NX_OTB_MARKET" == "itil">
          <PDM_MACRO NAME=sfDropdown hdr=Status attr="status" factory=crs_cr>
     <PDM_ELSE>
          <PDM_MACRO NAME=sfDropdown hdr=Status attr="status" factory=crs>
     </PDM_IF>
     <PDM_IF "$args.KEEP.PARENT_SEARCH" != "">
          <PDM_MACRO NAME=sfTextbox hdr=" " attr="persistent_id" qbe_condition=NE display_value=" " value="$args.KEEP.PARENT_SEARCH" disabled=yes>
     </PDM_IF>
     <PDM_MACRO NAME=sfStartRow>
     <PDM_MACRO NAME=sfDropdown hdr=Priority attr="priority" factory=pri>
     <PDM_IF "$args.use_template" == "1">
var passval = searchFilterDropdown("Active","active","","noempty","< empty >","(active = 0 OR active = 1)","<selected>","Active","1","Inactive","0");
     <PDM_ELSE>
var passval = searchFilterDropdown("Active","active","","Active","1","Inactive","0");
     </PDM_IF>
     <PDM_IF "$env.NX_OTB_MARKET" == "itil">
          <PDM_MACRO NAME=sfHier hdr="Request Area" attr="category.sym" factory=pcat_cr>
     <PDM_ELSE>
          <PDM_MACRO NAME=sfHier hdr="Request Area" attr="category.sym" factory=pcat>
     </PDM_IF>
     <PDM_IF "$env.NX_OTB_MARKET" == "itil">
          <PDM_MACRO NAME=sfLookup hdr="Configuration Item" attr="affected_resource.name" factory=nr>
     <PDM_ELSE>
          <PDM_MACRO NAME=sfLookup hdr="Affected Asset" attr="affected_resource.name" factory=nr>
     </PDM_IF>
     <PDM_MACRO NAME=sfLookup hdr="Reported By" attr="log_agent" factory=cnt>
     <PDM_MACRO NAME=sfStartRow>
     <PDM_MACRO NAME=sfLookup hdr="End User Name" attr="customer" colspan=2 factory=cnt>
     <PDM_MACRO NAME=sfTextbox hdr="End User User ID" attr="customer.userid" size=20>
     <PDM_MACRO NAME=sfLookup hdr="End User Location" attr="customer.location.name" factory=loc>
     <PDM_MACRO NAME=sfLookup hdr="End User Organization" attr="customer.organization.name" factory=org>
     <PDM_MACRO NAME=sfTextbox hdr="External Reference" attr="ext_ref" size=20>
     <PDM_MACRO NAME=sfStartRow type=Set>
     <PDM_MACRO NAME=sfDropdown hdr=Impact attr="impact" factory=imp>
     <PDM_IF "$env.NX_CLASSIC_SLA_PROCESSING" == "Yes">
          <PDM_MACRO NAME=sfDropdown hdr="Service Type" attr="support_lev" factory=sdsc>
     <PDM_ELSE>
          <PDM_MACRO NAME=sfLookup hdr="Service Type" attr="attached_slas.map_sdsc.sym" factory=sdsc>
     </PDM_IF>
     <PDM_MACRO NAME=sfDate hdr="Earliest Open Date" attr="open_date" qbe_condition=GE>
     <PDM_MACRO NAME=sfDate hdr="Latest Open Date" attr="open_date" qbe_condition=LE>
     <PDM_MACRO NAME=sfLookup hdr="Parent Request" attr="parent.ref_num" factory=cr>
     <PDM_MACRO NAME=sfStartRow>
     <PDM_MACRO NAME=sfDropdown hdr=Severity attr="severity" factory=sev>
     <PDM_MACRO NAME=sfDropdown hdr=Urgency attr="urgency" factory=urg>
     <PDM_MACRO NAME=sfDate hdr="Earliest Resolve Date" attr="resolve_date" qbe_condition=GE>
     <PDM_MACRO NAME=sfDate hdr="Latest Resolve Date" attr="resolve_date" qbe_condition=LE>
     <PDM_MACRO NAME=sfHier hdr="Root Cause" attr="rootcause.sym" factory=rc>
     <PDM_MACRO NAME=sfStartRow>
     <PDM_IF "$args.use_template" == "1">
searchFilterDropdown("Template","template_name.template_name","","noempty",
"Yes","(template_name != ' ' AND template_name IS NOT NULL)");
searchFilterDropdown("Template Active","template_name.delete_flag","","noempty",
"Active","(template_name.delete_flag = 0)");
     <PDM_ELSE>
searchFilterDropdown("Template","template_name","",
"Yes","(template_name != ' ' AND template_name IS NOT NULL)",
"No","(template_name = ' ' OR template_name IS NULL)");
          <PDM_MACRO NAME=sfDropdown hdr="Template Active" attr="template_name.delete_flag">
     </PDM_IF>
     <PDM_MACRO NAME=sfDate hdr="Earliest Close Date" attr="close_date" qbe_condition=GE>
     <PDM_MACRO NAME=sfDate hdr="Latest Close Date" attr="close_date" qbe_condition=LE>
     <PDM_IF "$args.use_template" == "1">
          <PDM_MACRO NAME=sfStartRow>
          <PDM_MACRO NAME=sfTextbox hdr="Template Name" attr="template_name" size=20>
          <PDM_MACRO NAME=sfTextbox hdr="Template Class" attr="template_name.template_class" size=12>
     </PDM_IF>
     <PDM_IF "$env.NX_CLASSIC_SLA_PROCESSING" != "Yes">
          <PDM_MACRO NAME=sfDropdown hdr="Legacy Service Type" attr="support_lev" factory=sdsc>
     </PDM_IF>
     <PDM_MACRO NAME=sfStartRow>
searchFilterDropdown("Child Type","child_type","","Not A Child","0","Child","1");
searchFilterDropdown("SLA Violation","sla_violation","",
"Yes", "(sla_violation > 0)",
"No",  "(sla_violation = 0 OR sla_violation IS NULL)");
     <PDM_IF "$env.NX_TTV_ENABLED" != "">
          <PDM_MACRO NAME=sfDate hdr="Earliest Time To Violation" attr="attached_slas.time_to_violation" qbe_condition=GE>
          <PDM_MACRO NAME=sfDate hdr="Latest Time To Violation" attr="attached_slas.time_to_violation" qbe_condition=LE>
     </PDM_IF>
     <PDM_MACRO NAME=sfStartRow type=Set>
     <PDM_MACRO NAME=sfTextbox hdr="Request Summary" attr="summary" size=42 colspan=2>
     <PDM_MACRO NAME=sfTextbox hdr="Request Description" attr="description" size=42 colspan=2>
<pdm_macro name=sfEnd>
</SCRIPT>
<PDM_FORM NAME="frmFID">
</PDM_FORM>
<PDM_IF "${current:n/a}" != "n/a">
<SCRIPT LANGUAGE="JavaScript">
<pdm_jscript file=list_edit.js>
startListEdit(__search_filter);
listEditStartRow();
listEditReadonly("ref_num","Request #");
listEditField("status");
listEditField("priority");
listEditField("parent.ref_num");
listEditField("assignee");
listEditEndRow();
listEditReadonly("summary",3);
endListEdit();
var msgFoundNone = "No requests found";
var msgFound1 = "1 request found";
var msgFound = "%1 requests found";
var msgFoundMore = "%1 requests found.  Displaying %2 through %3";
var msgSelect = "Click to select desired request";
var msgSelectAlg = "Click to select desired request and add a %1 activity log";
var msgSelectTempl = "Click to select desired request template";
var show_template_name = ("$args.use_template" == "1");
if ( searchFilterValueOf("template_name").indexOf("NOT NULL") != -1 )
   show_template_name = true;
var summary_colspan = 4;
var ref_num_style;
<PDM_MACRO NAME=lsStart>
<pdm_macro name=lsWrite text="pdm_if \"@{list.sla_violation:0}\" != '0'"> 
<pdm_macro name=lsWrite text="ref_num_style = 'listHilite';">
<pdm_macro name=lsWrite text="pdm_elif \"@{list.macro_predicted_violation:0}\" != '0' || \"@{list.predicted_sla_violation:0}\" != '0'"> 
<pdm_macro name=lsWrite text="ref_num_style = 'listWarning';"> 
<pdm_if "$env.NX_TTV_HIGHLIGHT" == 'Yes' && "$env.NX_TTV_ENABLED" != "">
     <pdm_macro name=lsWrite text="pdm_elif @{list.ttv_att_slas.length:0} != 0">
     <pdm_macro name=lsWrite text="ref_num_style = 'listWarning';">
</pdm_if>
<pdm_macro name=lsWrite text="pdm_else">
<pdm_macro name=lsWrite text="ref_num_style = '';">
<pdm_macro name=lsWrite text="/pdm_if">
     <PDM_MACRO NAME=lsCol hdr="Request #" attr=ref_num link=yes style=ref_num_style>
<pdm_macro name=lsWrite both=yes text="if (show_template_name) {">
  summary_colspan++;
 
     <PDM_MACRO NAME=lsCol hdr=Template attr=template_name link=yes>
  <pdm_macro name=lsWrite both=yes text="}">
     <PDM_MACRO NAME=lsCol hdr=Status attr=status>
     <PDM_MACRO NAME=lsCol hdr="Open Date" attr=open_date>
     <PDM_MACRO NAME=lsCol hdr=Priority attr=priority>
     <PDM_MACRO NAME=lsCol hdr=Group/Parent attr=group>
     <PDM_MACRO NAME=lsCol hdr=Contacts label=Assignee attr=assignee>
     <PDM_MACRO NAME=lsCol attr=summary startrow=yes colspan=summary_colspan>
     <PDM_MACRO NAME=lsCol attr=parent.ref_num>
     <PDM_MACRO NAME=lsCol label=Customer attr=customer>
<PDM_MACRO NAME=lsEnd isTicketFactory=1>
</SCRIPT>
</PDM_IF>
<BASE TARGET="_top">
<PDM_INCLUDE FILE="std_footer.htmpl">
</BODY>
</HTML>
</PDM_IF>
<PDM_WSP>
list_in.htmpl
<PDM_IF 0>
list_in.htmpl
WHEN PRESENTED:
     When we need to display a list of ITIL Incidents.
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110 OVERRIDE=YES>
<PDM_INCLUDE FILE=styles.htmpl>
<SCRIPT LANGUAGE="JavaScript">
<PDM_IF "$args.KEEP.ForChild" == "1" && "$args.KEEP.exclude_chg_ref_num" == "">
var hdrTitle = "Incident Children Search";
var hdrTitleList = "Incident Children List";
var hdrTitleTempl = "Incident Children Template Search";
<PDM_ELSE>
var hdrTitle = "Incident Search";
var hdrTitleList = "Incident List";
var hdrTitleTempl = "Incident Template Search";
</PDM_IF>
</SCRIPT>
<PDM_INCLUDE FILE=std_head.htmpl>
<SCRIPT LANGUAGE="JavaScript">
var rptName = new Array("insum.rpt", "indtl.rpt");
var cfgCanEdit = true;
propFormName = "list_in.htmpl";
propFormName2 = "in";
var from_detail = "$args.KEEP.from_detail";
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></SCRIPT>
<PDM_INCLUDE FILE=std_list_include.htmpl>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/comboname.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
</HEAD>
<BODY CLASS="list">
<PDM_INCLUDE FILE=std_body.htmpl filename="Incident">
<SCRIPT LANGUAGE="JavaScript">
<pdm_macro name=sfStart factory=in create=false>
<PDM_IF "$args.KEEP.ForChild" == "1">
document.writeln('<INPUT TYPE=hidden NAME=HTMPL VALUE=update_lrel_in.htmpl>');
</PDM_IF>
<PDM_IF "" != "$args.KEEP.exclude_ref_num">
document.write('<INPUT TYPE=hidden NAME=QBE.NE.ref_num VALUE="$args.KEEP.exclude_ref_num">');
</PDM_IF>
var argCreateAlg = "${args.CREATE_ALG:}";
if ( argCreateAlg.length > 0 ) {
   var argAlgPreset = "${args.ALG_PRESET:}";
   var argAlgPresetRel = "${args.ALG_PRESET_REL:}";
   document.write('<INPUT TYPE=hidden NAME=CREATE_ALG VALUE="' + argCreateAlg + '">');
   if ( argAlgPreset.length > 0 )
      document.write('<INPUT TYPE=hidden NAME=ALG_PRESET VALUE="$args.ALG_PRESET">');
   if ( argAlgPresetRel.length > 0 )
      document.write('<INPUT TYPE=hidden NAME=ALG_PRESET_REL VALUE="$args.ALG_PRESET_REL">');
}
<PDM_MACRO NAME=sfStartRow>
searchFilterDropdown("Assignment Status","","",
"Has assignee","(assignee IS NOT NULL)",
"Has group","(group IS NOT NULL)",
"Assignee or group","(assignee IS NOT NULL OR group IS NOT NULL)",
"Assignee and group","(assignee IS NOT NULL AND group IS NOT NULL)",
"Assignee; no group","(assignee IS NOT NULL AND group IS NULL)",
"Group; no assignee","(assignee IS NULL AND group IS NOT NULL)",
"No assignee","(assignee IS NULL)",
"No group","(group IS NULL)",
"No assignee; no group","(assignee IS NULL AND group IS NULL)",2);
<PDM_MACRO NAME=sfLookup hdr=Assignee attr="assignee" factory=agt>
<PDM_MACRO NAME=sfLookup hdr=Group attr="group" factory=grp>
<PDM_MACRO NAME=sfDropdown hdr=Status attr="status" factory=crs_in>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDropdown hdr=Priority attr="priority" factory=pri>
<PDM_IF "$args.use_template" == "1">
var passval = searchFilterDropdown("Active","active","","noempty","< empty >","(active = 0 OR active = 1)","<selected>","Active","1","Inactive","0");
<PDM_ELSE>
var passval = searchFilterDropdown("Active","active","","Active","1","Inactive","0");
</PDM_IF>
<PDM_MACRO NAME=sfHier hdr="Incident Area" attr="category.sym" factory=pcat_in>
<PDM_MACRO NAME=sfLookup hdr="Configuration Item" attr="affected_resource.name" factory=nr>
<PDM_MACRO NAME=sfLookup hdr="Reported By" attr="log_agent" factory=cnt>
<PDM_MACRO NAME=sfTextbox hdr="External Reference" attr="ext_ref" size=20>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfLookup hdr="End User Name" attr="customer" colspan=2 factory=cnt>
<PDM_MACRO NAME=sfTextbox hdr="End User User ID" attr="customer.userid" size=20>
<PDM_MACRO NAME=sfLookup hdr="End User Location" attr="customer.location.name" factory=loc>
<PDM_MACRO NAME=sfLookup hdr="End User Organization" attr="customer.organization.name" factory=org>
<PDM_MACRO NAME=sfDropdown hdr="Work Around" attr="zWorkAround">
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfLookup hdr=Problem attr="problem.ref_num" colspan=2 factory=pr>
<PDM_MACRO NAME=sfLookup hdr=Change attr="change.chg_ref_num" factory=chg>
searchFilterDropdown("Incident Priority","incident_priority","QBE.EQ" ,"0","0","1","1","2","2","3","3","4","4","5","5","6","6","7","7","8","8","9","9","10","10");
<PDM_MACRO NAME=sfStartRow type=Set>
<PDM_IF "$env.NX_CLASSIC_SLA_PROCESSING" == "Yes">
     <PDM_MACRO NAME=sfDropdown hdr="Service Type" attr="support_lev" factory=sdsc>
<PDM_ELSE>
     <PDM_MACRO NAME=sfLookup hdr="Service Type" attr="attached_slas.map_sdsc.sym" colspan=1 factory=sdsc>
     <PDM_MACRO NAME=sfDropdown hdr="Legacy Service Type" attr="support_lev" factory=sdsc>
     <PDM_IF "$env.NX_TTV_ENABLED" != "">
          <PDM_MACRO NAME=sfDate hdr="Earliest Time To Violation" attr="attached_slas.time_to_violation" qbe_condition=GE>
          <PDM_MACRO NAME=sfDate hdr="Latest Time To Violation" attr="attached_slas.time_to_violation" qbe_condition=LE>
     </PDM_IF>
</PDM_IF>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDropdown hdr=Impact attr="impact" factory=imp>
<PDM_MACRO NAME=sfDate hdr="Earliest Open Date" attr="open_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Open Date" attr="open_date" qbe_condition=LE>
<PDM_MACRO NAME=sfLookup hdr=Parent attr="parent.ref_num" factory=in>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDropdown hdr=Severity attr="severity" factory=sev>
<PDM_MACRO NAME=sfDropdown hdr=Urgency attr="urgency" factory=urg>
<PDM_MACRO NAME=sfDate hdr="Earliest Resolve Date" attr="resolve_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Resolve Date" attr="resolve_date" qbe_condition=LE>
<PDM_MACRO NAME=sfStartRow>
searchFilterDropdown("Child Type","child_type","","Not A Child","0","Child","1");
<PDM_MACRO NAME=sfHier hdr="Root Cause" attr="rootcause.sym" factory=rc>
searchFilterDropdown("SLA Violation","sla_violation","",
"Yes", "(sla_violation > 0)",
"No",  "(sla_violation = 0 OR sla_violation IS NULL)");
<PDM_MACRO NAME=sfStartRow>
<PDM_IF "$args.use_template" == "1">
searchFilterDropdown("Template","template_name.template_name","","noempty",
"Yes","(template_name != ' ' AND template_name IS NOT NULL)");
searchFilterDropdown("Template Active","template_name.delete_flag","","noempty",
"Active","(template_name.delete_flag = 0)");
     <PDM_MACRO NAME=sfTextbox hdr="Template Name" attr="template_name" size=20>
     <PDM_MACRO NAME=sfTextbox hdr="Template Class" attr="template_name.template_class" size=12>
<PDM_ELSE>
searchFilterDropdown("Template","template_name","",
"Yes","(template_name != ' ' AND template_name IS NOT NULL)",
"No","(template_name = ' ' OR template_name IS NULL)");
     <PDM_MACRO NAME=sfDropdown hdr="Template Active" attr="template_name.delete_flag">
</PDM_IF>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDate hdr="Earliest Close Date" attr="close_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Close Date" attr="close_date" qbe_condition=LE>
<PDM_MACRO NAME=sfStartRow type=Set>
<PDM_MACRO NAME=sfTextbox hdr="Incident Summary" attr="summary" size=42 colspan=2>
<PDM_MACRO NAME=sfTextbox hdr="Incident Description" attr="description" size=42 colspan=2>
<pdm_macro name=sfEnd>
</SCRIPT>
<PDM_FORM NAME="frmFID">
</PDM_FORM>
<PDM_IF "${current:n/a}" != "n/a">
<SCRIPT LANGUAGE="JavaScript">
<pdm_jscript file=list_edit.js>
startListEdit(__search_filter);
listEditStartRow();
listEditReadonly("ref_num","Incident #");
listEditField("status");
listEditField("priority");
listEditField("problem.ref_num");
listEditField("parent.ref_num");
listEditField("assignee");
listEditEndRow();
listEditReadonly("summary",3);
endListEdit();
var msgFoundNone = "No incidents found";
var msgFound1 = "1 incident found";
var msgFound = "%1 incidents found";
var msgFoundMore = "%1 incidents found.  Displaying %2 through %3";
var msgSelect = "Click to select desired incident";
var msgSelectAlg = "Click to select desired incident and add a %1 activity log";
var msgSelectTempl = "Click to select desired incident template";
var show_template_name = ("$args.use_template" == "1");
if ( searchFilterValueOf("template_name").indexOf("NOT NULL") != -1 )
   show_template_name = true;
var summary_colspan = 3;
var ref_num_style;
<PDM_MACRO NAME=lsStart>
<pdm_macro name=lsWrite text="pdm_if \"@{list.sla_violation:0}\" != '0'"> 
<pdm_macro name=lsWrite text="ref_num_style = 'listHilite';">
<pdm_macro name=lsWrite text="pdm_elif \"@{list.macro_predicted_violation:0}\" != '0' || \"@{list.predicted_sla_violation:0}\" != '0'"> 
<pdm_macro name=lsWrite text="ref_num_style = 'listWarning';">
<pdm_if "$env.NX_TTV_HIGHLIGHT" == 'Yes' && "$env.NX_TTV_ENABLED" != "">
     <pdm_macro name=lsWrite text="pdm_elif @{list.ttv_att_slas.length:0} != 0">
     <pdm_macro name=lsWrite text="ref_num_style = 'listWarning';">
</pdm_if>
<pdm_macro name=lsWrite text="pdm_else">
<pdm_macro name=lsWrite text="ref_num_style = '';">
<pdm_macro name=lsWrite text="/pdm_if">
     <PDM_MACRO NAME=lsCol hdr="Incident #" attr=ref_num link=yes style=ref_num_style>
<pdm_macro name=lsWrite both=yes text="if (show_template_name) {">
  summary_colspan++;
 
     <PDM_MACRO NAME=lsCol hdr=Template attr=template_name link=yes>
  <pdm_macro name=lsWrite both=yes text="}">
     <PDM_MACRO NAME=lsCol hdr=Status attr=status>
     <PDM_MACRO NAME=lsCol hdr="Open Date" attr=open_date>
     <PDM_MACRO NAME=lsCol hdr=Priority/Problem attr=priority>
     <PDM_MACRO NAME=lsCol hdr=Group/Parent attr=group>
     <PDM_MACRO NAME=lsCol hdr=Contacts label=Assignee attr=assignee>
     <PDM_MACRO NAME=lsCol attr=summary startrow=yes colspan=summary_colspan>
     <PDM_MACRO NAME=lsCol attr=problem.ref_num>
     <PDM_MACRO NAME=lsCol attr=parent.ref_num>
     <PDM_MACRO NAME=lsCol label="End User" attr=customer>
     <PDM_MACRO NAME=lsCol attr=category startrow=yes justify=left>
     <PDM_MACRO NAME=lsCol label="Ext Ref" attr=ext_ref justify=left>
     <PDM_MACRO NAME=lsCol label=WAR attr=zWorkAround justify=left>
<PDM_MACRO NAME=lsEnd isTicketFactory=1>
</SCRIPT>
</PDM_IF>
<BASE TARGET="_top">
<PDM_INCLUDE FILE="std_footer.htmpl">
</BODY>
</HTML>
<PDM_WSP>
list_pr.htmpl
<PDM_IF 0>
list_pr.htmpl
WHEN PRESENTED:
     When we need to display a list of ITIL Problems.
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110 OVERRIDE=YES>
<PDM_INCLUDE FILE=styles.htmpl>
<SCRIPT LANGUAGE="JavaScript">
<PDM_IF "$args.KEEP.ForChild" == "1" && "$args.KEEP.exclude_chg_ref_num" == "">
var hdrTitle = "Problem Children Search";
var hdrTitleList = "Problem Children List";
var hdrTitleTempl = "Problem Children Template Search";
<PDM_ELSE>
var hdrTitle = "Problem Search";
var hdrTitleList = "Problem List";
var hdrTitleTempl = "Problem Template Search";
</PDM_IF>
</SCRIPT>
<PDM_INCLUDE FILE=std_head.htmpl>
<SCRIPT LANGUAGE="JavaScript">
var rptName = new Array("prsum.rpt", "prdtl.rpt");
var cfgCanEdit = true;
propFormName = "list_pr.htmpl";
propFormName2 = "pr";
var from_detail = "$args.KEEP.from_detail";
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/val_type.js"></SCRIPT>
<PDM_INCLUDE FILE=std_list_include.htmpl>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/comboname.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
</HEAD>
<BODY CLASS="list">
<PDM_INCLUDE FILE=std_body.htmpl filename="Problem">
<SCRIPT LANGUAGE="JavaScript">
<pdm_macro name=sfStart factory=pr create=false>
<PDM_IF "$args.KEEP.ForChild" == "1">
document.writeln('<INPUT TYPE=hidden NAME=HTMPL VALUE=update_lrel_pr.htmpl>');
</PDM_IF>
<PDM_IF "" != "$args.KEEP.exclude_ref_num">
document.write('<INPUT TYPE=hidden NAME=QBE.NE.ref_num VALUE="$args.KEEP.exclude_ref_num">');
</PDM_IF>

var argCreateAlg = "${args.CREATE_ALG:}";
if ( argCreateAlg.length > 0 ) {
   var argAlgPreset = "${args.ALG_PRESET:}";
   var argAlgPresetRel = "${args.ALG_PRESET_REL:}";
   document.write('<INPUT TYPE=hidden NAME=CREATE_ALG VALUE="' + argCreateAlg + '">');
   if ( argAlgPreset.length > 0 )
      document.write('<INPUT TYPE=hidden NAME=ALG_PRESET VALUE="$args.ALG_PRESET">');
   if ( argAlgPresetRel.length > 0 )
      document.write('<INPUT TYPE=hidden NAME=ALG_PRESET_REL VALUE="$args.ALG_PRESET_REL">');

}

<PDM_MACRO NAME=sfStartRow>
searchFilterDropdown("Assignment Status","","",
"Has assignee","(assignee IS NOT NULL)",
"Has group","(group IS NOT NULL)",
"Assignee or group","(assignee IS NOT NULL OR group IS NOT NULL)",
"Assignee and group","(assignee IS NOT NULL AND group IS NOT NULL)",
"Assignee; no group","(assignee IS NOT NULL AND group IS NULL)",
"Group; no assignee","(assignee IS NULL AND group IS NOT NULL)",
"No assignee","(assignee IS NULL)",
"No group","(group IS NULL)",
"No assignee; no group","(assignee IS NULL AND group IS NULL)",2);
<PDM_MACRO NAME=sfLookup hdr=Assignee attr="assignee" factory=agt>
<PDM_MACRO NAME=sfLookup hdr=Group attr="group" factory=grp>
<PDM_MACRO NAME=sfDropdown hdr=Status attr="status" factory=crs_pr>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDropdown hdr=Priority attr="priority" factory=pri>
<PDM_IF "$args.use_template" == "1">
var passval = searchFilterDropdown("Active","active","","noempty","< empty >","(active = 0 OR active = 1)","<selected>","Active","1","Inactive","0");
<PDM_ELSE>
var passval = searchFilterDropdown("Active","active","","Active","1","Inactive","0");
</PDM_IF>
<PDM_MACRO NAME=sfHier hdr="Problem Area" attr="category.sym" factory=pcat_pr>
<PDM_MACRO NAME=sfLookup hdr="Configuration Item" attr="affected_resource.name" factory=nr>
<PDM_MACRO NAME=sfLookup hdr="Reported By" attr="log_agent" factory=cnt>
<PDM_MACRO NAME=sfTextbox hdr="External Reference" attr="ext_ref" size=20>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfLookup hdr="End User Name" attr="customer" colspan=2 factory=cnt>
<PDM_MACRO NAME=sfTextbox hdr="End User User ID" attr="customer.userid" size=20>
<PDM_MACRO NAME=sfLookup hdr="End User Location" attr="customer.location.name" factory=loc>
<PDM_MACRO NAME=sfLookup hdr="End User Organization" attr="customer.organization.name" factory=org>
<PDM_MACRO NAME=sfDropdown hdr="Work Around" attr="zWorkAround">
<PDM_MACRO NAME=sfStartRow>
<PDM_IF "$env.NX_CLASSIC_SLA_PROCESSING" == "Yes">
     <PDM_MACRO NAME=sfDropdown hdr="Service Type" attr="support_lev" colspan=2 factory=sdsc>
<PDM_ELSE>
     <PDM_MACRO NAME=sfLookup hdr="Service Type" attr="attached_slas.map_sdsc.sym" colspan=2 factory=sdsc>
     <PDM_MACRO NAME=sfDropdown hdr="Legacy Service Type" attr="support_lev" factory=sdsc>
     <PDM_IF "$env.NX_TTV_ENABLED" != "">
          <PDM_MACRO NAME=sfDate hdr="Earliest Time To Violation" attr="attached_slas.time_to_violation" qbe_condition=GE>
          <PDM_MACRO NAME=sfDate hdr="Latest Time To Violation" attr="attached_slas.time_to_violation" qbe_condition=LE>
     </PDM_IF>
</PDM_IF>
<PDM_MACRO NAME=sfStartRow type=Set>
<PDM_MACRO NAME=sfDropdown hdr=Impact attr="impact" factory=imp>
<PDM_MACRO NAME=sfDate hdr="Earliest Open Date" attr="open_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Open Date" attr="open_date" qbe_condition=LE>
<PDM_MACRO NAME=sfLookup hdr=Parent attr="parent.ref_num" factory=pr>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDropdown hdr=Severity attr="severity" factory=sev>
<PDM_MACRO NAME=sfDropdown hdr=Urgency attr="urgency" factory=urg>
<PDM_MACRO NAME=sfDate hdr="Earliest Resolve Date" attr="resolve_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Resolve Date" attr="resolve_date" qbe_condition=LE>
<PDM_MACRO NAME=sfStartRow>
searchFilterDropdown("Child Type","child_type","","Not A Child","0","Child","1");
<PDM_MACRO NAME=sfHier hdr="Root Cause" attr="rootcause.sym" factory=rc>
searchFilterDropdown("SLA Violation","sla_violation","",
"Yes", "(sla_violation > 0)",
"No",  "(sla_violation = 0 OR sla_violation IS NULL)");

<PDM_MACRO NAME=sfStartRow>
<PDM_IF "$args.use_template" == "1">
searchFilterDropdown("Template","template_name.template_name","","noempty",
"Yes","(template_name != ' ' AND template_name IS NOT NULL)");
searchFilterDropdown("Template Active","template_name.delete_flag","","noempty",
"Active","(template_name.delete_flag = 0)");
     <PDM_MACRO NAME=sfTextbox hdr="Template Name" attr="template_name" size=20>
     <PDM_MACRO NAME=sfTextbox hdr="Template Class" attr="template_name.template_class" size=12>
<PDM_ELSE>
searchFilterDropdown("Template","template_name","",
"Yes","(template_name != ' ' AND template_name IS NOT NULL)",
"No","(template_name = ' ' OR template_name IS NULL)");
     <PDM_MACRO NAME=sfDropdown hdr="Template Active" attr="template_name.delete_flag">
</PDM_IF>
<PDM_MACRO NAME=sfStartRow>
<PDM_MACRO NAME=sfDate hdr="Earliest Close Date" attr="close_date" qbe_condition=GE>
<PDM_MACRO NAME=sfDate hdr="Latest Close Date" attr="close_date" qbe_condition=LE>
<PDM_MACRO NAME=sfLookup hdr=Change attr="change.chg_ref_num" factory=chg>
<PDM_MACRO NAME=sfStartRow type=Set>
<PDM_MACRO NAME=sfTextbox hdr="Problem Summary" attr="summary" size=42 colspan=2>
<PDM_MACRO NAME=sfTextbox hdr="Problem Description" attr="description" size=42 colspan=2>

<pdm_macro name=sfEnd>

</SCRIPT>
<PDM_FORM NAME="frmFID">
</PDM_FORM>
<PDM_IF "${current:n/a}" != "n/a">
<SCRIPT LANGUAGE="JavaScript">
<pdm_jscript file=list_edit.js>
startListEdit(__search_filter);
listEditStartRow();
listEditReadonly("ref_num","Problem #");
listEditField("status");
listEditField("priority");
listEditField("parent.ref_num");
listEditField("assignee");
listEditEndRow();
listEditReadonly("summary",3);
endListEdit();

var msgFoundNone = "No problems found";
var msgFound1 = "1 problem found";
var msgFound = "%1 problems found";
var msgFoundMore = "%1 problems found.  Displaying %2 through %3";
var msgSelect = "Click to select desired problem";
var msgSelectAlg = "Click to select desired problem and add a %1 activity log";
var msgSelectTempl = "Click to select desired problem template";

var show_template_name = ("$args.use_template" == "1");
if ( searchFilterValueOf("template_name").indexOf("NOT NULL") != -1 )
   show_template_name = true;

var summary_colspan = 4;
var ref_num_style;
<PDM_MACRO NAME=lsStart>

<pdm_macro name=lsWrite text="pdm_if \"@{list.sla_violation:0}\" != '0'"> 
<pdm_macro name=lsWrite text="ref_num_style = 'listHilite';">
<pdm_macro name=lsWrite text="pdm_elif \"@{list.macro_predicted_violation:0}\" != '0' || \"@{list.predicted_sla_violation:0}\" !=
'0'"> 
<pdm_macro name=lsWrite text="ref_num_style = 'listWarning';">
<pdm_if "$env.NX_TTV_HIGHLIGHT" == 'Yes' && "$env.NX_TTV_ENABLED" != "">
     <pdm_macro name=lsWrite text="pdm_elif @{list.ttv_att_slas.length:0} != 0">
     <pdm_macro name=lsWrite text="ref_num_style = 'listWarning';">
</pdm_if>
<pdm_macro name=lsWrite text="pdm_else">
<pdm_macro name=lsWrite text="ref_num_style = '';">
<pdm_macro name=lsWrite text="/pdm_if">
     <PDM_MACRO NAME=lsCol hdr="Problem #" attr=ref_num link=yes style=ref_num_style>
<pdm_macro name=lsWrite both=yes text="if (show_template_name) {">
  summary_colspan++;
     <PDM_MACRO NAME=lsCol hdr=Template attr=template_name link=yes>
<pdm_macro name=lsWrite both=yes text="}">
     <PDM_MACRO NAME=lsCol hdr=Status attr=status>
     <PDM_MACRO NAME=lsCol hdr="Open Date" attr=open_date>
     <PDM_MACRO NAME=lsCol hdr=Priority attr=priority>
     <PDM_MACRO NAME=lsCol hdr=Group/Parent attr=group>
     <PDM_MACRO NAME=lsCol hdr=Contacts label=Assignee attr=assignee>
     <PDM_MACRO NAME=lsCol attr=summary startrow=yes colspan=summary_colspan>
     <PDM_MACRO NAME=lsCol attr=parent.ref_num>
     <PDM_MACRO NAME=lsCol label="End User" attr=customer>
     <PDM_MACRO NAME=lsCol attr=category startrow=yes justify=left>
     <PDM_MACRO NAME=lsCol label="Ext Ref" attr=ext_ref justify=left>
     <PDM_MACRO NAME=lsCol label=WAR attr=zWorkAround justify=left>
<PDM_MACRO NAME=lsEnd isTicketFactory=1>
</SCRIPT>
</PDM_IF>
<BASE TARGET="_top">
<PDM_INCLUDE FILE="std_footer.htmpl">
</BODY>
</HTML>

<PDM_WSP>
xx_businessimpact_tab.htmpl
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110>
<PDM_WSP mode=edit preview="NBTAB=xx_businessimpact_tab" factory=chg>
<PDM_INCLUDE FILE=styles.htmpl>
<PDM_INCLUDE FILE=std_head.htmpl busy=no>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
</HEAD>
<BODY>
<PDM_INCLUDE FILE=std_body.htmpl filename="">
<PDM_FORM NAME="frm201">
<SCRIPT LANGUAGE="JavaScript">
tab_banner("Business Impact");
<PDM_MACRO NAME=dtlStartRow class=tab>
<PDM_MACRO NAME=dtlTextbox hdr="Impact Description" attr="zBusinessImpact" size=113 rows=10>
<PDM_MACRO NAME=dtlEndTable>
</SCRIPT>
</PDM_FORM>
</BODY>
</HTML>
<PDM_IF 0>
@(#)$Id: xx_businessimpact_tab.htmpl,v 1.0 2007/07/19 14:51:14 dpaessens Exp $
</PDM_IF>
xx_candp_tab.htmpl
<PDM_IF 0>
xx_candp_tab.htmpl
WHEN PRESENTED:
    When we need to display a detail of a single Issue
INTENT:
    Display a notebook page for issue costs and plans.
Note:
The PDM_FORM tag is required for a notebook page htmpl
file, but only one PDM_FORM tag is allowed. Anything
outside the PDM_FORM tag won't be included in the
notebook page. All the javascript files defined in the
notebook page HTMPL file need to be also defined in the
main detail HTMPL file.
User can test the notebook page HTMPL file by using the
following URL:
<location of pdmcgi>?OP=SHOW_DETAIL+PERSID=<persistent_id>+
HTMPL=<notebook page htmpl file name>
for example: http://test_machine/scripts/pdmcgi.exe?OP=
SHOW_DETAIL+PERSID=cr:13677+HTMPL=crro_alg_tab.htmpl
</PDM_IF>
<html lang="en"><HEAD>
<PDM_PRAGMA RELEASE=110>
<PDM_WSP mode=edit preview="NBTAB=xx_candp_tab" factory=chg>
<PDM_INCLUDE FILE=styles.htmpl>
<PDM_INCLUDE FILE=std_head.htmpl busy=no>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
</HEAD>
<BODY>
<PDM_INCLUDE FILE=std_body.htmpl filename="">
<PDM_FORM NAME="frm201">
<SCRIPT LANGUAGE="JavaScript">
tab_banner("Time / Costs");
<PDM_MACRO NAME=dtlStartRow class=tab>
<PDM_MACRO NAME=dtlTextbox hdr="Est Cost" attr="zCostEstimated" size=15>
<PDM_MACRO NAME=dtlTextbox hdr="Actual Cost" attr="zCostActual" size=15>
<PDM_MACRO NAME=dtlTextbox hdr="Est Duration" attr="est_total_time" size=15 evt="onChange='validate_duration_ts(this)'">
<PDM_MACRO NAME=dtlTextbox hdr="Actual Duration" attr="actual_total_time" size=15 evt="onChange='validate_duration_ts(this)'">
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlTextbox hdr=Effort attr="effort" size=80 colspan=4 rows=2>
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlTextbox hdr="Backout Plan" attr="backout_plan" size=80 colspan=4 rows=2>
<PDM_MACRO NAME=dtlEndTable>
</SCRIPT>
</PDM_FORM>
</BODY>
</HTML>
<PDM_IF 0>
@(#)$Id: xx_candp_tab.htmpl,v 1.13 2005/01/19 18:37:14 jenji01 Exp $
</PDM_IF>
detail_formDP.js
// Copyright (c) 2005 CA.  All rights reserved.
// detail_form.js,v 1.341.1.7 2006/05/04 23:28:03
var _dtl=void(0);
var _dtl_debug=false;
var rxQuote=new RegExp(/"/g);
var cur_row_num=-1;
var cur_exp_row_arr=void(0);
var exp_sec_num=0;
function exp_row_node(row_num)
{
this.row_num=row_num;
this.row_id_arr=new Array();
}
exp_row_node.prototype.add_row_id=function(id)
{
var idx=this.row_id_arr.length;
var row_id;
if(typeof id=="string"&&id!="")
row_id=id;
else
row_id="exp_row"+exp_sec_num+this.row_num+"_"+idx;
this.row_id_arr[idx]=row_id;
return row_id;
}
exp_row_node.prototype.hide_row=function()
{
return this.change_row_disp_state("none");
}
exp_row_node.prototype.show_row=function()
{
var show_str="block";
if(!_browser.isIE)
show_str="";
return this.change_row_disp_state(show_str);
}
exp_row_node.prototype.change_row_disp_state=function(disp)
{
var len=this.row_id_arr.length;
var id;
var row;
var height=0;
var prev_disp;
for(var i=(len-1);i>=0;i--)
{
id=this.row_id_arr[i];
if(typeof id=="string")
{
row=document.getElementById(id);
if(typeof row=="object")
{
prev_disp=row.style.display;
if(prev_disp!="none"&&
disp=="none")
height+=row.offsetHeight;
row.style.display=disp;
if(prev_disp=="none"&&
disp!="none")
height+=row.offsetHeight;
}
}
}
return height;
}
function get_exp_row_id(id)
{
if(cur_row_num==-1)
return id;
var len=cur_exp_row_arr.length;
for(var i=0;i<len;i++)
{
if(cur_exp_row_arr[i].row_num==cur_row_num)
break;
}
if(i==len)return id;
return cur_exp_row_arr[i].add_row_id(id);
}
function createExpandableRow(exp_rows)
{
cur_exp_row_arr=new Array();
cur_row_num=0;
var arr=exp_rows.split(",");
for(var i=0;i<arr.length;i++)
cur_exp_row_arr[cur_exp_row_arr.length]=new exp_row_node(arr[i]);
return cur_exp_row_arr;
}
function DetailForm(factory,id,next_persid,stdbuttons,skip_page_hdr,onsubmit)
{
if(factory=="defer"){
this.edit=true;
holdHTMLText(false);
stdbuttons=false;
this.win=window;
if(typeof skip_page_hdr=="undefined")
skip_page_hdr="skip";
}
else{
this.edit=(typeof edit_form=="number"&&edit_form==1);
this.id=id;
this.next_persid=next_persid;
}
if(typeof onsubmit=="string")
this.onsubmit=onsubmit;
else
this.onsubmit="return check_submit();";
this.lastKeycode=0;
this.html="";
this.expSecHtml="";
this.factory=factory;
this.displayName="";
try{
if(this.factory==propFactory&&
factoryDisplayName.length>0)
this.displayName=factoryDisplayName;
}
catch(e){}
this.lastTableNum=-1;
this.rowNum=0;
this.colNum=0;
this.hdrColNum=0;
this.maxCol=0;
this.colID=0;
this.currID="";
this.rowData=new Array();
this.dateField=new Array();
this.colSpan=new Array();
this.form=new Array();
this.formStarted=false;
this.tableStarted=false;
this.doingLabelButton=false;
this.rowOpen=false;
this.TDOpen=false;
this.tabIndex=100;
this.imgBtnRow=false;
this.roclass=" CLASS=detailro";
this.eventHandler="";
this.firstField=void(0);
this.firstFieldFocused=0;
this.onload=void(0);
this.fieldToValidate=new Array();
this.errorCount=0;
this.serverErrorCount=0;
this.propertyRow=void(0);
this.spellchk=false;
this.fieldsToReset=void(0);
this.syncing=false;
this.secondary=false;
this.skip_agt_check=false;
this.dataoverrideclass="";
this.editAttrs=new Object();
this.lookupAttrs=new Object();
this.doSrchKnow=0;
this.lastHdrtext="";
this.propId="id";
this.propHdr="hdrtext";
this.propMaxSize="maxsize";
this.propIsReq="is_required";
this.propServerErr="serverFoundError";
this.propError="error";
this.propExtError="extError";
this.propBrowserError="browserFoundError";
this.propSDProp="is_property";
this.propNotFound=null;
if(!this.edit){
this.hdrclass="detailro";
this.reqhdrclass="detailro";
this.dataclass=this.roclass;
this.backfillReq=false;
}
else{
this.hdrclass="labeltext";
this.reqhdrclass="requiredlabeltext";
this.dataclass="";
var opnr=ahdframeset.opener;
this.backfillReq=(this.id=="0"&&
typeof opnr=="object"&&opnr!=null&&
typeof opnr.cfgIsPopup=="string"&&
typeof opnr.argBackfillField=="string"&&
opnr.cfgIsPopup.length>0&&
opnr.argBackfillField.length>0);
}
if(typeof propGLType=="string"&&
propGLType=="secondary")
{
this.secondary=true;
if(typeof argPersistentID!="undefined")
{
var edit_windows=getEditWindows(argPersistentID);
for(var i=0;i<edit_windows.length;i++){
var w=edit_windows[i];
if(typeof w._dtl=="object"&&
!w._dtl.secondary){
w.parent.opener=ahdtop;
window.opener=w.parent;
}
}
}
}
if(skip_page_hdr!="skip")
{
docWriteln("<TABLE cellSpacing=0 cellPadding=0 width='100%' border=0  class=page_header>");
docWriteln("<TR>");
docWriteln("<TD align=left width='99%'><h2 style='margin:0px;'>"+form_title+"</h2></TD>");
docWriteln("<TD align=right width='1%'>");
ImgBtnSetDefaultTabIndex(this.edit?30000:this.tabIndex);
if(typeof stdbuttons!="boolean"||stdbuttons){
this.imgBtnRow=true;
if(!this.edit){
ImgBtnRow(void(0),false);
// if((0+cfgUserAuth)>1){
// ImgBtnCreate("btn001",msgtext(513),"detailEdit()",true);
// }
}
else{
var saveButtonFieldset=false;
if(typeof detailExtraSaveButtons!="undefined"){
var count=detailExtraSaveButtons(false);
if(count>0){
saveButtonFieldset=true;
this.imgBtnRow=count+1;
var fieldset="<table><tr><td>";
if(_browser.isIe)
fieldset+="<fieldset>";
else
fieldset+="<fieldset class=firefox_fieldset>";
var legend=msgtext(930);
if(typeof factoryDisplayName=="string"&&
factoryDisplayName.length>0)
legend=msgtext(933,factoryDisplayName);
docWriteln(fieldset+"<legend class=button_legend>"+
legend+"</legend>");
}
}
ImgBtnRow(void(0),false);
if(!this.secondary)
ImgBtnCreate("btn001",msgtext(208),"detailSave()",true);
else
ImgBtnCreate("btn001",msgtext(401),"detailSave()",true);
if(saveButtonFieldset){
detailExtraSaveButtons(true);
ImgBtnEndRow();
docWriteln("</fieldset></td><td valign=bottom>");
ImgBtnRow(void(0),false);
}
ImgBtnCreate("btncncl",msgtext(209),"detailCancel()",true);
ImgBtnCreate("btn003",msgtext(400),
"check_reset();detailReset()",true);
}
}
}
}
function DetailForm_getHTMLText()
{
if(typeof this.win=="object"&&!this.win.closed)
return this.win.getHTMLText();
else
return"";
}
DetailForm.prototype.getHTMLText=DetailForm_getHTMLText;
function startDetail(options,bScroll)
{
if(_dtl.imgBtnRow){
ImgBtnEndRow();
if(typeof _dtl.imgBtnRow=="number"&&_dtl.imgBtnRow>1)
docWriteln("</td></tr></table>");
_dtl.imgBtnRow=false;
}
docWriteln("</TD></TR></TABLE>");
ImgBtnSetDefaultTabIndex(_dtl.tabIndex);
build_alertmsg();
if(typeof options!="string")
options="";
if(options==""||null==options.match(/noscroll/i)){
if(typeof bScroll=="undefined")
bScroll=0;
startScrollbar(false,bScroll);
}
_dtl.center=(options!=""&&null!=options.match(/center/i));
if(_dtl.center)
docWriteln("<CENTER>");
if(_dtl.factory.length>0){
_dtl.formStarted=true;
var out="<FORM NAME=main_form ACTION='"+cfgCgi+"' METHOD=";
if(!_dtl.edit)
out+="GET>\n";
else
out+="POST STYLE='display:none' onSubmit='"+_dtl.onsubmit+"'>\n"+
"<INPUT TYPE=HIDDEN NAME=JEDIT VALUE=1>\n";
out+='<INPUT TYPE=HIDDEN NAME=SID VALUE="'+cfgSID+'">\n'+
'<INPUT TYPE=HIDDEN NAME=FID VALUE="'+cfgFID+'">\n'+
'<INPUT TYPE=HIDDEN NAME=OP VALUE="UPDATE">\n'+
'<INPUT TYPE=HIDDEN NAME=FACTORY VALUE="'+_dtl.factory+'">\n';
if(_dtl.id.length>0)
out+="<INPUT TYPE=HIDDEN NAME=SET.id VALUE='"+_dtl.id+"'>\n";
docWriteln(out);
_dtl.form[0]=document.main_form;
}
}
function endDetail()
{
detailEndRow();
var out="";
if(_dtl.tableStarted)
out="</TABLE>\n";
if(_dtl.formStarted)
out+="</FORM>";
docWriteln(out);
_dtl.tableStarted=false;
if(typeof AlertMsg=="string"&&AlertMsg.length>0){
var e=document.getElementById("alertmsgText");
if(typeof e=="object"&&e!=null){
e.innerHTML=AlertMsg;
e=document.getElementById("alertmsg");
e.style.display="block";
adjScrollDivHeight();
}
}
if(typeof _dtl.firstField=="string"){
_dtl.firstField=document.getElementById(_dtl.firstField);
if(_dtl.firstField!=null){
_dtl.onload=window.onload;
window.onload=detailOnload;
}
else if(_dtl.edit)
_dtl.form[0].style.display="block";
}
if(_dtl.center)
docWriteln("</CENTER>");
if(typeof ahdtop=="object"&&
typeof ahdtop.detailForms=="object"&&
(typeof alg_factory!="string"||
alg_factory==propFactory)){
if(typeof argPersistentID=="string"&&
argPersistentID.length>0)
ahdtop.detailForms[argPersistentID]=window.parent;
if(propFactory=="chg"&&typeof argChgRefNum=="string")
ahdtop.detailForms["chg"+argChgRefNum]=window.parent;
else if((propFactory=="cr"||propFactory=="iss")&&
typeof argRefNum=="string")
ahdtop.detailForms[propFactory+argRefNum]=window.parent;
}
if(_dtl.spellchk){
do_hiddenfm('spell_form','main_form');
}
}
function detailOnload()
{
if(typeof _dtl.form[0]=="object"){
var f=_dtl.form[0];
f.style.display="block";
if(propFormName.match(/^zdetail/i)&&
typeof f.HTMPL!="object"){
var htmpl=document.createElement("input");
htmpl.type="hidden";
htmpl.name="HTMPL";
htmpl.value=propFormName;
f.appendChild(htmpl);
}
}
if(typeof _dtl.onload=="function")
_dtl.onload();
setTempKeyDownHandler(detailKeyDown);
try{
if(_dtl.serverErrorCount==0){
if(_dtl.firstField.offsetTop>0&&
window.parent.name!="popunder"&&
_dtl.lastKeycode==0&&
(typeof ahdframeset.workframe!="object"||
typeof ahdframeset.workframe.SkipInitialFocus=="undefined"||
ahdframeset.workframe.SkipInitialFocus!="1"))
_dtl.firstField.focus();
}
else{
var firstBadField=detailValidate();
if(typeof firstBadField=="object")
detailSetFocus(firstBadField);
else
_dtl.firstField.focus();
}
}
catch(e){}
if(typeof top.workframe=="object")
setTimeout("top.workframe.SkipInitialFocus = 0",3000);
if(document.location.search.match(/INITFROM=(\w*)/)&&
typeof top.opener=="object"&&
top.opener!=null&&
!top.opener.closed&&
typeof top.opener.document.forms[RegExp.$1]=="object"){
var srcForm=top.opener.document.forms[RegExp.$1];
for(var i=0;i<srcForm.elements.length;i++){
var e=srcForm.elements[i];
var tgt=document.main_form.elements[e.name];
if(typeof tgt=="object"&&tgt!=null){
if(tgt.type!="select-one")
{
if(e.name=="SET.description"||e.name=="SET.summary")
tgt.value=unescape(e.value);
else
tgt.value=e.value;
}
else{
for(var j=0;j<tgt.options.length;j++){
var o=tgt.options[j];
if(o.value==e.value){
tgt.selectedIndex=j;
break;
}
}
}
}
}
}
}
function detailOnUnload()
{
if(typeof ahdtop!="undefined"){
if(typeof alg_factory!="string"||
alg_factory==propFactory){
if(typeof argPersistentID=="string"&&
argPersistentID.length>0)
delete ahdtop.detailForms[argPersistentID];
if(propFactory=="chg"&&typeof argChgRefNum=="string")
delete ahdtop.detailForms["chg"+argChgRefNum];
else if((propFactory=="cr"||propFactory=="iss")&&
typeof argRefNum=="string")
delete ahdtop.detailForms[propFactory+argRefNum];
}
}
}
function detailFocus1st()
{
var bSkipFocus=false;
if(typeof ahdframeset.workframe=="object")
{
if(ahdframeset.workframe.SkipInitialFocus!="undefined")
{
if(ahdframeset.workframe.SkipInitialFocus=="1")
{
bSkipFocus=true;
}
}
}
if(bSkipFocus)
{
return;
}
if(typeof _dtl!="undefined"&&
!_dtl.firstFieldFocused)
{
window.focus();
try{
_dtl.firstField.focus();
}
catch(e){}
}
try{
if(_dtl.edit)
ahdframeset.workframe.SkipInitialFocus="1";
}
catch(e){}
}
function detailStartExpRow(form_name,label,exp_rows,colspan,tblClass)
{
if((form_name!="")&&
(label!="")&&
(exp_rows!="")&&
(colspan>0)&&
!ahdtop.cstUsingScreenReader)
{
detailEndTable();
detailExpandSec(form_name,label,exp_rows,colspan);
}
detailStartRow(tblClass);
}
function detailStartRow(tblClass)
{
if(tblClass=="CLASS=")
tblClass=void(0);
detailCloseForm()
var html="";
detailEndRow();
if(_dtl.tableStarted&&
(typeof tblClass!="undefined"||
ahdtop.cstUsingScreenReader||
(ahdtop.cfgUserType!="analyst"&&!_dtl.edit))){
html+="</TABLE>\n";
_dtl.tableStarted=false;
}
if(!_dtl.tableStarted){
if(_dtl.rowNum==_dtl.lastTableNum)
_dtl.rowNum++;
_dtl.lastTableNum=_dtl.rowNum;
_dtl.currTblId="dtltbl"+_dtl.rowNum;
_dtl.currTblObj=null;
html+="<TABLE id="+_dtl.currTblId+" ";
if(typeof tblClass=="string"&&tblClass.length>0)
html+=tblClass;
else{
html+="cellpadding=1 cellspacing=5";
if(!_dtl.center)
html+=" WIDTH='90%'";
}
html+=">\n";
_dtl.tableStarted=true;
docWrite(html);
html="";
_dtl.currTblObj=document.getElementById(_dtl.currTblId);
if(_dtl.currTblObj!=null){
var summary;
if(typeof notebook_current_tabinfo=="object")
summary=msgtext(875,notebook_current_tabinfo.tab_name,_dtl.rowNum+1);
else if(typeof hdrTitle=="string"&&hdrTitle.length>0)
summary=msgtext(874,hdrTitle,_dtl.rowNum+1);
else
summary=msgtext(838,_dtl.displayName,_dtl.rowNum+1);
if(ahdtop.cfgUserType=="analyst"&&
!ahdtop.cstUsingScreenReader)
summary=summary.replace(/[\s-]*$/,"");
_dtl.currTblObj.summary=summary;
}
}
if(_dtl.expSecHtml!="")
{
html+=_dtl.expSecHtml;
_dtl.expSecHtml="";
}
if(cur_row_num!=-1)
cur_row_num++;
var row_id=get_exp_row_id("");
if(row_id!="")row_id=" ID='"+row_id+"' ";
html+='<TR'+row_id+' VALIGN=TOP>';
docWriteln(html);
_dtl.rowOpen=true;
}
function detailCloseForm()
{
if(!_dtl.edit&&_dtl.formStarted){
document.writeln("</form>");
_dtl.formStarted=false;
}
}
function detailWriteRow()
{
detailEndRow(false);
}
function detailEndRow(closeRow)
{
var html="";
if(_dtl.colNum>0){
if(_dtl.rowOpen){
if(_dtl.colNum==1&&
(ahdtop.cfgUserType!="analyst"||
ahdtop.cstUsingScreenReader)){
if(_dtl.currTblObj==null)
_dtl.currTblObj=document.getElementById(_dtl.currTblId);
if(_dtl.currTblObj!=null)
_dtl.currTblObj.cellSpacing="0";
var th=document.getElementsByTagName("th");
html+="<th>&nbsp;</th>";
_dtl.colSpan[_dtl.colNum]="";
detailSetRowData("&nbsp;");
}
html+="</TR>\n";
}
var row_id=get_exp_row_id("");
if(row_id!="")row_id=" ID='"+row_id+"' ";
html+='<TR'+row_id+'>\n';
_dtl.rowOpen=true;
for(var i=0;i<_dtl.colNum;i++){
var text=_dtl.rowData[i];
html+="<td";
if(typeof _dtl.colSpan[i]=="string")
html+=_dtl.colSpan[i];
html+=_dtl.dataclass+" ALIGN=left VALIGN=top>\n";
if(typeof _dtl.dateField[i]!="number"||
_dtl.dateField[i]!=1){
html+=text+"\n";
}
else{
var next_id=void(0);
var date_data=text.split(":",5);
if(date_data.length==4)
html+=date_input_text(detailCurrForm(),"",date_data[0],
date_data[1],date_data[2],date_data[3]);
if(date_data.length==5)
{
html+=date_input_text(detailCurrForm(),"",date_data[0],
date_data[1],date_data[2],date_data[3],
date_data[4]);
}
}
if(!text.match(/<\/td>/i))
html+="</td>\n";
}
_dtl.colNum=0;
_dtl.hdrColNum=0;
_dtl.colID=0;
_dtl.rowNum++;
}
else if(_dtl.rowOpen){
if(_dtl.TDOpen){
html+="</td>";
_dtl.TDOpen=false;
}
if(_dtl.currTblId=="dtltbl"+_dtl.rowNum){
_dtl.currObj=document.getElementById(_dtl.currTblId);
if(_dtl.currObj!=null){
_dtl.currObj.id="";
_dtl.currObj.summary="";
}
}
}
if(typeof closeRow!="boolean"||closeRow){
if(_dtl.rowOpen){
html+="</tr>";
_dtl.rowOpen=false;
}
}
else{
html+="<td "+_dtl.roclass+">";
_dtl.TDOpen=true;
}
if(html.length>0)
docWriteln(html);
}
function detailEndHdrRow()
{
_dtl.colNum=0;
_dtl.hdrColNum=0;
_dtl.colID=0;
if(_dtl.rowOpen){
docWriteln("</TR>");
_dtl.rowOpen=false;
}
}
function detailEndTable()
{
detailEndRow();
docWriteln("</TABLE>");
_dtl.tableStarted=false;
}
function detailSetEventHandler(text,readonly)
{
if(_dtl.edit||
(typeof readonly=="boolean"&&readonly)){
_dtl.eventHandler=text;
}
}
function detailSetFieldTitle(title)
{
_dtl.fieldTitle=title;
}
function detailNextID(colspan,lastInRow)
{
var text="";
var id="df_"+_dtl.rowNum+"_"+_dtl.colID;
_dtl.currID=id;
if(typeof _dtl.firstField=="undefined")
_dtl.firstField=id;
if(typeof notebook_current_tabinfo=="object")
notebook_current_tabinfo.setFirstField(id);
if(typeof colspan=="number")
_dtl.colID+=colspan;
else{
if(typeof colspan=="boolean")
lastInRow=colspan;
_dtl.colID++;
}
text=" ID="+id+" tabindex="+_dtl.tabIndex;
var eh=_dtl.eventHandler;
if(eh.length==0){
text+=" onFocus=\"return detailFocus(this);\""+
" onBlur=\"return detailBlur(this);\"";
}
else{
_dtl.eventHandler="";
eh=" "+eh;
if(eh.match(/^(.*onFocus=\\?['"'])(.*)$/i))
eh=RegExp.$1+"detailFocus(this);"+RegExp.$2;
else
text+=" onFocus=\"return detailFocus(this);\"";
if(eh.match(/^(.*onBlur=\\?['"'])(.*)$/i))
eh=RegExp.$1+"detailBlur(this);"+RegExp.$2;
else
text+=" onBlur=\"return detailBlur(this);\"";
text+=eh;
}
if(typeof lastInRow=="boolean"&&lastInRow){
_dtl.rowNum++;
_dtl.colID=0;
_dtl.colNum=0;
_dtl.hdrColNum=0;
}
return text;
}
function detailNextLinkID()
{
var text=" ID=dflnk_"+_dtl.rowNum+"_"+_dtl.colID;
text+=" tabindex=-1";
text+=" onFocus=\"return detailFocus(this);\""+
" onBlur=\"return detailBlur(this);\"";
return text;
}
function detailIncrCol(colspan)
{
if(typeof colspan=="number")
_dtl.colID+=colspan;
else
_dtl.colID++;
}
function detailFocus(e)
{
if(typeof e=="object"&&e!=null){
if(e.className!="errorField"&&
e.className!="focusErrorField")
e.className="focusField";
else
e.className="focusErrorField";
if(_dtl.lastKeycode==0)
_dtl.lastKeycode=1;
if((typeof _dtl.firstField=="object")&&
(_dtl.firstField==e))
_dtl.firstFieldFocused=1;
}
return true;
}
function detailBlur(e)
{
if(typeof e=="object"&&e!=null){
if(e.className!="errorField"&&
e.className!="focusErrorField")
e.className="";
else{
detailValidate(true,false);
if(_dtl.errorCount)
e.className=="errorField";
else
e.className=="";
}
if((typeof _dtl.firstField=="object")&&
(_dtl.firstField==e))
_dtl.firstFieldFocused=0;
}
return true;
}
function detailCurrForm()
{
var n=_dtl.form.length-1;
if(n<=0)
return"main_form";
else
return"main_form"+n;
}
function detailLabelFor(hdrtext,labelForId)
{
var id,doLabelFor;
if(typeof labelForId=="boolean")
doLabelFor=labelForId;
else
doLabelFor=(typeof _dtl.fieldTitle!="string"||
_dtl.fieldTitle.length==0);
if(doLabelFor){
if(typeof labelForId=="string")
id=labelForId;
else
id="df_"+_dtl.rowNum+"_"+_dtl.colID;
}
if(_dtl.currTblObj==null)
_dtl.currTblObj=document.getElementById(_dtl.currTblId);
if(_dtl.currTblObj!=null&&
(ahdtop.cstUsingScreenReader||
ahdtop.cfgUserType!="analyst")){
var newSummaryText=(_dtl.colNum==0?" ":", ")+hdrtext;
if(typeof _dtl.fieldTitle=="string"&&
_dtl.fieldTitle.length>0){
newSummaryText=(_dtl.colNum==0?" ":", ")+_dtl.fieldTitle;
if(!_dtl.edit)
_dtl.fieldTitle=void(0);
}
_dtl.currTblObj.summary+=newSummaryText;
}
return" scope='col'>"+hdrtext;
}
function detailRowHdr(hdrtext,colspan,is_required,writeToDoc,labelForId)
{
var cols="";
if(typeof colspan!="number")
colspan=1;
else if(colspan>1)
cols=" colspan="+colspan;
_dtl.lastHdrtext=hdrtext;
if(hdrtext.length>0){
if(ahdtop.cfgUserType=="analyst"&&
!ahdtop.cstUsingScreenReader)
hdrtext=hdrtext+"&nbsp;&nbsp;&nbsp;";
var html="<th"+cols+" ALIGN=left VALIGN=baseline";
if(!hdrtext.match(/^ +$/)){
if(!bool(is_required))
html+=" class="+_dtl.hdrclass;
else{
html+=" class="+_dtl.reqhdrclass;
var trailingNbsp=0;
while(hdrtext.match(/^(.*)&nbsp;\s*$/i)){
hdrtext=RegExp.$1;
trailingNbsp++;
}
hdrtext+=ahdtop.cfgIndRequired;
_dtl.lastHdrtext+=ahdtop.cfgIndRequired;
while(trailingNbsp-->2)
hdrtext+="&nbsp;";
}
}
html+=detailLabelFor(hdrtext,labelForId)+"</th>";
if(typeof writeToDoc!="boolean"||writeToDoc)
docWriteln(html);
}
_dtl.colSpan[_dtl.hdrColNum++]=cols;
if(_dtl.hdrColNum>_dtl.maxCol)
_dtl.maxCol=_dtl.hdrColNum;
return html;
}
function detailReadonlyFormRowHdr(hdrtext,colspan,is_required,writeToDoc)
{
var saveEdit=_dtl.edit;
_dtl.edit=false;
detailRowHdr(hdrtext,colspan,is_required,writeToDoc);
_dtl.edit=saveEdit;
}
function detailSetReadonlyRowData(value,colspan,id,rows,size)
{
if(typeof id!="string"||id.length==0){
id="df_"+_dtl.rowNum+"_"+_dtl.colID;
detailIncrCol(colspan);
}
if(typeof _dtl.firstField=="undefined")
_dtl.firstField=id;
var html,idinfo=" id="+id;
if((!ahdtop.cstUsingScreenReader)||
value.match(/^\s*\<a /i)){
html=value.replace(/\n/g,"<br>");
if(_dtl.edit)
idinfo+=" style='font-size:0.7em;'";
if(typeof _dtl.colSpan[_dtl.colNum]=="string")
_dtl.colSpan[_dtl.colNum]+=idinfo;
else
_dtl.colSpan[_dtl.colNum]=idinfo;
}
else{
idinfo+=" tabindex="+_dtl.tabIndex+
" style='background-color:gainsboro;";
if(!_dtl.edit)
idinfo+="font-size:1.0em;";
idinfo+="'";
if(typeof size!="number"){
if(value.length<20)
size=20;
else if(value.length>100)
size=100;
else
size=value.length;
}
if(typeof rows=="number"&&rows>1){
html="<textarea readonly rows="+rows+" cols="+size+
idinfo+' title="'+_dtl.lastHdrtext+'">'+
value+"</textarea>";
}
else{
html="<input type=text readonly size="+size+idinfo;
if(value!="&nbsp;"){
value=value.replace(/"/g,'&quot;');
html+=' value="'+value+'"';
}
html+=' title="'+_dtl.lastHdrtext+'">';
}
}
detailSetRowData(html);
return;
}
function detailSetRowData(text,isDate)
{
if(_dtl.dataoverrideclass!="")
{
_dtl.colSpan[_dtl.colNum]+=_dtl.dataoverrideclass;
_dtl.dataoverrideclass="";
}
else
{
if(_dtl.dataclass.length==0&&text.substr(0,1)!="<")
_dtl.colSpan[_dtl.colNum]+=_dtl.roclass;
}
_dtl.rowData[_dtl.colNum]=text;
if((typeof isDate=="number")&&(isDate==1))
_dtl.dateField[_dtl.colNum]=1;
else
_dtl.dateField[_dtl.colNum]=0;
_dtl.colNum++;
if(_dtl.colNum>_dtl.maxCol)
_dtl.maxCol=_dtl.colNum;
}
function detailDate(hdrtext,attr_name,colspan,size,time,
is_required,value)
{
if(_dtl.edit)
detailDateEdit(hdrtext,attr_name,colspan,size,time,
is_required,value);
else
detailDateReadonly(hdrtext,attr_name,colspan,time,value);
}
function detailDateReadonly(hdrtext,attr_name,colspan,time,value)
{
detailRowHdr(hdrtext,colspan,false);
if(value.length>0)
value=date_to_string(value,0,0,time);
else
value="&nbsp;";
detailSetReadonlyRowData(value,colspan);
}
function detailDateEdit(hdrtext,attr_name,colspan,size,time,
is_required,value)
{
if(!detailOK2Edit(attr_name,hdrtext)){
detailDateReadonly(hdrtext,attr_name,colspan,time,value);
return;
}
var field_name;
if(attr_name.match(/^KEEP\./))
field_name=attr_name;
else
field_name="SET."+attr_name;
detailWriteDateHdr(hdrtext,field_name,colspan,is_required,false,"",time);
if(typeof size!="number"||size<2)
size=20;
var nextid=detailNextID(colspan);
if(ahdtop.cstUsingScreenReader){
var titletext=hdrtext;
if(bool(is_required))
titletext+=ahdtop.cfgIndRequired;
nextid+=' title="'+msgtext(897,titletext)+'"';
}
detailSetRowData(field_name+
":"+value+":"+size+
":"+nextid+":"+time,1);
detailSetValidate(hdrtext,is_required,100);
}
function detailWriteDateHdr(hdrtext,field_name,colspan,
is_required,selector_id,flag_name,time)
{
detailRowHdr("",colspan,is_required);
var n=_dtl.form.length-1;
var hdrhtml="<TH"+
_dtl.colSpan[_dtl.hdrColNum-1]+
' ALIGN=left VALIGN=middle>';
var link='<A class=lookup1em'+detailNextLinkID()+
' HREF="javascript:void(0)" onClick=\"';
if(typeof selector_id=="string")
link+="detailSwitchDateToText('"+selector_id+"','"+
field_name+"','"+flag_name+"', true);return false;\" ";
else
{
if(typeof time!="undefined"&&time=="no")
{
link+="popup_date_helper('"+detailCurrForm()+"','"+
field_name+"','"+
time+"');return false;\" ";
}
else
{
link+="popup_date_helper('"+detailCurrForm()+"','"+
field_name+"');return false;\" ";
}
}
var titletext=msgtext(852,hdrtext);
var lbltext=hdrtext;
if(ahdtop.cstUsingScreenReader){
lbltext=msgtext(840,hdrtext);
hdrhtml+=link+'title="'+msgtext(896,titletext)+'">';
}
else{
link+='title="'+titletext+'" onMouseOver="window.status=\''+
msgtext(102,hdrtext.toLowerCase()).replace(/\'/g,"\\\'")+
'\';return true" '+
'onMouseOut="window.status=window.defaultStatus;return true">';
hdrhtml+=link+
'<IMG WIDTH=12 HEIGHT=12 BORDER=0 STYLE="vertical-align:middle" SRC="'+
get_IMG_path("IMG_lookup_cal")+'" alt="'+
msgtext(852,hdrtext)+'">&nbsp;';
}
hdrhtml+="<SPAN CLASS=";
if(!bool(is_required))
hdrhtml+="lookup";
else{
hdrhtml+=_dtl.reqhdrclass;
lbltext=+ahdtop.cfgIndRequired;
}
hdrhtml+=detailLabelFor(lbltext)+"</SPAN></A></TH>";
docWriteln(hdrhtml);
}
function detailDateDropdown(hdrtext,attr_name,colspan,size,
is_required,flag_name,selections)
{
var field_name;
if(attr_name.indexOf("SET")==0)
field_name=attr_name;
else
field_name="SET."+attr_name;
var date_id="df_"+_dtl.rowNum+"_"+_dtl.colID;
detailWriteDateHdr(hdrtext,field_name,colspan,is_required,date_id,flag_name);
var dateNextID=detailNextID();
var text=date_input_text("main_form","",field_name,"",size,
dateNextID.replace(date_id,date_id+"_hdn")+
" STYLE='display:none'");
var eh="detailSwitchDateToText('"+date_id+
"','"+field_name+"','"+flag_name+"', false);";
var p=dateNextID.match(/^(.*)return (detailBlur.this.;)(.*)$/);
if(p==null)
dateNextID+=" "+eh;
else
dateNextID=p[1]+p[2]+eh+"return false;"+p[3];
var titletext=hdrtext;
if(bool(is_required))
titletext+=ahdtop.cfgIndRequired;
text+="<SELECT"+dateNextID+
" title=\""+titletext+"\""+
" onClick=\"_dtl.lastKeycode=0;"+eh+"\""+
" STYLE='width:"+(size*10)+"'>\n";
text+="<OPTION VALUE=0>&lt;"+msgtext(1)+"&gt;\n";
for(var i=6;i<arguments.length-1;i+=2)
text+="<OPTION VALUE="+arguments[i]+">"+
arguments[i+1]+"\n";
text+="<OPTION VALUE=other>"+msgtext(290)+"\n";
text+="</SELECT>";
detailSetRowData(text);
detailSetValidate(hdrtext,is_required,100);
}
function detailSwitchDateToText(id,field_name,flag_name,popup_helper)
{
var selector=document.getElementById(id);
var input=document.getElementById(id+"_hdn");
if(selector==null||input==null)
{
if(popup_helper)
popup_date_helper('main_form',field_name);
}
else{
var v=selector[selector.selectedIndex].value;
if(v!="0"||popup_helper){
selector.onblur=null;
selector.id=id+"_selector";
selector.tabIndex=-1;
input.id=id;
input.style.display="";
input.setAttribute("autocomplete","OFF");
if(_dtl.lastKeycode==0||_dtl.lastKeycode==ENTER)
input.focus();
selector.style.display="none";
var flag=document.getElementById(flag_name);
if(flag!=null)
flag.value="1";
if(v=="other"||popup_helper)
popup_date_helper('main_form',field_name);
else{
var today=new Date();
if(v-0>0){
var tmp=Math.round(today.getTime()/ 1000) + (v - 0);
input.value=date_to_string(tmp,0);
}
}
adjScrollDivHeight();
}
}
}
function detailDropdown(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results,link,cbwidth,extraURL,
dflt,selections)
{
var i,field_name;
common_name_value=unescape(common_name_value);
rel_attr=unescape(rel_attr);
if(typeof selections!="string"||selections.length==0)
selections=new Array();
else{
selections=unescape(selections);
if(selections=="SelListCacheMax"){
detailLookupEdit(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results,"yes",extraURL);
return;
}
selections=selections.split("@,@");
for(i=18;i<arguments.length;i++)
selections[selections.length]=unescape(arguments[i]);
}
if(!detailOK2Edit(attr_name,hdrtext)){
detailLookupReadonly(hdrtext,attr_name,colspan,
persid,common_name_value,link);
return;
}
detailRowHdr(hdrtext,colspan,is_required);
if(attr_name.match(/^KEEP\./))
field_name=attr_name;
else
field_name="SET."+attr_name;
var item='<SELECT'+detailNextID(colspan);
if(cbwidth!=0)
item+=' STYLE="WIDTH:'+cbwidth+'px;"';
if(typeof _dtl.fieldTitle!="string"||
_dtl.fieldTitle.length==0){
var titletext=hdrtext;
if(bool(is_required))
titletext+=ahdtop.cfgIndRequired;
item+=" title=\""+titletext+"\"";
}
else{
item+=" title=\""+_dtl.fieldTitle+"\"";
_dtl.fieldTitle=void(0);
}
item+=' NAME="'+field_name+'">\n';
var options="";
if(!bool(is_required)||
(rel_attr.length==0&&dflt.length==0))
options+='<OPTION VALUE="">&lt;'+msgtext(1)+'&gt;\n';
var curr_found=false;
for(i=1;i<selections.length;i+=2){
var sym=selections[i-1];
var code=selections[i];
if(code==rel_attr||
(sym==dflt&&
rel_attr.length==0&&
dflt.length>0)){
curr_found=true;
options+='<OPTION SELECTED VALUE="'+code+'">'+sym+'\n';
}
else
options+='<OPTION VALUE="'+code+'">'+sym+'\n';
}
if(!curr_found&&rel_attr.length>0){
if(common_name_value.length==0)
common_name_value="?";
options+='<OPTION SELECTED VALUE="'+rel_attr+'">'+common_name_value+'\n';
}
item+=options+'</SELECT>\n';
detailSetRowData(item);
detailSetValidate(hdrtext,is_required);
}
function detailHier(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results)
{
common_name_value=unescape(common_name_value);
rel_attr=unescape(rel_attr);
var ahdtop=get_ahdtop();
if(typeof ahdtop=="object"&&ahdtop!=null&&
ahdtop.cfgSuppressHier.indexOf(" "+obj_type+" ")!=-1){
detailLookupEdit(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results);
return;
}
if(_dtl.edit)
detailHierEdit(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results)
else
detailLookupReadonly(hdrtext,attr_name,colspan,
persid,common_name_value);
}
var cat_validate_fld=void(0);
function detailHierEdit(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results)
{
if(!detailOK2Edit(attr_name,hdrtext)){
detailLookupReadonly(hdrtext,attr_name,colspan,
persid,common_name_value);
return;
}
if(typeof size!="number"||size<2)
size=20;
var n=_dtl.form.length-1;
var item,do_autofill;
detailRowHdr("",colspan,is_required);
if(typeof common_name_attr!="string"||
common_name_attr.length==0)
do_autofill=false;
else
do_autofill=(autofill=="yes");
var hdrhtml="<TH"+
_dtl.colSpan[_dtl.hdrColNum-1]+
' ALIGN=left VALIGN=middle>';
var link='<A class=lookup1em'+detailNextLinkID()+
' HREF="javascript:void(0)" onclick="popup_hier(\''+
obj_type+"','KEY."+attr_name+
"','"+detailCurrForm()+"','"+
common_name_attr+"',1)\" ";
var lbltext=hdrtext;
var titletext=msgtext(851,hdrtext);
if(ahdtop.cstUsingScreenReader){
lbltext=msgtext(841,lbltext);
hdrhtml+=link+' title="'+msgtext(896,titletext)+'">';
}
else{
link+='title="'+titletext+'" onMouseOver="window.status=\''+
msgtext(102,lbltext.toLowerCase()).replace(/\'/g,"\\\'")+
'\';return true" '+
'onMouseOut="window.status=window.defaultStatus;return true">';
hdrhtml+=link+
'<IMG WIDTH=12 HEIGHT=12 BORDER=0 STYLE="vertical-align:middle" SRC="'+
get_IMG_path("IMG_lookup_hier")+'" alt="'+
msgtext(851,hdrtext)+'">&nbsp;';
}
hdrhtml+="<SPAN CLASS=";
if(!bool(is_required))
hdrhtml+="lookup";
else{
hdrhtml+=_dtl.reqhdrclass;
lbltext=+ahdtop.cfgIndRequired;
}
hdrhtml+=detailLabelFor(lbltext)+"</SPAN></A></TH>";
docWriteln(hdrhtml);
var onchg;
if(do_autofill)
onchg="detailAutofill(this,'"+obj_type+
"',0,'"+common_name_attr+"',true);";
else
onchg="detailClearSetField(this)";
var eh=_dtl.eventHandler;
if(eh.length==0)
_dtl.eventHandler="onChange=\""+onchg+"\" ";
else if(!eh.match(/^(.*onChange=\\?)(['"'])(.*)$/i))
_dtl.eventHandler+=" onChange=\""+onchg+"\" ";
else{
if(RegExp.$2=="'")
onchg=onchg.replace(/'/g,'"');
_dtl.eventHandler=RegExp.$1+RegExp.$2+onchg+";"+RegExp.$3;
}
if(obj_type=="KCAT"&&attr_name=="PRIMARY_INDEX")
{
item="<INPUT"+detailNextID(colspan)+" TYPE=text readonly style=border:none;background- color:white VALUE=\""+
common_name_value.replace(rxQuote,"&quot;")+
"\" SIZE=50"+" NAME=\"KEY."+attr_name+"\"";
}
else
{
item="<INPUT"+detailNextID(colspan)+" TYPE=text VALUE=\""+
common_name_value.replace(rxQuote,"&quot;")+
"\" SIZE="+size+" NAME=\"KEY."+attr_name+"\"";
}
if(ahdtop.cstUsingScreenReader){
titletext=hdrtext;
if(bool(is_required))
titletext+=ahdtop.cfgIndRequired;
item+=' title="'+msgtext(897,titletext)+'">\n';
}
else
item+=">\n";
item+='<INPUT TYPE=hidden NAME="'+
"SET."+attr_name+'" VALUE="'+rel_attr+'">\n';
if(typeof search_status=="string"&&search_status.length>0){
item+="<BR><SPAN ID=search_status_span CLASS=statuslabeltext>"+
search_status+"</SPAN>";
if(typeof AlertMsg=="string"&&AlertMsg.length>0)
AlertMsg+="<BR>"+hdrtext+": "+search_status;
else
AlertMsg=hdrtext+": "+search_status;
}
detailSetRowData(item);
var f_obj=detailSetValidate(hdrtext,is_required,0,search_status);
if(attr_name=="category")
cat_validate_fld=f_obj;
}
function detailLookup(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results,link,extraURL)
{
common_name_value=unescape(common_name_value);
if(attr_name=="group")
{
common_name_value=common_name_value.replace(", ,","");
}
if(_dtl.edit)
detailLookupEdit(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results,link,extraURL)
else
detailLookupReadonly(hdrtext,attr_name,colspan,
persid,common_name_value,link);
}
function detailLookupReadonly(hdrtext,attr_name,colspan,
persid,common_name_value,link)
{
var item;
common_name_value=unescape(common_name_value);
var arr=persid.split(":");
var is_contact=arr[0]=="agt"||
arr[0]=="cnt"||
arr[0]=="cst"||
arr[0]=="agtgrp"||
arr[0]=="grp";
if(is_contact)
{
arr=common_name_value.split(",");
if(arr.length==3)
common_name_value=arr[0]+", "+arr[1]+" "+arr[2];
}
var nextIdText=detailNextID(colspan);
var id=_dtl.currID+"_"+attr_name;
if(common_name_value.length==0){
_dtl.lookupAttrs[attr_name]={id:id};
detailRowHdr(hdrtext,colspan,false,void(0),id);
detailSetReadonlyRowData("&nbsp;",colspan,id);
return;
}
else if(typeof link=="string"&&link=="no"){
_dtl.lookupAttrs[attr_name]={id:id};
detailRowHdr(hdrtext,colspan,false,void(0),id);
detailSetReadonlyRowData(common_name_value,colspan,id);
return;
}
else{
detailRowHdr(hdrtext,colspan,false,void(0),false);
var lookupClass=(_dtl.edit?'lookup':'lookup1em');
if(typeof link=="string"&&link!="yes")
item='<A'+nextIdText+' HREF="javascript:'+link+
' " title="'+hdrtext+" "+common_name_value+
'"><SPAN class='+lookupClass+'>'+common_name_value+
'</SPAN></A>';
else
item="<A"+nextIdText+
' title="'+hdrtext+" "+common_name_value+
"\" HREF='javascript:showDetailWithPersid(\""+persid+
"\")'><SPAN class="+lookupClass+'>'+common_name_value+
'</SPAN></A>';
id=_dtl.currID;
}
_dtl.lookupAttrs[attr_name]={id:id};
detailSetRowData(item);
}
function selAgtCheck(sel)
{
if(_dtl.edit&&!_dtl.skip_agt_check)
{
var opt=sel.options[sel.selectedIndex];
if(typeof opt.value=="undefined"||opt.value=="")return;
var f=document.main_form;
detailAgtCheck(f,"group",opt.value,prop_ref);
}
}
function detailLookupEdit(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results,linkinfo,extraURL,bSetFontTo1em)
{
if(typeof bSetFontTo1em!="undefined")
{
if(bSetFontTo1em==1)
{
_dtl.dataoverrideclass=" style='font-size:1.0em;'";
}
}
if(!detailOK2Edit(attr_name,hdrtext)){
detailLookupReadonly(hdrtext,attr_name,colspan,
persid,common_name_value);
return;
}
if(typeof extraURL=="undefined")
extraURL="";
extraURL=extraURL.replace(/'/g,escape("'"));
extraURL=extraURL.replace(/"/g,escape('"'));
common_name_value=unescape(common_name_value);
if(typeof size!="number"||size<2)
size=20;
var n=_dtl.form.length-1;
var is_contact=obj_type=="agt"||
obj_type=="cnt"||
obj_type=="cst"||
obj_type=="agtgrp"||
obj_type=="grp";
var item,field_name,do_autofill;
if(typeof search_results!="string"||search_results.length==0)
search_results="";
else
search_results=search_results.split("@,@");
if(search_results.length>2){
detailRowHdr(hdrtext,colspan,is_required);
if(attr_name.match(/^KEEP\./))
field_name=attr_name;
else
field_name="SET."+attr_name;
if(attr_name=="group")
{
var onblur="selAgtCheck(this)";
var eh=_dtl.eventHandler;
if(eh.length==0)
_dtl.eventHandler="onBlur=\""+onblur+"\" ";
else if(!eh.match(/^(.*onBlur=\\?)(['"'])(.*)$/i))
_dtl.eventHandler+=" onBlur=\""+onblur+"\" ";
else
_dtl.eventHandler=RegExp.$1+RegExp.$2+onblur+";"+RegExp.$3;
}
item='<SELECT'+detailNextID(colspan)+
' NAME="'+field_name+'">\n';
var options="";
if(!bool(is_required))
options+='<OPTION VALUE="">&lt;'+msgtext(1)+'&gt;\n';
for(var i=1;i<search_results.length;i+=2){
var sym=search_results[i-1];
var code=search_results[i];
options+='<OPTION VALUE="'+code+'">'+sym+'\n';
}
options+="<OPTION VALUE='noneoftheabove'>"+msgtext(236)+"\n";
item+=options+'</SELECT>\n';
}
else{
detailRowHdr("",colspan,is_required);
if(search_results.length==2){
common_name_value=search_results[0];
rel_attr=search_results[1];
}
if(typeof common_name_attr!="string"||
common_name_attr.length==0)
do_autofill=false;
else
do_autofill=(autofill=="yes");
var hdrhtml="<TH"+
_dtl.colSpan[_dtl.hdrColNum-1]+
' ALIGN=left VALIGN=middle>';
var link='<A class=lookup1em'+
detailNextLinkID()+
' HREF="javascript:void(0)" onclick="';
if(typeof linkinfo=="string"&&linkinfo!="yes"){
link+=linkinfo+"\" ";
}
else if(is_contact)
link+="fill_name_fields(_dtl.form["+n+"],'"+
obj_type+"','"+attr_name+"',true,'"+extraURL+"' )\" ";
else{
link+="popup_search('"+obj_type+"','KEY."+attr_name+
"','"+detailCurrForm()+"', '"+extraURL+"',0,'"+
common_name_attr+"')\" ";
}
var titletext=msgtext(851,hdrtext);
var lbltext=hdrtext;
if(ahdtop.cstUsingScreenReader){
lbltext=msgtext(839,lbltext);
hdrhtml+=link+' title="'+msgtext(896,titletext)+'">';
}
else{
link+='title="'+titletext+'" onMouseOver="window.status=\''+
msgtext(102,lbltext.toLowerCase()).replace(/\'/g,"\\\'")+
'\';return true" '+
'onMouseOut="window.status=window.defaultStatus;return true">';
hdrhtml+=link+
'<IMG WIDTH=12 HEIGHT=12 BORDER=0 STYLE="vertical-align:middle" SRC="'+
get_IMG_path("IMG_lookup")+'" alt="'+
msgtext(851,hdrtext)+'">&nbsp;';
}
hdrhtml+="<SPAN CLASS=";
if(!bool(is_required))
hdrhtml+="lookup";
else{
hdrhtml+=_dtl.reqhdrclass;
lbltext+=ahdtop.cfgIndRequired;
}
hdrhtml+=detailLabelFor(lbltext)+"</SPAN></A></TH>";
docWriteln(hdrhtml);
var onchg;
if(do_autofill)
onchg="detailAutofill(this,'"+obj_type+
"',"+is_contact+",'"+common_name_attr+"',false,'"+extraURL+"');";
else if(is_contact)
onchg="fill_name_fields('main_form','"+obj_type+
"','"+attr_name+"',true,'"+extraURL+"');";
else
onchg="detailClearSetField(this);";
var eh=_dtl.eventHandler;
if(eh.length==0)
_dtl.eventHandler="onChange=\""+onchg+"\" ";
else if(!eh.match(/^(.*onChange=\\?)(['"'])(.*)$/i))
_dtl.eventHandler+=" onChange=\""+onchg+"\" ";
else{
if(RegExp.$2=="'")
onchg=onchg.replace(/'/g,'"');
_dtl.eventHandler=RegExp.$1+RegExp.$2+onchg+RegExp.$3;
}
item="<INPUT"+detailNextID(colspan)+" TYPE=text VALUE=\""+
common_name_value.replace(rxQuote,"&quot;")+
"\" SIZE="+size;
if(ahdtop.cstUsingScreenReader){
var titletext=hdrtext;
if(bool(is_required))
titletext+=ahdtop.cfgIndRequired;
item+=' title="'+msgtext(897,titletext)+'"';
}
item+=" NAME=\"";
if(!is_contact){
item+="KEY."+attr_name+"\">\n";
}
else{
item+=attr_name+"_combo_name\">\n";
item+='<INPUT TYPE=hidden NAME="'+
"KEY."+attr_name+'">\n';
item+='<INPUT TYPE=hidden NAME="'+
attr_name+'_lname">\n';
item+='<INPUT TYPE=hidden NAME="'+
attr_name+'_fname">\n';
item+='<INPUT TYPE=hidden NAME="'+
attr_name+'_mname">\n';
}
item+='<INPUT TYPE=hidden NAME="'+
"SET."+attr_name+'" VALUE="'+rel_attr+'">\n';
}
if(typeof search_status=="string"&&search_status.length>0){
item+="<BR><SPAN CLASS=statuslabeltext>"+
search_status+"</SPAN>";
if(typeof AlertMsg=="string"&&AlertMsg.length>0)
AlertMsg+="<BR>"+hdrtext+": "+search_status;
else
AlertMsg=hdrtext+": "+search_status;
}
detailSetRowData(item);
detailSetValidate(hdrtext,is_required,0,search_status);
}
function detailAutofill(e,obj_type,is_contact,common_name_attr,is_hier,extraURL)
{
if(typeof autofillTrigger!="undefined"&&
!autofillTrigger(e,obj_type,is_contact,common_name_attr))
return;
detailClearSetField(e);
var do_search=false;
if(_dtl.lastKeycode==TAB&&
ahdframe.currentAction==ACTN_COMPLETE&&
!e.value.match(/^\s*$/)){
if(is_contact)
do_search=true;
else if(is_hier)
popup_hier(obj_type,e.name,"main_form",common_name_attr,true);
else
popup_search(obj_type,e.name,"main_form",
extraURL,0,common_name_attr);
}
if(is_contact&&
e.name.match(/^(.*)_combo_name$/))
fill_name_fields(_dtl.form[0],obj_type,RegExp.$1,do_search,extraURL);
}
function detailClearSetField(e)
{
if(e.name.match(/^KEY\.(.*)$/)||
e.name.match(/^(.*)_combo_name$/)){
var setfld=document.main_form["SET."+RegExp.$1];
if(setfld!=null)
setfld.value="";
}
}
function detailCheckbox(hdrtext,attr_name,colspan,value,on,off)
{
if(_dtl.edit)
detailCheckboxEdit(hdrtext,attr_name,colspan,value);
else
detailCheckboxReadonly(hdrtext,attr_name,colspan,value,on,off);
}
function detailCheckboxReadonly(hdrtext,attr_name,colspan,value,on,off)
{
detailRowHdr(hdrtext,colspan,false);
if(value.length==0||value.match(/^[ 0]*$/)){
if(typeof off=="string"&&
off.length>0&&
!off.match(/^ +$/))
value=off;
else
value="&nbsp;";
}
else{
if(typeof on=="string"&&on.length>0)
value=on;
else
value="X";
}
detailSetReadonlyRowData(value,colspan);
}
function detailCheckboxEdit(hdrtext,attr_name,colspan,value)
{
if(!detailOK2Edit(attr_name,hdrtext)){
detailCheckboxReadonly(hdrtext,attr_name,colspan,value);
return;
}
detailRowHdr(hdrtext,colspan,false);
var item="<INPUT TYPE=hidden NAME=SET."+attr_name+
" VALUE=\""+value.replace(rxQuote,"&quot;")+"\">\n"+
"<INPUT"+detailNextID(colspan)+
" TYPE=checkbox VALUE='1' NAME=CBX."+attr_name+
" onClick=\"detailSetCbxFlag(this)\"";
if(typeof _dtl.fieldTitle!="string"||
_dtl.fieldTitle.length==0)
item+=" title=\""+hdrtext+"\"";
else{
item+=" title=\""+_dtl.fieldTitle+"\"";
_dtl.fieldTitle=void(0);
}
if(value.length>0&&!value.match(/^[ 0]*$/))
item+=" CHECKED";
item+=">";
detailSetRowData(item);
}
function detailSetCbxFlag(element)
{
if(element.name.match(/CBX\.([\.\w]*)/)){
var f=document.main_form["SET."+RegExp.$1];
if(f!=null)
f.value=(element.checked?"1":"0");
}
}
function detailTextbox(hdrtext,attr_name,colspan,rows,size,
is_required,maxsize,value,spellchk,srchknow)
{
if(_dtl.edit)
detailTextboxEdit(hdrtext,attr_name,colspan,rows,size,
is_required,maxsize,value,spellchk,srchknow)
else
detailTextboxReadonly(hdrtext,attr_name,colspan,value,
void(0),void(0),rows,size);
}
function detailTextboxReadonly(hdrtext,attr_name,colspan,value,id,overrideclass,rows,size)
{
value=unescape(value);
detailRowHdr(hdrtext,colspan,false);
if(value.length==0||value.match(/^ *$/))
value="&nbsp;";
if(typeof overrideclass!="undefined")
_dtl.dataoverrideclass=" CLASS="+overrideclass;
detailSetReadonlyRowData(value,colspan,id,rows,size);
}
function detailTextboxEdit(hdrtext,attr_name,colspan,rows,size,
is_required,maxsize,value,spellchk,srchknow)
{
if(!detailOK2Edit(attr_name,hdrtext)){
detailTextboxReadonly(hdrtext,attr_name,colspan,value);
return;
}
var item,th,field_name;
value=unescape(value);
if(typeof size!="number"||size<2)
size=20;
if(attr_name.match(/^KEEP\./))
field_name=attr_name;
else
field_name="SET."+attr_name;
var spellchk_button=(typeof spellchk=="string"&&spellchk.match(/^[Yy]/));
var srchknow_button=(typeof srchknow=="string"&&srchknow.match(/^[Yy]/));
if((!spellchk_button)&&(!srchknow_button))
detailRowHdr(hdrtext,colspan,is_required);
else{
_dtl.doingLabelButton=true;
var rowHdr=detailRowHdr(hdrtext,colspan,is_required,false);
if(typeof colspan!="number"||colspan==1)
th="<TH";
else
th="<TH COLSPAN="+colspan;
rowHdr=rowHdr.replace("baseline","middle");
var row_id=get_exp_row_id("");
if(row_id!="")
row_id=" ID='"+row_id+"' ";
docWriteln(th+" ALIGN=left><TABLE><TR"+row_id+">"+rowHdr);
if(spellchk_button){
_dtl.spellchk=true;
ImgBtnSetDefaultTabIndex(_dtl.tabIndex+1);
docWriteln("<TH>");
ImgBtnCreate("",msgtext(408),
"popup_spellchecker('spell_form','main_form','"+
field_name+"')",true,0,msgtext(912,hdrtext));
docWriteln("</TH>");
}
if(srchknow_button){
_dtl.srhknow=true;
ImgBtnSetDefaultTabIndex(_dtl.tabIndex+1);
docWriteln("<TH>");
ImgBtnCreate("",msgtext(690),
"srchknow('"+field_name+"')",true,0,
msgtext(913,hdrtext));
docWriteln("</TH>");
}
docWriteln("</TR></TABLE></TH>");
_dtl.doingLabelButton=false;
}
if(propFactory=="KD")
{
_dtl.spellchk=true;
}
var titletext=hdrtext;
if(bool(is_required))
titletext+=ahdtop.cfgIndRequired;
if(rows-0==1)
{
item="<INPUT"+detailNextID(colspan)+
" TYPE=text VALUE=\""+value.replace(rxQuote,"&quot;")+
"\" SIZE="+size+" NAME='"+field_name+"'";
if(typeof _dtl.fieldTitle!="string"||
_dtl.fieldTitle.length==0)
item+=" title=\""+titletext+"\"";
else{
item+=" title=\""+_dtl.fieldTitle+"\"";
_dtl.fieldTitle=void(0);
}
if(maxsize>0)
item+=" MAXLENGTH="+maxsize+">";
else
item+=">";
}
else{
item="<TEXTAREA"+detailNextID(colspan)+
" ROWS="+rows+" COLS="+size;
if(typeof _dtl.fieldTitle!="string"||
_dtl.fieldTitle.length==0)
item+=" title=\""+titletext+"\"";
else{
item+=" title=\""+_dtl.fieldTitle+"\"";
_dtl.fieldTitle=void(0);
}
item+=" NAME='"+field_name+"'>"+
value+"</TEXTAREA>";
}
detailSetRowData(item);
detailSetValidate(hdrtext,is_required,maxsize);
if(spellchk_button||srchknow_button)
_dtl.tabIndex++;
}
function detailExternal(hdrtext,text,colspan)
{
if(typeof text!="string"){
if(typeof text=="number"&&
typeof colspan=="undefined")
colspan=text;
if(typeof hdrtext!="string"||hdrtext.length==0)
return;
text=hdrtext;
hdrtext="";
}
detailRowHdr(hdrtext,colspan,false);
if(!text.match(/^\s*\</))
detailSetReadonlyRowData(text,colspan);
else
detailSetRowData(text);
}
function detailHTMLEditBox(hdrtext,attr_name,colspan,rows,size,
is_required,maxsize,value,spellchk,preview,optionid,readonly,toolbar)
{
var row_id;
var id="df_"+_dtl.rowNum+"_"+_dtl.colID;
var divId="div"+id;
var generatedButton=false;
if((typeof readonly=="string"&&readonly.match(/^[Yy]/))||
!detailOK2Edit(attr_name,hdrtext))
{
detailHTMLEditBoxReadOnly(hdrtext,attr_name,colspan,rows,size,
is_required,maxsize,value,preview,optionid,divId);
return;
}
var bShowEditor=true;
if(ahdtop.cfgNX_KT!="Yes"&&toolbar=="kd")
bShowEditor=false;
var th,field_name,spellButId;
if(optionid.length==0||optionid=="")
optionid="id"+attr_name;
if(typeof size!="number"||size<2)
size=20;
if(attr_name.match(/^KEEP\./))
field_name=attr_name;
else
field_name="SET."+attr_name;
var rowHdr=detailRowHdr(hdrtext,colspan,is_required,false);
if(typeof colspan!="number"||colspan==1)
th="<TH";
else
th="<TH COLSPAN="+colspan;
rowHdr=rowHdr.replace("baseline","middle");
row_id=get_exp_row_id("");
if(row_id!="")row_id=" ID='"+row_id+"' ";
docWriteln(th+" ALIGN=left><TABLE><TR"+row_id+">"+rowHdr+"<TH>");
_dtl.doingLabelButton=true;
if(bShowEditor||
(typeof spellchk=="string"&&spellchk.match(/^[Yy]/))){
generatedButton=true;
ImgBtnRow(10);
if(bShowEditor)
{
ImgBtnSetDefaultTabIndex(_dtl.tabIndex+1);
ImgBtnCreate("",msgtext(561,hdrtext),
"OpenHTMLEditor('"+field_name+"','"+divId+"','"+
toolbar+"')",true,0,msgtext(914,hdrtext));
}
if(typeof spellchk=="string"&&spellchk.match(/^[Yy]/))
{
_dtl.spellchk=true;
ImgBtnSetDefaultTabIndex(_dtl.tabIndex+1);
spellButId=ImgBtnCreate("",msgtext(408),
"popup_spellchecker('spell_form','main_form','"+
field_name+"')",true,0,msgtext(912,hdrtext));
}
ImgBtnEndRow();
}
docWriteln("</TH>");
if(bShowEditor&&typeof preview=="string"&&preview.match(/^[Yy]/))
{
var qvKey=registerActionKey("",msgtext(562),setRadioButton,
_dtl.form[0].name,optionid,0);
var htmlKey=registerActionKey("",msgtext(563),setRadioButton,
_dtl.form[0].name,optionid,1);
docWriteln("<TH><INPUT TYPE=radio ID=radioPreview NAME="+
optionid+
" onclick=detailHTMLEditBoxMode('1','"+divId+"','"+
id+"','"+spellButId+
"') tabindex="+(_dtl.tabIndex+1)+
"><SPAN class=labeltext><label for='radioPreview'>"+
fmtLabelWithActkey(msgtext(562),qvKey)+
"</label></SPAN><INPUT TYPE=radio CHECKED ID=radioSource NAME="+
optionid+
" onclick=detailHTMLEditBoxMode('0','"+divId+"','"+
id+"','"+spellButId+
"') tabindex="+(_dtl.tabIndex+1)+
"><SPAN class=labeltext><label for='radioSource'>"+
fmtLabelWithActkey(msgtext(563),htmlKey)+
"</label></SPAN></TH>");
}
docWriteln("</TR></TABLE></TH>");
_dtl.doingLabelButton=false;
var item="";
item+="<TABLE CELLPADDING=0 CELLSPACING=0>";
if(bShowEditor)
{
row_id=get_exp_row_id("");
if(row_id!="")row_id=" ID='"+row_id+"' ";
item+="<TR"+row_id+">"+"<TD><DIV ID='"+divId+"' "+
" style='display:none;overflow:auto;font-size:1.0em;background-color:#f4f4f4;border- style:solid;border-width:1;'>"+
"</DIV></TD></TR>";
}
row_id=get_exp_row_id("");
var titletext=hdrtext;
if(bool(is_required))
titletext+=ahdtop.cfgIndRequired;
if(row_id!="")row_id=" ID='"+row_id+"' ";
item+="<TR><TD"+row_id+"><TEXTAREA "+detailNextID(colspan)+
" title=\""+titletext+"\""+
" ROWS="+rows+" COLS="+size+
" NAME='"+field_name+"'></TEXTAREA></TD></TR></TABLE>";
detailSetRowData(item);
detailSetValidate(hdrtext,is_required,maxsize);
var sCMD="SetHTMLValue('"+value+"','"+field_name+"');";
window.setTimeout(sCMD,50);
if(generatedButton)
_dtl.tabIndex++;
}
function SetHTMLValue(sValue,sFldName)
{
sValue=unescape(sValue);
var e=null;
for(var i=0;i<document.forms.length;i++){
e=document.forms[i].elements[sFldName];
if(typeof e=="object")
break;
}
if(typeof e=="object")
try{
e.value=sValue;
}
catch(e){}
}
function detailHTMLEditBoxReadOnly(hdrtext,attr_name,colspan,rows,size,
is_required,maxsize,value,preview,optionid,divId)
{
var row_id;
var field_name;
value=unescape(value);
value=ReplaceRepIdToImgPath(value);
if(optionid==0||optionid.length==0||optionid=="")
optionid="id"+attr_name;
if(typeof size!="number"||size<2)
size=20;
if(attr_name.match(/^KEEP\./))
field_name=attr_name;
else
field_name="SET."+attr_name;
detailRowHdr(hdrtext,colspan,false);
detailIncrCol(colspan);
var sAttr=detailNextID(colspan);
var startPos=sAttr.indexOf("=");
var endPos=sAttr.indexOf(" ",startPos);
var sID=sAttr.substring(startPos+1,endPos);
var item="";
row_id=get_exp_row_id("");
if(row_id!="")
row_id=" ID='"+row_id+"' ";
item+="<TABLE width=100% CELLPADDING=0 CELLSPACING=0 class=labeltext style='font- size:1.0em;'><TR"+row_id+
"><TD><DIV ID='"+divId+"' tabindex="+_dtl.tabIndex+
" title=\""+hdrtext+"\" style='overflow:auto;'>"+
value+"</DIV></TD></TR></TABLE>";
detailSetRowData(item);
}
function detailKeyDown(active_element,keycode,shiftkey,altkey)
{
_dtl.lastKeycode=keycode;
var r,c,e=null,v;
if(typeof active_element=="object"){
var id=active_element.id;
if(typeof id!="string")
id="";
if(id.match(/df([\w]*)_([\d]+)_([\d]+)/)){
var lnk=RegExp.$1;
var row=RegExp.$2-0;
var col=RegExp.$3-0;
var maxRow=_dtl.rowNum-1;
var maxCol=_dtl.maxCol;
if(row==_dtl.propertyRow){
switch(keycode){
case ARROW_UP:
if(col>0)
e=document.getElementById("df_"+row+"_"+(col-1));
break;
case ARROW_DOWN:
e=document.getElementById("df_"+row+"_"+(col+1));
break;
}
if(e!=null)
keycode=0;
}
switch(keycode){
case ARROW_LEFT:
if(ahdtop.cfgUserType!="analyst"||
ahdtop.cstUsingScreenReader)
break;
if(!altkey){
if((active_element.type=="text"||
active_element.type=="textarea")&&
active_element.value.length>0)
break;
}
while(e==null){
col--;
if(col<0){
col=maxCol;
if(row>0)
row--;
else
row=maxRow;
}
e=document.getElementById("df_"+row+"_"+col);
}
break;
case ARROW_RIGHT:
if(active_element.tagName=="A"&&
!altkey&&
!shiftkey){
for(var p=active_element;
p!=null&&p.tagName!="FORM";
p=p.parentNode){
var handler=p.oncontextmenu;
if(handler==null)
handler=p.onmouseover;
if(handler!=null){
var script=handler.toString().replace(/\n/g," ");
if(script.match(/\{(.*\.show)/)){
eval(RegExp.$1+"('mouseless',active_element,0)");
return false;
}
}
}
}
if(ahdtop.cfgUserType!="analyst"||
ahdtop.cstUsingScreenReader)
break;
if(!altkey){
if((active_element.type=="text"||
active_element.type=="textarea")&&
active_element.value.length>0)
break;
}
while(e==null){
col++;
if(col>maxCol){
col=0;
if(row<maxRow)
row++;
else
row=0;
}
e=document.getElementById("df_"+row+"_"+col);
}
break;
case ARROW_UP:
if(ahdtop.cstUsingScreenReader){
if(active_element.type=="text")
e=document.getElementById("dflnk_"+row+"_"+col);
if(e==null)
break;
}
if((active_element.type=="select-one"||
active_element.type=="select-multiple")&&
(_browser.isNS||!shiftkey))
break;
if(!altkey){
if(active_element.type=="textarea"&&
active_element.value.length>0)
break;
}
if(lnk!="lnk")
e=document.getElementById("dflnk_"+row+"_"+col);
for(r=row-1;r>0&&e==null;r--)
e=document.getElementById("df_"+r+"_"+col);
while(e==null){
if(row>0)
row--;
else
row=maxRow;
for(c=col;e==null&&c>=0;c--)
e=document.getElementById("df_"+row+"_"+c);
}
break;
case ARROW_DOWN:
if(ahdtop.cstUsingScreenReader&&
active_element.tagName!="A")
break;
if((active_element.type=="select-one"||
active_element.type=="select-multiple")&&
(_browser.isNS||!shiftkey))
break;
if(!altkey){
if(active_element.type=="textarea"&&
active_element.value.length>0)
break;
}
if(lnk=="lnk")
e=document.getElementById("df_"+row+"_"+col);
for(r=row+1;r<=maxRow&&e==null;r++)
e=document.getElementById("df_"+r+"_"+col);
while(e==null){
if(row<maxRow)
row++;
else
row=0;
for(c=col;e==null&&c>=0;c--)
e=document.getElementById("df_"+row+"_"+c);
}
break;
case TAB:
if(_dtl.errorCount){
for(var i=0;i<_dtl.fieldToValidate.length;i++){
v=_dtl.fieldToValidate[i];
if(v.id==active_element.id){
if(v.browserFoundError){
v.browserFoundError=v.error;
var incr=shiftkey?-1:+1;
while(true){
i+=incr;
if(i<0)
i=_dtl.fieldToValidate.length-1;
else if(i>=_dtl.fieldToValidate.length)
i=0;
v=_dtl.fieldToValidate[i];
if(v.error){
if(v.id!=active_element.id)
e=document.getElementById(v.id);
break;
}
}
}
break;
}
}
}
break;
case ENTER:
if(active_element.type=="checkbox"){
active_element.checked=!active_element.checked;
detailSetCbxFlag(active_element);
return false;
}
if(typeof active_element.onblur!="undefined"&&
active_element.onblur!=null&&
(active_element.type=="select-one"||
active_element.type=="text")){
active_element.onblur();
return false;
}
if(shiftkey)
return false;
break;
}
}
if(shiftkey){
switch(keycode){
case HOME:
if(typeof active_element.type=="string"&&
(active_element.type=="text"||
active_element.type=="textarea"))
break;
case PAGE_UP:
detailTabOff(1);
return false;
case END:
if(typeof active_element.type=="string"&&
(active_element.type=="text"||
active_element.type=="textarea"))
break;
case PAGE_DOWN:
detailTabOff(-1);
return false;
}
}
if(e!=null){
detailSetFocus(e);
return false;
}
}
return true;
}
function detailTabOff(direction)
{
if(typeof direction!="number"){
if((!_browser.isIE)||
window.event==null)
direction=1;
else
direction=(window.event.shiftKey?-1:1);
}
var e,startRow,startCol,endRow,endCol;
if(direction==1){
startRow=0;
startCol=0;
endRow=_dtl.rowNum;
endCol=_dtl.maxCol;
}
else{
startRow=_dtl.rowNum-1;
startCol=_dtl.maxCol-1;
endRow=-1;
endCol=-1;
}
for(var row=startRow;row!=endRow;row+=direction){
for(var col=startCol;col!=endCol;col+=direction){
e=document.getElementById("df_"+row+"_"+col);
if(e!=null){
var p=e.parentNode;
while(p!=null&&
(p.tagName!="DIV"||!p.id.match(/nbtab_\d+/)))
p=p.parentNode;
if(e.parentNode.style.display!="none"){
if(p==null||
p.style.display=="block"){
if(typeof ahdframeset.workframe!="object"||
typeof ahdframeset.workframe.SkipInitialFocus=="undefined"||
ahdframeset.workframe.SkipInitialFocus!="1"){
setTimeout("try { document.getElementById('"+e.id+
"').focus(); } catch(e) {}",0);
}
return true;
}
}
}
}
}
var evt=window.event;
/*
var outstr=" info: ";
if(evt.srcElement&&typeof evt.srcElement.name!="undefined"){
outstr="name = ";
outstr+=evt.srcElement.name;
}
if(evt.srcElement&&typeof evt.srcElement.id!="undefined"){
outstr+=" id = ";
outstr+=evt.srcElement.id;
}
*/
if(evt!=null)
{
if(evt.srcElement.name=="end"&&!evt.altKey){
e=document.getElementById("start");
if(typeof e!="undefined"){
e.focus();
}
}
}
return true;
}
function detailSetFocus(e)
{
if(typeof e=="object"&&
e!=null){
for(var p=e.parentNode;p!=null;p=p.parentNode){
if(p.tagName=="DIV"&&
p.id.match(/nbtab_(\d+)/)){
var n=RegExp.$1-0;
show_tab_src(n,false);
break;
}
}
if(typeof ahdframeset.workframe!="object"||
typeof ahdframeset.workframe.SkipInitialFocus=="undefined"||
ahdframeset.workframe.SkipInitialFocus!="1"){
setTimeout("try { document.getElementById('"+e.id+
"').focus(); } catch(e) {}",0);
}
return;
}
if((typeof ahdframeset.workframe!="object"||
typeof ahdframeset.workframe.SkipInitialFocus=="undefined"||
ahdframeset.workframe.SkipInitialFocus!="1")&&
typeof detailFocus1st!="undefined"){
detailFocus1st();
}
}
function detailNoProperties(factory)
{
detailEndRow();
if(typeof factory!="string"||factory.length==0)
factory=_dtl.factory;
var catg;
if(factory!="cr")
catg=msgtext(248);
else if(propIsITIL)
catg=msgtext(300);
else
catg=msgtext(249);
var row_id=get_exp_row_id("");
if(row_id!="")row_id=" ID='"+row_id+"' ";
var out="<TR"+row_id+"><TD COLSPAN=3 ALIGN=CENTER CLASS=labeltext>"+
msgtext(246,catg)+
"</TD></TR>";
docWriteln(out);
_dtl.propertyRow=_dtl.rowNum;
_dtl.propertyTabFirstIndex=_dtl.tabIndex;
_dtl.propertyTabIndex=_dtl.tabIndex;
}
function detailWriteProperty(number,required,label,value,sample,type,options)
{
if(typeof _dtl.propertyRow=="undefined"){
_dtl.propertyRow=_dtl.rowNum;
_dtl.propertyTabFirstIndex=_dtl.tabIndex;
_dtl.propertyTabIndex=_dtl.tabIndex;
}
if(!_dtl.edit){
detailSetRowData(label);
_dtl.lastHdrtext=label;
detailSetReadonlyRowData(value);
}
else{
var checked="";
if(typeof type!="string")
{
type="TEXT";
}else
{
if(type=="CHECKBOX")
{
if(value.toLowerCase()=="yes")
{
checked=" checked='checked'";
}
value="Yes";
}
}
var hdrtext=label;
if(required!="1")
_dtl.colSpan[_dtl.colNum]=" CLASS="+_dtl.hdrclass;
else{
hdrtext+=ahdtop.cfgIndRequired;
_dtl.colSpan[_dtl.colNum]=" CLASS="+_dtl.reqhdrclass;
}
_dtl.rowData[_dtl.colNum++]=hdrtext;
_dtl.tabIndex=_dtl.propertyTabIndex;
var rowData;
if(typeof type=="string"&&type=="SELECT")
{
var option_data=options.split("@,@");
var i;
rowData="<select "+detailNextID()+
" title=\""+hdrtext+"\""+
" name=SET.prop"+number+".value>";
for(i=1;i<option_data.length;i+=2)
{
rowData+="<option value='"+option_data[i-1]+"'";
if(option_data[i-1]==value)
rowData+="selected ";
rowData+=">"+option_data[i]+"</option>";
}
rowData+="</select>";
}else
{
rowData="<input"+detailNextID()+" TYPE='"+type+"'"+
" title=\""+hdrtext+'"'+
checked+" name=SET.prop"+number+".value "+
"size=50 "+
"value=\""+value.replace(rxQuote,"&quot;")+"\">";
}
_dtl.colSpan[_dtl.colNum]="";
detailSetRowData(rowData);
detailSetValidate(msgtext(251,label),required,240,"",true);
_dtl.propertyTabIndex=_dtl.tabIndex;
}
_dtl.colSpan[_dtl.colNum]="";
_dtl.lastHdrtext=msgtext(929,label);
detailSetReadonlyRowData(sample,void(0),_dtl.currID+"_sample");
_dtl.rowData[_dtl.colNum-1]+="</td></tr><tr>";
}
function detailMergeProperties(srcDtl)
{
var tgt=document.getElementById("propertyDiv");
if(tgt==null||
typeof _dtl.propertyRow!="number"||
typeof srcDtl.propertyRow!="number"||
srcDtl.factory!="defer")
return;
var i,j;
var currPropCnt=0;
var propIndex=0;
var currValCnt=_dtl.fieldToValidate.length;
var propErrorFound=false;
for(i=currValCnt-1;i>=0;i--){
var v=_dtl.fieldToValidate[i];
if(v.id.match(/df_(\d+)_\d+/)){
row=RegExp.$1-0;
if(row==_dtl.propertyRow){
currPropCnt++
if(v.error)
propErrorFound=true;
}
else if(row<_dtl.propertyRow){
propIndex=i+1;
break;
}
}
}
if(propErrorFound)
detailValidate();
tgt.innerHTML=srcDtl.getHTMLText();
resetHTMLTextHold();
var newPropCnt=srcDtl.fieldToValidate.length;
if(newPropCnt<currPropCnt){
for(i=propIndex+newPropCnt,j=propIndex+currPropCnt;
j<currValCnt;
i++,j++)
_dtl.fieldToValidate[i]=_dtl.fieldToValidate[j];
_dtl.fieldToValidate.length=currValCnt+newPropCnt-currPropCnt;
}
else if(newPropCnt>currPropCnt){
for(i=currValCnt+newPropCnt-currPropCnt-1,j=currValCnt-1;
i>=propIndex+newPropCnt;
i--,j--)
_dtl.fieldToValidate[i]=_dtl.fieldToValidate[j];
}
for(i=propIndex,j=0;j<newPropCnt;i++,j++)
_dtl.fieldToValidate[i]=srcDtl.fieldToValidate[j];
if(typeof notebook_set_first_property=="function")
notebook_set_first_property(tgt,srcDtl.firstField);
}
function detailSetValidate(hdrtext,is_required,maxsize,emsg,is_prop)
{
if(typeof is_required=="string")
is_required=parseInt(is_required,10);
if(typeof maxsize=="undefined")
maxsize=0;
else if(typeof maxsize=="string")
maxsize=parseInt(maxsize,10);
if(typeof emsg!="string")
emsg="";
if(is_required||maxsize>0||emsg.length>0){
var v=new Object();
v.id=_dtl.currID;
v.hdrtext=hdrtext;
v.maxsize=maxsize;
v.is_required=is_required;
v.serverFoundError=(emsg.length>0);
v.error=false;
v.extError=false;
v.browserFoundError=false;
v.is_property=(typeof is_prop=="boolean"&&is_prop);
_dtl.fieldToValidate[_dtl.fieldToValidate.length]=v;
if(v.serverFoundError)
_dtl.serverErrorCount++;
return v;
}
return void(0);
}
function detailOK2Edit(attr_name,hdrtext)
{
if(_dtl.edit){
if(typeof _dtl.editAttrs[attr_name]=="undefined"){
if(typeof hdrtext!="string"||hdrtext.length==0)
hdrtext=attr_name;
_dtl.editAttrs[attr_name]=hdrtext;
if("nr"==propFactory&&typeof ufam_restricted=="number"&&1==ufam_restricted){
var ahdtop=get_ahdtop();
if(typeof ahdtop=="object"){
if(ahdtop.cfgUfamAttributes.indexOf(" "+attr_name+" ")>=0){
return false;
}
}
}
return true;
}
showAlertMsg(msgtext(771,attr_name,hdrtext,
_dtl.editAttrs[attr_name]));
}
return false;
}
function detailSave(op)
{
if((ahdframe.currentAction==ACTN_LOADPROP||
ahdframe.currentAction==ACTN_CHK_ASSIGNEE)&&
typeof ahdframe.resumeAction=="undefined"){
if(typeof op=="string"&&op.length>0)
ahdframe.resumeAction="detailSave('"+op+"')";
else
ahdframe.resumeAction="detailSave()";
return;
}
if(typeof preSaveTrigger=="function")
if(!preSaveTrigger())
return;
e=document.getElementById("alertmsgText");
if(e!=null)
e.innerHTML="";
var firstBadField=detailValidate();
if(_dtl.errorCount>_dtl.serverErrorCount)
detailSetFocus(firstBadField);
else{
if(_dtl.secondary){
if(propFormName2==propFactory){
var f=document.main_form;
if(typeof f.HTMPL!="object"){
ahdframeset.top_splash.next_persid=argPersistentID;
var htmpl=document.createElement("input");
htmpl.name="HTMPL";
htmpl.value="show_main_detail.htmpl";
f.appendChild(htmpl);
}
}
}
else{
var edit_windows=getEditWindows(argPersistentID);
for(var i=0;i<edit_windows.length;i++){
var w=edit_windows[i];
if(typeof w._dtl=="object"){
firstBadField=w.detailValidate();
if(w._dtl.errorCount>w._dtl.serverErrorCount){
w.detailSetFocus(firstBadField);
return;
}
else
w.pdm_submit("main_form","UPDATE",void(0),true);
}
}
}
if(_dtl.backfillReq){
var f=document.main_form;
if(typeof f.HTMPL!="object"){
ahdframeset.top_splash.next_persid="backfill";
var htmpl=document.createElement("input");
htmpl.type="hidden";
htmpl.name="HTMPL";
htmpl.value="show_main_detail.htmpl";
f.appendChild(htmpl);
var arr=argPersistentID.split(":");
var is_contact=arr[0]=="agt"||
arr[0]=="cnt"||
arr[0]=="cst"||
arr[0]=="agtgrp"||
arr[0]=="grp";
if(is_contact)
{
var is_cnt=document.createElement("input");
is_cnt.type="hidden";
is_cnt.name="KEEP.is_contact";
is_cnt.value="1";
f.appendChild(is_cnt);
}
}
}
try{
if(typeof top.opener.autoRefreshWindows=="object")
top.opener.autoRefreshWindows[parent.window.name]=true;
}
catch(e){}
if(typeof alg_factory=="string"&&
_dtl.factory!=alg_factory){
ahdtop.saveAckMsgNum=920;
ahdtop.saveAckMsgFactoryName=msgtext(936);
ahdtop.saveAckMsgObjectName="";
}
else{
if(_dtl.id==0)
ahdtop.saveAckMsgNum=920;
else
ahdtop.saveAckMsgNum=921;
ahdtop.saveAckMsgFactoryName=factoryDisplayName;
if(argCommonNameAttr=="id"||
argCommonNameAttr=="description"||
argCommonNameAttr=="text"||
argCommonNameAttr=="COMMENT_TEXT"||
argCommonNameAttr=="constraint_majic")
ahdtop.saveAckMsgObjectName="";
else
ahdtop.saveAckMsgObjectName=saveAckMsgObjectName;
}
if(typeof op=="string"&&op.length>0)
pdm_submit('main_form',op,void(0),true);
else
pdm_submit('main_form','UPDATE',void(0),true);
}
}
function detailCancel()
{
if(ahdframe.currentAction==ACTN_LOADPROP&&
typeof ahdframe.resumeAction=="undefined"){
ahdframe.resumeAction="detailCancel()";
return;
}
detailResetSyncFields()
if(_dtl.secondary){
if(propFormName2==propFactory){
ahdframeset.top_splash.next_persid=argPersistentID;
_dtl.next_persid="show_main_detail.htmpl";
}
}
else{
var edit_windows=getEditWindows(argPersistentID);
for(var i=0;i<edit_windows.length;i++){
var w=edit_windows[i];
if(w.ahdframeset==ahdtop){
w.ImgBtnDoCancel();
}
else{
w.ImgBtnDisableButton("btncncl");
w.parent.close();
}
}
}
cancel_update(_dtl.factory,_dtl.id,_dtl.next_persid,void(0),true);
}
function detailEdit()
{
if(!action_in_progress()){
set_action_in_progress(ACTN_LOADFORM);
var url=cfgCgi;
var dlm="?";
var f=document.main_form;
var element_count=f.elements.length;
for(var i=0;i<element_count;i++){
var e=f.elements[i];
url+=dlm+e.name+"="+escape(e.value);
dlm="+";
}
replace_page(url);
}
}
function detailReportValidation(field,has_error,emsg)
{
var badField=null;
for(var i=0;i<_dtl.fieldToValidate.length;i++){
var v=_dtl.fieldToValidate[i];
if(v.id==field.id){
if(has_error){
v.extError=true;
v.extErrorMsg=emsg;
badField=detailValidate();
}
else if(v.extError){
v.extError=false;
badField=detailValidate();
}
return badField;
}
}
if(has_error)
alert(emsg);
return badField;
}
function detailReset()
{
for(var i=0;i<_dtl.fieldToValidate.length;i++){
var v=_dtl.fieldToValidate[i];
v.extError=false;
}
if(_dtl.edit&&_dtl.id!="0")
detailValidate();
try
{
if(typeof _dtl.firstField=="object")
_dtl.firstField.focus();
}
catch(e)
{
}
detailResetSyncFields()
if(propFactory=="USP_PREFERENCES")
{
if(typeof window_onload=="function")
{
window_onload();
}
}
}
function detailValidate(display_alertmsg,popup_alertmsg)
{
if(typeof AlertMsg=="string")AlertMsg="";
if(typeof display_alertmsg=="undefined")
display_alertmsg=0;
_dtl.errorCount=0;
_dtl.serverErrorCount=0;
var e,v,firstBadField;
var alertmsg=document.getElementById("alertmsg");
if(_dtl.fieldToValidate.length>0){
var msg="";
for(var i=0;i<_dtl.fieldToValidate.length;i++){
v=_dtl.fieldToValidate[i];
e=document.getElementById(v.id);
var newmsg="";
v.error=false;
if(e!=null){
e.className="";
var val="";
if(e.type=="select-multiple")
{
for(var j=0;j<e.length;j++)
{
var e_val=e.options[j].value;
if(e_val.length>0)
{
val=e_val;
break;
}
}
}
else if(e.type!="select-one")
val=e.value;
else if(e.selectedIndex!=-1)
val=e.options[e.selectedIndex].value;
if(v.is_required&&
val.length==0)
newmsg=msgtext_with_pfx(250,v.hdrtext);
else if(v.maxsize>0&&
v.maxsize<val.length)
newmsg=msgtext_with_pfx(11,v.hdrtext,val.length,
v.maxsize);
else if(v.serverFoundError){
_dtl.serverErrorCount++;
newmsg="";
}
if(v.extError){
if(newmsg.length>0)
newmsg+="<BR>";
newmsg+=v.hdrtext+": "+v.extErrorMsg;
}
if(newmsg.length>0||v.serverFoundError){
e.className="errorField";
v.error=true;
v.browserFoundError=true;
_dtl.errorCount++;
if(typeof firstBadField!="object")
firstBadField=e;
if(msg.length==0)
msg=newmsg;
else
msg+="<BR>"+newmsg;
}
}
}
}
if(_dtl.errorCount==0&&!display_alertmsg){
if(alertmsg!=null){
alertmsg.style.display="none";
adjScrollDivHeight();
}
}
else
showAlertMsg(msg,popup_alertmsg);
if(typeof reshow_curr_tab!="undefined")
reshow_curr_tab();
return firstBadField;
}
function showAlertMsg(msg,popup_alertmsg)
{
e=document.getElementById("alertmsgText");
if(e!=null&&typeof msg=="string"&&msg.length>0){
if(typeof AlertMsg!="string")
AlertMsg="";
if(AlertMsg.length>0)
AlertMsg+="<BR>"+msg;
else
AlertMsg=msg;
if(e.innerHTML!=AlertMsg){
e.innerHTML=AlertMsg;
if((ahdtop.cstUsingScreenReader||
ahdtop.cfgUserType!="analyst")&&
(typeof popup_alertmsg!="boolean"||popup_alertmsg)){
var popupMsg=AlertMsg.replace(RegExp("<BR>","gi"),"\\n")
.replace(RegExp('"',"g"),'\\"');
window.setTimeout('alert("'+popupMsg+'")',1);
}
}
var alertmsg=document.getElementById("alertmsg");
if(alertmsg!=null&&
alertmsg.style.display!="block"){
alertmsg.style.display="block";
adjScrollDivHeight();
}
}
}
function call_event_handlers(e)
{
if(typeof e.onchange!="undefined"&&
e.onchange!=null)
e.onchange();
if(typeof e.onblur!="undefined"&&
e.onblur!=null)
e.onblur();
}
function detailSyncEditForms(srcElement,isGroup)
{
if(!_dtl.syncing&&
typeof srcElement=="object"&&
typeof srcElement.type=="string"&&
typeof argPersistentID=="string"&&
argPersistentID.length>0){
_dtl.syncing=true;
var saveCurrVal=false;
if(typeof _dtl.fieldsToReset=="undefined"){
_dtl.fieldsToReset=new Object();
saveCurrVal=true;
}
else if(typeof _dtl.fieldsToReset[srcElement.name]=="undefined")
saveCurrVal=true;
var newValue;
if(srcElement.type!="select-one")
newValue=srcElement.value;
else
newValue=srcElement.options[srcElement.selectedIndex].value;
if(srcElement.name.match(/^SET\.([^\.]+)$/)||
srcElement.name.match(/^(.+)_combo_name$/)){
var attr_name=RegExp.$1;
if(typeof top.opener=="object"&&
top.opener!=null&&
typeof top.opener._dtl=="object"){
var attr_info=top.opener._dtl.lookupAttrs[attr_name];
if(typeof attr_info=="object"){
attr_info["newValueWindow"]=window;
if(srcElement.type!="select-one")
attr_info["newValue"]=newValue;
else
attr_info["newValue"]=
srcElement.options[srcElement.selectedIndex].text;
}
}
}
var edit_windows=getEditWindows(argPersistentID);
for(var i=0;i<edit_windows.length;i++){
var w=edit_windows[i];
var f=w.document.main_form;
if(typeof f=="object"){
var tgtElement=f.elements[srcElement.name];
if(typeof tgtElement=="object"&&tgtElement!=null){
if(tgtElement.type!="select-one"){
if(saveCurrVal){
_dtl.fieldsToReset[srcElement.name]=tgtElement.value;
saveCurrVal=false;
}
if(newValue==tgtElement.value)
break;
tgtElement.value=newValue;
}
else{
if(saveCurrVal){
_dtl.fieldsToReset[srcElement.name]=
tgtElement.options[tgtElement.selectedIndex].value;
saveCurrVal=false;
}
for(var k=tgtElement.length-1;k>=0;k--)
if(tgtElement.options[k].value==newValue)
break;
if(k<0||k==tgtElement.selectedIndex)
break;
tgtElement.selectedIndex=k;
}
if(typeof isGroup=="boolean"&&isGroup&&
typeof w._dtl=="object"&&
typeof w._dtl.skip_agt_check=="boolean")
w._dtl.skip_agt_check=true;
call_event_handlers(tgtElement);
break;
}
}
}
_dtl.syncing=false;
}
}
function detailResetSyncFields()
{
if(typeof _dtl.fieldsToReset=="object"){
for(var name in _dtl.fieldsToReset){
var v=_dtl.fieldsToReset[name];
var e=document.main_form.elements[name];
if(typeof e=="object"&&e!=null){
if(e.type!="select-one")
e.value=v;
else for(var i=e.options.length-1;i>=0;i--){
if(e.options[i].value==v){
e.selectedIndex=i;
break;
}
}
detailSyncEditForms(e);
}
}
_dtl.fieldsToReset=void(0);
}
}
function detailHideElements(id,count,new_first_id)
{
count=2*count;
var e=document.getElementById(id);
var hiddenElements=new Array();
if(e!=null){
var td=e.parentNode;
var tr=td.parentNode;
var rows=tr.parentNode.childNodes;
var found=false;
for(var i=0;i<rows.length;i++){
if(tr==rows[i]){
for(var col=0;col<tr.childNodes.length;col++){
if(tr.childNodes[col]==td){
found=true;
break;
}
}
break;
}
}
if(found){
for(;i>=0;i--){
if(typeof rows[i].childNodes=="object"&&
rows[i].childNodes.length>col){
e=rows[i].childNodes[col];
hiddenElements[hiddenElements.length]=e;
e.style.display="none";
if(typeof _dtl.firstField!="object"||
_dtl.firstField==null||
typeof _dtl.firstField.parentNode!="object"||
e==_dtl.firstField.parentNode)
if(typeof new_first_id=="string")
_dtl.firstField=document.getElementById(new_first_id);
count--;
if(count<=0)
break;
}
}
}
}
adjScrollDivHeight();
return hiddenElements;
}
function backfill_cnt_event(form_name,base_name,lname,fname,mname,
cntID,caller_type)
{
detailCntBackfill(form_name,base_name,lname,fname,mname,
cntID,caller_type);
}
function detailCntBackfill(form_name,base_name,lname,fname,mname,
cntID,caller_type)
{
var f=void(0);
var r=form_name.match(/main_form([0-9]*)/);
if(r!=null){
if(r[1].length==0)
f=_dtl.form[0];
else
f=_dtl.form[r[1]-0];
}
if(typeof f=="object"&&f!=null){
var combo_name=f.elements[base_name+"_combo_name"];
if(typeof combo_name!="object"||combo_name==null)
combo_name=f.elements[base_name];
if(typeof combo_name=="object"||combo_name!=null){
if(_dtl.errorCount){
for(var i=0;i<_dtl.fieldToValidate.length;i++){
var v=_dtl.fieldToValidate[i];
if(v.id==combo_name.id){
if(v.error&&v.is_required)
detailValidate();
}
}
}
if(typeof caller_type!="string"||caller_type!="autofill")
combo_name.focus();
if(typeof top.opener=="object"&&
top.opener!=null&&
typeof top.opener._dtl=="object"){
var attr_info=top.opener._dtl.lookupAttrs[base_name];
if(typeof attr_info=="object")
attr_info["newValue"]=combo_name.value;
}
}
}
}
function backfill_event(form,field_name,value,
persid,rel_attr_val,caller_type)
{
var e=form.elements[field_name];
if(caller_type!="autofill"){
_dtl.lastKeycode=0;
e.focus();
}
if(field_name=="SET.category")
change_category_func(propFactory);
else if(field_name=="KEY.category"){
e=form.elements["SET.category"];
if(typeof e=="object"){
if(e.type=="text"||
e.type=="hidden")
e.value=rel_attr_val;
else if(e.type=="select-one"){
for(var i=0;i<e.length;i++){
var o=e.options[i];
if(o.value==value){
o.selected=1;
break;
}
}
}
}
change_category_func(propFactory);
}
if(field_name=="KEY.PRIMARY_INDEX")
{
var iStartPos;
while(true)
{
iStartPos=value.indexOf(">");
if(iStartPos==-1)
{
break;
}
else
{
value=value.substring(iStartPos+1,value.length);
}
}
form.elements["KEY.PRIMARY_INDEX"].value=value;
form.elements["SET.PRIMARY_INDEX"].value=rel_attr_val;
}
if(field_name.match(/^.*\.(\w+)$/)&&
typeof top.opener=="object"&&
top.opener!=null&&
typeof top.opener._dtl=="object"){
var attr_info=top.opener._dtl.lookupAttrs[RegExp.$1];
if(typeof attr_info=="object")
attr_info["newValue"]=value;
}
}
function detailSwitchToEsc(typefld)
{
if(typeof typefld=="object"&&typefld.value=="TR"){
typefld.value="ESC";
var h1=document.getElementsByTagName("h1");
for(var i=0;i<h1.length;i++)
h1[i].innerHTML=escalate_title;
if(typeof prioElements=="object"){
for(i=0;i<prioElements.length;i++)
prioElements[i].style.display="";
_dtl.firstField=document.getElementById(prio_id);
}
}
}
function detailAgtCheck(f,base_name,cntID,prop_ref)
{
if(typeof prop_ref=="undefined")
prop_ref="";
if(base_name=="group"&&cntID!=""&&
typeof f=="object"&&f!=null&&
typeof f.elements["SET.assignee"]=="object")
{
var agt_id=f.elements["SET.assignee"].value;
var agt_name=f.elements["KEY.assignee"].value;
if(agt_id!=""||agt_name!=""){
set_action_in_progress(ACTN_CHK_ASSIGNEE);
upd_workframe("AGT_IN_GROUP","agt_id="+agt_id,
"agt_name="+agt_name,"group_id="+cntID,
"func=parent.ahdframe.clear_agt_callback",
"prop_ref="+prop_ref);
}
}
}
function detailXferEscBackfill(base_name,lname,fname,mname,
cntID,caller_type)
{
var f=_dtl.form[0];
if(typeof caller_type=="string"&&caller_type=="backfill"){
var combo_name=f.elements[base_name+"_combo_name"];
if(typeof combo_name=="object"||combo_name!=null)
detailSyncEditForms(e,(base_name=="group"));
}
detailAgtCheck(f,base_name,cntID);
if(caller_type=="autofill"){
var e=document.main_form.elements[base_name+"_combo_name"];
if(typeof e=="object"&&e!=null)
detailSyncEditForms(e);
}
}
function clear_agt_callback(bClear)
{
if(bClear&&typeof document.main_form!="undefined")
{
var f=document.main_form;
var key_fld=f.elements["KEY.assignee"];
var set_fld=f.elements["SET.assignee"];
var combo_fld=f.elements["assignee_combo_name"];
if(typeof key_fld=="object")
key_fld.value="";
if(typeof set_fld=="object")
set_fld.value="";
if(typeof combo_fld=="object")
{
combo_fld.value="";
call_event_handlers(combo_fld);
}
}
set_action_in_progress(ACTN_COMPLETE);
}
function detailExtUpdate(in_args){
if(!_dtl.edit){
if(typeof refreshForm!="undefined"){
refreshForm();
}
return;
}
if(typeof in_args=="undefined")return;
var key,val;
for(key in in_args){
if(0==key.indexOf("KEY.")||0==key.indexOf("SET.")){
var overWrite=0;
var attr=key.slice(4);
var owKey="OW."+attr;
var owVal=in_args[owKey];
if("string"==typeof owVal&&"1"==owVal){
overWrite="1";
}
val=in_args[key];
if("KEY.category"==key){
setEditElements("SET.category","",overWrite);
}
setEditElements(key,val,overWrite);
}
}
}
function setEditElements(elementName,val,overWrite)
{
var attrPrefix="";
var plainAttrName="";
var input_el=null;
if(!_dtl.edit)return 0;
if(typeof document.main_form=="undefined")
return-1;
if(0==elementName.indexOf("KEY.")||0==elementName.indexOf("SET.")){
attrPrefix=elementName.slice(0,3);
plainAttrName=elementName.slice(4);
}else{
return-1;
}
input_el=document.main_form.elements[elementName];
if(typeof input_el!="object"||input_el==null){
if("KEY"==attrPrefix){
input_el=document.main_form.elements["SET."+plainAttrName];
if(typeof input_el!="object"||input_el==null||input_el.type!="select-one")
{
return-1;
}
}else{
return-1;
}
}
if(1!=overWrite){
var oldVal="";
if("select-one"==input_el.type){
oldVal=input_el.options[input_el.selectedIndex].value;
}else{
oldVal=input_el.value;
}
if(typeof oldVal=="string"&&oldVal.length>0){
return 0;
}
}
if(input_el.type=="select-one"){
for(var i=0;i<input_el.options.length;i++){
var candidate;
if("KEY"==attrPrefix){
candidate=input_el.options[i].text;
}else{
candidate=input_el.options[i].value;
}
if(candidate==val){
input_el.selectedIndex=i;
break;
}
}
}else{
val=val.replace(/'/g,"\'");
input_el.value=val;
}
if(typeof input_el.onblur=="function"){
input_el.onblur();
}
if(typeof input_el.onchange=="function"){
input_el.onchange();
}
return 1;
}
function detailCopyEditForm(exceptions)
{
var parent_win=ahdframeset.opener;
var from_f=parent_win.document.main_form;
var  to_f=window.document.main_form;
if(typeof from_f=="object"&&
typeof to_f=="object")
{
var eles=from_f.elements;
var val;
for(var i=0;i<eles.length;i++)
{
var from_e=eles[i];
if(typeof from_e=="object"&&
from_e!=null&&
typeof from_e.name=="string"&&
from_e.name!=""&&
from_e.name!="FID"&&
from_e.name!="SID")
{
var j;
for(j=0;j<exceptions.length;j++)
{
if(from_e.name==exceptions[j])
break;
}
if(j<exceptions.length)continue;
var to_e=to_f.elements[from_e.name];
if(typeof to_e!="object"||to_e==null)
continue;
if(from_e.type=="select-one")
{
to_e.selectedIndex=from_e.selectedIndex;
}
else
if(from_e.type=="radio")
{
from_e=eles[from_e.name];
for(var k=0;k<from_e.length;k++)
{
to_e[k].checked=from_e[k].checked;
}
i+=(from_e.length-1);
}
else
{
to_e.value=from_e.value;
}
}
}
}
}
function detailDropdownEdit(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results,link,
cbwidth,extraURL,dflt,selections)
{
var i,field_name;
common_name_value=unescape(common_name_value);
selections=unescape(selections);
rel_attr=unescape(rel_attr);
if(typeof selections=="string"&&selections.length>0){
selections=selections.split("@,@");
for(i=18;i<arguments.length;i++)
selections[selections.length]=unescape(arguments[i]);
}
if(selections.length<=1){
detailLookupEdit(hdrtext,attr_name,obj_type,colspan,size,
is_required,persid,rel_attr,
autofill,common_name_attr,common_name_value,
search_status,search_results,"yes",extraURL);
return;
}
detailRowHdr(hdrtext,colspan,is_required);
if(attr_name.match(/^KEEP\./))
field_name=attr_name;
else
field_name="SET."+attr_name;
var item='<select'+detailNextID(colspan);
if(typeof _dtl.fieldTitle!="string"||
_dtl.fieldTitle.length==0){
var titletext=hdrtext;
if(bool(is_required))
titletext+=ahdtop.cfgIndRequired;
item+=" title=\""+titletext+"\"";
}
else{
item+=" title=\""+_dtl.fieldTitle+"\"";
_dtl.fieldTitle=void(0);
}
if(cbwidth==0){
if(!_dtl.edit)
item+=" style='font-size:1.0em;'";
}
else if(_dtl.edit)
item+=" style='width:'"+cbwidth+"px;'";
else
item+=" style='font-size:0em; width:'"+cbwidth+"px;'";
item+=' name="'+field_name+'">\n';
var options="";
if(!bool(is_required)||
(rel_attr.length==0&&dflt.length==0))
options+='<OPTION VALUE="">&lt;'+msgtext(1)+'&gt;\n';
var curr_found=false;
for(i=1;i<selections.length;i+=2){
var sym=selections[i-1];
var code=selections[i];
if(code==rel_attr||
(sym==dflt&&
rel_attr.length==0&&
dflt.length>0)){
curr_found=true;
options+='<OPTION SELECTED VALUE="'+code+'">'+sym+'\n';
}
else
options+='<OPTION VALUE="'+code+'">'+sym+'\n';
}
if(!curr_found&&rel_attr.length>0){
if(common_name_value.length==0)
common_name_value="?";
options+='<OPTION SELECTED VALUE="'+rel_attr+'">'+
common_name_value+'\n';
}
item+=options+'</SELECT>\n';
detailSetRowData(item);
detailSetValidate(hdrtext,is_required);
}
var exp_sec_arr=new Array();
function exp_sec_node(form_name,init_state,exp_rows)
{
this.form_name=form_name;
this.down_id="exp_sec_down_id"+exp_sec_num;
this.up_id="exp_sec_up_id"+exp_sec_num;
this.state=init_state;
this.exp_sec_num=exp_sec_num;
this.exp_rows_obj=createExpandableRow(exp_rows);
this.adj_height=0;
exp_sec_arr[exp_sec_num]=this;
exp_sec_num++;
}
exp_sec_node.on_load_func=function()
{
var len=exp_sec_arr.length;
var cur;
for(var i=0;i<len;i++)
{
cur=exp_sec_arr[i];
if(cur.state=="up")
cur.show_rows(true);
else
if(cur.state=="down")
cur.hide_rows(true);
}
}
exp_sec_node.prototype.hide_rows=function(bLoad)
{
this.adj_height=0;
var len=this.exp_rows_obj.length;
for(var i=(len-1);i>=0;i--)
{
this.adj_height+=this.exp_rows_obj[i].hide_row();
}
if(typeof bLoad!="boolean"||
!bLoad)
reshow_curr_tab(this.adj_height);
}
exp_sec_node.prototype.show_rows=function(bLoad)
{
this.adj_height=0;
var len=this.exp_rows_obj.length;
for(var i=0;i<len;i++)
{
this.adj_height-=this.exp_rows_obj[i].show_row();
}
if(typeof bLoad!="boolean"||
!bLoad)
reshow_curr_tab(this.adj_height);
}
function exp_sec_clicked(idx)
{
if(idx>=exp_sec_arr.length||
typeof exp_sec_arr[idx]=="undefined")
{
alertmsg(646);
return;
}
var obj=exp_sec_arr[idx];
var down_obj=document.getElementById(obj.down_id);
var up_obj=document.getElementById(obj.up_id);
if(obj.state=="up")
{
down_obj.style.display="block";
up_obj.style.display="none";
obj.state="down";
obj.hide_rows();
}
else
if(obj.state=="down")
{
down_obj.style.display="none";
up_obj.style.display="block";
obj.state="up";
obj.show_rows();
}
ahdtop.set_expand_sec_state(obj.form_name,obj.exp_sec_num,obj.state);
}
function detailExpandSec(form_name,label,exp_rows,colspan)
{
var init_state=ahdtop.get_expand_sec_state(form_name,exp_sec_num);
var html="";
var node=new exp_sec_node(form_name,init_state,exp_rows);
html+='<TR><TD COLSPAN='+colspan+'><TABLE width="100%" border="0" cellspacing="0" cellpadding="0"><TR>';
html+='<TD width="4" height="22" class="page_section_header_left"><IMG SRC="'+get_IMG_path("IMG_spacer")+
'" width="4" height="22" alt=""></TD>';
html+='<TD class="page_section_header_center"><SPAN  id="'+node.down_id+
'" class="page_section_header_text_hs" style="display:';
if(init_state=="down")
html+='block" ';
else
html+='none" ';
html+='onClick="exp_sec_clicked('+node.exp_sec_num+')">'+
'<IMG SRC="'+get_IMG_path("IMG_arrow_down")+'"  width="14" height="14" '+
'border="0" class="hide_show_button" alt="'+msgtext(848)+'">'+label+'</SPAN>'+
'<SPAN class="page_section_header_text_hs" id="'+node.up_id+'" style="display:';
if(init_state=="up")
html+='block" ';
else
html+='none" ';
html+='onClick="exp_sec_clicked('+node.exp_sec_num+')">'+
'<IMG SRC="'+get_IMG_path("IMG_arrow_up")+'" width="14" height="14" '+
'border="0" class="hide_show_button" alt="'+msgtext(849)+'">'+label+'</SPAN>'+
'</TD><TD width="4" height="22" class="page_section_header_right">'+
'<IMG SRC="'+get_IMG_path("IMG_spacer")+'" width="4" height="22" alt=""></TD></TR></TABLE></TD></TR>';
_dtl.expSecHtml=html;
}
function add_response(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";
display_new_page(url,ahdframeset.workframe);
set_action_in_progress(ACTN_AUTOFILL);
}
}
function add_response_callback(msg){
set_action_in_progress(0);
document.main_form.elements[resp_field].value+=unescape(msg);
}
function gblsd_ck_prefix(value)
{
var colon=/\:$/;
var result=value.match(colon);
if(result==null)alertmsg(651,value);
}
function gblsd_upcase(field)
{
field.value=field.value.toUpperCase();
}
function gblsd_set_global_name(v)
{
var f=document.main_form.elements["SET.global_name"];
if(f.value.length==0)f.value=v.toUpperCase();
}
function gblsd_ck_master(cb,g)
{
var f=document.main_form.elements["SET.is_master"];
if(cb.checked==true){
if(g!=""){
if(!confirm(msgtext(790,g))){
f.value=0;
cb.checked=false;
return;
}
}
f.value=1;
}else{
f.value=0;
}
return;
}
function detailValueOf(field_name)
{
var  form=window.document.main_form;
if(typeof form=="undefined")
return"";
var obj=form.elements[field_name];
if(typeof obj=="undefined")
return"";
if(obj.type=="select-one")
return obj.options[obj.selectedIndex].value;
else
return obj.value;
}
function loadFilterArray()
{
var attrs=propSearchConfig.split(",");
for(var i=0;i<attrs.length;i++)
{
if(attrs[i].substr(attrs[i].length-1,1)=="*"){
attrs[i]=attrs[i].substr(0,attrs[i].length-1);
}
var e=document.forms["main_form"].elements;
loadFilterArr[attrs[i]]="";
if(typeof e["SET."+attrs[i]]!="undefined"&&e["SET."+attrs[i]].value.length>0)
{
loadFilterArr[attrs[i]]=e["SET."+attrs[i]].value;
}
if(typeof e["KEY."+attrs[i]]!="undefined"&&e["KEY."+attrs[i]].value.length>0)
{
loadFilterArr[attrs[i]]=e["KEY."+attrs[i]].value;
}
if(attrs[i]=="priority"||attrs[i]=="severity"||attrs[i]=="impact"||attrs[i]=="urgency")
{
continue;
}else{
for(var j=0;j<e.length;j++)
{
if(typeof e[j].type=="string"&&
e[j].type=="select-one"&&
e[j].name.substr(0,4)=="SET."&&
e[j].value.length>0)
{
var attrlen=attrs[i].length;
if(e[j].name.substr(0,attrlen+4+1)=="SET."+attrs[i])
{
for(var k=0;k<e[j].length;k++)
{
if(e[j].options[k].selected==true)
{
loadFilterArr[attrs[i]]=e[j].options[k].text;
}
}
}
}
}
}
}
}
function srchknow(field)
{
if(typeof document.main_form.elements[field]=="undefined"||
typeof document.main_form.elements[field].value=="undefined"||
document.main_form.elements[field].value=="")
{
alertmsg(761);
return;
}
if(action_in_progress())
{
return;
}else{
set_action_in_progress(ACTN_SEARCH);
}
var idx=find_tab_by_src("SD_LAUNCHED");
if(idx!=null)
{
var tab_name=tab_name_by_id(idx);
var fac=argPersistentID.split(":");
if(fac[0]!='cr'&&fac[0]!='iss')
{
alert(msgtext(691,fac[0]));
return;
}
if(typeof _dtl=="object")
_dtl.doSrchKnow=1;
if((typeof cur_selected!="undefined")&&
(cur_selected==idx))
{
var tab_obj=window.frames[tab_name];
if((typeof tab_obj=="object")&&
(typeof tab_obj.loadFilter!="undefined"))
{
tab_obj.loadFilter();
return;
}
}
show_tab_src(idx);
}else{
alertmsg(692);
}
}
function getDetailElementProperty(elementId,propKey)
{
var propValue=this.propNotFound;
if(_dtl.fieldToValidate.length>0){
for(var i=0;i<_dtl.fieldToValidate.length;i++){
if(_dtl.fieldToValidate[i].id==elementId){
var targetElement=_dtl.fieldToValidate[i];
if(typeof targetElement[propKey]!="undefined")
propValue=targetElement[propKey];
break;
}
}
}
return propValue;
}
function detailValidateFileName(fld_obj)
{
if(typeof fld_obj=="undefined")
return true;
var val=fld_obj.value;
if(val.match(/[\\\/:\*\?"<>'\|^&,;+]/)!=null)
{
detailReportValidation(fld_obj,1,msgtext(765));
return false;
}
else
{
val=ltrim(val);
val=rtrim(val);
fld_obj.value=val;
detailReportValidation(fld_obj,0);
return true;
}
}
function ltrim(argvalue)
{
while(1)
{
if(argvalue.substring(0,1)!=" ")
break;
argvalue=argvalue.substring(1,argvalue.length);
}
return argvalue;
}
function rtrim(argvalue)
{
while(1)
{
if(argvalue.substring(argvalue.length-1,argvalue.length)!=" ")
break;
argvalue=argvalue.substring(0,argvalue.length-1);
}
return argvalue;
}