mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Remove v_conference_center_users as v_meeting_users was used instead.
This commit is contained in:
@@ -418,43 +418,4 @@
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "end_epoch";
|
||||
$z++;
|
||||
|
||||
/*
|
||||
$y = 4; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = "v_conference_center_users";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "conference_user_uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "conference_center_uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_conference_centers";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "conference_uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = "user_uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_users";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "user_uuid";
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
|
||||
*/
|
||||
|
||||
?>
|
||||
@@ -62,218 +62,169 @@ else {
|
||||
$conference_center_name = str_replace(" ", "-", $conference_center_name);
|
||||
}
|
||||
|
||||
/*
|
||||
//delete the user from the v_conference_center_users
|
||||
if ($_GET["a"] == "delete" && permission_exists("conference_center_delete")) {
|
||||
//set the variables
|
||||
$user_uuid = check_str($_REQUEST["user_uuid"]);
|
||||
$conference_center_uuid = check_str($_REQUEST["id"]);
|
||||
//delete the group from the users
|
||||
$sql = "delete from v_conference_center_users ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and conference_center_uuid = '".$conference_center_uuid."' ";
|
||||
$sql .= "and user_uuid = '".$user_uuid."' ";
|
||||
$db->exec(check_sql($sql));
|
||||
//redirect the browser
|
||||
require_once "resources/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_center_edit.php?id=$conference_center_uuid\">\n";
|
||||
echo "<div align='center'>Delete Complete</div>";
|
||||
require_once "resources/footer.php";
|
||||
return;
|
||||
}
|
||||
//process user data
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//add the user to the v_conference_center_users
|
||||
if (strlen($_REQUEST["user_uuid"]) > 0 && strlen($_REQUEST["id"]) > 0 && $_GET["a"] != "delete") {
|
||||
//set the variables
|
||||
$user_uuid = check_str($_REQUEST["user_uuid"]);
|
||||
$conference_center_uuid = check_str($_REQUEST["id"]);
|
||||
//assign the user to the extension
|
||||
$sql_insert = "insert into v_conference_center_users ";
|
||||
$sql_insert .= "(";
|
||||
$sql_insert .= "conference_user_uuid, ";
|
||||
$sql_insert .= "domain_uuid, ";
|
||||
$sql_insert .= "conference_center_uuid, ";
|
||||
$sql_insert .= "user_uuid ";
|
||||
$sql_insert .= ")";
|
||||
$sql_insert .= "values ";
|
||||
$sql_insert .= "(";
|
||||
$sql_insert .= "'".uuid()."', ";
|
||||
$sql_insert .= "'".$_SESSION['domain_uuid']."', ";
|
||||
$sql_insert .= "'".$conference_center_uuid."', ";
|
||||
$sql_insert .= "'".$user_uuid."' ";
|
||||
$sql_insert .= ")";
|
||||
$db->exec($sql_insert);
|
||||
//redirect the browser
|
||||
require_once "resources/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_center_edit.php?id=$conference_center_uuid\">\n";
|
||||
echo "<div align='center'>Add Complete</div>";
|
||||
require_once "resources/footer.php";
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
if ($action == "update") {
|
||||
$conference_center_uuid = check_str($_POST["conference_center_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
//if (strlen($dialplan_uuid) == 0) { $msg .= "Please provide: Dialplan UUID<br>\n"; }
|
||||
if (strlen($conference_center_name) == 0) { $msg .= "Please provide: Name<br>\n"; }
|
||||
if (strlen($conference_center_extension) == 0) { $msg .= "Please provide: Extension<br>\n"; }
|
||||
if (strlen($conference_center_pin_length) == 0) { $msg .= "Please provide: PIN Length<br>\n"; }
|
||||
//if (strlen($conference_center_order) == 0) { $msg .= "Please provide: Order<br>\n"; }
|
||||
//if (strlen($conference_center_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
|
||||
if (strlen($conference_center_enabled) == 0) { $msg .= "Please provide: Enabled<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table><tr><td>\n";
|
||||
echo $msg."<br />";
|
||||
echo "</td></tr></table>\n";
|
||||
persistformvar($_POST);
|
||||
echo "</div>\n";
|
||||
require_once "resources/footer.php";
|
||||
return;
|
||||
$msg = '';
|
||||
if ($action == "update") {
|
||||
$conference_center_uuid = check_str($_POST["conference_center_uuid"]);
|
||||
}
|
||||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
if ($action == "add") {
|
||||
//prepare the uuids
|
||||
$conference_center_uuid = uuid();
|
||||
$dialplan_uuid = uuid();
|
||||
//add the conference
|
||||
$sql = "insert into v_conference_centers ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "conference_center_uuid, ";
|
||||
$sql .= "dialplan_uuid, ";
|
||||
$sql .= "conference_center_name, ";
|
||||
$sql .= "conference_center_extension, ";
|
||||
$sql .= "conference_center_pin_length, ";
|
||||
$sql .= "conference_center_greeting, ";
|
||||
$sql .= "conference_center_description, ";
|
||||
$sql .= "conference_center_enabled ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$conference_center_uuid', ";
|
||||
$sql .= "'$dialplan_uuid', ";
|
||||
$sql .= "'$conference_center_name', ";
|
||||
$sql .= "'$conference_center_extension', ";
|
||||
$sql .= "'$conference_center_pin_length', ";
|
||||
$sql .= "'$conference_center_greeting', ";
|
||||
$sql .= "'$conference_center_description', ";
|
||||
$sql .= "'$conference_center_enabled' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//create the dialplan entry
|
||||
$dialplan_name = $conference_center_name;
|
||||
$dialplan_order ='333';
|
||||
$dialplan_context = $_SESSION['context'];
|
||||
$dialplan_enabled = 'true';
|
||||
$dialplan_description = $conference_center_description;
|
||||
$app_uuid = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9';
|
||||
dialplan_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_name, $dialplan_order, $dialplan_context, $dialplan_enabled, $dialplan_description, $app_uuid);
|
||||
|
||||
//<condition destination_number="500" />
|
||||
$dialplan_detail_tag = 'condition'; //condition, action, antiaction
|
||||
$dialplan_detail_type = 'destination_number';
|
||||
$dialplan_detail_data = '^'.$conference_center_extension.'$';
|
||||
$dialplan_detail_order = '010';
|
||||
$dialplan_detail_group = '2';
|
||||
dialplan_detail_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_detail_tag, $dialplan_detail_order, $dialplan_detail_group, $dialplan_detail_type, $dialplan_detail_data);
|
||||
|
||||
//<action application="lua" />
|
||||
$dialplan_detail_tag = 'action'; //condition, action, antiaction
|
||||
$dialplan_detail_type = 'lua';
|
||||
$dialplan_detail_data = 'app.lua conference_center';
|
||||
$dialplan_detail_order = '020';
|
||||
$dialplan_detail_group = '2';
|
||||
dialplan_detail_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_detail_tag, $dialplan_detail_order, $dialplan_detail_group, $dialplan_detail_type, $dialplan_detail_data);
|
||||
|
||||
//save the xml
|
||||
save_dialplan_xml();
|
||||
|
||||
$_SESSION["message"] = $text['message-add'];
|
||||
header("Location: conference_centers.php");
|
||||
//check for all required data
|
||||
//if (strlen($dialplan_uuid) == 0) { $msg .= "Please provide: Dialplan UUID<br>\n"; }
|
||||
if (strlen($conference_center_name) == 0) { $msg .= "Please provide: Name<br>\n"; }
|
||||
if (strlen($conference_center_extension) == 0) { $msg .= "Please provide: Extension<br>\n"; }
|
||||
if (strlen($conference_center_pin_length) == 0) { $msg .= "Please provide: PIN Length<br>\n"; }
|
||||
//if (strlen($conference_center_order) == 0) { $msg .= "Please provide: Order<br>\n"; }
|
||||
//if (strlen($conference_center_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
|
||||
if (strlen($conference_center_enabled) == 0) { $msg .= "Please provide: Enabled<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table><tr><td>\n";
|
||||
echo $msg."<br />";
|
||||
echo "</td></tr></table>\n";
|
||||
persistformvar($_POST);
|
||||
echo "</div>\n";
|
||||
require_once "resources/footer.php";
|
||||
return;
|
||||
} //if ($action == "add")
|
||||
}
|
||||
|
||||
if ($action == "update") {
|
||||
//update the conference center extension
|
||||
$sql = "update v_conference_centers set ";
|
||||
$sql .= "conference_center_name = '$conference_center_name', ";
|
||||
$sql .= "conference_center_extension = '$conference_center_extension', ";
|
||||
$sql .= "conference_center_pin_length = '$conference_center_pin_length', ";
|
||||
$sql .= "conference_center_greeting = '$conference_center_greeting', ";
|
||||
$sql .= "conference_center_description = '$conference_center_description', ";
|
||||
$sql .= "conference_center_enabled = '$conference_center_enabled' ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and conference_center_uuid = '$conference_center_uuid'";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
if ($action == "add") {
|
||||
//prepare the uuids
|
||||
$conference_center_uuid = uuid();
|
||||
$dialplan_uuid = uuid();
|
||||
//add the conference
|
||||
$sql = "insert into v_conference_centers ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "conference_center_uuid, ";
|
||||
$sql .= "dialplan_uuid, ";
|
||||
$sql .= "conference_center_name, ";
|
||||
$sql .= "conference_center_extension, ";
|
||||
$sql .= "conference_center_pin_length, ";
|
||||
$sql .= "conference_center_greeting, ";
|
||||
$sql .= "conference_center_description, ";
|
||||
$sql .= "conference_center_enabled ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$conference_center_uuid', ";
|
||||
$sql .= "'$dialplan_uuid', ";
|
||||
$sql .= "'$conference_center_name', ";
|
||||
$sql .= "'$conference_center_extension', ";
|
||||
$sql .= "'$conference_center_pin_length', ";
|
||||
$sql .= "'$conference_center_greeting', ";
|
||||
$sql .= "'$conference_center_description', ";
|
||||
$sql .= "'$conference_center_enabled' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//udpate the conference center dialplan
|
||||
$sql = "update v_dialplans set ";
|
||||
$sql .= "dialplan_name = '$conference_center_name', ";
|
||||
if (strlen($dialplan_order) > 0) {
|
||||
$sql .= "dialplan_order = '333', ";
|
||||
}
|
||||
$sql .= "dialplan_context = '".$_SESSION['context']."', ";
|
||||
$sql .= "dialplan_enabled = 'true', ";
|
||||
$sql .= "dialplan_description = '$conference_center_description' ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
|
||||
$db->query($sql);
|
||||
unset($sql);
|
||||
//create the dialplan entry
|
||||
$dialplan_name = $conference_center_name;
|
||||
$dialplan_order ='333';
|
||||
$dialplan_context = $_SESSION['context'];
|
||||
$dialplan_enabled = 'true';
|
||||
$dialplan_description = $conference_center_description;
|
||||
$app_uuid = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9';
|
||||
dialplan_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_name, $dialplan_order, $dialplan_context, $dialplan_enabled, $dialplan_description, $app_uuid);
|
||||
|
||||
//update dialplan detail condition
|
||||
$sql = "update v_dialplan_details set ";
|
||||
$sql .= "dialplan_detail_data = '^".$conference_center_extension."$' ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and dialplan_detail_tag = 'condition' ";
|
||||
$sql .= "and dialplan_detail_type = 'destination_number' ";
|
||||
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
|
||||
$db->query($sql);
|
||||
unset($sql);
|
||||
//<condition destination_number="500" />
|
||||
$dialplan_detail_tag = 'condition'; //condition, action, antiaction
|
||||
$dialplan_detail_type = 'destination_number';
|
||||
$dialplan_detail_data = '^'.$conference_center_extension.'$';
|
||||
$dialplan_detail_order = '010';
|
||||
$dialplan_detail_group = '2';
|
||||
dialplan_detail_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_detail_tag, $dialplan_detail_order, $dialplan_detail_group, $dialplan_detail_type, $dialplan_detail_data);
|
||||
|
||||
//update dialplan detail action
|
||||
$dialplan_detail_type = 'lua';
|
||||
$dialplan_detail_data = 'app.lua conference_center';
|
||||
$sql = "update v_dialplan_details set ";
|
||||
$sql .= "dialplan_detail_type = '".$dialplan_detail_type."', ";
|
||||
$sql .= "dialplan_detail_data = '".$dialplan_detail_data."' ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and dialplan_detail_tag = 'action' ";
|
||||
$sql .= "and dialplan_detail_type = 'lua' ";
|
||||
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
|
||||
$db->query($sql);
|
||||
//<action application="lua" />
|
||||
$dialplan_detail_tag = 'action'; //condition, action, antiaction
|
||||
$dialplan_detail_type = 'lua';
|
||||
$dialplan_detail_data = 'app.lua conference_center';
|
||||
$dialplan_detail_order = '020';
|
||||
$dialplan_detail_group = '2';
|
||||
dialplan_detail_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_detail_tag, $dialplan_detail_order, $dialplan_detail_group, $dialplan_detail_type, $dialplan_detail_data);
|
||||
|
||||
//syncrhonize configuration
|
||||
save_dialplan_xml();
|
||||
//save the xml
|
||||
save_dialplan_xml();
|
||||
|
||||
//apply settings reminder
|
||||
$_SESSION["reload_xml"] = true;
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("dialplan:".$_SESSION["context"]);
|
||||
|
||||
//redirect the browser
|
||||
$_SESSION["message"] = $text['message-update'];
|
||||
$_SESSION["message"] = $text['message-add'];
|
||||
header("Location: conference_centers.php");
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
} //if ($action == "add")
|
||||
|
||||
if ($action == "update") {
|
||||
//update the conference center extension
|
||||
$sql = "update v_conference_centers set ";
|
||||
$sql .= "conference_center_name = '$conference_center_name', ";
|
||||
$sql .= "conference_center_extension = '$conference_center_extension', ";
|
||||
$sql .= "conference_center_pin_length = '$conference_center_pin_length', ";
|
||||
$sql .= "conference_center_greeting = '$conference_center_greeting', ";
|
||||
$sql .= "conference_center_description = '$conference_center_description', ";
|
||||
$sql .= "conference_center_enabled = '$conference_center_enabled' ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and conference_center_uuid = '$conference_center_uuid'";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//udpate the conference center dialplan
|
||||
$sql = "update v_dialplans set ";
|
||||
$sql .= "dialplan_name = '$conference_center_name', ";
|
||||
if (strlen($dialplan_order) > 0) {
|
||||
$sql .= "dialplan_order = '333', ";
|
||||
}
|
||||
$sql .= "dialplan_context = '".$_SESSION['context']."', ";
|
||||
$sql .= "dialplan_enabled = 'true', ";
|
||||
$sql .= "dialplan_description = '$conference_center_description' ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
|
||||
$db->query($sql);
|
||||
unset($sql);
|
||||
|
||||
//update dialplan detail condition
|
||||
$sql = "update v_dialplan_details set ";
|
||||
$sql .= "dialplan_detail_data = '^".$conference_center_extension."$' ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and dialplan_detail_tag = 'condition' ";
|
||||
$sql .= "and dialplan_detail_type = 'destination_number' ";
|
||||
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
|
||||
$db->query($sql);
|
||||
unset($sql);
|
||||
|
||||
//update dialplan detail action
|
||||
$dialplan_detail_type = 'lua';
|
||||
$dialplan_detail_data = 'app.lua conference_center';
|
||||
$sql = "update v_dialplan_details set ";
|
||||
$sql .= "dialplan_detail_type = '".$dialplan_detail_type."', ";
|
||||
$sql .= "dialplan_detail_data = '".$dialplan_detail_data."' ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and dialplan_detail_tag = 'action' ";
|
||||
$sql .= "and dialplan_detail_type = 'lua' ";
|
||||
$sql .= "and dialplan_uuid = '$dialplan_uuid' ";
|
||||
$db->query($sql);
|
||||
|
||||
//syncrhonize configuration
|
||||
save_dialplan_xml();
|
||||
|
||||
//apply settings reminder
|
||||
$_SESSION["reload_xml"] = true;
|
||||
|
||||
//clear the cache
|
||||
$cache = new cache;
|
||||
$cache->delete("dialplan:".$_SESSION["context"]);
|
||||
|
||||
//redirect the browser
|
||||
$_SESSION["message"] = $text['message-update'];
|
||||
header("Location: conference_centers.php");
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//function to show the list of sound files
|
||||
// moved to functions.php
|
||||
|
||||
Reference in New Issue
Block a user