In Service Catalog the request name copied over need to be made readonly.
search cancel

In Service Catalog the request name copied over need to be made readonly.

book

Article ID: 279516

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager

Issue/Introduction

While copying the Request the name is displayed in the new pop-up form:

The users are able to modify the name since it can be edited.

Environment

USVCT 17.4

Resolution

We need to make the following changes in the XSL files to meet this requirement. Please follow the below steps:

  1. Copy the "requestprofile.xsl"  and "request_edit.xsl" files from %usm_home%\view\webapps\usm\explorer\request and move it to %usm_home%\filestore\custom\explorer\request folder.
  2. Update the below changes in "requestprofile.xsl" file

Before Changes

    var name = null;
   do {
     if(singleSelectionCount>0) {
       alert(promptMsg);
     } else {
       name = prompt(promptMsg, $($("#generaltable td[name='request_name']")[0]).text().trim());
       if (name != null) {
         name = name.trim();
         if (name == "") {
           alert("<xsl:value-of select="$xslcontent/clone_error_empty_name" />");
           name = null;  
         } else if (name.length > 128) {
           alert("<xsl:value-of select="$xslcontent/clone_error_long_name" />");
           name = null;
         }
       }
     }
   } while (name != null && name.length == 0);
   
   //User pressed cancel
   if (name == null) return;
    var url = "<xsl:value-of select="concat(icservletname,'?Node=icguinode.',icguinode/icguinodeinfo[21],'&Args=',COLLECTION/usm_request/request_id/LITERAL)" />"

After Changes

    var name = null;
   var confirmation=false;
     if(singleSelectionCount>0) {
       alert(promptMsg);
     } else {
       name = $($("#generaltable td[name='request_name']")[0]).text().trim();
       confirmation = confirm("Do you want to copy : "+ name);
       
     }
   
   //User pressed cancel
   if (confirmation == false) return;
    var url = "<xsl:value-of select="concat(icservletname,'?Node=icguinode.',icguinode/icguinodeinfo[21],'&Args=',COLLECTION/usm_request/request_id/LITERAL)" />"

 

Similarly, Update the below changes in the "request_edit.xsl" file. 

Note: "request-edit.xsl" file changes are only needed incase of service point integration with catalog.

Before Change:

        var name = null;
       do {
             if(singleSelectionCount>0) {
               alert(promptMsg);
             } else {
                 var reqNameElement = $(el).find("#request_details input[id='req_name']")[0];
                 if(reqNameElement != undefined){
                     name = prompt(promptMsg, reqNameElement.value);
                 }
                 else{
                     name = prompt(promptMsg, "");
                 }
               if (name != null) {
                     name = name.trim();
                     if (name == "") {
                       alert("<xsl:value-of select="$xslcontent/clone_error_empty_name" />");
                       name = null;  
                     } else if (name.length > 128) {
                       alert("<xsl:value-of select="$xslcontent/clone_error_long_name" />");
                       name = null;
                     }
               }
             }
       } while (name != null && name.length == 0);
   
       //User pressed cancel
       if (name == null) 
           return "";
       else
           return encodeURIComponent(name);
      }

     var expand = function(containerId, id)

 

After Changes:

        var reqNameElement = null;
        var confirmation=false;
           if(singleSelectionCount>0) {
               alert(promptMsg);
             } else {
                 reqNameElement = $(el).find("#request_details input[id='req_name']")[0];
                 confirmation = confirm("Do you want to copy : "+ reqNameElement.value);
                               }
        
   
       //User pressed cancel
       if (confirmation == false) 
           return "";
       else
           return encodeURIComponent(reqNameElement.value);
      }

     var expand = function(containerId, id)

3. Delete files from the translates folder in  %usm_home%\view\Trasnlates

4. Restart CA Service Catalog services