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

How to add more source for New Ticket

How do I add other sources for New Ticket created by staff?

I would like to add Twitter, Facebook, Instagram so other staff seeing the ticket automatically knew where to refer if necessary.

image

 
Reading an old post, I got the information that I cannot do this via the ui. In this post is not clear all necessary php files I need to edit. So, If someone can help me, thanks.

Comments

  • version of osTicket?

    moving thread to mods and customizations where it belongs.
  • on include/staff/ticket-open.php you can modify the following to add more source options:

    <?php echo __('Ticket Source');?>:
                </td>
                <td>
                    <select name="source">
                        <option value="CUSTOMSOURCE" selected="selected"><?php echo __('CUSTOMSOURCE'); ?></option>
                        <option value="Phone" <?php echo ($info['source']=='Phone')?'selected="selected"':''; ?>><?php echo __('Phone'); ?></option>
                        <option value="Email" <?php echo ($info['source']=='Email')?'selected="selected"':''; ?>><?php echo __('Email'); ?></option>
                        <option value="Other" <?php echo ($info['source']=='Other')?'selected="selected"':''; ?>><?php echo __('Other'); ?></option>
                    </select>

    However, when creating a ticket this will give you an error.  So you need to add your custom source to the array on line 3370 in /include/class.ticket.php for example:

    if ($vars['source'] && !in_array(
                strtolower($vars['source']), array('customsource','email','phone','other'))
            ) {
                $errors['source'] = sprintf(
                    __('Invalid source given - %s'),Format::htmlchars($vars['source'])
                );
            }

    note, in this array your source should be written in lowercase, because the php checks against lowercase strings.

    You will also need to modify include/staff/ticket-edit.php in a similar fashion.
  • I think you also need to modify the database since the type is stored as an enum and that does not allow custom types. If would be good if the devs made it possible to add new sources so plugins could add this themselves.

    Fyi, I have created a Facebook plugin here:
    http://osticket.com/forum/discussion/86737/facebook-integration-plugin
  • There is also a feature request for adding new ticket source via the gui. 

    And one of the developers (greezybacon) seems to like it:


    So the chances are not bad that this will be possible in a future release..
Sign In or Register to comment.