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?
  • screens
    2015-12-07 08_59_46-RDP-Manager.png
    1377 x 618 - 58K
    2015-12-07 09_00_14-RDP-Manager.png
    1043 x 494 - 63K
    2015-12-07 09_00_37-RDP-Manager.png
    1374 x 570 - 48K
    2015-12-07 09_01_13-RDP-Manager.png
    1091 x 238 - 58K
  • 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?

    2015_12_09_08_44_06_osTicket_Staff_Control_Panel.png
    540 x 250 - 16K
  • 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 ?
Sign In or Register to comment.