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

Most Popular

  • osTickets > Reports v4.2 (18056)
  • HTPC > Setup Windows 7 as a Media Center with XBMC (10964)
  • osTicket > View headers for original email message (4175)
  • WebDev > Allow PHP in Wordpress Widgets (3616)
  • Web Dev > Password protect webpage(s) with PHP & LDAP (2475)

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
Ooo-er
5point Studios Tattoo & Piercing

Meta

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

RSS HowToGeek

  • Week in Geek: Aero Glass Feature will be Removed from Windows 8
  • How to Speed Up Web Browsing with Search & Bookmark Keywords
  • Geek Trivia: Pagers Were First Developed To Assist Which Professionals?
  • The Best Tips and Tricks for Using Email Efficiently
  • Desktop Fun: Starry Skies Wallpaper Collection Series 2

RSS TheGeekStuff

  • UNIX / Linux Processes: C fork() Function
  • How to Calculate IP Header Checksum (With an Example)
  • How to Encrypt Your Bash Shell Script on Linux Using SHC
  • Intro to DOCSIS Architecture, CM CMTS Protocol for Cable Modems
  • Ettercap Tutorial: DNS Spoofing & ARP Poisoning Examples

RSS LifeHacker

  • DIY Maple-Flavored Pancake Syrup [Breakfast]
  • This Week's Top Downloads [Download Roundup]
  • Make Mini Dutch Baby Pancakes in a Muffin Tin [Breakfast]
  • Pour Vinegar Down Your Drain Every Three Months to Keep Clogs Away [Video]
  • Use the Jelly Pocket Method for a Better Drip-Free PB&J [Food Hacks]

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

Back to Top