• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Posts tagged internal id

osTicket> Show external ticket ID in browser title.

Aug13
2012
Written by Scott Rowley

 

At my full time job we often reference the ticket ID that we are working on in our daily log, notes or when just when referencing it from person to person. The following will allow for showing the external ticket ID in the browser title.

First we need a new function to reference, find the following in
include/class.ticket.php

/*============== Functions below do not require an instance of the class to be used. To call it use Ticket::function(params); ==================*/

And add the following right after it:

function getExtIdById($id){
$sql ='SELECT ticketID FROM '.TICKET_TABLE.' ticket WHERE ticket_id='.db_input($id);
$res=db_query($sql);
if($res && db_num_rows($res))
list($extid)=db_fetch_row($res);
return $extid;
}

Now open up
include/staff/header.inc.php and add the following just after your <title> tag:

<?if(Ticket::getExtIdById($id)){ echo Ticket::getExtIdById($id)." - "; }?>

Update!
There are a couple of pages you may be on (like “My Preferences”) where the ticket class is not loaded. In order to make sure it’s loaded for use you can added the following just before the title tag:

require_once('../include/class.ticket.php');
Posted in MySQL, osTicket, PHP - Tagged browser, class, external id, function, osTicket, php, reference, title

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top