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

Add new Source

Hey guys,

What are the files I need to modify if I want to add a new "source" to the ticket?

Right now, it has Source: Phone/Email/Other. I'd like to add "Fax" to it. Any clue? :)

Love to hear your suggestions!
Thanks all!

Comments

  • Currently only staff can open a ticket and select a source. That drop down is built in the include/staff/newticket.inc.php around line 82. You can add an additional option in there.

    <select name=\"source\">
    <option value=\"\" selected >Select Source</option>
    <option value=\"Phone\"<?=($info['source']=='Phone')?'selected':''?>>Phone</option>
    <option value=\"Email\" <?=($info['source']=='Email')?'selected':''?>>Email</option>
    <option value=\"Other\" <?=($info['source']=='Other')?'selected':''?>>Other</option>
    </select>
    <option value=\"Fax\" <?=($info['source']=='Fax')?'selected':''?>>Fax</option>
    </select>
    &nbsp;<font class=\"error\"><b>*</b>&nbsp;<?=$errors['source']?></font>
  • ntozier, thank you for the response. I did what you recommended, and I can see the new "Source" in the drop-down menu. But when I submit the ticket with the new "source" selected, it says: "Invalid Source - Fax"

    any clue? is there anything else I need to modify?
  • Hmmm let me take a looksee.
  • take a look at \support\include\class.ticket.php
    circa line 1456ish

    should look like:
            if($var['source'] && !in_array(strtolower($var['source']),array('email','phone','other')))
    $errors['source']='Invalid source - '.Format::htmlchars($var['source']);


    change it to
            if($var['source'] && !in_array(strtolower($var['source']),array('email','phone','other','fax')))
    $errors['source']='Invalid source - '.Format::htmlchars($var['source']);


    Ok there is more to do... the database table structure itself needs to be changed. You will need to run a mysql cli or gui and execute the following command:
    alter table ost_ticket change source source ENUM('Web','Email','Phone','Fax','Other');


    You should probably make sure that they are in the same order every where (which I didn't do but you should).
  • Thank You! That worked! :)
  • this still work in 1.8 just testet if anyone use it. 
  • In v1.9.x, look for a file called ticket-new.php under \osticket\include\staff then search ~Line 117
    and the \osticket\include\class.ticket.php Line 2614...

    I've ran the same command in MySQL as above and it's worked.

    Happy Days!! 
  • I would not recommend running this mod on 1.9.+ since the feature is actively being worked on by the devs and might even make the next release.
  • edited December 2015
    hey guys,

    in have not the "newticket.inc.php" i changed it at the "tickets.inc.php"

    i add the value in the database "ost_tickets".

    osticket say " * Invalid source given - Monitoring"

    has anyone a idea?
  • This thread is from 2011.
    What version are you running?
  • ost 1.9.12 on ms win2012, iis8,5 and php 5.6.14

    image
  • I don't see anything wrong with what you have done.

  • With these settings, it should go .... yes or?

  • The condiation is "!in_array(strtolower" so you i write "monitoring" with an small "m". Then it will work,
  • hi has anyone tested this working on v1.10.1 i want to add a few new ticket source fields as well ?
  • Hi, I just tried it and it works! but when I do an advanced search and select the source, I do not see the ones I added. Any ideas????
  • This thread is from 2011... for version 1.6.  You are bound to run into difficulty with advanced search since it was updated multiple times between 1.6 and current.  

    ost_ticket.source is an enum.  Which means you likely have to change the table itself.
This discussion has been closed.