mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
* fixes for #1822 4.2 branch app/extensions/app_languages.php + add duplicate extension error prompt app/extensions/extension_copy.php + add check to see if duplicate extension exists app/extensions/resources/classes/extension.php + add function to check if extension exists + all cherry picks "AND AND" fix from master * fix typo * Update app_languages.php * Update extension_copy.php * Update extension.php
This commit is contained in:
@@ -1598,4 +1598,4 @@ $text['button-call_routing']['ro'] = "rutare de apel";
|
||||
$text['button-call_routing']['ar-eg'] = "توجيه الدعوة";
|
||||
$text['button-call_routing']['he'] = "ניתוב שיחות";
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -47,7 +47,21 @@ else {
|
||||
$number_alias_new = check_str($_REQUEST["alias"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// skip clone if domain:extension already exists
|
||||
$ext = new extension;
|
||||
$ext->db = $db;
|
||||
if ($ext->exists($domain_uuid, $extension_new)) {
|
||||
//begin the page content
|
||||
require_once "resources/header.php";
|
||||
|
||||
echo "<div align='center'>".$text['error-extension-copy-already-exists']."<br />";
|
||||
echo " <input type='button' class='btn' alt='".$text['button-back']."' onclick=\"window.location='./extension_edit.php?id=".$extension_uuid."';\" value='".$text['button-back']."'>\n";
|
||||
echo "</div>";
|
||||
require_once "resources/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
//get the v_extensions data
|
||||
$sql = "select * from v_extensions ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
@@ -228,4 +242,4 @@ else {
|
||||
header("Location: extensions.php");
|
||||
return;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -504,6 +504,18 @@ if (!class_exists('extension')) {
|
||||
$_SESSION["reload_xml"] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// returns true if domain:extension already exists
|
||||
public function exists($domain_uuid, $extension) {
|
||||
$sql = "select * from v_extensions where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and extension='".$extension."'";
|
||||
|
||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
|
||||
return count($result) != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user