Did anyone manage to get their new field to display in the open tickets view?

I've had a look through this thread but can't see how to do it. In the passed I've done the Assigned mod (thanks Scott / http://sudobash.net/?p=158(http://sudobash.net/?p=158) )

Going back through i think i can see where to do it, I've now got the column, in my case its company. I used in tickets.inc.php:

<?=Format:($row,22,strpos($row,'@'))?> 

if i change company to name or department they populate but with company there are all blank.

I've checked in a ticket and when its open the company field is populated.

Any ideas?

thanks

Did anyone manage to get their new field to display in the open tickets view?

I've had a look through this thread but can't see how to do it. In the passed I've done the Assigned mod (thanks Scott / http://sudobash.net/?p=158(http://sudobash.net/?p=158) )

Going back through i think i can see where to do it, I've now got the column, in my case its company. I used in tickets.inc.php:

<?=Format:($row,22,strpos($row,'@'))?> 

if i change company to name or department they populate but with company there are all blank.

I've checked in a ticket and when its open the company field is populated.

Any ideas?

thanks

Try here...

(http://osticket.com/forums/showthread.php?t=6227)

Emailed Tickets Not Working

I added some fields using these directions. Now when a user sends an email it will no longer open a new ticket. Help??

a month later

$_POST in Dropdown?

Sure!

1. Create a new table in your database called sector. From PHPMyAdmin you'll run this query.

ALTER TABLE ost_ticket ADD COLUMN sector VARCHAR(50);

2. Next, in client/open.inc.php, you'll need to create an array with all of your options in it. Give it a name that is easy to remember.

$planit_arr = array('not on contract'=>"not on contract",'Planit 500'=>"Planit 500",'Planit 1000'=>"Planit 1000",'Planit 2000'=>"Planit 2000");

3. Lets whoop that messy array into the shape of a nice, neat select dropdown. This function is re-usable for any select!

function showOptionsDrop($array){

$string = '';

foreach($array as $k => $v){

$string .= '<option value="'.$k.'"'.$s.'>'.$v.'</option>'."\n";

}

return $string;

}

4. Now create a select just like you would in HTML, but use the ShowOptionsDrop function in place of the list of options.

Select One

<?php echo showOptionsDrop($planit_arr); ?>

Done and done.

Thx teryakisan, works fine for me, I can adjust so that the field at an incorrect entry form will not reset?

friendly regards

Norbert

We used this modification as well and it looks to be working fine in several areas except for one. If we navigate to the home page and attempt to create a new ticket all of the fields that we modified are there and it works fine. When we log in as a staff member and attempt to create a new ticket via the staff panel all of the fields show up just fine as well. But if we are a user logged into the system and we attempt to create a new ticket all of the fields do not show up properly. We have already attempted to load the original osTicket include/client/open.inc.php and when it is fresh it works fine but with none of the new fields. We can add a few fields to this and it works ok but when we add all of the fields that we need it seems to have a format issue. PM me for the URLs and or/screenshots below is our code for include/client/open.inc.php:

<?php

if(!defined('OSTCLIENTINC')) die('Kwaheri rafiki!'); //Say bye to our friend..

$info=($_POST && $errors)?Format:($_POST)(); //on error...use the post data

?>

<?if($errors) {?>

<?=$errors?>

<?}elseif($msg) {?>

<?=$msg?>

<?}elseif($warn) {?>

<?=$warn?>

<?}?>

Please fill in the form below to open a new ticket.

Company Name:

<?if ($thisclient && ($companyname=$thisclient->getCompanyName())) {

?>

"><?=$companyname?>

<?}else {?>

">

<?}?>

 * <?=$errors?>

Name of Reseller:

<?if ($thisclient && ($nameofreseller=$thisclient->getNameofReseller())) {

?>

"><?=$nameofreseller?>

<?}else {?>

">

<?}?>

 * <?=$errors?>

Purchase Date:

<?if ($thisclient && ($purchasedate=$thisclient->getPurchaseDate())) {

?>

"><?=$purchasedate?>

<?}else {?>

">

<?}?>

 * <?=$errors?>

Manufacturer:

<?if ($thisclient && ($manufacturer=$thisclient->getManufacturer())) {

?>

"><?=$manufacturer?>

<?}else {?>

">

<?}?>

 * <?=$errors?>

Model Number:

<?if ($thisclient && ($companyname=$thisclient->getModelNumber())) {

?>

"><?=$modelnumber?>

<?}else {?>

">

<?}?>

 * <?=$errors?>

MAC Address:

<?if ($thisclient && ($macaddress=$thisclient->getMACAddress())) {

?>

"><?=$macaddress?>

<?}else {?>

">

<?}?>

 * <?=$errors?>

Email Address:

<?if ($thisclient && ($email=$thisclient->getEmail())) {

?>

"><?=$email?>

<?}else {?>

">

<?}?>

 * <?=$errors?>

Telephone:

">

 Ext ">

  <?=$errors?>

 

Help Topic:

Select One

<?

$services= db_query('SELECT topic_id,topic FROM '.TOPIC_TABLE.' WHERE isactive=1 ORDER BY topic');

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

while (list($topicId,$topic) = db_fetch_row($services)){

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

"<?=$selected?>><?=$topic?>

<?

}

}else{?>

General Inquiry

<?}?>

 * <?=$errors?>

Subject:

">

 * <?=$errors?>

Message:

<? if($errors) {?>  <?=$errors?>
<?}?>

<?=$info?>

<?

if($cfg->allowPriorityChange() ) {

$sql='SELECT priority_id,priority_desc FROM '.TICKET_PRIORITY_TABLE.' WHERE ispublic=1 ORDER BY priority_urgency DESC';

if(($priorities=db_query($sql)) && db_num_rows($priorities)){ ?>

Priority:

<?

$info=$info?$info:$cfg->getDefaultPriorityId(); //use system's default priority.

while($row=db_fetch_array($priorities)){ ?>

" <?=$info==$row?'selected':''?> ><?=$row?>

<?}?>

<? }

}?>

<?if(($cfg->allowOnlineAttachments() && !$cfg->allowAttachmentsOnlogin())

|| ($cfg->allowAttachmentsOnlogin() && ($thisclient && $thisclient->isValid()))){

?>

Attachment:

 <?=$errors?>

<?}?>

<?if($cfg && $cfg->enableCaptcha() && (!$thisclient || !$thisclient->isValid())) {

if($_POST && $errors && !$errors)

$errors='Please re-enter the text again';

?>

Captcha Text:

   

 <?=$errors?>

<?}?>

 

13 days later

I broke my site trying to add this mod. Looked easy enough, but now the entire site is broken.

I'll have to try again in the morning. Thank god for osTicket in Cpanel/Fantastico to setup a new osTicket section.

Still no luck with this. I've broken 2 sites now.

7 days later

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

Come to find out that the problem was in the class.ticket.php/step 2 at the very last step. Your new fields cannot be below this entry:

',source='.db_input($source);

21 days later

Dynamic fields in the table

Is it easy to add a dynamic field in registering a new ticket? I want to add like a button to dynamically add a serial number field.

The Button name would be like "Add". Everytime it is click a new text field will be added to the table.

anyone can shed light on this?

8 days later

Is it easy to add a dynamic field in registering a new ticket? I want to add like a button to dynamically add a serial number field.

The Button name would be like "Add". Everytime it is click a new text field will be added to the table.

anyone can shed light on this?

What you can do. Is make a serial generation script with php and make a hidden field where that serial will put and inputted into the db. Once the ticket is submitted, then make a like to where it will pull it.

20 days later

I was successful in utilizing the company additional field and I created my own drop down and was successful in that as well. I will gladly share my files with anyone who may be interested. I have noticed that the search feature does not include any of the additional fields I will work on that next.

I need your help pleaseeee I have spend a lot of time try to create a dropdown field. I read for 2 or 3 times entire posts. I download osticketsfield.zip and create success the company field, but replace the files. But I need a dropdown field . in frontend, staff and database. and could you please share your files to do this ?

Thnaks in advance

11 days later

Has anyone recently installed this and find that the method in OP still works properly? I am looking to add a Price field, but don't want to get started on something that may not work.

10 days later

I followed the below instructions but got the following database error:

Unknown column 'valid_id' in 'field list'

What must I do to correct this?

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

4 days later

Did you carry out step 1 of the instructions (manually adding the field to your MySQL database)?

5 days later

Unknown column 'Support Agreement Ref:' in 'field list'

Hi all, im new to the board, Ive just installed an instance of OS tickets to my site and I've added 2 extra fields and removed the "phone ext" field. I'm getting the same fault on one entry, above. I've logged in to my php admin and added extra fields to the DB.

I've changed the php to each entry to give it a unique name, when I run a query in my SQL it gives me the sane error as Emmanuel.

Do we think that field lists should be quotated not apostrophe ?

Full error above. Does the name need to be exactly the same throughout the code in order for it to work?

14 days later

Scroll down

Hi.

Who can tell me step by step how to make a scroll down box like help topic?

3 months later

confused

:

which steps i have to follow to create a "New Filed" in users new ticket screen and also the same has to get update in staff screen..

pl suggest

3 months later

Take it even further

This is a great post and I have already been able to add two fields, but having a trouble with a third. However, that's not what I am posting about.

Could someone explain what each line of code is for? I am fairly new to PHP, having all of a week and a half of experience, and I have learned a lot, but am really looking to learn more.

Part of why I am asking is I am looking to accomplish something that could benefit from this knowledge. I have created a field called "store", which is a drop down that pulls from a table. I would like to Remove the subject field from displaying on newticket.inc.php, but I still want to record this field to the database. What I want recorded in the subject field is this: - . So it might look something like "Billing - Branch 153".

I am just unsure of where in the function it actually writes to the database. I will play around with and see what happens, but am hoping someone can help me with. I can provide my files if necessary.

TIA for any help that can be provided.