Hi there,

I'm using osTicket only for internal purposes, meaning that client is not going to place any tickets, only our own staff. I couldn't find any solution on the existing threads, hope you can help me. Here is what I need:

- In a new ticket, making entering client's email address optional (right now is not optional, you have to fill it out)

- In a new ticket, add the option of selecting not only the department, but also the group. For example, I have the Sales Dept, that has 4 different groups (Sales logistics, Productions, Hotels, Corporate).

I'm using the latest osTicket version. Thanks in advance for your help!

Try this:

Open includes/class.ticket.php, and find:

$fields = array('type'=>'email', 'required'=>1, 'error'=>'Email is required');

The 1 indicates that the field is required, and creates and error when there is no data. Change it to a zero and it is no longer required.

This field in the database is marked as 'NOT NULL', so it MUST have data to insert. If you log into your database you can change the field to 'NULL', and then you should be done.

Thanks PRedmond, I'll try it and let you know. Do you happen to have a solution for the Select Group issue?

In a new ticket, add the option of selecting not only the department, but also the group. For example, I have the Sales Dept, that has 4 different groups (Sales logistics, Productions, Hotels, Corporate).

thanks again!

From PM:

Could you please let me know the correct path?

This depends upon if you are using a local database (ie, on your computer) or a hosted database (ie on a webserver).

If it is a local database, then you can try entering "localhost/phpmyadmin" (without quotes) into your web browser.

If it is a hosted server, it depends upon how it is set up. Usually you have a 'control panel', where you can create a database, create email addresses, etc. Somewhere on this control panel there will be a reference to phpMyAdmin or 'Database Web Access' or similar. If in doubt, contact your web host for directions.

Once you have access to phpMyAdmin you can navigate to the ticket table, click on the 'structure' tab, then click the pencil ('edit') button on the email column. The next page has various options - you want to change the dropbox from 'Not Null' to 'Null'. Then click 'Save' (or is it 'Go'?), and you are done.

Once you have access to phpMyAdmin, it is fairly straight forward!

Hi, I made the changes in the class.ticket.php to 0 and the db, as below and it's still not working, any thoughts?

A) include/class.ticket.php

$fields = array('type'=>'email', 'required'=>0, 'error'=>'Email is required');

b) DB

SQL query:

ALTER TABLE `ost_ticket` CHANGE `email` `email` VARCHAR( 120 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL

What is it not doing? What error are you getting? Do errors appear in the error log?

Situation: Staff trying to make a ticket without filling the email field

What happens:

It shows a pink banner with the message: "Unable to create the ticket. Correct the error(s) and try again" and on the right side of the email field appears "Valid email required".

Let me know the path and I'll let you know what the error log says.

thanks again for your help

Ahh, I think that is because osTicket is running it through the email validator and of course it is failing because it is not a valid email address.

To fix this, you will probably have to edit the validator. Open include/class.validator.php and find:

case 'email':

if(!$this->is_email($this->input)){ // IF NOT email format then...

$this->errors=$field;

}

break;

You want to add a condition so that if the email field is blank, then it still goes ahead. This will prevent users entering random garbage into the field - they will have to either enter a valid email address, or nothing at all.

Try

case 'email':

if ((!$this->is_email($this->input)) OR (!$this->input == '') ){ // IF NOT email format then...

$this->errors=$field;

}

break;

I haven't actually tested this, so you may need to remove the exclamation mark, so it looks like this:

if ((!$this->is_email($this->input)) OR ($this->input == '') ){ // IF NOT email format then...

Either way, it should get you going. Post back which way works, so others can benefit too!

Hi,

Nevermind, it's working now!! thanks again for all your help. Don't want to abuse, but do you have any thoughts on the following thread?

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

thanks again!

OK, you need to use

if ((!$this->is_email($this->input)) OR (!$this->input == '') ){ // IF NOT email format then...

That is, the one with the exclamation mark (!)

There is a second place in class.ticket.php where you need to change

$fields = array('type'=>'email', 'required'=>1, 'error'=>'Email is required');

so the 1 is a 0.

This creates a ticket for me. The downside is that the system is incapable of emailing the client, as there is no email address. The system seems to handle that fairly gracefully...

...but... (isn't there always a but)

the way osTicket knows to append a response to a current ticket, or create a new ticket, seems to be a combination of the ticketID and the users email address... What happens if there is NO email address? I'm not sure. You will find out. There are a couple of theoretical possibilities. ALL responses could be combined into current tickets in a muddled way, all responses could create new tickets, the system could work perfectly...

How will the client log in to review their ticket if they don't have an email address?? It won't work. This means the client is NEVER able to follow up on the ticket: they won't get an email, and they can't log in...

Looks like this is not really a viable option. At least not unless there is another way for the client to follow up on their ticket...

Write a Reply...