Entering phone numbers in osTicket can be a bit frustrating. In our country, the standard format for phone numbers includes plus (+) and minus (-) signs. For example, a mobile number is typically written as +45-123-456789, while a regular landline might look like 08-56485160.
When entering an agent’s phone number in osTicket, I can use + and - without any issues. However, if I enter a 7-digit number, the system automatically reformats it to 123-4567. Similarly, a 10-digit number is converted to (123) 456-7890, following the US standard. This behavior appears to be defined in the include/class.format.php file.
The real problem arises when entering user phone numbers. Regardless of whether the display format is set to US Standard or Unformatted, the system does not retain any formatting. All phone numbers lose the +, -, and parentheses ().
Furthermore:
• 7-digit numbers are not displayed as 123-4567.
• 10-digit numbers are not displayed as (123) 456-7890.
• Any + or - signs entered are stripped out completely.
When entering phone numbers for a Company, I can include + and - signs using either the US Standard or Unformatted setting. However, when adding phone numbers for Organizations, these symbols are removed, regardless of the selected display format—just like with user phone numbers.
Key Issue
The inconsistency stems from the fact that there are at least three different forms for entering phone numbers:
- Company Information
- Organization Information
- Contact Information
Each form appears to handle phone numbers differently, and the selected format setting doesn’t seem to apply consistently across them. As for agent phone numbers, the formatting rules seem entirely separate, and it’s unclear how they are managed.
Proposed Solution
The simplest and most effective solution would be to define the phone number format in one central location—specifically, in the Settings section of the Admin Panel. This would ensure uniform formatting across all forms and eliminate the confusion caused by inconsistent handling of phone numbers.