Jump to content

Adding In Progress ticket to Admin's Header


Recommended Posts

Hello :)

 

I would like to make some changes on admin blend template

 

I want to add another section behind "Ticket(s) Awaiting Reply " in top header for (in progress tickets) or assigned tickets

 

After i checked your header.tpl and english.php language file, i couldn't find "stats" for in progress or assigned tickets

 

So my question is: How can i add another stats for " in progress" support tickets counter ?

 

Because you know the counter is already exist in sidebar and all i need to do is the value for this counter to add it behind "Tickets Awaiting Reply" in top header

 

Please check screenshot

i.imgur.com/iPsuLEh.png

Edited by Infopro
Please Attach Images to Your Posts.
Link to comment
Share on other sites

the "in progress" ticket value isn't available to header.tpl, so to do what you want to do, you'd need to either use an action hook to create this variable and pass it to header.tpl or, as a temporary measure, you could use {php} tags and query the database for the value.

 

http://docs.whmcs.com/Hooks:AdminAreaPage

 

Unfortunately i'm professional at developing, if it easy can you give a direct tutorial or direct code ? and we can really share this idea for members in WHMCS it's realy nice and simple

Link to comment
Share on other sites

you can modify header.tpl with the following code...

 

        <div class="stats">
           <a href="orders.php?status=Pending">
               <span class="stat">{$sidebarstats.orders.pending}</span>
               {$_ADMINLANG.stats.pendingorders}
           </a> |
           <a href="invoices.php?status=Overdue">
               <span class="stat">{$sidebarstats.invoices.overdue}</span>
               {$_ADMINLANG.stats.overdueinvoices}
           </a> |
           <a href="supporttickets.php">
               <span class="stat">{$sidebarstats.tickets.awaitingreply}</span>
               {$_ADMINLANG.stats.ticketsawaitingreply}
           </a> |
           <a href="supporttickets.php?view=In Progress">
               <span class="stat">{$ticketsinprogress}</span>
               Ticket(s) In Progress
           </a>
       </div>

you can use an admin language override if your admin area uses multiple languages.

 

http://docs.whmcs.com/Language_Overrides

 

and then create a new file in /includes/hooks and call it 'ticketsinprogress.php' and add the following code to it...

 

<?php

use Illuminate\Database\Capsule\Manager as Capsule;

function hook_ticket_status_inprogress($vars) 
{
   $inprogress = Capsule::table('tbltickets')
               ->where('status', 'In Progress')
               ->count();

   $return = array("ticketsinprogress" => $inprogress);
   return $return;
}
add_hook("AdminAreaPage", 1, "hook_ticket_status_inprogress");
?>

that will add a new Smarty variable in the admin area, $ticketsinprogress - which should contain the number of tickets in progress.

Link to comment
Share on other sites

I wonder if i can create specific status for in progress tickets but for every team member working on his own in progress tickets.

Do you have any idea for that ?

to do that that would be more complicated as you'd probably need to query multiple (3 or 4?) database tables to get the info that you want.

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