CA Service Management

  • 1.  adding a icon to the ticket in list page

    Posted Jun 30, 2017 02:09 PM

    Hello community,

     

    how to add a ICON or Image to the ticket row in the list page. I would like to differentiate a special ticket to normal ticket in the list page. 

    This is something similar to how VIP tickets gets highlighted in list page , but customer wants to highlight the tickets with different ICON based on Configuration and Organisation.

     

    how to achieve this, any suggestion.

     

    Thanks,

    Venkat



  • 2.  Re: adding a icon to the ticket in list page
    Best Answer

    Posted Jun 30, 2017 05:01 PM

    You could try this:

     

    FORM= list_in.HTMPL

     

    Search next variables

    var ref_num_style;
    var add_icon_to_cust;

    add later next variable
    var zadd_icon_to_cust;

     

    //Start custom

    <PDM_MACRO name=lsWrite text="pdm_if '@{list.customer.organization.name:0}' == '<<ORGANIZATION NAME>>' && '@{list.affected_resource.name:0}' == '<<CI NAME>>'">
    <PDM_MACRO name=lsWrite text="zadd_icon_to_cust = 1;">
    <PDM_MACRO name=lsWrite text="pdm_else">
    <PDM_MACRO name=lsWrite text="zadd_icon_to_cust = 0;">
    <PDM_MACRO name=lsWrite text="/pdm_if">

    //End custom


    <PDM_MACRO name=lsCol hdr="Incidente núm." attr=ref_num exportfmt="ShowLink" fmtfunc=writeIcon link=yes style=ref_num_style>

     

    Modify writeIcon function like:

     

    function writeIcon(name)
    {
    var htmlStr = name;
    if (add_icon_to_cust)
    {
    var specialHandlingAlertIcon = "$SpecialHandlingIcon";
    if(specialHandlingAlertIcon == "") // did they provide a icon in the config file?
    {
    specialHandlingAlertIcon = "$CAisd/img/announcements_16.png";
    }
    htmlStr = htmlStr + "&nbsp <img src='" + specialHandlingAlertIcon
    +"' border=0 height=14 width=14 alt='Alerta de tratamiento especial' title='Alerta de tratamiento especial'/>";
    }
    //Star custom
    if (zadd_icon_to_cust == 1){
    var zicon;
    zicon = "$CAisd/img/<<IMAGE NAME>>.png";
    htmlStr = htmlStr + "&nbsp <img src='" + zicon
    +"' border=0 height=<<HEIGHT OF YOUR IMAGE>> width=<<WIDTH OF YOUR IMAGE>> alt='Alert special handling' title='Special handling'/>";
    }

    //End custom
    rs.data(htmlStr);
    }

     

     

    Regards,

    Yonatan Sosa