diff --git a/app/voicemail_greetings/app_languages.php b/app/voicemail_greetings/app_languages.php index fb7dc42d92..a10a114994 100644 --- a/app/voicemail_greetings/app_languages.php +++ b/app/voicemail_greetings/app_languages.php @@ -1,6 +1,6 @@  $value) { + require_once "app_languages.php"; + foreach($text as $key => $value) { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } @@ -48,7 +48,7 @@ if (count($_GET)>0) { if (strlen($id)>0) { //get the greeting filename $sql = "select * from v_voicemail_greetings "; - $sql .= "where greeting_uuid = '$id' "; + $sql .= "where voicemail_greeting_uuid = '$id' "; $sql .= "and domain_uuid = '$domain_uuid' "; $sql .= "and voicemail_id = '$voicemail_id' "; $prep_statement = $db->prepare(check_sql($sql)); @@ -62,7 +62,7 @@ if (strlen($id)>0) { //delete recording from the database $sql = "delete from v_voicemail_greetings "; - $sql .= "where greeting_uuid = '$id' "; + $sql .= "where voicemail_greeting_uuid = '$id' "; $sql .= "and domain_uuid = '$domain_uuid' "; $sql .= "and voicemail_id = '$voicemail_id' "; $prep_statement = $db->prepare(check_sql($sql)); @@ -80,7 +80,7 @@ if (strlen($id)>0) { require_once "includes/header.php"; echo "\n"; echo "
\n"; - echo "".$text['confirm-delete-2']."\n"; + echo "".$text['confirm-delete']."\n"; echo "
\n"; require_once "includes/footer.php"; return; diff --git a/app/voicemail_greetings/voicemail_greeting_edit.php b/app/voicemail_greetings/voicemail_greeting_edit.php index f9300d6023..262cecb337 100644 --- a/app/voicemail_greetings/voicemail_greeting_edit.php +++ b/app/voicemail_greetings/voicemail_greeting_edit.php @@ -43,7 +43,7 @@ else { //set the action as an add or an update if (isset($_REQUEST["id"])) { $action = "update"; - $greeting_uuid = check_str($_REQUEST["id"]); + $voicemail_greeting_uuid = check_str($_REQUEST["id"]); } else { $action = "add"; @@ -51,7 +51,7 @@ else { //get the form value and set to php variables $voicemail_id = check_str($_REQUEST["voicemail_id"]); - if (count($_POST)>0) { + if (count($_POST) > 0) { $greeting_name = check_str($_POST["greeting_name"]); $greeting_description = check_str($_POST["greeting_description"]); @@ -64,7 +64,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $msg = ''; if ($action == "update") { - $greeting_uuid = check_str($_POST["greeting_uuid"]); + $voicemail_greeting_uuid = check_str($_POST["voicemail_greeting_uuid"]); } //check for all required data @@ -117,8 +117,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if ($action == "update" && permission_exists('voicemail_greetings_edit')) { //get the original filename $sql = "select * from v_voicemail_greetings "; - $sql .= "where greeting_uuid = '$greeting_uuid' "; - $sql .= "and domain_uuid = '$domain_uuid' "; + $sql .= "where voicemail_greeting_uuid = '$voicemail_greeting_uuid' "; + $sql .= "and voicemail_greeting_uuid = '$domain_uuid' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); @@ -140,27 +140,28 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "greeting_name = '$greeting_name', "; $sql .= "greeting_description = '$greeting_description' "; $sql .= "where domain_uuid = '$domain_uuid' "; - $sql .= "and greeting_uuid = '$greeting_uuid' "; + $sql .= "and voicemail_greeting_uuid = '$voicemail_greeting_uuid' "; $db->exec(check_sql($sql)); unset($sql); - require_once "includes/header.php"; - echo "\n"; - echo "
\n"; - echo "".$text['confirm-update']."\n"; - echo "
\n"; - require_once "includes/footer.php"; - return; + //redirect the user + require_once "includes/header.php"; + echo "\n"; + echo "
\n"; + echo "".$text['confirm-update']."\n"; + echo "
\n"; + require_once "includes/footer.php"; + return; } //if ($action == "update") } //if ($_POST["persistformvar"] != "true") } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) //pre-populate the form - if (count($_GET)>0 && $_POST["persistformvar"] != "true") { - $greeting_uuid = $_GET["id"]; + if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { + $voicemail_greeting_uuid = check_str($_GET["id"]); $sql = "select * from v_voicemail_greetings "; $sql .= "where domain_uuid = '$domain_uuid' "; - $sql .= "and greeting_uuid = '$greeting_uuid' "; + $sql .= "and voicemail_greeting_uuid = '$voicemail_greeting_uuid' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); @@ -183,7 +184,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "
"; echo "
\n"; - echo "
\n"; echo "\n"; @@ -192,7 +192,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; } if ($action == "update") { - echo "\n"; + echo "\n"; } echo "\n"; echo "\n"; @@ -221,7 +221,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo "\n"; echo th_order_by('greeting_description', $text['table-description'], $order_by, $order); - echo "\n"; echo " \n"; echo "\n"; @@ -362,11 +362,7 @@ else { echo " \n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo "
".$text['label-add']."".$text['label-edit']['en-us']."".$text['label-edit']."
\n"; if ($action == "update") { - echo " \n"; + echo " \n"; } echo " \n"; echo " \n"; diff --git a/app/voicemail_greetings/voicemail_greetings.php b/app/voicemail_greetings/voicemail_greetings.php index daaaf19bd4..d61edeb189 100644 --- a/app/voicemail_greetings/voicemail_greetings.php +++ b/app/voicemail_greetings/voicemail_greetings.php @@ -48,8 +48,8 @@ else { //get the http get values and set them as php variables $voicemail_id = check_str($_REQUEST["id"]); - $order_by = $_GET["order_by"]; - $order = $_GET["order"]; + $order_by = check_str($_GET["order_by"]); + $order = check_str($_GET["order"]); //used to search the array to determin if an extension is assigned to the user function is_extension_assigned($number) { @@ -301,7 +301,7 @@ else { echo "".$text['table-download']."".$text['table-size']."\n"; + echo "\n"; //if (permission_exists('voicemail_greetings_add')) { // echo " $v_link_label_add\n"; //} @@ -343,11 +343,11 @@ else { echo " ".$row['greeting_description']." \n"; - if (permission_exists('voicemail_greetings_edit')) { - echo " $v_link_label_edit\n"; - } + //if (permission_exists('voicemail_greetings_edit')) { + // echo " $v_link_label_edit\n"; + //} if (permission_exists('voicemail_greetings_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo "
 $paging_controls\n"; - //if (permission_exists('voicemail_greetings_add')) { - // echo " $v_link_label_add\n"; - //} - echo "  
\n";