Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Phone Number in New Ticket AutoComplete

I edited a couple of files to allow the phone number to also auto-complete when you create a new ticket on the staff side.

If you are using a vanilla implementation you can just extract to your osticket directory, the paths are already set.

Comments

  • wow thats helps me.....
    Thanks
  • Instructions for those who are using MODed version of OS Ticket (after all this is the MODS Forum)


    1. In include/ajax.tickets.php change the following

    a) In Function searchbyemail:

    Search for:

    $input = db_input(strtolower($params['input']),false);


    replace with:

    $input = strtolower($params['input']);


    next

    Search for:
    $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;



    next

    search for:
    while(list($email,$name)=db_fetch_row($resp)) {


    replace with:

    while(list($email,$name,$phone)=db_fetch_row($resp)) {


    next

    search for:

    $items[] ='{\"id\": \"'.$email.'\", \"value\": \"'.$email.'\", \"info\": \"'.$name.'\"}';


    replace with:

    $items[] ='{\"id\": \"'.$email.'\", \"value\": \"'.$email.'\", \"info\": \"'.$name.'\", \"phone\": \"'.$phone.'\"}';


    b) In Function search($params):

    search for:
    $input = db_input(strtolower($params['input']),false);


    replace with:
    $input = strtolower($params['input']);



    **NOTE** For some reason the releaseLOCK function has been removed from the file attached


    2. In include/staff/newticket.inc.php change the following

    Search for:
    <td><input type=\"text\" name=\"phone\" size=\"25\" value=\"<?=$info['phone']?>\">
    &nbsp;Ext&nbsp;<input type=\"text\" name=\"phone_ext\" size=\"6\" value=\"<?=$info['phone_ext']?>\">
    <font class=\"error\">&nbsp;<?=$errors['phone']?></font></td>


    replace with:
    <td><input type=\"text\" id=\"phone\" name=\"phone\" size=\"25\" value=\"<?=$info['phone']?>\">&nbsp;<font class=\"error\">&nbsp;<?=$errors['phone']?></font></td>


    next

    search for:
                    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; document.getElementById('phone').value = obj.phone; return false; }



    2. In SCP/JS/bsn.AutoSuggest_2.1.3.js change the following:

    search for:
    Vthis.aSug.push(  { 'id':jsondata.results[i].id, 'value':jsondata.results[i].value, 'info':jsondata.results[i].info }  );


    replace with:

    this.aSug.push(  { 'id':jsondata.results[i].id, 'value':jsondata.results[i].value, 'info':jsondata.results[i].info, 'phone':jsondata.results[i].phone }  );



    next


    search for:

    span.appendChild(small);


    below it add:
    span.appendChild(br);
    var small2 = _b.DOM.cE(\"small\", {}, arr[i].phone);
    span.appendChild(small2);





    Enjoy
  • nice mod!!

    i was wondering if it can be done in the client section.
    my clients are kinda lazy and dont wanna type their name and stuff
    so i though of adding a search button in the "new ticket".. near the e-mail textbox so they can just enter their email and everything else would be added automatically
  • C-team, did you figure out the client side ?
Sign In or Register to comment.