Jump to content

Adding to header.tpl to display specific status total


garybarr

Recommended Posts

We have projects that we do and it gets moved to a "Complete - Awaiting Pickup" status.  We still want to track these until their item is picked up, but it drives us crazy to have them still showing in our active tickets count/view.  So I took some information I found in another support community topic and modified it to work....  And it does show the correct count of tickets in that specific status, but if you click on the link, it shows an empty page.  Here is what I did:

 

/include/hooks/adminticketstatus.php:

Quote

 

<?php

use Illuminate\Database\Capsule\Manager as Capsule;

function hook_ticket_status_active($vars) 
{
   $ticketscomplete = Capsule::table('tbltickets')
               ->whereIn('status', array('Complete - Awaiting Pickup'))
               ->count();

   return array("ticketscomplete" => $ticketscomplete);
}
add_hook("AdminAreaPage", 1, "hook_ticket_status_active");
?>

 

Then in the admin\templates\blend\header.tpl I  added the part  in the header to show '$ticketscomplete'

 

Quote

 <div class="header">
        <div class="logo">
            <a href="index.php"><img src="templates/{$template}/images/logo.gif" border="0" /></a>
        </div>
        <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?view=active">
                <span class="stat">{$sidebarstats.tickets.active}</span> 
                Active Tickets
            </a> | 
            <a href="supporttickets.php">
                <span class="stat">{$sidebarstats.tickets.awaitingreply}</span>
                {$_ADMINLANG.stats.ticketsawaitingreply}
            </a> |
            <a href="supporttickets.php?view=ticketscomplete">
               <span class="stat">{$ticketscomplete}</span>
               Complete/Awaiting Pickup
           </a>
        </div>
    </div>

 

So it does display the numbers properly:

12 Pending Orders | 4 Overdue Invoices | 27 Active Tickets | 0 Ticket(s) Awaiting Reply | 5 Complete/Awaiting Pickup

However, when you click on Complete/Awaiting Pickup, it takes me to the supporttickets.php page, but it shows no tickets at all.  I know I'm just linking to the wrong page to pull that information up, but I'm just not sure what I should be pointing to. 

I want to be able to click that and have it ONLY display  the tickets with the status "Complete - Awaiting Pickup"

 

Link to comment
Share on other sites

OK... I've found that the problem is my status....  I started using

 

supporttickets.php?view=answered format and it works fine... so I guess I'm actually trying to find out if there is a way to use supporttickets.php?view= and add my status which has spaces in it? 

 

 

Link to comment
Share on other sites

On 30/03/2019 at 18:50, garybarr said:

supporttickets.php?view=answered format and it works fine... so I guess I'm actually trying to find out if there is a way to use supporttickets.php?view= and add my status which has spaces in it? 

if this "Complete - Awaiting Pickup" support status was setup in the usual way, there should already be a link in your support tickets menu...

for example, 4+ years ago I answered a question (i'll post the link but the specific thread isn't relevant to your situation) and I added a custom ticket status of "Really Closed" - so if I wanted to see a list of tickets with that custom status, the link to it is already there in the menu... supporttickets.php?view=Really%20Closed

UmAUxew.png

so the link should be supporttickets.php?view=Complete%20-%20Awaiting%20Pickup - but if the link already exists in your support tickets menu, just copy the link from there! 🙂

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