mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-04 02:43:48 +00:00
Update the file name in voicemail greetings.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
//$apps[$x]['menu'][0]['uuid'] = '71197938-224b-3a90-c076-3979cabb3ee9';
|
||||
//$apps[$x]['menu'][0]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
|
||||
//$apps[$x]['menu'][0]['category'] = 'internal';
|
||||
//$apps[$x]['menu'][0]['path'] = '/app/voicemail_greetings/v_voicemail_greetings.php';
|
||||
//$apps[$x]['menu'][0]['path'] = '/app/voicemail_greetings/voicemail_greetings.php';
|
||||
//$apps[$x]['menu'][0]['groups'][] = 'admin';
|
||||
//$apps[$x]['menu'][0]['groups'][] = 'superadmin';
|
||||
|
||||
|
||||
@@ -46,8 +46,7 @@ if (count($_GET)>0) {
|
||||
|
||||
if (strlen($id)>0) {
|
||||
//get the greeting filename
|
||||
$sql = "";
|
||||
$sql .= "select * from v_voicemail_greetings ";
|
||||
$sql = "select * from v_voicemail_greetings ";
|
||||
$sql .= "where greeting_uuid = '$id' ";
|
||||
$sql .= "and domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and user_id = '$user_id' ";
|
||||
@@ -61,8 +60,7 @@ if (strlen($id)>0) {
|
||||
unset ($prep_statement);
|
||||
|
||||
//delete recording from the database
|
||||
$sql = "";
|
||||
$sql .= "delete from v_voicemail_greetings ";
|
||||
$sql = "delete from v_voicemail_greetings ";
|
||||
$sql .= "where greeting_uuid = '$id' ";
|
||||
$sql .= "and domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and user_id = '$user_id' ";
|
||||
@@ -79,7 +77,7 @@ if (strlen($id)>0) {
|
||||
|
||||
//redirect the user
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_voicemail_greetings.php?id=$user_id\">\n";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=voicemail_greetings.php?id=$user_id\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "".$text['confirm-delete-2']."\n";
|
||||
echo "</div>\n";
|
||||
|
||||
@@ -35,7 +35,8 @@ else {
|
||||
exit;
|
||||
}
|
||||
|
||||
foreach($content_voicemail_greetings as $key => $value) {
|
||||
//add multi-lingual support
|
||||
foreach($content_voicemail_greetings as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
@@ -105,7 +106,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
unset($sql);
|
||||
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_voicemail_greetings.php?id=".$user_id."\">\n";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=voicemail_greetings.php?id=".$user_id."\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "".$text['confirm-add']."\n";
|
||||
echo "</div>\n";
|
||||
@@ -115,11 +116,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
if ($action == "update" && permission_exists('voicemail_greetings_edit')) {
|
||||
//get the original filename
|
||||
$sql = "";
|
||||
$sql .= "select * from v_voicemail_greetings ";
|
||||
$sql = "select * from v_voicemail_greetings ";
|
||||
$sql .= "where greeting_uuid = '$greeting_uuid' ";
|
||||
$sql .= "and domain_uuid = '$domain_uuid' ";
|
||||
//echo "sql: ".$sql."<br />\n";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
@@ -131,9 +130,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//if file name is not the same then rename the file
|
||||
if ($greeting_name != $greeting_name_orig) {
|
||||
//echo "orig: ".$v_voicemail_greetings_dir.'/'.$filename_orig."<br />\n";
|
||||
//echo "new: ".$v_voicemail_greetings_dir.'/'.$greeting_name."<br />\n";
|
||||
rename($v_voicemail_greetings_dir.'/'.$greeting_name_orig, $v_voicemail_greetings_dir.'/'.$greeting_name);
|
||||
//echo "orig: ".$voicemail_greetings_dir.'/'.$filename_orig."<br />\n";
|
||||
//echo "new: ".$voicemail_greetings_dir.'/'.$greeting_name."<br />\n";
|
||||
rename($voicemail_greetings_dir.'/'.$greeting_name_orig, $voicemail_greetings_dir.'/'.$greeting_name);
|
||||
}
|
||||
|
||||
//update the database with the new data
|
||||
@@ -146,7 +145,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
unset($sql);
|
||||
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_voicemail_greetings.php?id=".$user_id."\">\n";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=voicemail_greetings.php?id=".$user_id."\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "".$text['confirm-update']."\n";
|
||||
echo "</div>\n";
|
||||
@@ -159,8 +158,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
//pre-populate the form
|
||||
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
|
||||
$greeting_uuid = $_GET["id"];
|
||||
$sql = "";
|
||||
$sql .= "select * from v_voicemail_greetings ";
|
||||
$sql = "select * from v_voicemail_greetings ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and greeting_uuid = '$greeting_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
@@ -196,7 +194,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
if ($action == "update") {
|
||||
echo "<td align='left' width='30%' nowrap><b>".$text['label-edit']['en-us']."</b></td>\n";
|
||||
}
|
||||
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_voicemail_greetings.php?id=".$user_id."'\" value='".$text['button-back']."'></td>\n";
|
||||
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='voicemail_greetings.php?id=".$user_id."'\" value='".$text['button-back']."'></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
|
||||
@@ -137,8 +137,7 @@ require_once "includes/paging.php";
|
||||
//build a list of voicemail greetings
|
||||
$config_voicemail_greeting_list = '|';
|
||||
$i = 0;
|
||||
$sql = "";
|
||||
$sql .= "select * from v_voicemail_greetings ";
|
||||
$sql = "select * from v_voicemail_greetings ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and user_id = '$user_id' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
@@ -271,8 +270,7 @@ require_once "includes/paging.php";
|
||||
*/
|
||||
|
||||
//get the number of rows in v_extensions
|
||||
$sql = "";
|
||||
$sql .= " select count(*) as num_rows from v_voicemail_greetings ";
|
||||
$sql = "select count(*) as num_rows from v_voicemail_greetings ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and user_id = '$user_id' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
@@ -297,8 +295,7 @@ require_once "includes/paging.php";
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//get the greetings list
|
||||
$sql = "";
|
||||
$sql .= "select * from v_voicemail_greetings ";
|
||||
$sql = "select * from v_voicemail_greetings ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and user_id = '$user_id' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
@@ -322,7 +319,7 @@ require_once "includes/paging.php";
|
||||
echo th_order_by('greeting_description', $text['table-description'], $order_by, $order);
|
||||
echo "<td align='right' width='42'>\n";
|
||||
//if (permission_exists('voicemail_greetings_add')) {
|
||||
// echo " <a href='v_voicemail_greetings_edit.php?&user_id=".$user_id."' alt='add'>$v_link_label_add</a>\n";
|
||||
// echo " <a href='voicemail_greetings_edit.php?&user_id=".$user_id."' alt='add'>$v_link_label_add</a>\n";
|
||||
//}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
@@ -347,11 +344,11 @@ require_once "includes/paging.php";
|
||||
echo "</td>\n";
|
||||
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
echo " <a href=\"v_voicemail_greetings.php?id=$user_id&a=download&type=rec&t=bin&filename=".base64_encode($row['greeting_name'])."\">\n";
|
||||
echo " <a href=\"voicemail_greetings.php?id=$user_id&a=download&type=rec&t=bin&filename=".base64_encode($row['greeting_name'])."\">\n";
|
||||
echo " download";
|
||||
echo " </a>";
|
||||
//echo " \n";
|
||||
//echo " <a href=\"javascript:void(0);\" onclick=\"window.open('v_voicemail_greetings_play.php?id=$user_id&a=download&type=rec&filename=".base64_encode($row['greeting_name'])."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
|
||||
//echo " <a href=\"javascript:void(0);\" onclick=\"window.open('voicemail_greetings_play.php?id=$user_id&a=download&type=rec&filename=".base64_encode($row['greeting_name'])."', 'play',' width=420,height=40,menubar=no,status=no,toolbar=no')\">\n";
|
||||
//echo " play";
|
||||
//echo " </a>";
|
||||
echo "</td>\n";
|
||||
@@ -364,10 +361,10 @@ require_once "includes/paging.php";
|
||||
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
if (permission_exists('voicemail_greetings_edit')) {
|
||||
echo " <a href='v_voicemail_greetings_edit.php?id=".$row['greeting_uuid']."&user_id=".$user_id."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
echo " <a href='voicemail_greetings_edit.php?id=".$row['greeting_uuid']."&user_id=".$user_id."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
if (permission_exists('voicemail_greetings_delete')) {
|
||||
echo " <a href='v_voicemail_greetings_delete.php?id=".$row['greeting_uuid']."&user_id=".$user_id."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
echo " <a href='voicemail_greetings_delete.php?id=".$row['greeting_uuid']."&user_id=".$user_id."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
@@ -384,7 +381,7 @@ require_once "includes/paging.php";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
//if (permission_exists('voicemail_greetings_add')) {
|
||||
// echo " <a href='v_voicemail_greetings_edit.php?user_id=".$user_id."' alt='add'>$v_link_label_add</a>\n";
|
||||
// echo " <a href='voicemail_greetings_edit.php?user_id=".$user_id."' alt='add'>$v_link_label_add</a>\n";
|
||||
//}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
Reference in New Issue
Block a user