Script URL: n/a
Version of script: Newest
Version of PHP: 5
Hosting company: n/a
Have you searched THIS FORUM for your problem:
(if not please do before posting)
If so, what terms did you try:
Write your message below:
Hi there,
I was just wondering if it's possible to display who the last person who replied to the ticket was on the main screen? (through print_tickets.inc.php)
I would imagine something like this, but it would be great if someone could steer me along the right path:
if ($name == "admin") {
echo "Staff"; }
else { echo "Customer"; }
I'm just not sure of the correct variable names.
Any help appreciated!
Conor
Last reply
Moderator: mkoch227
Last Replier
Well I am pretty sure someone has already figured this out by now. But because I did not see a solution to this issue, I came up with a quick remedy to it. It is just a couple of lines of code that will help keep track of who is doing what.
Alright within the "print_tickets.inc.php" file look for the following lines of code:
if ($ticket['lastreplier']=='1') {$ticket['lastreplier']=$hesklang['staff'];}
else {$ticket['lastreplier']=$hesklang['customer'];}
**********************************************
REPLACE WITH...
if ($ticket['lastreplier']=='1') {
$id = $ticket['id'];
$sqlid = "SELECT `name` FROM `hesk_replies` WHERE `replyto`=$id ORDER BY `dt` DESC";
$data = mysql_query($sqlid);
$reply = mysql_fetch_array($data);
$ticket['lastreplier']=$reply["name"];}
else {$ticket['lastreplier']=$hesklang['customer'];}
***********************************************
This should do it. I have tested it out numerous times. So have fun!
Oh, BTW. Mad kudos to the guys that developed this script. My company is loving this script as a temporary solution until our commercial product comes down the pike. And as of right now, that does not look like it is coming any time soon... So my hat is off to the gentlmen that devloped this code.... Bravo!
Alright within the "print_tickets.inc.php" file look for the following lines of code:
if ($ticket['lastreplier']=='1') {$ticket['lastreplier']=$hesklang['staff'];}
else {$ticket['lastreplier']=$hesklang['customer'];}
**********************************************
REPLACE WITH...
if ($ticket['lastreplier']=='1') {
$id = $ticket['id'];
$sqlid = "SELECT `name` FROM `hesk_replies` WHERE `replyto`=$id ORDER BY `dt` DESC";
$data = mysql_query($sqlid);
$reply = mysql_fetch_array($data);
$ticket['lastreplier']=$reply["name"];}
else {$ticket['lastreplier']=$hesklang['customer'];}
***********************************************
This should do it. I have tested it out numerous times. So have fun!
Oh, BTW. Mad kudos to the guys that developed this script. My company is loving this script as a temporary solution until our commercial product comes down the pike. And as of right now, that does not look like it is coming any time soon... So my hat is off to the gentlmen that devloped this code.... Bravo!