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

Changing "New Ticket" form

Hello everyone,

I have to change "New Ticket" form,
exactly I want to set Email Address field as NOT requied,
and I don't want checking Telephone field validation form,
because we've 3digit extension numbers only (and osticket is working inside
company).

I know, that these changes I can make in .php files
but I don't know exactly in which file.

Best wishes,
Lucas

Comments

  • Do you want this on the staff side or the client side or both?
  • Only on the staff side,
    my it support team will register tickets via phone :)
  • Hey,

    in ../upload/include/class.ticket.php SEARCH:

    * The mother of all functions...You break it you fix it!


    Under that is the code you have to edit. For STAFF you need:

    ...
    }elseif(strcasecmp($origin,'staff')==0){ //tickets created by staff...e.g on callins.
    $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');


    Now you can put a "0" (not required) or "1" (required) behind "'required'=>(0/1),"

    Hope I could help you!

    Greetings,
    Torben
  • OK, right now I will check it.
    Thanx a lot for Your reply:)

    I will write if it works.
    e.
  • Yeah, I put 0 on all 3 positions and it works!

    But I still have problem with valid phone no.
    I wan't to use short form, eg. 888-888
    without checking it is valid or not.

    I tried to comment this:

    //Make sure phone extension is valid
    if($var['phone_ext'] ) {
    if(!is_numeric($var['phone_ext']) && !$errors['phone'])
    $errors['phone']='Invalid phone ext.';
    elseif(!$var['phone']) //make sure they just didn't enter ext without phone #
    $errors['phone']='Phone number required';
    }

    but with no results..

    Regards,
    e.
  • OK,
    I started to search what makes error:
    Valid phone # required

    This is because I fill in the form with too short phone number.
    Valid phone is 9-digits number.

    OK mates,
    How to change that?

    Best Regards,
    e.
    =========================================

    OK< I got it:

    in class.validator.php
    search for:
    function is_phone($phone) {
    $stripped=eregi_replace("(\(|\)|\-|\+)","",ereg_replace("([ ]+)","",$phone));
    return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>13)))?false:true;
    It means that You have to fill in the phone number min 7 digits and max 13.
    So if You need to change it is right place;)
  • what about if we would like to make these required field mods on client sides too? like l would like to disable e-mail required and enable telefon and extantion fields
  • ern;11288 said:
    OK,
    in class.validator.php
    search for:

    Quote:
    function is_phone($phone) {
    $stripped=eregi_replace("(\(|\)|\-|\+)","",ereg_replace("([ ]+)","",$phone));
    return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>13)))?false:true;
    that worked! thanks
  • OK,
    in class.validator.php
    search for:

    Quote:
    function is_phone($phone) {
    $stripped=eregi_replace("(\(|\)|\-|\+)","",ereg_replace("([ ]+)","",$phone));
    return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>13)))?false:true;
    Ok, I have edited this how i wanted it and i still get the following message from my vaildation script "Valid phone # required (type not set)". Anything I'm missing.

    kayla
  • Hello,

    Sorry for bringing up a old topic, but I wanted to do the same as the original post: set Email Address as NOT required for new tickets created by staff.

    I am using version 1.8.1 and I can't find the code to do it. Can anyone help me?

    Thank you very much!
  • This thread is from 2009 and for version 1.6.  It does not work on newer versions than that.
    You currently need to have email address for osT to work properly.  It has been mentioned and discussed that it may be changed in the future.
This discussion has been closed.