Help Desk Software & Beyond
August 22, 2017, 01:52:33 AM *
Welcome, Guest. Please login or register.
To post messages you need to register. We apologize for inconvenience, but this is to prevent spam.
Registration is instant (no email verification) and we do not ask for any personal information.

Login with username, password and session length
News: Welcome to Help Desk Software forum!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: [MOD] 'Extended Ticket Editor' (TTX v 3.0 & down?)  (Read 27330 times)
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« on: November 25, 2007, 06:31:24 PM »

This modification is for an Enhanced Ticket Message Editor.

It will allow you to fully edit or completely delete any message in a ticket as well as the name of the author of any message.  You can even toggle the "internal" status of operator messages.  Only operators with "ME" privileges can edit messages.  "ME" can be granted under the Users tab of the TTX Setup program at ../setup.cgi

It will work on any flavor of TTX v 2.24 and probably any version up to 3.0 but that's at your own risk.

12/14/09 - Tested in TTX 3.0 and found a few things missing from original instructions.

Features:

1.  Display of ticket number, number of message, and total number of messages in ticket.
2.  Links to navigate or scroll through all messages in a ticket.
3.  Edit the name associated with the message.
4.  Change the "internal" status of Operator messages.
5.  Optionally add an "edited by" notation.
6.  Optionally add a reason for editing message. (only in conjunction with #5)
7.  Full preview pane which shows (source) or (with edits); "(source)" is displaying what's saved in the ticket; "(with edits)" is displaying what your changes will look like.
8.  Color of preview matches scheme of ticket... customer, operator, or internal.
9.  Delete messages.
10.  Edit multiple messages without closing window.
11.  Get a warning if you attempt to view the next message without saving your edits.
12.  BBCode editor - you might have to make changes so that this editor functions with your version of TTXMarkup.pm

Buttons Explained:

Save & Exit - quick and easy, make your edits, save, and close the pop-up window all at once.
Save - save your edits to the ticket but keep the pop-up open for additional editing.
Preview - preview your edits in the pane below.
Delete - delete this message from the ticket; after asking for confirmation, deletes message, and closes pop-up.
Revert - discard your edits (before saving) and go back to original ticket message; will keep pop-up open.
Exit - closes the pop-up without saving anything.


"edit message" link in ticket only shows for operators with "ME" privileges:



The pop-up editor window (showing a customer message):



The pop-up editor window (showing an operator message):

« Last Edit: December 14, 2009, 06:03:09 PM by Sparky » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #1 on: November 25, 2007, 06:45:04 PM »

Edits

1.  In ttx.cgi

add the part in red...

Quote
my $cmddef = {
edit   => { action => 'TTXEditor::editor', access => 1, noheader => 1   },

2.  In TTXTicket.pm

add the "#" in red to comment out three lines or delete those lines.

Quote
  my $editlink;
  if ($isoper && $t->{status} ne 'PND') {
    if ($user->get('me')) {
      # eval 'use TTXMsgEdit';
      # if ($@ eq undef) {
        $editlink = 1;
      # }
    }
  }

3.  In TTXTicket.pm

find this...

Quote
$editlink = "<br>".TTXMsgEdit::link($cfg, $t, $mid);

replace with this...

Quote
$editlink = "<br><a href='#' onclick='return editor($mid)'>edit message</a>";


4.  In ticket.html template

add this function to the Javascript functions at the top of the template...

Quote
<script language="JavaScript"><!--
function editor(msgid){
    document.getElementById('msg2').value = msgid;
    hwstring="scrollbars=yes,width=750,height=650,resizable=yes,toolbar=no,menubar=no,status=yes";
    newwin = window.open('', 'wineditor', hwstring);
    newwin.document.close();
    newwin.focus();
    document.forms['formeditor'].submit();
    return false;
}
function refresh(){
   document.getElementById('do').value = 0;
   document.forms['newticket'].submit();
   return false;
}
//-->
</script>

and add this <form> to the end of the template...

Quote
<!-- Form to Create Ticket Message Editor Window -->
<form method="post" action="(%ENV_SCRIPT_NAME%)" id="formeditor" target="wineditor" >
<input type="hidden" name="cmd" value="edit">
<input type="hidden" name="tid" value="(%INPUT_tid%)">
<input type="hidden" name="key" value="(%INPUT_key%)">
<input type="hidden" name="mid" id="msg2" value="">
</form>

and find the following and add the part in red...

Quote
<input type=hidden name=do id="do" value=1>


5.  In ttxcfg.cgi, add this line...

Quote
rememberme=1


6.  In TTXCommon.pm, add a new subroutine just above dbtik subroutine

Quote
# ======================================================================== tmstp
# NEW datestamp subroutine for edited messages
sub tmstp {
  return "-" if !$_[0];
  my $cfg = TTXData::get('CONFIG');
  my $longtime = 1 if $cfg->get('time.long') || $_[1];
  my $tz = $cfg->get('timezone') * 60;
  my $tm = $_[0] + $tz;
  my ($sec,$min,$hour,$mday,$mon,$year, $wday) = gmtime($tm);
  my ($sec1,$min1,$hour1,$mday1,$mon1,$year1) = gmtime(time() + $tz);
  my $datestamp;
  my $wkday;
  if ($cfg->get('time.weekday')) {
    $wkday = TTXDictionary::translate($week[$wday]).' ';
  }
  $year += 1900; $year =~ s/^\d\d//;
  $mon++; $mon = "0$mon" if $mon < 10;
  $mday = "0$mday" if $mday < 10;
  $datestamp = $wkday . ($cfg->get('etime') ? "$mday/$mon/$year" : "$mon/$mday/$year");
  my $ap;
  if ($hour < 12) {
   $ap = "AM";
   if ($hour eq 0) {
   $hour = 12;
   }
  } else {
     if ($hour ne 12) {
     $hour = $hour - 12;
     }
   $ap = "PM";
  }
  $min = "0$min" if $min < 10;
  $datestamp .= " - $hour:$min $ap";
  return $datestamp;
}
« Last Edit: April 21, 2010, 10:57:08 AM by Sparky » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #2 on: November 25, 2007, 06:51:10 PM »

The Files

Download the ZIP file.

http://gofile.io/?id=0r7S9P

Upload as follows...

1.  "TTXEditor.pm" with other TTX pm modules (ASCII text FTP upload with 755 permissions)
2.  "edit.html" in templates directory
3.  "buttons" directory in templates directory
4.  "bbeditor.js" in templates directory
5.  "ttx.css" in templates directory
« Last Edit: April 14, 2016, 03:51:45 PM by Sparky » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #3 on: November 25, 2007, 06:55:50 PM »

This modification has been in use here (at my location, NOT United Web Coders) for the last couple months without any major issues or problems.

As always...

1.  You should be very familiar with HTML and somewhat familiar with PERL otherwise you might be getting in over your head.
2.  Use Notepad or a good text editor as you might get weird results with HTML editors.
3.  Back-up your entire installation before proceeding.
4.  Problems?  PM me if you get stuck but support will be very limited.
5.  Really stuck?  Restore your original files until you can figure it out.
« Last Edit: January 21, 2008, 01:53:58 PM by sparky672 » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #4 on: January 21, 2008, 02:05:45 PM »

Do not reverse the order of your messages as described here....

http://forum.unitedwebcoders.com/index.php/topic,511.0.html

http://forum.unitedwebcoders.com/index.php/topic,275.0.html

My mod will not play nice with that.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
loneguard
Jr. Member
**

Karma: 0
Posts: 98


View Profile
« Reply #5 on: January 31, 2008, 05:13:13 AM »

I've tried to follow your step by step instructions, but so far no editor buttons are visible at all.
I think the problem is with paths. My cgi-bin is outside httpdocs, and that creates a problem referencing them in relative path terms.


Logged
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #6 on: January 31, 2008, 09:29:02 AM »

I've tried to follow your step by step instructions, but so far no editor buttons are visible at all.
I think the problem is with paths. My cgi-bin is outside httpdocs, and that creates a problem referencing them in relative path terms.

This mod is not for a BB Code mark-up editor.

This is for an editor that will allow you to edit each existing message in a ticket.  Following the instructions exactly as listed here will only get you the pop-up window for editing messages.

The instructions above do not specify how to add the BB Code buttons although they are included in the files to download.  This is a very advanced mod and it is assumed that one would know how to edit the various paths in the templates if they wanted the BB Code buttons.

Anyone not up to the task of installing this mod should consider the plug 'n play version from Alex....

http://www.troubleticketexpress.com/messageeditor.html
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #7 on: January 31, 2008, 09:38:20 AM »

My cgi-bin is outside httpdocs, and that creates a problem referencing them in relative path terms.

It's designed to function with the module in the same location as all the TTX modules and the new BB Code buttons & Javascript in the same directory as the TTX templates.

For some reason, if you have to move the Button Images, CSS, & Javascript, you'll have to update & verify the following...

 - The paths in the HTML templates.
 - The paths in the CSS file.

You will not need to know any PERL... there is nothing in the CGI/PERL module to edit with respect to paths.

Like with all mods, minor adjustments are expected since every user's installation could be slightly different.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
loneguard
Jr. Member
**

Karma: 0
Posts: 98


View Profile
« Reply #8 on: January 31, 2008, 09:53:09 AM »

It's the css file I forgot to modify to reflect the fact that my cgi-bin is one up from httpdocs.
Thanks,
Jack
Logged
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #9 on: January 31, 2008, 09:56:09 AM »

It's the css file I forgot to modify to reflect the fact that my cgi-bin is one up from httpdocs.
Thanks,
Jack

Very good.  I wasn't sure which part of this was the problem for you so I tried to hit all the issues at once.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #10 on: December 14, 2009, 03:25:52 PM »

Tested as working in TTX 3.0

For all versions, must have the following in your ttxcfg.cgi file...

rememberme=1
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
mikjonf
Newbie
*

Karma: 0
Posts: 9


View Profile
« Reply #11 on: February 24, 2010, 10:29:56 AM »

Hello,
I have followed these instruction exactly but have a small issue.
In the Ticket editor I now see the link in each message to "edit message". I also have made sure that ME is checked in User setup. However when I click on the "edit message" link it just returns me back to the same page. I do not get the message editor popup window. I have made sure that popups are allowed and even copied the link to a new window and I get the same results.
Is there something I missed?

Thanks,
Mike
Logged
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #12 on: February 24, 2010, 10:35:36 AM »

Hello,
I have followed these instruction exactly but have a small issue.
In the Ticket editor I now see the link in each message to "edit message". I also have made sure that ME is checked in User setup. However when I click on the "edit message" link it just returns me back to the same page. I do not get the message editor popup window. I have made sure that popups are allowed and even copied the link to a new window and I get the same results.
Is there something I missed?

Thanks,
Mike

Successful creation of the pop-up depends on Javascript.

Run it in Firefox and have the Error Console open to see if you get any Javascript errors.  If so, double check your edits and if you cut & pasted from this page, you probably carried over a bunch of invisible characters.  Use a high quality text editor to see and remove invisible characters.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
mikjonf
Newbie
*

Karma: 0
Posts: 9


View Profile
« Reply #13 on: February 24, 2010, 01:46:14 PM »

Yes, thanks. I have done as you suggested and Firefox Error Console tells me that "Editor is not defined"

Thanks,
Mike
Logged
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #14 on: February 24, 2010, 01:53:02 PM »

Yes, thanks. I have done as you suggested and Firefox Error Console tells me that "Editor is not defined"

Thanks,
Mike

Did you figure it out then?

This is your link calling the "editor" object...

Quote
<a href='#' onclick='return editor($mid)'>edit message</a>

If Firefox is telling you that it's undefined, then you're either missing the Javascript function called "editor" (below) or you've got an invisible character mucking it up someplace...

Quote
<script language="JavaScript"><!--
function editor(msgid){
    document.getElementById('msg2').value = msgid;
    hwstring="scrollbars=yes,width=750,height=650,resizable=yes,toolbar=no,menubar=no,status=yes";
    newwin = window.open('', 'wineditor', hwstring);
    newwin.document.close();
    newwin.focus();
    document.forms['formeditor'].submit();
    return false;
}
function refresh(){
   document.getElementById('do').value = 0;
   document.forms['newticket'].submit();
   return false;
}
//-->
</script>
« Last Edit: April 21, 2010, 01:25:11 PM by Sparky » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!
Page created in 0.035 seconds with 20 queries.