Play button in IVR Menu edit (#6786)

* add play button for ivr long and short greetings
This commit is contained in:
K-Flagman 2023-08-26 09:17:04 -07:00 committed by GitHub
parent 97835fdd6a
commit ff578da24e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 1 deletions

View File

@ -894,6 +894,8 @@
echo "<input type='button' id='btn_select_to_input_".escape($destination_id)."' class='btn' name='' alt='back' onclick='changeToInput".escape($destination_id)."(document.getElementById(\"".escape($destination_id)."\"));this.style.visibility = \"hidden\";' value='&#9665;'>";
unset($destination_id);
}
echo "&nbsp;<input type='submit' name='submit' class='btn' onclick='return do_play(true,false,\"greet_long\");' value='"."Play"."'>&nbsp;\n";
echo "<span style='display: none' align='right' id='listen_greet_long'><audio controls=controls id=audio_greet_long autoplay=autoplay></span>\n";
echo " <br />\n";
echo $text['description-greet_long']."\n";
echo "</td>\n";
@ -1035,6 +1037,8 @@
echo "<input type='button' id='btn_select_to_input_".escape($destination_id)."' class='btn' name='' alt='back' onclick='changeToInput".escape($destination_id)."(document.getElementById(\"".escape($destination_id)."\"));this.style.visibility = \"hidden\";' value='&#9665;'>";
unset($destination_id);
}
echo "&nbsp;<input type='submit' name='submit' class='btn' onclick='return do_play(true,false,\"greet_short\");' value='"."Play"."'>&nbsp;\n";
echo "<span style='display: none' align='right' id='listen_greet_short'><audio controls=controls id=audio_greet_short autoplay=autoplay></span>\n";
echo "<br />\n";
echo $text['description-greet_short']."\n";
echo "</td>\n";
@ -1650,6 +1654,28 @@
echo "</form>";
//include the footer
require_once "resources/footer.php";
?>
<script>
function do_play(s,d,id) {
if (s) {
$('#preview').val('true');
$('#listen_' + id).show();
src = "/app/recordings/recordings.php" + "?action=download&type=rec&filename=" + $('#ivr_menu_'+id).val()
if (d) {
$('#listen_' + id).hide();
window.location.href = src;
} else {
$('#audio_'+id).attr('src', src);
}
return false;
} else {
$('#preview').val('false');
return true;
}
}
</script>
<?php
//include the footer
require_once "resources/footer.php";
?>

View File

@ -67,6 +67,8 @@
}
}
unset($sql, $parameters, $row, $recording_decoded);
} elseif ($_GET['filename']) {
$recording_filename = $_GET['filename'];
}
// build full path