Edits
1. Upload files as per previous post.
2. In
ttx.cgi, find the following and ADD the part in
red...
msgdel => { action => 'TTXMsgEdit::del', access => 1, noheader => 1 },
custdesk => { action => 'TTXCustDesk::custdesk', access => 0, noheader => 0 },
3. In
ttx.cgi, find the following and remove it...
$data{HELPDESKCMD} = ($cfg->get('_USER') ne undef) ? 'helpdesk':'ticket';
if ($query->param('cmd') eq 'mytickets' ||
($query->param('cmd') eq 'ticket' && $query->param('emailkey') ne undef && $query->param('sid') eq undef)) {
$data{HELPDESKCMD} = 'mytickets&emailkey=' . $query->param('emailkey');
}
replace it with this...
#### modified VIEW TICKET LINKS
my $command;
if ($cfg->get('_USER') ne undef) {
$command = 'helpdesk';
} else {
$command = 'ticket';
}
$data{HELPDESKCMD} = '<a href="'.$ENV{SCRIPT_NAME}.'?cmd='.$command.'&sid='.$query->param('sid').'&style='.$query->param('style').'">Ticket List</a>';
# if you're customer and on Ticket page, this generates a link to take you to Customer Ticket List
if (($query->param('cmd') eq 'ticket' || $query->param('cmd') eq 'custdesk') && $cfg->get('_USER') eq undef) {
$data{HELPDESKCMD} = '<a href="#" onclick="return custdesk()">My Tickets</a>';
} elsif ($cfg->get('_USER') eq undef) {
$data{HELPDESKCMD} = '<a href="'.$ENV{SCRIPT_NAME}.'?cmd='.$command.'&sid='.$query->param('sid').'&style='.$query->param('style').'">View Ticket</a>';
}
4. In
header.shtmlfind and
remove this...
<a href="(%ENV_SCRIPT_NAME%)?cmd=(%HELPDESKCMD%)&sid=(%INPUT_sid%)&style=(%INPUT_style%)">Tickets</a>
replace it by
adding this...
(%HELPDESKCMD%)
5. In
TTXDesk.pm(to make the search filter)
a.
buildfilter section, find the following and ADD the part in
red...
my ($cfg, $query, $data, $cfg2) = @_;
b.
buildfilter section, find the following and DELETE the part in
red...
my @fltrcols = split(/\|/, $cfg->get('fltrcols'));
replace it with this...
my @fltrcols;
if ($cfg2 eq undef) { $cfg2 = '';}
my $filtercfg = 'fltrcols'.$cfg2;
@fltrcols = split(/\|/, $cfg->get($filtercfg));
c.
buildfilter section, find the following and DELETE the part in
red...
$data->{TICKETFILTER} = $buff;
replace it with this...
if ($cfg2 ne ''){ $data->{TICKETFILTER2} = $buff; }
else { $data->{TICKETFILTER} = $buff; }
6. In
ttxcfg.cgi, add the following line. This defines the search fields under the Customer Ticket List...
fltrcols3=text|subject
and these lines...
dsort=updated
dsortorder=D
dwindow=30
7. In
ticket.htmladd this to the bottom...
<form method="post" action="(%ENV_SCRIPT_NAME%)" id="formcustdesk">
<input type="hidden" name="cmd" value="custdesk">
<input type="hidden" name="style" value="(%INPUT_style%)">
<input type="hidden" name="sid" value="(%INPUT_sid%)">
<input type="hidden" name="key" value="(%INPUT_key%)">
<input type="hidden" name="email" value="(%TICKET_email%)">
<input type="hidden" name="tg" id="tg" value="1">
<input type="hidden" name="send" id=send value="0">
<input type="hidden" name="text" value="(%TEXT%)">
<input type="hidden" name="fltrsubj" value="(%SUBJ%)">
<input type="hidden" name="reset" id="reset" value="">
</form>
... and add this to the top
<script language="JavaScript"><!--
function custdesk(){
document.forms['formcustdesk'].submit();
return false;
}
//-->
</script>