From 668bc3355ce7b0e851aeb24a839b2023819c98ca Mon Sep 17 00:00:00 2001 From: dkgroot Date: Sun, 6 Jun 2021 14:07:07 +0000 Subject: [PATCH 01/49] Update version number to 14.2.0.2 --- module.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module.xml b/module.xml index 7b468d4..4ed9ca8 100644 --- a/module.xml +++ b/module.xml @@ -1,7 +1,7 @@ sccp_manager SCCP Manager - 14.2.0.1 + 14.2.0.2 setup SCCP Connectivity Steve Lad, Alex GP @@ -18,6 +18,7 @@ * Version 14.0.0.1 * - Alfa Release new DB structure Add User mobility * Version 14.1.0.1 * - Migrated to chan-sccp repo * Version 14.2.0.1 * - Retired old interface - min chan-sccp v433 + * Version 14.2.0.2 * - Fix module database definition https://github.com/chan-sccp/sccp_manager From 792cf3452279a1579dc83cead1008b0d95c479d4 Mon Sep 17 00:00:00 2001 From: dkgroot Date: Sun, 6 Jun 2021 18:10:08 +0000 Subject: [PATCH 02/49] Update json file --- sccpManagerUpdater.json | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sccpManagerUpdater.json b/sccpManagerUpdater.json index cc7e59d..35ab5f6 100644 --- a/sccpManagerUpdater.json +++ b/sccpManagerUpdater.json @@ -2,24 +2,20 @@ "rawname": "sccp_manager", "repo": "extended", "name": "Sccp Manager", - "version": "14.2.0.2", + "version": "14.2.0.3", "publisher": "Steve Lad", "license": "GPL", "licenselink": "http://www.gnu.org/licenses/gpl.txt", - "changelog": [ - "*14.2.0.2* First release of new version without old interface", - "*13.0.0.1* Packaging of ver 1.0.0.1", - "*12.0.0.1* Packaging of ver 1.0.0.1" - ], + "changelog": "*14.2.0.3* Fix module database definition\n*14.2.0.3* Fix module database definition\n*14.2.0.2* First release of new version without old interface\n*13.0.0.1* Packaging of ver 1.0.0.1\n*12.0.0.1* Packaging of ver 1.0.0.1", "category": "Settings", "description": "The Cisco Manager module lets you manage the chan-sccp module.", "depends": { - "version": "14.0", + "version": "14.0" }, "supported": { "version": "13.0" }, - "location": "https://github.com/chan-sccp/sccp_manager/archive/refs/tags/V14.2.0.2.tar.gz", - "md5sum": "885935a928b29927a2f9006eda20b549", - "packaged": "3362963" + "location": "https://github.com/chan-sccp/sccp_manager/archive/refs/tags/v14.2.0.3.tar.gz", + "md5sum": "9aff57a6553a4a3649e056013fe1758f", + "packaged": "1623001021" } From 0c2df2d5293463a52e37d388258734fb7157b0f7 Mon Sep 17 00:00:00 2001 From: dkgroot Date: Sun, 6 Jun 2021 18:12:50 +0000 Subject: [PATCH 03/49] Update module to point to other updateurl branch --- module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.xml b/module.xml index 4ed9ca8..98954f4 100644 --- a/module.xml +++ b/module.xml @@ -25,7 +25,7 @@ 13.0.0.2M https://github.com/chan-sccp/sccp_manager - https://raw.githubusercontent.com/chan-sccp/sccp_manager/develop/sccpManagerUpdater.json + https://raw.githubusercontent.com/chan-sccp/sccp_manager/update_json/sccpManagerUpdater.json GPL From 4ec741e1fac6e8df39f4378cb820f1d6914cbd6a Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Mon, 7 Jun 2021 12:44:18 +0200 Subject: [PATCH 04/49] Revert "Update module to point to other updateurl branch" This reverts commit 0c2df2d5293463a52e37d388258734fb7157b0f7. --- module.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.xml b/module.xml index 98954f4..4ed9ca8 100644 --- a/module.xml +++ b/module.xml @@ -25,7 +25,7 @@ 13.0.0.2M https://github.com/chan-sccp/sccp_manager - https://raw.githubusercontent.com/chan-sccp/sccp_manager/update_json/sccpManagerUpdater.json + https://raw.githubusercontent.com/chan-sccp/sccp_manager/develop/sccpManagerUpdater.json GPL From 0fa539bd6a6dae2111ca2a69d819b832dfb972a7 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Mon, 7 Jun 2021 16:23:21 +0200 Subject: [PATCH 05/49] Remove unused delete button Remove disabled delete button --- views/hardware.extension.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/views/hardware.extension.php b/views/hardware.extension.php index bde3121..e7eefed 100644 --- a/views/hardware.extension.php +++ b/views/hardware.extension.php @@ -19,9 +19,6 @@ if (!empty($this->sccpvalues['system_rouminguser'])) {

  -
@@ -47,7 +44,7 @@ if (!empty($this->sccpvalues['system_rouminguser'])) { if (rmn_dev == 'yes') { exp_dev += '  '; } - return exp_dev; + return exp_dev; return '  '; } - \ No newline at end of file + From 5ad6f5bae048a2b009700aa8565f5d797bc6c5a5 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Tue, 8 Jun 2021 12:50:48 +0200 Subject: [PATCH 06/49] Update button labels Update button labels in Server Config Atom whitespace removal in hardware.phone --- sccpManTraits/bmoFunctions.php | 5 +++-- views/hardware.phone.php | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sccpManTraits/bmoFunctions.php b/sccpManTraits/bmoFunctions.php index c703810..5ff2e18 100644 --- a/sccpManTraits/bmoFunctions.php +++ b/sccpManTraits/bmoFunctions.php @@ -34,6 +34,7 @@ trait bmoFunctions { } public function getActionBar($request) { + dbug('request',$request); $buttons = array(); switch ($request['display']) { case 'sccp_adv': @@ -92,13 +93,13 @@ trait bmoFunctions { 'submit' => array( 'name' => 'ajaxsubmit', 'id' => 'ajaxsubmit', - 'value' => _("Submit") + 'value' => _("Save") ), 'reset' => array( 'name' => 'reset', 'id' => 'ajaxcancel', 'data-reload' => 'reload', - 'value' => _("Reset") + 'value' => _("Cancel") ), ); diff --git a/views/hardware.phone.php b/views/hardware.phone.php index b5f3b9a..cf83ae4 100644 --- a/views/hardware.phone.php +++ b/views/hardware.phone.php @@ -35,7 +35,7 @@ - + @@ -62,7 +62,7 @@ } } return exp_model; - + } function DispayDeviceActionsKeyFormatter(value, row, index) { var exp_model = ''; @@ -70,9 +70,9 @@ exp_model += '    \n'; - + } else { exp_model += '    \n'; exp_model += '  '; @@ -84,7 +84,7 @@ if (value === null) { return '-- EMPTY --'; } - var data = value.split(";"); + var data = value.split(";"); result = ''; for (var i = 0; i < data.length; i++) { var val = data[i].split(','); @@ -94,5 +94,5 @@ } return result; } - - \ No newline at end of file + + From 03057edd6c98ed4f9d718dde4f90cd7334a8fdd0 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Tue, 8 Jun 2021 14:39:23 +0200 Subject: [PATCH 07/49] Fix Broken Rnav in add device Replace _DIR_ with absolute path; _DIR_ references sccpTraits Fix error in toolbar id --- sccpManTraits/bmoFunctions.php | 3 +-- views/hardware.rnav.php | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/sccpManTraits/bmoFunctions.php b/sccpManTraits/bmoFunctions.php index 5ff2e18..9d54576 100644 --- a/sccpManTraits/bmoFunctions.php +++ b/sccpManTraits/bmoFunctions.php @@ -34,7 +34,6 @@ trait bmoFunctions { } public function getActionBar($request) { - dbug('request',$request); $buttons = array(); switch ($request['display']) { case 'sccp_adv': @@ -110,7 +109,7 @@ trait bmoFunctions { public function getRightNav($request) { if (isset($request['tech_hardware']) && ($request['tech_hardware'] == 'cisco')) { - return load_view(__DIR__ . "/views/hardware.rnav.php", array('request' => $request)); + return load_view("/var/www/html/admin/modules/sccp_manager/views/hardware.rnav.php", array('request' => $request)); } } diff --git a/views/hardware.rnav.php b/views/hardware.rnav.php index df0271e..3080456 100644 --- a/views/hardware.rnav.php +++ b/views/hardware.rnav.php @@ -1,18 +1,24 @@ -
+ data-search="true" + data-toolbar="#toolbar-sccp-rnav" + data-url="ajax.php?module=sccp_manager&command=getPhoneGrid&type=sccp" + data-cache="false" + data-toggle="table" + class="table"> - - - + + +
From dface29681686caf07a15d7aa0b489fa9f901cc5 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Tue, 8 Jun 2021 14:43:13 +0200 Subject: [PATCH 08/49] Delete .nfs.2005102d.05d5 Delete extraneous file --- views/.nfs.2005102d.05d5 | Bin 4096 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 views/.nfs.2005102d.05d5 diff --git a/views/.nfs.2005102d.05d5 b/views/.nfs.2005102d.05d5 deleted file mode 100644 index 8787841520bc03863226103feac39b83c5e06942..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIUt(=a103vVqiUI z1JS`yK|uMa^k@i-hQMeDjE2By2#kinXb6mkz-S1JhQMeDjE2By2v8*i7=fmMFc`>% zWMmdA6r~pDmlh?bDx~EXWh-Rnm89mCWaj53=Hyf=!cbj9nnLwI M+$%B+a{vDW0Ix+Hl>h($ From 7f96c121fad7b77e0137a4d757d597ed6c1f78d0 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Tue, 8 Jun 2021 15:23:43 +0200 Subject: [PATCH 09/49] Update module category in updater.json Update module category in updater.json - this is used in Module Admin Remove unused JS --- assets/js/sccp_manager.js | 35 ++--------------------------------- sccpManagerUpdater.json | 2 +- 2 files changed, 3 insertions(+), 34 deletions(-) diff --git a/assets/js/sccp_manager.js b/assets/js/sccp_manager.js index f169511..e60ffc1 100644 --- a/assets/js/sccp_manager.js +++ b/assets/js/sccp_manager.js @@ -25,37 +25,7 @@ $(document).ready(function () { } }); - /* - $('#ajaxbackup').on('click', function (e) { - var vdata = ''; - var snd_command = 'backupsettings'; - $('.fpbx-submit').each(function () { - vdata = vdata + $(this).serialize() + '&'; - }); - - $.ajax({ - type: 'POST', - url: 'ajax.php?module=sccp_manager&command=' + snd_command, - data: vdata, - success: function (data) { - if (data.status === true) { - if (data.message) { - alert(data.message); - } else { - alert('Data Save'); - } - } else { - if (Array.isArray(data.message)) { - data.message.forEach(function (entry) { - fpbxToast(entry, 'error', 'error'); - }); - } - } - } - }); - - }); - */ + // ajaxsubmit2 is "Save and continue" - saves form data and stays on form $('#ajaxsubmit2').on('click', function (e) { var vdata = ''; var snd_command = 'savesettings'; @@ -93,7 +63,7 @@ $(document).ready(function () { } }); }); - + // ajaxsubmit is save and close form $('#ajaxsubmit').on('click', function (e) { var vdata = ''; var snd_command = 'savesettings'; @@ -136,7 +106,6 @@ $(document).ready(function () { if (data.search != null) { location.search = data.search; } -// if (data.reload === true ) { if (data.reload === true && old_style ===true ) { location.reload(); } diff --git a/sccpManagerUpdater.json b/sccpManagerUpdater.json index 35ab5f6..0d19988 100644 --- a/sccpManagerUpdater.json +++ b/sccpManagerUpdater.json @@ -7,7 +7,7 @@ "license": "GPL", "licenselink": "http://www.gnu.org/licenses/gpl.txt", "changelog": "*14.2.0.3* Fix module database definition\n*14.2.0.3* Fix module database definition\n*14.2.0.2* First release of new version without old interface\n*13.0.0.1* Packaging of ver 1.0.0.1\n*12.0.0.1* Packaging of ver 1.0.0.1", - "category": "Settings", + "category": "Sccp Connectivity", "description": "The Cisco Manager module lets you manage the chan-sccp module.", "depends": { "version": "14.0" From 214509e2c750eeac082b64563e65ba8b3a399767 Mon Sep 17 00:00:00 2001 From: steve-lad <72376554+steve-lad@users.noreply.github.com> Date: Thu, 10 Jun 2021 12:15:18 +0200 Subject: [PATCH 10/49] Use BMO Hooks Use BMO Hooks Correct HTML --- sccpManTraits/bmoFunctions.php | 57 ++++++++++++++++++++++++++++++-- views/advserver.dialtemplate.php | 6 ++-- views/advserver.keyset.php | 22 ++++++------ views/advserver.model.php | 2 +- views/hardware.extension.php | 12 +++---- views/hardware.phone.php | 4 +-- views/hardware.sphone.php | 18 +++++----- 7 files changed, 86 insertions(+), 35 deletions(-) diff --git a/sccpManTraits/bmoFunctions.php b/sccpManTraits/bmoFunctions.php index 9d54576..9bbd35e 100644 --- a/sccpManTraits/bmoFunctions.php +++ b/sccpManTraits/bmoFunctions.php @@ -3,12 +3,41 @@ namespace FreePBX\modules\Sccp_manager\sccpManTraits; trait bmoFunctions { - /* unused but FPBX API requires it */ + + //Need to reload freePBX for modifications below to work + + //need 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(); } + // Try to change extensions which is part of core + public static function myGuiHooks() { + return array('core'); + } + + 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); + } + //$cc->addguielem("_top", new \gui_pageheading('', 'I added a header', false)); + } + } + + + /* unused but FPBX API requires it */ public function install() { @@ -85,7 +114,6 @@ trait bmoFunctions { 'value' => _("Cancel") ), ); - break; case 'sccpsettings': $buttons = array( @@ -101,7 +129,30 @@ trait bmoFunctions { 'value' => _("Cancel") ), ); - + break; + case 'extensions': + // only called from configpage inits + $buttons = array( + 'submit' => array( + 'name' => 'ajaxsubmit', + 'id' => 'ajaxsubmit', + 'data-search' => '?display=sccp_custom', + 'value' => _("Save") + ), + 'Save' => array( + 'name' => 'ajaxsubmit2', + 'id' => 'ajaxsubmit2', + 'stayonpage' => 'yes', + 'value' => _("Save + Continue") + ), + 'cancel' => array( + 'name' => 'cancel', + 'id' => 'ajaxcancel', + 'data-search' => '?display=sccp_custom', + 'data-hash' => 'sccpdevice', + 'value' => _("Cancel") + ), + ); break; } return $buttons; 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 - +