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

osTicket> View headers for original email message

May25
2011
Written by Scott Rowley

This MOD will allow you to view the original email message headers. The headers also take alot of screen space so we have them “hidden” by default but you can click a link to expand and view them.

1.6ST: If you have not yet modified include/staff/viewticket.inc.php or scp/js/scp.js then you can simply download the following files and replace them. As always, make backups of your local files first.
Download

Hidden Shown
Hidden headers Shown headers


Find the following in include/staff/viewticket.inc.php

<tr><th nowrap>Last Message:</th>
<td><?=Format::db_datetime($ticket->getLastMessageDate())?></td>
</tr>
</table>
</td>
</tr>
</table>

Add AFTER that:

<?
$query='SELECT headers,created FROM '.TICKET_MESSAGE_TABLE.' WHERE ticket_id='.db_input($id).' ORDER BY created DESC LIMIT 1';
$result=mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
$headers=htmlentities($row['headers']);
}
?>
<?php if($headers!=''){ ?>
<span class="msg"><a href="#" onclick="ShowHeaders();">Show/Hide Headers</a></span>
<table align="center" id="headerTable" style="display:none" class="ticketinfo" cellspacing="1" cellpadding="3" width="100%" border=0>
<tr>
<td><?=nl2br($headers);?>
</td>
</tr>
</table>
<?php } ?>

Add the ability to show/hide it

scp/js/scp.js

function dispHidden(obj)
{
if(obj.style.display == "none")
{
obj.style.display = "";
}
else
{
obj.style.display = "none";
}
}
function ShowHeaders()
{
dispHidden(headerTable)
}
Posted in osTicket - Tagged address, email, header, headers, hide, Javascript, mod, modification, original, osTicket, show, ticket
« HTPC> Setup Windows 7 as a Media Center with XBMC
» AWK> Useful examples

16 Comments

  1. grateful's Gravatar grateful
    May 26, 2011 at 7:35 am

    Great mod! Implemented it this morning, works as desired. Thanks a lot!

    • Scott Rowley's Gravatar Scott Rowley
      May 26, 2011 at 7:37 am

      Awesome! Thanks for the feedback! 🙂

  2. leon zak's Gravatar leon zak
    May 29, 2011 at 11:06 pm

    Very nice — just put the mod in — worked fine.
    Thanks,
    leon …

    • Scott Rowley's Gravatar Scott Rowley
      May 30, 2011 at 9:28 am

      Awesome, glad it worked for you. Thanks for the feedback!

  3. M450N's Gravatar M450N
    June 1, 2011 at 4:22 am

    This is excellent — It even works on emails previously submitted!
    One thing I’ve noticed is I now cant view the info in the system log of admin panel on 1.6ST

    • Scott Rowley's Gravatar Scott Rowley
      June 1, 2011 at 8:07 am

      Not sure whats going on there, I can still view my system log info just fine — this MOD doesn’t touch that code. You sure you haven’t implemented anything else recently and are just now noticing it?

  4. Thomas Markey's Gravatar Thomas Markey
    July 7, 2011 at 4:02 am

    Doesn’t work….

    • Scott Rowley's Gravatar Scott Rowley
      July 7, 2011 at 7:54 am

      Thomas, can you be more specific? What isn’t working? Do you not see the headers at all, do they always show but can’t be hidden, are they always hidden, do you get an error message?

  5. Thomas Markey's Gravatar Thomas Markey
    July 12, 2011 at 2:26 am

    Can you send over your files with this mod and I can compare.?
    You have my email in your inbox.

  6. Omar Cespedez's Gravatar Omar Cespedez
    August 4, 2011 at 1:26 pm

    Hello
    I have a problem:
    There is no data in the “Headers” in table “ticket_message” hence the above shows no information.
    Could you please help me.

    Greetings

    • Scott Rowley's Gravatar Scott Rowley
      August 4, 2011 at 1:29 pm

      Its not going to show any headers unless the ticket was created via email. Was this tickets sent in via email?

  7. Omar Cespedez's Gravatar Omar Cespedez
    August 4, 2011 at 1:44 pm

    Thanks for your quick response, the ticket has been made by the ticket system. I think it was created via mail
    Could you give me an example of how this would create a ticket via.

    I hope not to bother with these questions

  8. Scott Rowley's Gravatar Scott Rowley
    August 4, 2011 at 1:49 pm

    No worries, how did you, your staff, or the user come to create the ticket? What steps did you take?

    Did you browse to a webpage of your tickets installation or did you setup email and someone sent an email to it?

    • Omar Cespedez's Gravatar Omar Cespedez
      August 4, 2011 at 2:23 pm

      I will tell you how

  9. Jere Austill's Gravatar Jere Austill
    December 29, 2013 at 9:07 pm

    I have always wanted a mod like this, but sadly just found it after I had upgraded to osTicket Core, v1.8.0.1

    Any chance you could look into making this mod work in the latest osTicket version?

    • Ryan C's Gravatar Ryan C
      July 25, 2014 at 3:49 pm

      It would be great if this could be updated to work with the latest osTicket. I think this mod would be a great feature to have to troubleshoot when user’s emails come in and create multiple tickets.

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