Version #

Hey how you doing.

I was just wondering if you know the version number of this? I think this should work with freeTicket 1.0b? I read that free ticket is another version that is osticket.

any advice would be cool.

thanks

Hey all,

I have successfully created the company field per the original poster's instructions and was able to get it to add the company field to the staff ticket list. All you have to do is add the column named company to your ost_ticket table.

I currently have a base os ticket install so if you to have a base install the attached files will add this field for you. The zip file has 6 files in it. When you unzip it it should create two directories one is clients the other is staff. One file should be outside these two directories.

This should make it a lot easier for anyone else trying to do this. If you want to see what i did just open the files and do a search for company and you will find my changes. The files go in the following locations:

Loose File

class.ticket.php /include

Client Folder in Zip

open.inc.php /include/client

viewticket.inc.php /include/client

Staff Folder in Zip

newticket.inc.php /include/staff

tickets.inc.php /incllude/staff

viewticket.inc.php /include/staff

I hope this helps everyone out there.

J

it wont work

so I've tried it with freeTicket 1.0b and it wont work.

i'm gonna try on osticket 1.6 and see if it works. But I'm thinking this was done up for version 1.6?

so I've tried it with freeTicket 1.0b and it wont work.

i'm gonna try on osticket 1.6 and see if it works. But I'm thinking this was done up for version 1.6?

This Mod does work with the current version.

Can I buy a zip with all the working code?

Hi, Just install osTicket and joined the Forum. I need to add additional fields as well. Seems complicated. Anybody willing to supply or sell all neccessary files modified?

Drachsi

Blank page after follow the steps

Hi,

I am getting blank page for after follow all the steps given, nothing appear, no track status no open new ticket, all is blank.

There have been a lot of questions about how to add a new field to the ticket and rightly so, the more info a user can provide the better. For our purposes we wanted to add a Company field so we knew exactly who we were dealing with.

We added the field successfully and this thread explains the process. As a favor, can someone help us with adding that new field to the "tickets.inc.php" page?!?! It would be greatly appreciated. We'd like to be able to see Company in that table as a column where you see the ticket id, date, department, priority etc.

To add a new field there are 6 places you have to go to accomplish your goal.

MySQL Database: manually add a field to ost_Ticket

support/include/class.ticket.php

support/include/client/open.inc.php

support/include/client/viewticket.inc.php

include/staff/viewticket.inc.php

include/staff/newticket.inc.php

2.) class.ticket.php

Add your variable here:

class Ticket{

var $id;

var $extid;

var $email;

var $status;

var $created;

var $updated;

var $priority;

and here: like so ($this->newvar=$row;)

if(($res=db_query($sql)) && db_num_rows($res)):

$row=db_fetch_array($res);

$this->id =$row;

$this->extid =$row;

$this->email =$row;

$this->fullname =$row;

and here:

//GET

function getId(){

return $this->id;

}

function getExtId(){

return $this->extid;

}

function getEmail(){

return $this->email;

}

function getNewvar(){

return $this->newvar;

}

and here:

function create($var,&$errors,$origin,$autorespond=true,$alertstaff=true) {

global $cfg,$thisclient,$_FILES;

$id=0;

$fields=array();

$fields = array('type'=>'string', 'required'=>1, 'error'=>'newvar required');

and finally:

$extId=Ticket:();

$sql= 'INSERT INTO '.TICKET_TABLE.' SET created=NOW() '.

',ticketID='.db_input($extId).

',dept_id='.db_input($deptId).

',priority_id='.db_input($priorityId).

',email='.db_input($var).

',name='.db_input(Format:($var)).

',newvar='.db_input(Format:($var)).

3.) open.inc.php Copy info from other the other fields, just make sure the new field php scripts are different.

4.) viewticket.inc.php Repeat Step 3

5.) staff/viewticket.inc.php Repeat Step 4

4.) staff/newticket.inc.php Repeat Step 5

add new field

Hi,

Anyone can help me with adding new field?

I tried twice, the new field I created appear, but when I opened created ticket, I cant reply to that ticket. No message box etc, just the title.

I need two field username and passwd

Thank you.

new field created successfully but not working

Hi,

I have created new field successfully.

Can see in open new ticket, but whatever input in the new 2 field does not appear after submiited.

It works fine when I use admin and edit the ticket, I input edit in the 2 new field, it works fine, but not working when user input in open new ticket.

Is this have any wrong in open.inc.php?

Adding a Dropdown

New to osTicket, PHP, and MySQL. A task at work for me is to add a dropdown menu with different options available. Has anyone mastered this yet? Everytime I go through the process of adding a field as described at the beginning of the forum, I end up with a blank web page. Help!

Not a great deal of good at PHP/MySQL but I can tell you the following:

No, the original mod does not completely work for 1.6ST.

Yes, it displays fine (if you've done it correctly) and reads from the DB fine.

No, it is not saving to the DB. This should give you a few hints as to where to start looking for bugs. ;-)

I have finally figured it out. My install was messed up and had to do a fresh install.

This info on how to setup new fields is from a brand new install.

No other mods installed.

I have also included the files for download. Just add the correct database entry and they are plug and play.

The database entry was

Field: level

TypeDocumentation: VARCHAR

Length/Values: 32

Collation: latin1_swedish_ci

Attributes: Leave blank

Null: Null or Not Null "your choice"

Default2: 0

Extra: Leave blank

Primary: not checked

Index: not checked

Unique: not checked

---: Checked

Fulltext: Checked

Comments: Blank

I have not done the staff area yet. I will post those when i am finished.

Hope this helps some of you.

Hi, I tried to do all that you have here but when I hit submit it just gives me an error saying that I need to fill oall the boxes correct and each has something it it.

Im not sure whats going on wrong here..

any help?

5 days later

Hi, I tried to do all that you have here but when I hit submit it just gives me an error saying that I need to fill oall the boxes correct and each has something it it.

Im not sure whats going on wrong here..

any help?

Have you gone through scp/tickets.php (I think) and changed the appropriate lines from required=1 to required=0?

2 months later

Awesome Tutorial!

This works perfectly! Thanks

Hi all!

this description here was very useful but I am trying to implement a dropdown menu in the frontend which has the same function as the "Topic" menu.

I created an additional table in database with the same structure as th topic table, named ost_lkw (german abbreviation for truck).

blank

I also added this line into the main.inc.php

define('LKW_TABLE',TABLE_PREFIX.'lkw');

I have also added two more fields into the ticket table.

lkw_id

lkw

The following code was added to the open.inc.php

<tr>

<th>Fahrzeug:</th>

<td>

<select name="lkwId">

<option value="" selected >bitte w&auml;hlen...</option>

<?

$services= db_query('SELECT lkw_id,lkw FROM '.LKW_TABLE.' WHERE isactive=1 ORDER BY lkw');

if($services && db_num_rows($services)) {

while (list($lkwId,$lkw) = db_fetch_row($services)){

$selected = ($info==$lkwId)?'selected':''; ?>

<option value="<?=$lkwId?>"<?=$selected?>><?=$lkw?></option>

<?

}

}else{?>

<option value="0" >keine Zuordnung</option>

<?}?>

</select>

&nbsp;<font class="error">*&nbsp;<?=$errors?></font>

</td>

</tr>

I would like to create a dropdown selection of all trucks (menu filled with the data from ost_trucks). So its the same way like the selection of 'Topic'

The code is complex.

Maybe there is already an answer for my question in this forum here?

th

11 days later

Add new field in new tickets

Hi I use this great software, but I need to add a new drop down menu before the department selection. I read the guide to add this, but when I insert new ticket (compile all form requred ) the software response me with error. Don't create the ticket because in necessary the new filed just added, but I have insert the data...the field contein the data...I don't understand....

Thanks for future support..

4 days later

Doesn't Update SQL Database

Hi All,

I am very new with OSTicket, but do have some experience with SQL and PHP. I followed the instructions, and everything works as it should, except that the SQL database doesn't get updated with the new information. I am trying to have the user select which building (from a drop down list) they are in.

I have attached the code in a zip of the few classes that needed to be modified.

Any help would be greatly appreciated. I have spent most of the day trying to figure this one out. If I manually put a building ID into the database (in a ticket in the ticket table), it will correctly display the building, but it won't actually create the ticket with the building id included.

Thanks!

Andy

[upload.zip](https://forum.osticket.com/assets/files/migrated/1/93658fadbbd57d2cefa01a9409c3d5b.zip)

a month later

Fetch Mail not working after new field

Hi there,

Fetch Mail is not working after creating the new field as per Frink09 instructions which vintagekruzer posted earlier.

any help?

fixed

Hi there,

Fetch Mail is not working after creating the new field as per Frink09 instructions which vintagekruzer posted earlier.

any help?

I fixed this, the problem was that the new field i create was set in the db not to be null,i.e.required field, as the fetchmail function was not able to populate that field emails were not been fetched.

jkisner Thanks!

I just wanted to say thanks to jkisner for his zip file and information.

This worked a treat and I have hopefully learnt something today!

7 days later

Developers hear our plea

I have looked at literally more than a dozen ticket systems free and paid from rt to spiceworks, eticket, mantis and everything in between. OSTickets is by far the best fit for us because it's simple but offers good features. The one break the camel back feature it doesn't have is the ability to add custom fields, edit custom fields, and search custom fields. I think the pouplarity of this thread should let everyone know that this should be on the 1.7 or 2.0 roadmap. Until then ill use this hack.

David

One Last Note

Thanks to Frink09 for the origional hack and directions and a huge thanks to jkisner for the post on page 14, as programmer myself, your company field add made it very easy for me to track down all the changes and make my own, complete with 9 new fields including dropdowns powered by mysql tables and i will be able to sync up these tables to another database and run custom crystal reports to see how much time and money, are spent on tickets by division, customer etc. I also be able to see frequency of tickets by problem, department, and division! Now I just need to hack it to edit my custom fields and im business (and i see its all in class.tickets.php file.) God Bless Open Source and OSTicket!

This hack makes osTicket truly a fantatsic solution, thanks to everyone, and if you read this far and you are still lost go back to page 14 and read jkisner's post and download his 6 file hack.

Perfect guys just perfect.