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) {
|
||||
$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_name']['value'] = $label;
|
||||
$settings['mailbox']['value']= '';
|
||||
|
@ -84,7 +71,6 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
|||
}
|
||||
}
|
||||
|
||||
// die(print_r($settings));
|
||||
$tech = Array();
|
||||
$sql = "DESCRIBE sccpline";
|
||||
foreach ($this->database->query($sql) as $row) {
|
||||
|
@ -102,6 +88,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
|||
|
||||
$sth = $this->database->prepare($sql);
|
||||
$sth->execute();
|
||||
redirect('http://192.168.50.254/admin/config.php?display=sccp_phone', false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,15 +6,13 @@ trait bmoFunctions {
|
|||
|
||||
//Need to reload freePBX for modifications below to work
|
||||
|
||||
//need to catch extensions
|
||||
//want to catch extensions
|
||||
public static function myConfigPageInits() {
|
||||
dbug('have config page inits');
|
||||
return array("extensions");
|
||||
}
|
||||
|
||||
public function doConfigPageInit($page) {
|
||||
if ($page == "extensions") {
|
||||
dbug('have extensions in doConfigPageInit');
|
||||
}
|
||||
$this->doGeneralPost();
|
||||
}
|
||||
|
@ -25,19 +23,13 @@ trait bmoFunctions {
|
|||
}
|
||||
|
||||
public function doGuiHook(&$cc) {
|
||||
dbug('$_REQUEST', $_REQUEST);
|
||||
//dbug('CC', $cc);
|
||||
if ($_REQUEST['display'] == "extensions" ) {
|
||||
if (isset($_REQUEST['tech_hardware'])) {
|
||||
dbug('Have caught hook in doGuiHook');
|
||||
$this->getActionBar($_REQUEST);
|
||||
//this is the add extensions form
|
||||
}
|
||||
//$cc->addguielem("_top", new \gui_pageheading('', 'I added a header', false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* unused but FPBX API requires it */
|
||||
|
||||
public function install() {
|
||||
|
@ -64,6 +56,7 @@ trait bmoFunctions {
|
|||
|
||||
public function getActionBar($request) {
|
||||
$buttons = array();
|
||||
dbug('Request in BMO is', $request);
|
||||
switch ($request['display']) {
|
||||
case 'sccp_adv':
|
||||
if (empty($request['tech_hardware'])) {
|
||||
|
@ -132,6 +125,7 @@ trait bmoFunctions {
|
|||
break;
|
||||
case 'extensions':
|
||||
// only called from configpage inits
|
||||
dbug('in case extensions');
|
||||
$buttons = array(
|
||||
'submit' => array(
|
||||
'name' => 'ajaxsubmit',
|
||||
|
|
|
@ -39,12 +39,12 @@ if (!empty($this->sccpvalues['system_rouminguser'])) {
|
|||
function DispayPhoneActionsKeyFormatter(value, row, index) {
|
||||
var exp_dev = '';
|
||||
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 class="clickable delete" data-id="' + row['name'] + '"><i class="fa fa-trash"></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>';
|
||||
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 "<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>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<i class="fa fa-list"></i>
|
||||
<?php echo _("List Device")?>
|
||||
</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>
|
||||
<?php echo _("Add Device")?>
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue