Hi all

I need a little help in here.

I have made a new field, contain company numbers no problem in that, but after 2 years now, I rely need to search for these numbers?

What do I need to do so I can search in that field or better all field and massage?

Cheers

Jimmy

See lines 133-150 in includes/staff/tickets.inc.php

I have the same problem. I created a new field call "MemberId" and I everything displays correctly but I can't search by that field.

I added this to tickets.inc.php line 130-150

//This sucks..mass scan! search anything that moves!

$deep_search=true;

if($_REQUEST && $_REQUEST=='FT') { //Using full text on big fields.

$qwhere.=" AND ( ticket.email LIKE '%$queryterm%'".

" OR ticket.MemberId LIKE '%$queryterm%'". <--Added this line for my field

" OR ticket.name LIKE '%$queryterm%'".

" OR ticket.subject LIKE '%$queryterm%'".

" OR note.title LIKE '%$queryterm%'".

" OR MATCH(message.message) AGAINST('$queryterm')".

" OR MATCH(response.response) AGAINST('$queryterm')".

" OR MATCH(note.note) AGAINST('$queryterm')".

' ) ';

}else{

$qwhere.=" AND ( ticket.email LIKE '%$queryterm%'".

" OR ticket.name LIKE '%$queryterm%'".

" OR ticket.subject LIKE '%$queryterm%'".

" OR message.message LIKE '%$queryterm%'".

" OR response.response LIKE '%$queryterm%'".

" OR note.note LIKE '%$queryterm%'".

" OR note.title LIKE '%$queryterm%'".

' ) ';

This works for me when memberID is part of the ost_ticket table.

open include/class.ticket.php

on line 46 add

var $memberID;

find this code (should be around line 92)...

$this->row=$row;

and directly above that, insert this line...

$this->memberID =$row;

Your search code in tickets.inc.php should now work properly.

:

Hey teryakisan thanks for the reply.

I checked class.tickets.php and I already have those rows.

I'm pretty new to php and sql both. Could it have to with that I have memberid written out as 'MemberId'?

I consistently wrote it that way but that is the only difference I see with how I added everything.

make sure you have MemberID referenced in BOTH instances of $qwhere.

$deep_search=true;

if($_REQUEST && $_REQUEST=='FT') { //Using full text on big fields.

$qwhere.=" AND ( ticket.email LIKE '%$queryterm%'".

" OR ticket.MemberId LIKE '%$queryterm%'". <--Added this line for my field

" OR ticket.name LIKE '%$queryterm%'".

" OR ticket.subject LIKE '%$queryterm%'".

" OR ticket.subject LIKE '%$queryterm%'".

" OR note.title LIKE '%$queryterm%'".

" OR MATCH(message.message) AGAINST('$queryterm')".

" OR MATCH(response.response) AGAINST('$queryterm')".

" OR MATCH(note.note) AGAINST('$queryterm')".

' ) ';

}else{

$qwhere.=" AND ( ticket.email LIKE '%$queryterm%'".

" OR ticket.MemberId LIKE '%$queryterm%'". <--- ADD IN THIS LINE

" OR ticket.name LIKE '%$queryterm%'".

" OR ticket.subject LIKE '%$queryterm%'".

" OR message.message LIKE '%$queryterm%'".

" OR response.response LIKE '%$queryterm%'".

" OR note.note LIKE '%$queryterm%'".

" OR note.title LIKE '%$queryterm%'".

' ) ';

That was it!

I didn't have it listed in the second instance of $qwhere

Thanks a lot teryakisan!

11 days later

Select List?

Hello, thank you in advance.

I need to add a field named, conveniently enough, location. However, I need a select box, and I am not sure how or where to put the <?=$info?> in /include/client/open.inc.php

Here is an idea of what I am after:

<tr>

<th valign="top">Location:</th>

<td>

<? if($errors) {?> <font class="error"><b>&nbsp;<?=$errors?></b></font><br/><?}?>

<select name="location" >

<option value="Boise HQ">Boise HQ</option>

<option value="Emmett">Emmett</option>

<option value="Nampa">Nampa</option>

<option value="Payette">Payette</option>

<option value="Program Coordination">Program Coordination</option>

<option value="Rupert">Rupert</option>

<option value="Sandcastles">Sandcastles</option>

<option value="Twin Falls">Twin Falls</option>

<option value="Weiser">Weiser</option>

<option value="Other">Other</option>

</select>

</td>

</tr>

Added new field sucessfully but problem at the time of create ticket by Email

Hi,

I added one new field at newticket.php and make changes in other files too.

when i create ticket with user login it woks fine. But when i send an email ticket will not create.

please tell mi what change should i do in Mailfetch.php file.So i cann create ticket via email also.

thanks an adv.

Hello, thank you in advance.

I need to add a field named, conveniently enough, location. However, I need a select box, and I am not sure how or where to put the <?=$info?> in /include/client/open.inc.php

Here is an idea of what I am after:

<tr>

<th valign="top">Location:</th>

<td>

<? if($errors) {?> <font class="error"><b>&nbsp;<?=$errors?></b></font><br/><?}?>

<select name="location" >

<option value="Boise HQ">Boise HQ</option>

<option value="Emmett">Emmett</option>

<option value="Nampa">Nampa</option>

<option value="Payette">Payette</option>

<option value="Program Coordination">Program Coordination</option>

<option value="Rupert">Rupert</option>

<option value="Sandcastles">Sandcastles</option>

<option value="Twin Falls">Twin Falls</option>

<option value="Weiser">Weiser</option>

<option value="Other">Other</option>

</select>

</td>

</tr>

the option value should look like this (based on your last entry there. Replace Other with the option in each case):

<option value="Other" <?=($info=='Other')?'selected':''?>>Other</option>

or at least that works for me in newticket.inc.php I am not using the client side entry of the program

the option value should look like this (based on your last entry there. Replace Other with the option in each case):

<option value="Other" <?=($info=='Other')?'selected':''?>>Other</option>

or at least that works for me in newticket.inc.php I am not using the client side entry of the program

Thank you for your fast response, I will try this. It is probably a moot point as I will be creating my own form anyhow for WordPress integration as per (http://cloudpointoh.com/better-os-ticket-wordpress-integration(http://cloudpointoh.com/better-os-ticket-wordpress-integration)), but I wanted to use the generated form as a skeleton and confirm everything is functioning as it should with osTicket first.

EDIT: One quick question (I don't know PHP) does it become

>Other

for the unselected options? So the entire thing would be

Location:

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

>Boise HQ

>Emmett

>Nampa

>Payette

>Program Coordination

>Rupert

>Sandcastles

>Twin Falls

>Weiser

>Other

Thank you for your fast response, I will try this. It is probably a moot point as I will be creating my own form anyhow for WordPress integration as per (http://cloudpointoh.com/better-os-ticket-wordpress-integration(http://cloudpointoh.com/better-os-ticket-wordpress-integration)), but I wanted to use the generated form as a skeleton and confirm everything is functioning as it should with osTicket first.

EDIT: One quick question (I don't know PHP) does it become

>Other

for the unselected options? So the entire thing would be

Location:

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

>Boise HQ

>Emmett

>Nampa

>Payette

>Program Coordination

>Rupert

>Sandcastles

>Twin Falls

>Weiser

>Other

That looks about right to me. But I am fairly new to PHP myself...

That looks about right to me. But I am fairly new to PHP myself...

Thanks again. I don't have the staff side fully finished yet, but from what I can see in phpMyAdmin it looks to be working correctly.

Maybe someone can use this example in the future and it will help them too.

Now I am running into an issue.

I have a field that I put in that contains the first 5-digits of an internal account number. The issue is that sometimes the first digit is a zero.

Even though I set the type for the field to text in class.ticket.php, and the field in the MySQL table is set to Text, it still strips that leading 0.

Any thoughts?

Thanks so much for the help so far. I am close to getting this to work. The only problem now is that when I add

Users Name:

<?=Format:($ticket->getUsers_Name())?>

to viewticket.inc.php

....everything AFTER that point won't display on the page. I added it after the getName variable and even tried it after other variables and it won't display the value requested nor anything after. I get a blank page after that point.

Any Pointers?

Adding to viewticket.inc.php

I can add some things like Source and Subject, but even when i try VARs that have been standard to OSTicket they do the same.

<?=Format:($ticket->getip_address())?>

And even if i try my new VARs

<?=Format:($ticket->getusers_name())?>

<?=Format:($ticket->getusers_email())?>

I still end up with the viewticket.inc.php, cutting off the rest of the form forward from the point of insertion of any of the above lines.

Please please help...

Thanks

Doesnt matter resolved it, i was using the wrong get name as some are different to the row names.

Getting the new field on the forms but no entry into the database

Hey everyone, this thread has been great but I'm an issue getting entry's into the database. The field shows up fine on the forms, just nothing gets entered into the database. I believe I have it setup correct on the database side. I've attached a zip file containing my php files. Can someone check them over to see where I'm messing up? The field i'm creating is Property Tag, and the variable is prop. The property tag column on the database is:

Column Name: propertytag

Datatype: varchar(45) this might need to be change? Our Tag numbers are 6 numbers.

The options I have: Not Null checked, should this be changed? I don't have anything else selected.

Thanks for the help everyone!

[osticket.zip](https://forum.osticket.com/assets/files/migrated/5/cdebe74dc3629b92b580a0ad62a2233.zip)

Help?

Hey everyone, this thread has been great but I'm an issue getting entry's into the database. The field shows up fine on the forms, just nothing gets entered into the database. I believe I have it setup correct on the database side. I've attached a zip file containing my php files. Can someone check them over to see where I'm messing up? The field i'm creating is Property Tag, and the variable is prop. The property tag column on the database is:

Column Name: propertytag

Datatype: varchar(45) this might need to be change? Our Tag numbers are 6 numbers.

The options I have: Not Null checked, should this be changed? I don't have anything else selected.

Thanks for the help everyone

Can anyone help with this above? I would really appreciate it. I think its just a small thing I'm missing in the code.

Thanks