From 3b327be2ddfd0efb9b3fcb9b11b8a0a1589c4315 Mon Sep 17 00:00:00 2001 From: reliberate Date: Thu, 25 Feb 2016 14:39:28 -0700 Subject: [PATCH] Voicemail: Fixes to Greeting select box. Bypass browser password manager pop-up when saving. --- app/voicemails/voicemail_edit.php | 43 +++++++++++++++++-------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php index 5cc4e6ff4b..1908a4934c 100644 --- a/app/voicemails/voicemail_edit.php +++ b/app/voicemails/voicemail_edit.php @@ -141,9 +141,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "voicemail_uuid, "; $sql .= "voicemail_id, "; $sql .= "voicemail_password, "; - if (strlen($greeting_id) > 0) { - $sql .= "greeting_id, "; - } + $sql .= "greeting_id, "; $sql .= "voicemail_mail_to, "; $sql .= "voicemail_file, "; $sql .= "voicemail_local_after_email, "; @@ -156,9 +154,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'".uuid()."', "; $sql .= "'".$voicemail_id."', "; $sql .= "'".$voicemail_password."', "; - if (strlen($greeting_id) > 0) { - $sql .= "'".$greeting_id."', "; - } + $sql .= (($greeting_id != '') ? "'".$greeting_id."'" : 'null').", "; $sql .= "'".$voicemail_mail_to."', "; $sql .= "'".$voicemail_file."', "; $sql .= "'".$voicemail_local_after_email."', "; @@ -175,12 +171,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $sql = "update v_voicemails set "; $sql .= "voicemail_id = '".$voicemail_id."', "; $sql .= "voicemail_password = '".$voicemail_password."', "; - if (strlen($greeting_id) > 0) { - $sql .= "greeting_id = '".$greeting_id."', "; - } - else { - $sql .= "greeting_id = null, "; - } + $sql .= "greeting_id = ".(($greeting_id != '') ? "'".$greeting_id."'" : 'null').", "; $sql .= "voicemail_mail_to = '".$voicemail_mail_to."', "; $sql .= "voicemail_file = '".$voicemail_file."', "; $sql .= "voicemail_local_after_email = '".$voicemail_local_after_email."', "; @@ -294,6 +285,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $greetings = $prep_statement->fetchAll(PDO::FETCH_NAMED); + echo "
".print_r($greetings, true)."


"; $greeting_count = count($greetings); unset ($prep_statement, $sql); @@ -302,7 +294,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $document['title'] = $text['title-voicemail']; //show the content - echo "
\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -346,8 +338,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; if ($greeting_count > 0) { foreach ($greetings as $greeting) { - $selected = ($greeting['id'] == $greeting_id) ? 'selected' : null; - echo "\n"; + $selected = ($greeting['greeting_id'] == $greeting_id) ? 'selected' : null; + echo "\n"; } } echo " \n"; @@ -445,7 +437,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo " \n"; echo " \n"; } @@ -562,7 +554,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; } echo " "; - echo " \n"; + echo " \n"; unset($sql, $result); echo "
\n"; echo " ".$text['description-forward_destinations']."\n"; @@ -614,13 +606,26 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo "
"; - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo "
"; @@ -311,7 +303,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; - echo " \n"; + echo " \n"; echo "
"; echo "

"; echo "
"; + echo "\n"; + //include the footer require_once "resources/footer.php"; ?> \ No newline at end of file