Eng_Designer Posted March 4, 2016 Share Posted March 4, 2016 (edited) 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 March 4, 2016 by Infopro Please Attach Images to Your Posts. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 5, 2016 Share Posted March 5, 2016 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 0 Quote Link to comment Share on other sites More sharing options...
Eng_Designer Posted March 5, 2016 Author Share Posted March 5, 2016 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 5, 2016 Share Posted March 5, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
Eng_Designer Posted March 5, 2016 Author Share Posted March 5, 2016 It's working ! Thank you 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 ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 6, 2016 Share Posted March 6, 2016 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. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.