Jump to content

Group name beside client name ticket area


Recommended Posts

you could create an action hook and place it in the includes/hooks folder and give it a name, e.g 'adminviewticket.php'

 

<?php

use Illuminate\Database\Capsule\Manager as Capsule;

function admin_ticket_clientgroup_hook($vars) {

   if ($vars['pagetemplate']=="viewticket") {
           $clientgroup = Capsule::table('tblclients')
               ->join('tblclientgroups', 'tblclients.groupid', '=', 'tblclientgroups.id')
               ->where('tblclients.id', $vars['userid'])
               ->get();
   }

   return array("clientgroup" => $clientgroup[0]->groupname);
}
add_hook("AdminAreaPage", 1, "admin_ticket_clientgroup_hook");
?>

that will create a Smarty variable, $clientgroup, that you can use in the 'viewticket.tpl' template - you could change...

 

<div class="title">
{if $reply.contactid}
{$_ADMINLANG.fields.contact}
{elseif $reply.userid}
{$_ADMINLANG.fields.client}
{else}
<a href="mailto:{$reply.clientemail}">{$reply.clientemail}</a>
{/if}
</div>

to...

 

<div class="title">
{if $clientgroup}{$_ADMINLANG.fields.clientgroup}: {$clientgroup}
{elseif $reply.contactid}
{$_ADMINLANG.fields.contact}
{elseif $reply.userid}
{$_ADMINLANG.fields.client}
{else}
<a href="mailto:{$reply.clientemail}">{$reply.clientemail}</a>
{/if}
</div>

that will show the client group below the client name - if they are not in a client group, it will work as previously and display 'Contact' or 'Client' (or your language equivalent).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated