From 479f1d6134efdea81bea2f4f98ac16497cb9d527 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 20 May 2022 02:10:26 +0000 Subject: [PATCH] Small fix for 'update_lead' delete_lead feature of Non-Agent API git-svn-id: svn://192.168.202.10@3604 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/non_agent_api.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/www/vicidial/non_agent_api.php b/www/vicidial/non_agent_api.php index 9e0b14b3..52f2717b 100644 --- a/www/vicidial/non_agent_api.php +++ b/www/vicidial/non_agent_api.php @@ -194,10 +194,11 @@ # 220307-0937 - Added 'update_presets' function # 220310-0825 - Added DELETE action to the 'update_presets' function # 220312-0944 - Added vicidial_dial_cid_log logging +# 220519-2206 - Small fix for 'update_lead' delete_lead feature # -$version = '2.14-171'; -$build = '220312-0944'; +$version = '2.14-172'; +$build = '220519-2206'; $php_script='non_agent_api.php'; $api_url_log = 0; @@ -14878,6 +14879,11 @@ if ($function == 'update_lead') if ( (strlen($VL_update_SQL)>6) or ($delete_lead=='Y') ) { + if (strlen($VL_update_SQL)>6) + { + $stmt = "UPDATE vicidial_list SET $VL_update_SQL where lead_id='$search_lead_id[$n]';"; + $result_reason = "update_lead LEAD HAS BEEN UPDATED"; + } if ($delete_lead=='Y') { $stmt = "INSERT INTO vicidial_callbacks_archive SELECT * from vicidial_callbacks where lead_id='$search_lead_id[$n]';"; @@ -14893,11 +14899,6 @@ if ($function == 'update_lead') $stmt = "DELETE from vicidial_list where lead_id='$search_lead_id[$n]';"; $result_reason = "update_lead LEAD HAS BEEN DELETED $VCBaffected_rows|$VCBAaffected_rows"; } - if (strlen($VL_update_SQL)>6) - { - $stmt = "UPDATE vicidial_list SET $VL_update_SQL where lead_id='$search_lead_id[$n]';"; - $result_reason = "update_lead LEAD HAS BEEN UPDATED"; - } if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $VLaffected_rows = mysqli_affected_rows($link);