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

Adding a New Field to tickets

12345679»

Comments

  • Hi,

    I add a field called: endereco and I'm getting the error below when I submit a new ticket:

    * Valid endereco # required (type not set)

    Could you help me?

    Tks
  • For step 1, how exactly do you add a new field to the database? I am looking to add a field for "paypal email address".

    Edit: Found these 2 sources that solved the issue. If anyone else is curious:
    http://www.openscriptsolution.com/2009/11/15/how-to-add-extra-fields-on-the-open-ticket-form-of-client-side-in-osticket-v1-6-rc5/

    http://www.openscriptsolution.com/2009/12/10/add-new-field-in-edit-ticket-form-of-osticket-v1-6-rc5/
  • What are the chances this will work on 1.7
  • Add custom field to user?

    Is ther an easy way to add a customer field to 'user'? I'm try to specify teams of users within a department (i.e. team 1, team 2).

    Thanks!
  • Hi folks,
    I added the code and got the custom field "Street Address" working fine. I have one issue. I see that others have had the same issue described in previous posts but nobody posted a solution....

    When a client creates a new ticket, it works fine. However, when a client is logged in and now tries to create a ticket, the screen displays only the Name and Email, but stops at my custom field. Best I can figure out is that the problem is in this piece of code...can anybody help please? Thanks.


      <tr>
    <th nowrap >Street Address:</th>
    <td>
    [COLOR=\"Red\"]<?if ($thisclient && ($address=$thisclient->getaddress())) {
    ?>
    <input type=\"hidden\" name=\"address\" size=\"25\" value=\"<?=$address?>\"><?=$address?>[/COLOR]
    <?}else {?>
    <input type=\"text\" name=\"address\" size=\"25\" value=\"<?=$info['address']?>\">
    <?}?>
    &nbsp;<font class=\"error\">*&nbsp;<?=$errors['address']?></font>
    </td>
    </tr>
  • OK. got the fix on post # 39, for those looking for a solution to the same issue. Thanks.
    jazzman;31971 said:
    Hi folks,
    I added the code and got the custom field "Street Address" working fine. I have one issue. I see that others have had the same issue described in previous posts but nobody posted a solution....

    When a client creates a new ticket, it works fine. However, when a client is logged in and now tries to create a ticket, the screen displays only the Name and Email, but stops at my custom field. Best I can figure out is that the problem is in this piece of code...can anybody help please? Thanks.


      <tr>
    <th nowrap >Street Address:</th>
    <td>
    [COLOR=\"Red\"]<?if ($thisclient && ($address=$thisclient->getaddress())) {
    ?>
    <input type=\"hidden\" name=\"address\" size=\"25\" value=\"<?=$address?>\"><?=$address?>[/COLOR]
    <?}else {?>
    <input type=\"text\" name=\"address\" size=\"25\" value=\"<?=$info['address']?>\">
    <?}?>
    &nbsp;<font class=\"error\">*&nbsp;<?=$errors['address']?></font>
    </td>
    </tr>
  • Create a new ticket via email fails due to custom field.

    Hi all,
    I created a new custom field called "Street Address" (required field) and it works great when the user goes to the online form and creates a new ticket.
    However I have email piping enabled. So when the user sends an email to create a new ticket, osticket is unable to create the ticket due to the fact that it does not know how to populate the custom field. Has anybody done this?
    Thanks,
    -jazzman.
  • Jazzman,

    Try making the field not required.
  • teryakisan;32173 said:
    Jazzman,

    Try making the field not required.
    Yes I know I could do that, however it is a required field and I need that information populated for every ticket. Is there any way to do this?
  • please post a copy of your class.ticket.php
  • teryakisan;32177 said:
    please post a copy of your class.ticket.php
    Hi Teryakisan, my class.ticket.php is attached as a zip file. thanks for helping out.
    class.ticket.zip
    13K
  • jazzman said:
    I need that information populated for every ticket
    Okay, here's the problem. OSTicket pipe populates the fields by looking at the components of the email such as the from address, the subject, and the message body. When the sender types the address information into one of those fields, OSTicket has no way of knowing what it is, what to do with it, or even how to find it.

    Unless you specifically delineate the address information with something like !-- address --!, then write a function to look for that delineation, OST won't even be able to tell where the address information begins and ends. You'll need to have a very fine grain control over how the message body is populated with your user information.

    I suggest that you build a custom email send form then take a look at the stripQuotedReply() and getReplySeperator() functions in api/pipe.php. This should get you moving in the right direction, sorry I couldn't be of more help.
  • Thanks for looking at this. I will try this out.
    teryakisan;32183 said:
    Okay, here's the problem. OSTicket pipe populates the fields by looking at the components of the email such as the from address, the subject, and the message body. When the sender types the address information into one of those fields, OSTicket has no way of knowing what it is, what to do with it, or even how to find it.

    Unless you specifically delineate the address information with something like !-- address --!, then write a function to look for that delineation, OST won't even be able to tell where the address information begins and ends. You'll need to have a very fine grain control over how the message body is populated with your user information.

    I suggest that you build a custom email send form then take a look at the stripQuotedReply() and getReplySeperator() functions in api/pipe.php. This should get you moving in the right direction, sorry I couldn't be of more help.
  • Hi,

    I'm new to the Forum and this is my first post.

    I was just wondering if there was a guide similar to sudobash's style to follow? As-well as being new to osTicket, I am also new to MySQL (the tinkering side) and messing with .php

    Going by the first page, #1 has confused me and then #2 on-wards :rolleyes:

    Any help or guidance would be greatly appreciate as the boss man wants a 'site' field adding.

    Thanks,
    DJ.
  • It works fine from support end.

    I have created a userid column in table and it is working well in backend .
    It even works well if user in not logged in and creating a ticket.
    The only glitch is it is not working when user is logged in and trying to create new ticket.
    All i get is Missing or invalid data - check the errors and try again
  • Missing Page to Edit (class.client.php)

    Was working from the original post and noticed that changes to class.client.php were missing.

    When opening a new ticket from a returning user, those new fields will need to be there as well.

    7.) class.client.php
    Add

    $this->newVar		  = $row['newVar'];


    Add

    function getnewVar(){
    return($this->newVar);
    }
  • Still confused

    Hello,

    I am using 1.6v of osTicket and am VERY new with MySQL. Can anyone tell me how to add a field inside of a DB table? I am so lost!!!! Also, can someone re-post the steps with the updated codes that have been changes throughout this whole thread? I just am so lost I don't know if I can do this.
  • Thanks a lot. a very very useful and MOD.
  • Thank you to everyone that has contributed to this. I have added 2 extra fields to the ticket and it all works as expected.

    1 thing I can't work out is how to get 1 of the additional fields to show in the dashboard view???

    I have a couple of customers that log tickets on behalf of their customers. This is the field I have added that I would like to add to the dashboard.

    Many Thanks
    Joe
  • Adding new field to Dashboard

    You can add a new to the header section in include/staff/tickets.inc.php (you'll also have to add it to include/client/tickets.inc.php) and depending on if you want to sort or not, adding the <?=$negorder?><?=$qstr?> code along with it.

    I added "School"

    <th width=\"40\">
    <a href=\"tickets.php?sort=school&order=<?=$negorder?><?=$qstr?>\" title=\"Sort By School <?=$negorder?>\">School</a></th>


    As long as the query after that section is picking up your new field, you should be able to then add the record after the line:

    <tr class=\"<?=$class?> \" id=\"<?=$row['ticket_id']?>\">


    Each after that is the corresponding field in the record.

    I added "School" here as well, but due to it being another table, it's easier to show you the line to find that uses "name" instead.

    <td nowrap><?=Format::truncate($row['name'],22,strpos($row['name'],'@'))?>&nbsp;</td>


    This will not add it to the client view of the tickets.inc.php
  • I have a problems because I have done you explain but, when I started the osticket, I don't view nothing in the page.

    I do changes, I want add to column in the osticket, the name of the column it's "empresa"

    you can help me ?
Sign In or Register to comment.