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

Unrequire E-Mail Field at new Ticket in Backend

Hi there,

sometimes we have to create a ticket in backend for the internal process. In the most cases we don't have to use an E-Mail address 'cause there is no customer. But in the backend we have to define an E-Mail address, or we get an error.

Is there a possibility to remove the requirement for the E-Mail field in the backend when creating a new ticket? I'd taken a look at the scripts but didn't found something till yet.

Thanks for Help,

Phobius

PS: Sorry for my bad English.

Comments

  • Hey Phobius,

    it's possible and you have to change some things in

    include/class.ticket.php:

    SEARCH:

    $fields['email']    = array('type'=>'email',    'required'=>1, 'error'=>'Valid email required');


    and CUT it out. You will not need it at that place!

    AND PASTE it here:

    if(strcasecmp($origin,'web')==0) { //Help topic only applicable on web tickets.
    $fields['topicId'] = array('type'=>'int', 'required'=>1, 'error'=>'Select help topic');
    $fields['email'] = array('type'=>'email', 'required'=>1, 'error'=>'Valid email required');


    AND here:

    }elseif(strcasecmp($origin,'staff')==0){ //tickets created by staff...e.g on callins.
    $fields['email'] = array('type'=>'email', 'required'=>0, 'error'=>'Valid email required');
    $fields['deptId'] = array('type'=>'int', 'required'=>1, 'error'=>'Dept. required');


    AND SET:
    'required'=>0
    like it is in the code above!

    At the end it has to look like that:

    function create($var,&$errors,$origin,$autorespond=true,$alertstaff=true) {
    global $cfg,$thisclient,$_FILES;

    $id=0;
    $fields=array();
    $fields['name'] = array('type'=>'string', 'required'=>1, 'error'=>'Name required');
    $fields['subject'] = array('type'=>'string', 'required'=>1, 'error'=>'Subject required');
    $fields['message'] = array('type'=>'text', 'required'=>1, 'error'=>'Message required');
    if(strcasecmp($origin,'web')==0) { //Help topic only applicable on web tickets.
    $fields['topicId'] = array('type'=>'int', 'required'=>1, 'error'=>'Select help topic');
    $fields['email'] = array('type'=>'email', 'required'=>1, 'error'=>'Valid email required');
    }elseif(strcasecmp($origin,'staff')==0){ //tickets created by staff...e.g on callins.
    $fields['email'] = array('type'=>'email', 'required'=>0, 'error'=>'Valid email required');
    $fields['deptId'] = array('type'=>'int', 'required'=>1, 'error'=>'Dept. required');
    $fields['source'] = array('type'=>'string', 'required'=>1, 'error'=>'Indicate source');
    $fields['duedate'] = array('type'=>'date', 'required'=>0, 'error'=>'Invalid date - must be MM/DD/YY');
    }else { //Incoming emails
    $fields['emailId'] = array('type'=>'int', 'required'=>0, 'error'=>'Email unknown');
    }
    $fields['pri'] = array('type'=>'int', 'required'=>0, 'error'=>'Invalid Priority');
    $fields['phone'] = array('type'=>'phone', 'required'=>0, 'error'=>'Valid phone # required');


    Hope I could help you!

    Greetings,
    Torben
  • I forgot something...

    To "delete" the "*" behind the E-Mail field you have to edit include/staff/newticket.inc.php

    SEARCH:

    &nbsp;<font class=\"error\"><b>*</b>&nbsp;<?=$errors['email']?></font>


    AND DELETE this column...you will not need it!:)

    Greetings,
    Torben
  • Hi trbn,

    thanks for the quick reply. I will test it when I come home.

    Greets,

    Phobius
  • It works great :)

    Thank you again for your help.
  • sound good, thanks...
  • Email Not Required on Front-end

    Hello,

    How can this procedure be modified so that emails are also not required on the front-end?
  • Hey again,

    it's the same procedure!

    if(strcasecmp($origin,'web')==0) { //Help topic only applicable on web tickets.
    $fields['topicId'] = array('type'=>'int', 'required'=>1, 'error'=>'Select help topic');
    $fields['email'] = array('type'=>'email', 'required'=>0, 'error'=>'Valid email required');


    You have to set
    'required'=>1
    to
    'required'=>0
    like in the code above. You have to be sure that you do that for web tickets!!

    1=required,
    0= NOT required

    Greetings,
    Torben
  • Thanks, this works great. Is there any way to disable sending emails on tickets that are created without an email address though?
  • Thanks for the info but now I would like to check the status of the ticket without entering the mail, what changes are necessary to achieve this?
  • can't get front end to work

    I really need to disable almost all requirements for the users end when they open a new ticket. Really all I need is their name, a message, and a subject line.

    I am talking about the end users submitting a ticket from the website. I have successfully disabled the requirement for when staff punches in a ticket, however, for "web" tickets, it still pops up saying "Valid email required" when submitting a new ticket from "Web".

    I have followed the instructions as per in this thread but it seems that there is just more to it than that in order to get it working for web tickets.

    In addition, in the matrix where you change these requirements, I changed the error message "Valid email required", to "VALIDDDDDDDDD email required". as a test, and it did not have an impact. It still returns "Valid email required".

    Maybe that's internal/log error message and there is another place the email is validated.


    If anybody has any idea that would be great.

    In the meantime I have rigged up a form with sendmail to email a secret email address. This allows me to strip all the requirements. Unfortunately it seems that email is so unreliable these days.
  • update

    update: I was working with the wrong set of files, so everything I said above could be wrong. (Likely is wrong)

    I did create a html form that has invisible input data (noreply@xxxx.com) which makes things nicer for now.
  • spidawg, did you use the same method which trbn provider??
  • @Tay, this thread is 7 years old.. likely not going to work with any current osTicket.
    I suggest using the API and a dummy internal email address. Rather than modifying the core files.
  • edited December 2017
    killing zombie thread with a head shot.

    If you have an issue Please help us to help you by reading and following the posting guidelines located in this thread: Please read before requesting assistance.  The more information you give us the better we will be able to assist you. Thank you.
This discussion has been closed.