Browse Source

Correção da mensagem de erro ao inserir ramais mesmo com a operacao ok e inclusao das variaveis RAMAL_REGISTRO e CALLERID REGISTRO, feito pelo arquivox funcoes.php na gravação do arquivo sip_ramais.conf

1.9
AMARILDO PEREIRA 6 months ago
parent
commit
9cbe3fc117
  1. 85
      admin/cadRamais.php
  2. 2
      admin/funcoes.php

85
admin/cadRamais.php

@ -15,7 +15,7 @@ if ($_GET['ajax'] == 1) {
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="admin/css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="ISO-8859-1" />
<script type="text/javascript" src="admin/js/jquery-1.4.js"></script>
@ -27,12 +27,12 @@ if ($_GET['ajax'] == 1) {
<script src="admin/js/pbxAjax.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
$(document).ready(function () {
$("#form1").validationEngine({
sucess: function() {
sucess: function () {
document.form1.submit();
},
failure: function() {}
failure: function () {}
})
});
@ -139,9 +139,9 @@ if ($_GET['ajax'] == 1) {
}
</script>
<link href="admin/css/forms.css" rel="stylesheet" type="text/css">
</head>
</head>
<body>
<body>
<?php
$acao = $_GET["acao"];
$acao2 = $_GET["acao2"];
@ -347,10 +347,7 @@ if ($_GET['ajax'] == 1) {
$z++;
$msg .= 'Erro ao incluir ramal ' . $nome2 . '!' . '\n';
} else {
if (!pg_affected_rows($result)) {
$z++;
$msg .= 'Erro ao incluir ramal ' . $nome2 . '!' . '\n';
} else {
$query = "SELECT max(id) AS id FROM pbx_sip_ramais";
$result = pg_query($dbcon, $query);
$id_ult = pg_fetch_row($result);
@ -421,7 +418,6 @@ if ($_GET['ajax'] == 1) {
}
}
}
}
if ($z >= 1) {
echo "<script>javascript:alert('$msg');</script>";
echo "<script>javascript:history.back();</script>";
@ -754,7 +750,8 @@ if ($_GET['ajax'] == 1) {
$query2 = "SELECT id, username, nome, tipo FROM pbx_troncos WHERE org_id = {$org_id} ORDER BY nome;";
$result2 = pg_query($dbcon, $query2);
$troncos = pg_fetch_all($result2);
foreach ($troncos as $v) { ?>
foreach ($troncos as $v) {
?>
<?php $selected = ""; ?>
<?php $dispPbx = $v['tipo'] . '/' . $v['username']; ?>
<?php ($dispPbx == $ispbx_tronco) ? $selected = "selected" : null; ?>
@ -870,9 +867,10 @@ if ($_GET['ajax'] == 1) {
<?php
$query2 = "SELECT * FROM pbx_musichold_grupos WHERE org_id = {$org_id} AND nome <> 'agentes' order by nome asc";
$result2 = pg_query($dbcon, $query2);
while ($dados2 = pg_fetch_array($result2)) { ?>
while ($dados2 = pg_fetch_array($result2)) {
?>
<option value="<?= $dados2['nome']; ?>" <?= ($acao == 'edita') && ($musica_espera == $dados2['nome']) ? "selected" : null; ?>><?= $dados2['nome']; ?></option>
<?php } ?>
<?php } ?>
</select>
</fieldset>
</td>
@ -942,9 +940,10 @@ if ($_GET['ajax'] == 1) {
<?php
$query2 = "SELECT * FROM pbx_contextos WHERE org_id = {$org_id} ORDER BY id ASC";
$result2 = pg_query($dbcon, $query2);
while ($dados2 = pg_fetch_array($result2)) { ?>
while ($dados2 = pg_fetch_array($result2)) {
?>
<option value="<?= $dados2['nome']; ?>" <?= ($acao == 'edita') && ($context == $dados2['nome']) ? "selected" : null; ?>><?= $dados2['nome']; ?></option>
<?php } ?>
<?php } ?>
</select>
</fieldset>
</div>
@ -1317,7 +1316,7 @@ if ($_GET['ajax'] == 1) {
<input type="radio" name="tipoRota[<?= $idRota; ?>]" class="tipoRotaAgente" value="3;<?= $idRota; ?>" <?= ($tipoAcesso == 3) ? "checked=\"checked\"" : null; ?> />
</td>
</tr>
<?php } ?>
<?php } ?>
</table>
</div>
</fieldset>
@ -1411,9 +1410,9 @@ if ($_GET['ajax'] == 1) {
</table>
</form>
<script type="text/javascript">
$(document).ready(function() {
$(document).ready(function () {
window.resizeTo($('#form1').width() + 100, $('#form1').height() - 550);
$('#btfechar').click(function() {
$('#btfechar').click(function () {
var $ = window.parent.$;
var jQuery = window.parent.jQuery;
$.unblockUI({
@ -1432,58 +1431,58 @@ if ($_GET['ajax'] == 1) {
$('#imgAgente').attr("src", "imgSite/bullet-link-active.gif");
}
$("#simCheck").mouseover(function() {
$("#simCheck").mouseover(function () {
$(this).css("cursor", "pointer");
});
$("#naoCheck").mouseover(function() {
$("#naoCheck").mouseover(function () {
$(this).css("cursor", "pointer");
});
$("#senhaCheck").mouseover(function() {
$("#senhaCheck").mouseover(function () {
$(this).css("cursor", "pointer");
});
$("#agenteCheck").mouseover(function() {
$("#agenteCheck").mouseover(function () {
$(this).css("cursor", "pointer");
});
$(document).ready(function() {
$('#simCheck').click(function() {
$(document).ready(function () {
$('#simCheck').click(function () {
$('.tipoRotaSim').attr("checked", true);
LimpaImagem();
$('#imgSim').attr("src", "imgSite/bullet-link-hover.gif");
});
});
$(document).ready(function() {
$('#naoCheck').click(function() {
$(document).ready(function () {
$('#naoCheck').click(function () {
$('.tipoRotaNao').attr("checked", true);
LimpaImagem();
$('#imgNao').attr("src", "imgSite/bullet-link-hover.gif");
});
});
$(document).ready(function() {
$('#senhaCheck').click(function() {
$(document).ready(function () {
$('#senhaCheck').click(function () {
$('.tipoRotaSenha').attr("checked", true);
LimpaImagem();
$('#imgSenha').attr("src", "imgSite/bullet-link-hover.gif");
});
});
$(document).ready(function() {
$('#agenteCheck').click(function() {
$(document).ready(function () {
$('#agenteCheck').click(function () {
$('.tipoRotaAgente').attr("checked", true);
LimpaImagem();
$('#imgAgente').attr("src", "imgSite/bullet-link-hover.gif");
});
})
$(document).ready(function() {
$(document).ready(function () {
var $box = $('.box');
$box.toggle();
});
$(document).ready(function() {
$('.animate').click(function() {
$(document).ready(function () {
$('.animate').click(function () {
var $box = $('.box');
if ($box.is(':visible')) {
$box.slideToggle('slow');
@ -1499,13 +1498,13 @@ if ($_GET['ajax'] == 1) {
});
});
$(document).ready(function() {
$(document).ready(function () {
var $boxChf = $('.boxChefeSec');
$boxChf.toggle();
});
$(document).ready(function() {
$('.animateCfs').click(function() {
$(document).ready(function () {
$('.animateCfs').click(function () {
var $boxChf = $('.boxChefeSec');
if ($boxChf.is(':visible')) {
$boxChf.slideToggle('slow');
@ -1521,13 +1520,12 @@ if ($_GET['ajax'] == 1) {
});
});
</script>
</body>
</body>
</html>
<?php
</html>
<?php
function GetDefaultRedesPermitidas()
{
function GetDefaultRedesPermitidas() {
global $dbcon;
$query = "select extranet from pbx_sip_general";
$result = pg_query($dbcon, $query);
@ -1536,4 +1534,5 @@ function GetDefaultRedesPermitidas()
}
$row = pg_fetch_array($result);
return $row['extranet'];
}
}

2
admin/funcoes.php

@ -922,6 +922,8 @@ function gera_arquivos($dbcon, $tipo, $reload = 1, $reloadUra = 1)
}
}
}
fwrite($escreve, sprintf("setvar=RAMAL_REGISTRO=%s", $dados["nome"]));
fwrite($escreve, sprintf("setvar=CALLERID_REGISTRO=%s", $dados["callerid"]));
fwrite($escreve, chr(13) . chr(10));
}

Loading…
Cancel
Save