diff --git a/conf/Sccp.class.php.v433 b/conf/Sccp.class.php.v433 index 46fbbda..253caef 100644 --- a/conf/Sccp.class.php.v433 +++ b/conf/Sccp.class.php.v433 @@ -31,21 +31,9 @@ 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) { + global $currentcomponent; $add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description'); - // print_r($_REQUEST); - // echo '

'; - // die(print_r($settings)); $settings['cid_num']['value'] = ''; $settings['cid_name']['value'] = $label; $settings['mailbox']['value']= ''; @@ -84,7 +72,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 +89,10 @@ class Sccp extends \FreePBX\modules\Core\Driver { $sth = $this->database->prepare($sql); $sth->execute(); + // Redirect to SCCP Phone page. This was last function in add so + // should be safe. Prefer to add in Hooks, but is not followed + // even if set for $currentcomponent + redirect("config.php?display=sccp_phone", false); return true; } diff --git a/sccpManTraits/bmoFunctions.php b/sccpManTraits/bmoFunctions.php index 9d54576..1bd6817 100644 --- a/sccpManTraits/bmoFunctions.php +++ b/sccpManTraits/bmoFunctions.php @@ -3,12 +3,40 @@ namespace FreePBX\modules\Sccp_manager\sccpManTraits; trait bmoFunctions { - /* unused but FPBX API requires it */ + + //Need to reload freePBX for modifications below to work + + //want to catch extensions + public static function myConfigPageInits() { + return array("extensions"); + } public function doConfigPageInit($page) { + if ($page == "extensions") { + } $this->doGeneralPost(); } + // Try to change extensions which is part of core + public static function myGuiHooks() { + return array('core'); + } + + public function doGuiHook(&$cc) { + if ($_REQUEST['display'] == "extensions" ) { + if ($_REQUEST['tech_hardware'] == 'sccp_custom') { + /* + this is the add extensions form + On submit returns to extensions page. Users prefer that it returns + To Sccp Phone. + Below adds redirect URL, but it is not followed + $cc->setRedirectURL("config.php?display=sccp_phone"); + so force redirect at end of addDevice in SccpClass + */ + } + } + } + /* unused but FPBX API requires it */ public function install() { @@ -85,7 +113,6 @@ trait bmoFunctions { 'value' => _("Cancel") ), ); - break; case 'sccpsettings': $buttons = array( @@ -101,7 +128,6 @@ trait bmoFunctions { 'value' => _("Cancel") ), ); - break; } return $buttons; @@ -109,7 +135,7 @@ trait bmoFunctions { public function getRightNav($request) { if (isset($request['tech_hardware']) && ($request['tech_hardware'] == 'cisco')) { - return load_view("/var/www/html/admin/modules/sccp_manager/views/hardware.rnav.php", array('request' => $request)); + return load_view($_SERVER['DOCUMENT_ROOT'] .'/admin/modules/sccp_manager/views/hardware.rnav.php', array('request' => $request)); } } diff --git a/views/advserver.dialtemplate.php b/views/advserver.dialtemplate.php index cc37ab7..e7bd7bf 100644 --- a/views/advserver.dialtemplate.php +++ b/views/advserver.dialtemplate.php @@ -12,12 +12,12 @@

-   +  
- +
@@ -39,4 +39,4 @@ } return exp_model; } - \ No newline at end of file + diff --git a/views/advserver.keyset.php b/views/advserver.keyset.php index 2dc039c..6228047 100644 --- a/views/advserver.keyset.php +++ b/views/advserver.keyset.php @@ -54,7 +54,7 @@ $keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Displa
-
+
@@ -72,7 +72,7 @@ $keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Displa - +
@@ -101,9 +101,9 @@ $keynamearray = array('onhook' => array('sname' => 'ONHOOK', 'name' =>'Displa Help. max len = 15 - +