2.3 MOD: Insert Ticket Submitter's Name into Ticket Reply

Everything related to Hesk - helpdesk software

Moderator: mkoch227

Post Reply
Lisaweb
Posts: 94
Joined: Sun Sep 25, 2011 3:23 pm

2.3 MOD: Insert Ticket Submitter's Name into Ticket Reply

Post by Lisaweb »

In testing the system getting it ready for launch, I noticed that my test users had trouble distinguishing who they were really replying to. If they were going to assign the ticket to another user, they would address the reply to the other user, instead of the addressing the reply towards the customer who originally submitted the ticket. This could be potentially embarrassing.

To keep this from happening, I added code that automatically entered an introduction using the submitter's name into the message reply text box. I also added new line commands (\n\n) so the cursor is positioned exactly where the user would being typing their reply. Canned replies are inserted to the same potion as well, making it lightning fast for the user to reply.
Hello [ticket submitter name],

[canned response]

[signature]
To accomplish this, in admin/admin_ticket.php

Find this line (somewhere near #1018):

Code: Select all

<span id="HeskMsg"><textarea name="message" id="message" rows="12" cols="60"><?php if (isset($_SESSION['ticket_message'])) {echo stripslashes(hesk_input($_SESSION['ticket_message']));} ?></textarea></span></p>
And replace it with this line:

Code: Select all

<span id="HeskMsg"><textarea name="message" id="message" rows="12" cols="60">Hello <?php echo $ticket['name']; ?>,<?php echo ("\n\n");?><?php if (isset($_SESSION['ticket_message'])) {echo stripslashes(hesk_input($_SESSION['ticket_message']));} ?></textarea></span></p>
Auto-inserting the submitter's name reminds the users of whom they are replying to, tremendously lowering the probability of mistakenly replying to another user. And it saves them time as well. :-)



[edited for clarity 10-7-2011 7:30am PST]
- Lisa
franku
Posts: 12
Joined: Thu Jul 22, 2010 3:57 pm

Re: 2.3 MOD: Insert Ticket Submitter's Name into Ticket Repl

Post by franku »

Great Mod!

One question for you.

Our customer enter their full name - ie. John Doe.

That means this script mod adds "Hello John Doe,"

Is there a way it can only enter the first name - ie. the characters up to the first space and strip the last name so it comes accross more personal?
Frank
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: 2.3 MOD: Insert Ticket Submitter's Name into Ticket Repl

Post by Klemen »

Something like

Code: Select all

$ticket['just_name'] = $ticket['name'];
$space = strpos($ticket['just_name'],' ');
$space = $space > 0 ? $space : strlen($ticket['just_name']);
$ticket['just_name'] = substr($ticket['just_name'],0,$space);
then use

Code: Select all

$ticket['just_name']
instead of

Code: Select all

$ticket['name']
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
franku
Posts: 12
Joined: Thu Jul 22, 2010 3:57 pm

Re: 2.3 MOD: Insert Ticket Submitter's Name into Ticket Repl

Post by franku »

Worked Like a dream - Thanks to both of you!
:D
Frank
Lisaweb
Posts: 94
Joined: Sun Sep 25, 2011 3:23 pm

Re: 2.3 MOD: Insert Ticket Submitter's Name into Ticket Repl

Post by Lisaweb »

Sweet! I'm gonna code that in today!

Thanks Klemen! :-)
- Lisa
Post Reply