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

Create ticket without required phone number?

I would like my users to be able to enter an extension without entering a phone number. Right now if you try to submit a ticket with an extension but no phone number it says "Phone number required". So you can put a phone with no extension, or no phone at all, but as soon as you put in an extension by itself you get "Phone number required". I know that you can edit class.ticket.php to turn off and on required fields and I see code which specifically states "Make sure phone extension is valid" in two places, but it seems as though if I comment those sections out, or even delete them it doesn't change anything. I doesn't help that I know zip about programming :rolleyes:

Ultimately, what I'd like to do is ensure that they IF they enter an extension that A: It doesn't require a phone number and B: That the system validates that the extension is four digits.

Any help would be very much appreciated!

P.S. I accidentally originally posted this in the troubleshooting section and can't figure out how to delete/relocate it.

Comments

  • have you found a solution to this? I'm trying to do the same.
  • function getPhoneNumber(){
    $phone=Format::phone($this->getPhone());
    if(($ext=$this->getPhoneExt()))
    $phone.=" $ext";

    return $phone;
    }


    \include\class.ticket.php

    lines 1104 - 1110
    locate

            //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';
    }[code]

    I believe commenting out the

    [code] //elseif(!$var['phone']) //make sure they just didn't enter ext without phone #
    //$errors['phone']='Phone number required'


    would have the desired effect. I have no idea if it would cause other problems or not though.
  • Thank you. That seems to work. I'm on version 1.7.1.1 and in the \include\class.ticket.php file there were actually 2 locations with the "make sure phone extension is valid".

    1629 and 1902. When I commented the lines in section 1902 it worked. I'm not sure why it's also in 1629 section. I commented it out at both locations anyway. It seems to work okay.
  • dannyyo;44828 said:
    Thank you. That seems to work. I'm on version 1.7.1.1 and in the \include\class.ticket.php file there were actually 2 locations with the "make sure phone extension is valid".

    1629 and 1902. When I commented the lines in section 1902 it worked. I'm not sure why it's also in 1629 section. I commented it out at both locations anyway. It seems to work okay.
    Then you probably should have started your own thread in the 1.7 section of the forums. This is posted in the 1.6 section. :) Going to close this thread since its solved.
This discussion has been closed.