diff --git a/CHANGELOG.md b/CHANGELOG.md
index b802af8a..04a0a3ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,44 @@
This file documents all notable changes made to ITFlow.
+## [25.03.4]
+
+### Fixed
+- Ability to remove additional assets from the ticket details screen.
+- Fix the ability to remove assets from edit ticket not working when only 1 asset exists.
+- Fix Database Backup corruption.
+- Client Portal - show ticket number instead of ticket id in ticket listing.
+- Add Purchase Reference to copy asset.
+- Add Link to asset details from the global search.
+- Fix Bulk assign ticket only showing contacts instead of ITFlow users.
+
+
+## [25.03.3]
+
+### Fixed
+- Fix adding ITFlow user.
+- Do not alert on inactive recurring invoices.
+- Fix ticket user assignment including bulk assignment.
+- Fix adding a location phone extension.
+- Do not default to +1 Country code, instead default to null.
+- Do not format numbers unless a country code is entered.
+- Fix editing network location.
+- Fix ticket redaction on client replies.
+- Remove more from user activity as it requires admin privledges.
+- Fix MFA Enforcement page.
+
+## [25.03.2]
+
+### Fixed
+- Revert DB.sql change
+
+## [25.03.1]
+
+### Fixed
+- Phone number missing in various sections.
+- Match Database.
+- Client Export Only display licenses users and assets from the selected client only.
+
## [25.03]
### Fixed
diff --git a/admin_settings_company.php b/admin_settings_company.php
index 3b9a3fc1..dceee89e 100644
--- a/admin_settings_company.php
+++ b/admin_settings_company.php
@@ -119,7 +119,7 @@ $company_initials = nullable_htmlentities(initials($company_name));
";
diff --git a/contact_details.php b/contact_details.php
index f77f7051..f77ff726 100644
--- a/contact_details.php
+++ b/contact_details.php
@@ -32,7 +32,7 @@ if (isset($_GET['contact_id'])) {
$contact_phone = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_phone_country_code));
$contact_extension = nullable_htmlentities($row['contact_extension']);
$contact_mobile_country_code = nullable_htmlentities($row['contact_mobile_country_code']);
- $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_phone'], $contact_mobile_country_code));
+ $contact_mobile = nullable_htmlentities(formatPhoneNumber($row['contact_mobile'], $contact_mobile_country_code));
$contact_email = nullable_htmlentities($row['contact_email']);
$contact_photo = nullable_htmlentities($row['contact_photo']);
$contact_pin = nullable_htmlentities($row['contact_pin']);
diff --git a/database_updates.php b/database_updates.php
index 1cc29ceb..3a7a593e 100644
--- a/database_updates.php
+++ b/database_updates.php
@@ -3424,10 +3424,43 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.2'");
}
- // if (CURRENT_DATABASE_VERSION == '2.1.2') {
- // // Insert queries here required to update to DB version 2.1.3
+ if (CURRENT_DATABASE_VERSION == '2.1.2') {
+
+ // Update country_code to NULL for `contacts` table
+ mysqli_query($mysqli, "ALTER TABLE `contacts` MODIFY `contact_phone_country_code` VARCHAR(10) DEFAULT NULL");
+ mysqli_query($mysqli, "ALTER TABLE `contacts` MODIFY `contact_mobile_country_code` VARCHAR(10) DEFAULT NULL");
+
+ // Update country_code to NULL for `locations` table
+ mysqli_query($mysqli, "ALTER TABLE `locations` MODIFY `location_phone_country_code` VARCHAR(10) DEFAULT NULL");
+ mysqli_query($mysqli, "ALTER TABLE `locations` MODIFY `location_fax_country_code` VARCHAR(10) DEFAULT NULL");
+
+ // Update country_code to NULL for `vendors` table
+ mysqli_query($mysqli, "ALTER TABLE `vendors` MODIFY `vendor_phone_country_code` VARCHAR(10) DEFAULT NULL");
+
+ // Update country_code to NULL for `companies` table
+ mysqli_query($mysqli, "ALTER TABLE `companies` MODIFY `company_phone_country_code` VARCHAR(10) DEFAULT NULL");
+
+ // Set country_code to NULL for `contacts` table
+ mysqli_query($mysqli, "UPDATE `contacts` SET `contact_phone_country_code` = NULL");
+ mysqli_query($mysqli, "UPDATE `contacts` SET `contact_mobile_country_code` = NULL");
+
+ // Set country_code to NULL for `locations` table
+ mysqli_query($mysqli, "UPDATE `locations` SET `location_phone_country_code` = NULL");
+ mysqli_query($mysqli, "UPDATE `locations` SET `location_fax_country_code` = NULL");
+
+ // Set country_code to NULL for `vendors` table
+ mysqli_query($mysqli, "UPDATE `vendors` SET `vendor_phone_country_code` = NULL");
+
+ // Set country_code to NULL for `companies` table
+ mysqli_query($mysqli, "UPDATE `companies` SET `company_phone_country_code` = NULL");
+
+ mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.3'");
+ }
+
+ // if (CURRENT_DATABASE_VERSION == '2.1.3') {
+ // // Insert queries here required to update to DB version 2.1.4
// // Then, update the database to the next sequential version
- // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.3'");
+ // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.1.4'");
// }
} else {
diff --git a/db.sql b/db.sql
index e7e25b7d..bfb82256 100644
--- a/db.sql
+++ b/db.sql
@@ -546,7 +546,7 @@ CREATE TABLE `companies` (
`company_state` varchar(200) DEFAULT NULL,
`company_zip` varchar(200) DEFAULT NULL,
`company_country` varchar(200) DEFAULT NULL,
- `company_phone_country_code` varchar(10) DEFAULT '1',
+ `company_phone_country_code` varchar(10) DEFAULT NULL,
`company_phone` varchar(200) DEFAULT NULL,
`company_email` varchar(200) DEFAULT NULL,
`company_website` varchar(200) DEFAULT NULL,
@@ -680,10 +680,10 @@ CREATE TABLE `contacts` (
`contact_name` varchar(200) NOT NULL,
`contact_title` varchar(200) DEFAULT NULL,
`contact_email` varchar(200) DEFAULT NULL,
- `contact_phone_country_code` varchar(10) DEFAULT '1',
+ `contact_phone_country_code` varchar(10) DEFAULT NULL,
`contact_phone` varchar(200) DEFAULT NULL,
`contact_extension` varchar(200) DEFAULT NULL,
- `contact_mobile_country_code` varchar(10) DEFAULT '1',
+ `contact_mobile_country_code` varchar(10) DEFAULT NULL,
`contact_mobile` varchar(200) DEFAULT NULL,
`contact_photo` varchar(200) DEFAULT NULL,
`contact_pin` varchar(255) DEFAULT NULL,
@@ -1115,10 +1115,10 @@ CREATE TABLE `locations` (
`location_city` varchar(200) DEFAULT NULL,
`location_state` varchar(200) DEFAULT NULL,
`location_zip` varchar(200) DEFAULT NULL,
- `location_phone_country_code` varchar(10) DEFAULT '1',
+ `location_phone_country_code` varchar(10) DEFAULT NULL,
`location_phone` varchar(200) DEFAULT NULL,
`location_phone_extension` varchar(10) DEFAULT NULL,
- `location_fax_country_code` varchar(10) DEFAULT '1',
+ `location_fax_country_code` varchar(10) DEFAULT NULL,
`location_fax` varchar(200) DEFAULT NULL,
`location_hours` varchar(200) DEFAULT NULL,
`location_photo` varchar(200) DEFAULT NULL,
@@ -2468,7 +2468,7 @@ CREATE TABLE `vendors` (
`vendor_name` varchar(200) NOT NULL,
`vendor_description` varchar(200) DEFAULT NULL,
`vendor_contact_name` varchar(200) DEFAULT NULL,
- `vendor_phone_country_code` varchar(10) DEFAULT '1',
+ `vendor_phone_country_code` varchar(10) DEFAULT NULL,
`vendor_phone` varchar(200) DEFAULT NULL,
`vendor_extension` varchar(200) DEFAULT NULL,
`vendor_email` varchar(200) DEFAULT NULL,
@@ -2498,4 +2498,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2025-03-26 11:13:46
+-- Dump completed on 2025-03-31 12:05:41
diff --git a/functions.php b/functions.php
index aac5502c..31008b8d 100644
--- a/functions.php
+++ b/functions.php
@@ -194,140 +194,161 @@ function truncate($text, $chars) {
}
function formatPhoneNumber($phoneNumber, $country_code = '', $show_country_code = false) {
-
// Remove all non-digit characters
$digits = preg_replace('/\D/', '', $phoneNumber);
$formatted = '';
+ // If no digits at all, fallback early
+ if (strlen($digits) === 0) {
+ return $phoneNumber;
+ }
+
+ // Helper function to safely check the first digit
+ $startsWith = function($str, $char) {
+ return isset($str[0]) && $str[0] === $char;
+ };
+
switch ($country_code) {
- case '1': // USA/Canada — (123) 456-7890
+ case '1': // USA/Canada
if (strlen($digits) === 10) {
$formatted = '(' . substr($digits, 0, 3) . ') ' . substr($digits, 3, 3) . '-' . substr($digits, 6);
}
break;
- case '44': // UK — 07123 456 789
- if ($digits[0] === '0') $digits = substr($digits, 1);
+ case '44': // UK
+ if ($startsWith($digits, '0')) {
+ $digits = substr($digits, 1);
+ }
if (strlen($digits) === 10) {
$formatted = '0' . substr($digits, 0, 4) . ' ' . substr($digits, 4, 3) . ' ' . substr($digits, 7);
}
break;
- case '61': // Australia — 0412 345 678
- if ($digits[0] === '0') $digits = substr($digits, 1);
+ case '61': // Australia
+ if ($startsWith($digits, '0')) {
+ $digits = substr($digits, 1);
+ }
if (strlen($digits) === 9) {
$formatted = '0' . substr($digits, 0, 4) . ' ' . substr($digits, 4, 3) . ' ' . substr($digits, 7);
}
break;
- case '91': // India — 91234 56789
+ case '91': // India
if (strlen($digits) === 10) {
$formatted = substr($digits, 0, 5) . ' ' . substr($digits, 5);
}
break;
- case '81': // Japan — 03-1234-5678
- if ($digits[0] === '0') $digits = substr($digits, 1);
+ case '81': // Japan
+ if ($startsWith($digits, '0')) {
+ $digits = substr($digits, 1);
+ }
if (strlen($digits) >= 9 && strlen($digits) <= 10) {
$formatted = '0' . substr($digits, 0, 2) . '-' . substr($digits, 2, 4) . '-' . substr($digits, 6);
}
break;
- case '49': // Germany — 030 12345678
- if ($digits[0] === '0') $digits = substr($digits, 1);
+ case '49': // Germany
+ if ($startsWith($digits, '0')) {
+ $digits = substr($digits, 1);
+ }
if (strlen($digits) >= 10) {
$formatted = '0' . substr($digits, 0, 3) . ' ' . substr($digits, 3);
}
break;
- case '33': // France — 01 23 45 67 89
- if ($digits[0] === '0') $digits = substr($digits, 1);
+ case '33': // France
+ if ($startsWith($digits, '0')) {
+ $digits = substr($digits, 1);
+ }
if (strlen($digits) === 9) {
$formatted = '0' . implode(' ', str_split($digits, 2));
}
break;
- case '34': // Spain — 612 345 678
+ case '34': // Spain
if (strlen($digits) === 9) {
$formatted = substr($digits, 0, 3) . ' ' . substr($digits, 3, 3) . ' ' . substr($digits, 6);
}
break;
- case '39': // Italy — 312 345 6789
- if ($digits[0] === '0') $digits = substr($digits, 1);
+ case '39': // Italy
+ if ($startsWith($digits, '0')) {
+ $digits = substr($digits, 1);
+ }
$formatted = '0' . implode(' ', str_split($digits, 3));
break;
- case '55': // Brazil — (11) 91234-5678
+ case '55': // Brazil
if (strlen($digits) === 11) {
$formatted = '(' . substr($digits, 0, 2) . ') ' . substr($digits, 2, 5) . '-' . substr($digits, 7);
}
break;
- case '7': // Russia — 8 (912) 345-67-89
- if ($digits[0] === '8') $digits = substr($digits, 1);
+ case '7': // Russia
+ if ($startsWith($digits, '8')) {
+ $digits = substr($digits, 1);
+ }
if (strlen($digits) === 10) {
$formatted = '8 (' . substr($digits, 0, 3) . ') ' . substr($digits, 3, 3) . '-' . substr($digits, 6, 2) . '-' . substr($digits, 8);
}
break;
- case '86': // China — 138 0013 8000
+ case '86': // China
if (strlen($digits) === 11) {
$formatted = substr($digits, 0, 3) . ' ' . substr($digits, 3, 4) . ' ' . substr($digits, 7);
}
break;
- case '82': // South Korea — 010-1234-5678
+ case '82': // South Korea
if (strlen($digits) === 11) {
$formatted = substr($digits, 0, 3) . '-' . substr($digits, 3, 4) . '-' . substr($digits, 7);
}
break;
- case '62': // Indonesia — 0812 3456 7890
- if ($digits[0] !== '0') $digits = '0' . $digits;
+ case '62': // Indonesia
+ if (!$startsWith($digits, '0')) {
+ $digits = '0' . $digits;
+ }
if (strlen($digits) === 12) {
$formatted = substr($digits, 0, 4) . ' ' . substr($digits, 4, 4) . ' ' . substr($digits, 8);
}
break;
- case '63': // Philippines — 0912 345 6789
+ case '63': // Philippines
if (strlen($digits) === 11) {
$formatted = substr($digits, 0, 4) . ' ' . substr($digits, 4, 3) . ' ' . substr($digits, 7);
}
break;
- case '234': // Nigeria — 0801 234 5678
- if ($digits[0] !== '0') $digits = '0' . $digits;
+ case '234': // Nigeria
+ if (!$startsWith($digits, '0')) {
+ $digits = '0' . $digits;
+ }
if (strlen($digits) === 11) {
$formatted = substr($digits, 0, 4) . ' ' . substr($digits, 4, 3) . ' ' . substr($digits, 7);
}
break;
- case '27': // South Africa — 082 123 4567
+ case '27': // South Africa
if (strlen($digits) >= 9 && strlen($digits) <= 10) {
$formatted = substr($digits, 0, 3) . ' ' . substr($digits, 3, 3) . ' ' . substr($digits, 6);
}
break;
- case '971': // UAE — 050 123 4567
+ case '971': // UAE
if (strlen($digits) === 9) {
$formatted = substr($digits, 0, 3) . ' ' . substr($digits, 3, 3) . ' ' . substr($digits, 6);
}
break;
default:
- // If no match, do nothing here and use fallback below
+ // fallback — do nothing, use raw digits later
break;
}
- // Fallback if formatting failed
- if (!$formatted && strlen($digits) >= 7) {
- $formatted = substr($digits, 0, 3) . ' ' . substr($digits, 3, 3) . ' ' . substr($digits, 6);
- }
-
- // Still no formatting? Use raw digits
if (!$formatted) {
- $formatted = $digits ?: $phoneNumber; // Use original input if digits are empty
+ $formatted = $digits ?: $phoneNumber;
}
return $show_country_code && $country_code ? "+$country_code $formatted" : $formatted;
diff --git a/global_search.php b/global_search.php
index 045c6ed5..7e64d5d3 100644
--- a/global_search.php
+++ b/global_search.php
@@ -721,7 +721,6 @@ if (isset($_GET['query'])) {
} else {
$asset_serial_display = $asset_serial;
}
- $asset_mac = nullable_htmlentities($row['asset_mac']);
$asset_uri = nullable_htmlentities($row['asset_uri']);
$asset_status = nullable_htmlentities($row['asset_status']);
$asset_created_at = nullable_htmlentities($row['asset_created_at']);
@@ -746,9 +745,9 @@ if (isset($_GET['query'])) {
?>
-
+
-
+
diff --git a/includes/app_version.php b/includes/app_version.php
index 956cbfa0..f7d4a284 100644
--- a/includes/app_version.php
+++ b/includes/app_version.php
@@ -5,4 +5,4 @@
* Update this file each time we merge develop into master. Format is YY.MM (add a .v if there is more than one release a month.
*/
-DEFINE("APP_VERSION", "25.03");
+DEFINE("APP_VERSION", "25.03.4");
diff --git a/includes/database_version.php b/includes/database_version.php
index 021f1386..66ba4bf3 100644
--- a/includes/database_version.php
+++ b/includes/database_version.php
@@ -5,4 +5,4 @@
* It is used in conjunction with database_updates.php
*/
-DEFINE("LATEST_DATABASE_VERSION", "2.1.2");
+DEFINE("LATEST_DATABASE_VERSION", "2.1.3");
diff --git a/mfa_enforcement.php b/mfa_enforcement.php
index 74c0a40c..289ef2fb 100644
--- a/mfa_enforcement.php
+++ b/mfa_enforcement.php
@@ -1,7 +1,7 @@
-
+