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

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, internal id, osTicket, php, reference, title
« osTicket> Refresh ticket page every N seconds (1.6RC5)
» Google> Search by Image instead of text (Identify Image)

5 Comments

  1. Troy's Gravatar Troy
    August 16, 2012 at 9:19 am

    Scott –
    First, thanks for your work on osT. I, like several other people started to wonder if the system had lost the interest of the developers, but with the intro of 1.7 I think we can all hope for a revived interest in the system.

    I also use WP as a base for my websites, and I would really love nothing more than to take the code for osT and integrate it as a plugin to WP. I wanted to see this happen with 1.6ST, but now it seems like it would be wise to wait for the stable release of 1.7 when it becomes available shortly.

    If you would be interested in such a project, please let me know. I think it would greatly benefit WP users and bring a whole new market of users to the osT community.

    Thanks!
    Troy

    • Scott Rowley's Gravatar Scott Rowley
      August 16, 2012 at 9:43 am

      Troy,

      Thanks for the comments. I may have an interest in that some day through my company (120 Productions). But that would definitely wait until a 1.7ST and probably after I make any needed updates to my existing MODs so that all of them work under 1.7.

  2. Juan Diaz's Gravatar Juan Diaz
    May 28, 2013 at 5:52 pm

    Is there a way for me to just pay you to install the Os ticket you got (CSS) and and just change the Header to say my company?

    I got no experience in CSS 🙁

    I also got this nice side menu that from : http://tympanus.net/codrops/2013/03/05/vertical-icon-menu/
    But the Icons wont show since im using blogger, can you change the icons font to show just regular jpeg icons?

    Again I will pay you, please help me .

    • Scott Rowley's Gravatar Scott Rowley
      June 17, 2013 at 1:53 pm

      Sorry for the delay, did you still need help with this?

      • Juan Diaz's Gravatar Juan Diaz
        September 11, 2013 at 5:18 pm

        I do still I purchased the host and got it running but I dont like the original theme. I love yours and Would like someone to install it for me. Since I got no experience on how to install the thing. I would like to go st8 to the pro.

        My Email is carlos881672@gmail.com Thank you and no worries

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