From 1b63f7ba9f285fecd32d218da249ef53e2a86ef2 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 8 Aug 2014 06:49:18 +0000 Subject: [PATCH] If the frequency is not set then do not include it. --- app/call_center/call_center_queue_edit.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/call_center/call_center_queue_edit.php b/app/call_center/call_center_queue_edit.php index 45b7c7dded..aab8e5cb6a 100644 --- a/app/call_center/call_center_queue_edit.php +++ b/app/call_center/call_center_queue_edit.php @@ -196,8 +196,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "queue_discard_abandoned_after, "; $sql .= "queue_abandoned_resume_allowed, "; $sql .= "queue_cid_prefix, "; - $sql .= "queue_announce_sound, "; - $sql .= "queue_announce_frequency, "; + if (strlen($queue_announce_sound) > 0) { + $sql .= "queue_announce_sound, "; + } + if (strlen($queue_announce_frequency) > 0) { + $sql .= "queue_announce_frequency, "; + } $sql .= "queue_description "; $sql .= ")"; $sql .= "values "; @@ -221,8 +225,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$queue_discard_abandoned_after', "; $sql .= "'$queue_abandoned_resume_allowed', "; $sql .= "'$queue_cid_prefix', "; - $sql .= "'$queue_announce_sound', "; - $sql .= "'$queue_announce_frequency', "; + if (strlen($queue_announce_sound) > 0) { + $sql .= "'$queue_announce_sound', "; + } + if (strlen($queue_announce_frequency) > 0) { + $sql .= "'$queue_announce_frequency', "; + } $sql .= "'$queue_description' "; $sql .= ")"; $db->exec(check_sql($sql));