From c9839eadc598a804d93a7ef5fa122f8b01a1a189 Mon Sep 17 00:00:00 2001 From: stevenA Date: Sun, 9 Jan 2022 12:58:18 +0100 Subject: [PATCH] Use doConfigPageInit BMO method Increase compliance with BMO. Decreases calls and improves responsiveness --- Sccp_manager.class.php | 9 ++++++++- page.sccp_phone.php | 1 + sccpManTraits/ajaxHelper.php | 1 + sccpManTraits/bmoFunctions.php | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Sccp_manager.class.php b/Sccp_manager.class.php index 8c818b2..48d37ae 100644 --- a/Sccp_manager.class.php +++ b/Sccp_manager.class.php @@ -110,7 +110,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { if ($freepbx == null) { throw new Exception("Not given a FreePBX Object"); } - + dbug('__construct called', debug_backtrace(2)); $this->class_error = array(); $this->FreePBX = $freepbx; $this->db = $freepbx->Database; @@ -208,6 +208,11 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } } + public function showPage() { + dbug('showPage called', $_REQUEST); + return; + } + /* * Show form information - General */ @@ -306,6 +311,8 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO { } public function phoneShowPage() { + dbug($_REQUEST); + dbug(debug_backtrace(0)); $request = $_REQUEST; $action = !empty($request['action']) ? $request['action'] : ''; $inputform = !empty($request['tech_hardware']) ? $request['tech_hardware'] : ''; diff --git a/page.sccp_phone.php b/page.sccp_phone.php index 4d65ba7..111ee2c 100644 --- a/page.sccp_phone.php +++ b/page.sccp_phone.php @@ -14,6 +14,7 @@ if (!defined('FREEPBX_IS_AUTH')) { // function is called. This is where you do any changes. The page.foo.php // is only for DISPLAYING things. MVC is a cool idea, ya know? // +dbug(debug_backtrace()); $spage = FreePBX::create()->Sccp_manager; if (empty($spage->class_error)) { $display_page = $spage->phoneShowPage(); diff --git a/sccpManTraits/ajaxHelper.php b/sccpManTraits/ajaxHelper.php index f482dc9..62b2d4d 100644 --- a/sccpManTraits/ajaxHelper.php +++ b/sccpManTraits/ajaxHelper.php @@ -45,6 +45,7 @@ trait ajaxHelper { $request = $_REQUEST; $msg = array(); $cmd_id = $request['command']; + dbug('ajax', $cmd_id); switch ($cmd_id) { case 'savesettings': // Consolidate this into a separate method to improve legibility diff --git a/sccpManTraits/bmoFunctions.php b/sccpManTraits/bmoFunctions.php index 88b8c9d..839006e 100644 --- a/sccpManTraits/bmoFunctions.php +++ b/sccpManTraits/bmoFunctions.php @@ -153,6 +153,8 @@ trait bmoFunctions { $final = $this->sccp_conf_init[$id]; } } + + $i++; } return $final; }