Hi again,
I am currently using osTicket v1.6 RC4, and in this version, when a Staff add new ticket by typing some characters of client's email, there will be appear a pop-up list box that contains of list of client's email and name. And when a Staff click on one of some items in the list, the email and the name textbox on that form will be filled-in based on the item that Staff click. But not with the phone textbox! :(
So I made a modification in order the client's phone number also will be filled-in automatically based on the item that a Staff click on the pop-up list box. :)
As usual, let's getting started now!
Open \include\staff\newticket.inc.php file, and FIND:
<td><input type="text" name="phone" size="25"
REPLACE WITH:
<td><input type="text" id="phone" name="phone" size="25"
FIND:
callback: function (obj) { document.getElementById('email').value = obj.id; document.getElementById('name').value = obj.info; return false;}
REPLACE WITH:
callback: function (obj) {
document.getElementById('email').value = obj.id;
document.getElementById('name').value = obj.info.substring(0, obj.info.indexOf('|'));
document.getElementById('phone').value = obj.info.substring(obj.info.indexOf('|') + 1);
return false;
}
Open \include\ajax.tickets.php, and FIND:
$sql='SELECT DISTINCT email,name FROM '.TICKET_TABLE.' WHERE email LIKE \''.$input.'%\' ORDER BY created LIMIT '.$limit;
REPLACE WITH:
$sql='SELECT DISTINCT email,name,phone FROM '.TICKET_TABLE.' WHERE email LIKE \''.$input.'%\' ORDER BY created LIMIT '.$limit;
FIND:
while(list($email,$name)=db_fetch_row($resp)) {
REPLACE WITH:
while(list($email,$name,$phone)=db_fetch_row($resp)) {
FIND:
$items ='{"id": "'.$email.'", "value": "'.$email.'", "info": "'.$name.'"}';
REPLACE WITH:
$items ='{"id": "'.$email.'", "value": "'.$email.'", "info": "'.$name.'|'.$phone.'"}';
That's all, everyone.
Now test your "New Ticket" form from Staff Panel, and enjoy the result! I hope this will be helpful for all of you.
Cheers!
Best regards,
Masino Sinaga