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

Most Popular

  • osTickets > Reports v4.1 (11806)
  • HTPC > Setup Windows 7 as a Media Center with XBMC (6370)
  • osTicket > Auto-Assignment Rules (3603)
  • osTicket > View headers for original email message (2332)
  • Ubuntu 10.10 VNC Login Screen (2162)

osTicket > View headers for original email message

May25
2011
14 Comments Written by Scott Rowley
If you find this post useful PLEASE consider simply clicking on an ad. It costs you nothing and it helps maintain the website. Thank you!

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)
}
ajax loader
If you find this post useful PLEASE consider simply clicking on an ad. It costs you nothing and it helps maintain the website. Thank you!
Posted in osTicket - Tagged address, email, header, headers, hide, Javascript, mod, modification, original, osTicket, show, ticket
SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail
« HTPC > Setup Windows 7 as a Media Center with XBMC
» AWK > Useful examples

14 Comments

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

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

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

      Awesome! Thanks for the feedback! :)

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

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

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

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

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

    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

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

      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?

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

    Doesn’t work….

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

      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?

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

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

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

    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

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

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

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

    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

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

    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?

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

      I will tell you how

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Be Heard!

Authors needed! Feel like sharing your tech wisdom with the world? We are looking to expand our writer base and would love to hear from you. We need articles on any relevant technology/software/media/howto/etc (Well...lets at least hold to the legal stuff ;)

Just email scott (at) sudobash (dot) net

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

Sudo Bash Member sites

Des Moines, Iowa Karate Classes
Iowa MMA Tournaments
Iowa SAR

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

RSS HowToGeek

  • DIY Digital POV Clock On a Hard Drive Platter
  • How to Disable the Splash Screens in Office (Word, Excel, PowerPoint)
  • How To Resolve Dependencies While Compiling Software on Ubuntu
  • Version Tracking With Subversion (SVN) For Beginners
  • How to Set Up Email Notifications for Your Windows Home Server

RSS TheGeekStuff

  • How to Install GIT for Windows and Create / Clone Remote Repositories
  • 5 Practical Linux fuser Command Examples
  • Linux Memory Management – Virtual Memory and Demand Paging
  • XSS Attack Examples (Cross-Site Scripting Attacks)
  • 10 Things You (and Your Boss) Can Do To Change Your World

RSS LifeHacker

  • Remove Clothing Wrinkles with a Damp Towel [Clothes]
  • Factor in the Convenience Fee Before Charging Income Taxes to Your Credit Card [Taxes]
  • How to Block Annoying Tech Rumors and Movie Spoilers on Your Browser [Annoyances]
  • Use Plastic Shower Caps in the Kitchen to Cover Large Bowls and Leftovers [Clever Uses]
  • Twitter for iOS and Android Updates, Restores Swipe Gestures and Optimizes for Android Tablets [Updates]

EvoLve theme by Blogatize  •  Powered by WordPress Sudo Bash
By Geeks - For Geeks

Back to Top