Add redirect after saving to sccp_line
Add redirect after saving to sccpline Revert changes in page script formatting
This commit is contained in:
parent
214509e2c7
commit
cf546961fe
|
@ -31,21 +31,8 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* public function addDevice1($id, $settings) {
|
|
||||||
$sql = 'INSERT INTO sccp (id, keyword, data, flags) values (?,?,?,?)';
|
|
||||||
$sth = $this->database->prepare($sql);
|
|
||||||
$settings = is_array($settings)?$settings:array();
|
|
||||||
foreach($settings as $key => $setting) {
|
|
||||||
$sth->execute(array($id,$key,$setting['value'],$setting['flag']));
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
public function addDevice($id, $settings) {
|
public function addDevice($id, $settings) {
|
||||||
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description');
|
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description');
|
||||||
// print_r($_REQUEST);
|
|
||||||
// echo '<br><br>';
|
|
||||||
// die(print_r($settings));
|
|
||||||
$settings['cid_num']['value'] = '';
|
$settings['cid_num']['value'] = '';
|
||||||
$settings['cid_name']['value'] = $label;
|
$settings['cid_name']['value'] = $label;
|
||||||
$settings['mailbox']['value']= '';
|
$settings['mailbox']['value']= '';
|
||||||
|
@ -84,7 +71,6 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// die(print_r($settings));
|
|
||||||
$tech = Array();
|
$tech = Array();
|
||||||
$sql = "DESCRIBE sccpline";
|
$sql = "DESCRIBE sccpline";
|
||||||
foreach ($this->database->query($sql) as $row) {
|
foreach ($this->database->query($sql) as $row) {
|
||||||
|
@ -102,6 +88,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
|
|
||||||
$sth = $this->database->prepare($sql);
|
$sth = $this->database->prepare($sql);
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
|
redirect('http://192.168.50.254/admin/config.php?display=sccp_phone', false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,15 +6,13 @@ trait bmoFunctions {
|
||||||
|
|
||||||
//Need to reload freePBX for modifications below to work
|
//Need to reload freePBX for modifications below to work
|
||||||
|
|
||||||
//need to catch extensions
|
//want to catch extensions
|
||||||
public static function myConfigPageInits() {
|
public static function myConfigPageInits() {
|
||||||
dbug('have config page inits');
|
|
||||||
return array("extensions");
|
return array("extensions");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function doConfigPageInit($page) {
|
public function doConfigPageInit($page) {
|
||||||
if ($page == "extensions") {
|
if ($page == "extensions") {
|
||||||
dbug('have extensions in doConfigPageInit');
|
|
||||||
}
|
}
|
||||||
$this->doGeneralPost();
|
$this->doGeneralPost();
|
||||||
}
|
}
|
||||||
|
@ -25,19 +23,13 @@ trait bmoFunctions {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function doGuiHook(&$cc) {
|
public function doGuiHook(&$cc) {
|
||||||
dbug('$_REQUEST', $_REQUEST);
|
|
||||||
//dbug('CC', $cc);
|
|
||||||
if ($_REQUEST['display'] == "extensions" ) {
|
if ($_REQUEST['display'] == "extensions" ) {
|
||||||
if (isset($_REQUEST['tech_hardware'])) {
|
if (isset($_REQUEST['tech_hardware'])) {
|
||||||
dbug('Have caught hook in doGuiHook');
|
//this is the add extensions form
|
||||||
$this->getActionBar($_REQUEST);
|
|
||||||
}
|
}
|
||||||
//$cc->addguielem("_top", new \gui_pageheading('', 'I added a header', false));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* unused but FPBX API requires it */
|
/* unused but FPBX API requires it */
|
||||||
|
|
||||||
public function install() {
|
public function install() {
|
||||||
|
@ -64,6 +56,7 @@ trait bmoFunctions {
|
||||||
|
|
||||||
public function getActionBar($request) {
|
public function getActionBar($request) {
|
||||||
$buttons = array();
|
$buttons = array();
|
||||||
|
dbug('Request in BMO is', $request);
|
||||||
switch ($request['display']) {
|
switch ($request['display']) {
|
||||||
case 'sccp_adv':
|
case 'sccp_adv':
|
||||||
if (empty($request['tech_hardware'])) {
|
if (empty($request['tech_hardware'])) {
|
||||||
|
@ -132,6 +125,7 @@ trait bmoFunctions {
|
||||||
break;
|
break;
|
||||||
case 'extensions':
|
case 'extensions':
|
||||||
// only called from configpage inits
|
// only called from configpage inits
|
||||||
|
dbug('in case extensions');
|
||||||
$buttons = array(
|
$buttons = array(
|
||||||
'submit' => array(
|
'submit' => array(
|
||||||
'name' => 'ajaxsubmit',
|
'name' => 'ajaxsubmit',
|
||||||
|
|
|
@ -39,12 +39,12 @@ if (!empty($this->sccpvalues['system_rouminguser'])) {
|
||||||
function DispayPhoneActionsKeyFormatter(value, row, index) {
|
function DispayPhoneActionsKeyFormatter(value, row, index) {
|
||||||
var exp_dev = '';
|
var exp_dev = '';
|
||||||
var rmn_dev = '<?php echo $roming_enable ?>';
|
var rmn_dev = '<?php echo $roming_enable ?>';
|
||||||
exp_dev += "<a href="config.php?display=extensions&extdisplay=' + row['name'] + '"><i class="fa fa-pencil"></i></a> ";
|
exp_dev += '<a href="config.php?display=extensions&extdisplay=' + row['name'] + '"><i class="fa fa-pencil"></i></a> ';
|
||||||
exp_dev += "<a class="clickable delete" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>";
|
exp_dev += '<a class="clickable delete" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
|
||||||
if (rmn_dev == 'yes') {
|
if (rmn_dev == 'yes') {
|
||||||
exp_dev += "<a href="config.php?display=sccp_phone&tech_hardware=r_user&ru_id=' + row['name'] + '"><i class="fa fa-bicycle"></i></a> ";
|
exp_dev += '<a href="config.php?display=sccp_phone&tech_hardware=r_user&ru_id=' + row['name'] + '"><i class="fa fa-bicycle"></i></a> ';
|
||||||
}
|
}
|
||||||
return exp_dev;
|
return exp_dev;
|
||||||
return "<a href="config.php?display=extensions&extdisplay=' + row['name'] + '"><i class="fa fa-pencil"></i></a> <a class="clickable delete" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>";
|
return '<a href="config.php?display=extensions&extdisplay=' + row['name'] + '"><i class="fa fa-pencil"></i></a> <a class="clickable delete" data-id="' + row['name'] + '"><i class="fa fa-trash"></i></a>';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<i class="fa fa-list"></i>
|
<i class="fa fa-list"></i>
|
||||||
<?php echo _("List Device")?>
|
<?php echo _("List Device")?>
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-default" href="config.php?display=sccp_phone&tech_hardware=cisco">
|
<a class="btn btn-default" href="config.php?display=sccp_phone&tech_hardware=cisco">
|
||||||
<i class="fa fa-plus"> </i>
|
<i class="fa fa-plus"> </i>
|
||||||
<?php echo _("Add Device")?>
|
<?php echo _("Add Device")?>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue