Contact - Phone: Adjust to even check same contact for duplicate speed dial numbers.

This commit is contained in:
fusionate 2025-01-28 16:11:21 -07:00
parent fe0680f9b1
commit 9106c7fbfe
No known key found for this signature in database
1 changed files with 3 additions and 3 deletions

View File

@ -163,9 +163,9 @@
$sql .= "from v_contact_phones ";
$sql .= "where phone_speed_dial = :phone_speed_dial ";
$sql .= "and domain_uuid = :domain_uuid ";
if ($action == "update") {
$sql .= "and contact_uuid <> :contact_uuid ";
$parameters['contact_uuid'] = $contact_uuid;
if ($action == "update" && is_uuid($contact_phone_uuid)) {
$sql .= "and contact_phone_uuid <> :contact_phone_uuid ";
$parameters['contact_phone_uuid'] = $contact_phone_uuid;
}
$parameters['phone_speed_dial'] = $phone_speed_dial;
$parameters['domain_uuid'] = $domain_uuid;