Clean up and document redirect changes
Add comments Standardise URL's Remove surplus cases
This commit is contained in:
parent
7427fcabb8
commit
9547cfe927
|
@ -32,6 +32,7 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addDevice($id, $settings) {
|
public function addDevice($id, $settings) {
|
||||||
|
global $currentcomponent;
|
||||||
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description');
|
$add_fld = array ("name"=>'label',"outboundcid"=>'cid_num',"langcode"=>'language',"extdisplay"=>'description');
|
||||||
$settings['cid_num']['value'] = '';
|
$settings['cid_num']['value'] = '';
|
||||||
$settings['cid_name']['value'] = $label;
|
$settings['cid_name']['value'] = $label;
|
||||||
|
@ -88,7 +89,10 @@ class Sccp extends \FreePBX\modules\Core\Driver {
|
||||||
|
|
||||||
$sth = $this->database->prepare($sql);
|
$sth = $this->database->prepare($sql);
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
redirect("http://{$_SERVER['SERVER_ADDR']}/admin/config.php?display=sccp_phone", false);
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,15 @@ trait bmoFunctions {
|
||||||
|
|
||||||
public function doGuiHook(&$cc) {
|
public function doGuiHook(&$cc) {
|
||||||
if ($_REQUEST['display'] == "extensions" ) {
|
if ($_REQUEST['display'] == "extensions" ) {
|
||||||
if (isset($_REQUEST['tech_hardware'])) {
|
if ($_REQUEST['tech_hardware'] == 'sccp_custom') {
|
||||||
//this is the add extensions form
|
/*
|
||||||
|
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
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +63,6 @@ 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'])) {
|
||||||
|
@ -123,38 +129,13 @@ trait bmoFunctions {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'extensions':
|
|
||||||
// only called from configpage inits
|
|
||||||
dbug('in case extensions');
|
|
||||||
$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;
|
return $buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRightNav($request) {
|
public function getRightNav($request) {
|
||||||
if (isset($request['tech_hardware']) && ($request['tech_hardware'] == 'cisco')) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue