- Create Cisco phone service for user mobility.
This commit is contained in:
parent
ce3bee1341
commit
8d8d45d2d9
|
@ -1319,7 +1319,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$name_dev = '';
|
$name_dev = '';
|
||||||
$db_field = $this->dbinterface->get_db_SccpTableData("get_colums_sccpusers");
|
$db_field = $this->dbinterface->get_db_SccpTableData("get_colums_sccpuser");
|
||||||
// $hw_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid'];
|
// $hw_id = (empty($get_settings['sccp_deviceid'])) ? 'new' : $get_settings['sccp_deviceid'];
|
||||||
// $update_hw = ($hw_id == 'new') ? 'update' : 'clear';
|
// $update_hw = ($hw_id == 'new') ? 'update' : 'clear';
|
||||||
$hw_prefix = 'SEP';
|
$hw_prefix = 'SEP';
|
||||||
|
@ -1394,7 +1394,7 @@ class Sccp_manager extends \FreePBX_Helpers implements \BMO {
|
||||||
// return $save_settings;
|
// return $save_settings;
|
||||||
// $update_hw = ($hw_id == 'new') ? 'update' : 'clear';
|
// $update_hw = ($hw_id == 'new') ? 'update' : 'clear';
|
||||||
|
|
||||||
$this->dbinterface->sccp_save_db("sccpusers", $save_settings, 'replace', 'name');
|
$this->dbinterface->sccp_save_db("sccpuser", $save_settings, 'replace', 'name');
|
||||||
|
|
||||||
$save_buttons = $this-> get_buttons_phone($get_settings,$name_dev, 'sccpline');
|
$save_buttons = $this-> get_buttons_phone($get_settings,$name_dev, 'sccpline');
|
||||||
// Sace Buttons config
|
// Sace Buttons config
|
||||||
|
|
|
@ -56,8 +56,8 @@ class dbinterface {
|
||||||
$sql = "DESCRIBE sccpdevice";
|
$sql = "DESCRIBE sccpdevice";
|
||||||
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
|
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
|
||||||
break;
|
break;
|
||||||
case "get_colums_sccpusers":
|
case "get_colums_sccpuser":
|
||||||
$sql = "DESCRIBE sccpusers";
|
$sql = "DESCRIBE sccpuser";
|
||||||
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
|
$raw_settings = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
|
||||||
break;
|
break;
|
||||||
case "get_sccpdevice_byid":
|
case "get_sccpdevice_byid":
|
||||||
|
@ -67,8 +67,8 @@ class dbinterface {
|
||||||
. 'LEFT JOIN sccpdevmodel as addon ON t1.addon=addon.model WHERE name="' . $data['id'] . '";';
|
. 'LEFT JOIN sccpdevmodel as addon ON t1.addon=addon.model WHERE name="' . $data['id'] . '";';
|
||||||
$raw_settings = sql($sql, "getRow", DB_FETCHMODE_ASSOC);
|
$raw_settings = sql($sql, "getRow", DB_FETCHMODE_ASSOC);
|
||||||
break;
|
break;
|
||||||
case "get_sccpdusers":
|
case "get_sccpuser":
|
||||||
$sql = "SELECT * FROM `sccpusers` ";
|
$sql = "SELECT * FROM `sccpuser` ";
|
||||||
if (!empty($data['id'])) {
|
if (!empty($data['id'])) {
|
||||||
$sql .= 'WHERE name="' . $data['id'] . '" ';
|
$sql .= 'WHERE name="' . $data['id'] . '" ';
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ class dbinterface {
|
||||||
break;
|
break;
|
||||||
case 'sccpdevmodel':
|
case 'sccpdevmodel':
|
||||||
case 'sccpdevice':
|
case 'sccpdevice':
|
||||||
case 'sccpusers':
|
case 'sccpuser':
|
||||||
$sql_db = $db_name;
|
$sql_db = $db_name;
|
||||||
$sql_key = "";
|
$sql_key = "";
|
||||||
$sql_var = "";
|
$sql_var = "";
|
||||||
|
|
|
@ -1584,7 +1584,7 @@ and open the template in the editor. Base Version before all crash :-)
|
||||||
<item type="IE-D" id="2" seq="99">
|
<item type="IE-D" id="2" seq="99">
|
||||||
<label>User password</label>
|
<label>User password</label>
|
||||||
<input>
|
<input>
|
||||||
<name>pin</name>
|
<name>password</name>
|
||||||
<default></default>
|
<default></default>
|
||||||
</input>
|
</input>
|
||||||
<help>Help!</help>
|
<help>Help!</help>
|
||||||
|
|
190
install.php
190
install.php
|
@ -16,7 +16,8 @@ global $amp_conf;
|
||||||
global $astman;
|
global $astman;
|
||||||
global $version;
|
global $version;
|
||||||
global $srvinterface;
|
global $srvinterface;
|
||||||
|
global $mobile_hw;
|
||||||
|
$mobile_hw = '0';
|
||||||
|
|
||||||
$class = "\\FreePBX\\Modules\\Sccp_manager\\srvinterface";
|
$class = "\\FreePBX\\Modules\\Sccp_manager\\srvinterface";
|
||||||
if (!class_exists($class, false)) {
|
if (!class_exists($class, false)) {
|
||||||
|
@ -27,6 +28,7 @@ if (class_exists($class, false)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get_DB_config($sccp_compatible) {
|
function Get_DB_config($sccp_compatible) {
|
||||||
|
global $mobile_hw;
|
||||||
$db_config_v0 = array(
|
$db_config_v0 = array(
|
||||||
'sccpdevmodel' => array(
|
'sccpdevmodel' => array(
|
||||||
'enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
|
'enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
|
||||||
|
@ -220,6 +222,7 @@ function Get_DB_config($sccp_compatible) {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Software mobile
|
||||||
$db_config_v4 = array(
|
$db_config_v4 = array(
|
||||||
'sccpdevmodel' => array(
|
'sccpdevmodel' => array(
|
||||||
'enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
|
'enabled' => array('create' => "INT(2) NULL DEFAULT '0'"),
|
||||||
|
@ -304,10 +307,44 @@ function Get_DB_config($sccp_compatible) {
|
||||||
'echocancel' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
'echocancel' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
||||||
'silencesuppression' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
'silencesuppression' => array('create' => "enum('on','off') NOT NULL default 'off'", 'modify' => "enum('on','off')"),
|
||||||
'dnd' => array('create' => "enum('off','reject','silent','user') NOT NULL default 'reject'", 'modify' => "enum('off','reject','silent','user')", 'def_modify' => "reject")
|
'dnd' => array('create' => "enum('off','reject','silent','user') NOT NULL default 'reject'", 'modify' => "enum('off','reject','silent','user')", 'def_modify' => "reject")
|
||||||
|
),
|
||||||
|
'sccpuser' => array(
|
||||||
|
'name' => array('create' => "varchar(20) NOT NULL", 'modify' => "VARCHAR(20)" ),
|
||||||
|
'pin' => array('create' => "varchar(7) NOT NULL", 'modify' => "VARCHAR(7)" ),
|
||||||
|
'password' => array('create' => "varchar(7) NOT NULL", 'modify' => "VARCHAR(7)" ),
|
||||||
|
'description' => array('create' => "varchar(45) NOT NULL", 'modify' => "VARCHAR(45)" ),
|
||||||
|
'roaminglogin' => array('create' => "ENUM('on','off','multi') NULL DEFAULT 'off'", 'modify' => "ENUM('on','off','multi')" ),
|
||||||
|
'auto_logout' => array('create' => "ENUM('on','off') NULL DEFAULT 'off'", 'modify' => "ENUM('on','off')" ),
|
||||||
|
'homedevice' => array('create' => "varchar(20) NOT NULL", 'modify' => "VARCHAR(20)" ),
|
||||||
|
'devicegroup' => array('create' => "varchar(7) NOT NULL", 'modify' => "VARCHAR(7)" ),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
// Hardware Mobile. Can switch Softwate to Hardware
|
||||||
|
$db_config_v4M = array(
|
||||||
|
'sccpdevmodel' => array(
|
||||||
|
'loadinformationid' => array('create' => "VARCHAR(30) NULL DEFAULT NULL")
|
||||||
|
),
|
||||||
|
'sccpdevice' => array(
|
||||||
|
'pickupexten' => array('drop' => "yes"),
|
||||||
|
'directed_pickup' => array('drop' => "yes"),
|
||||||
|
'_description' => array('rename' => "description"),
|
||||||
|
'_loginname' => array('drop' => "yes"),
|
||||||
|
'_profileid' => array('drop' => "yes"),
|
||||||
|
|
||||||
|
),
|
||||||
|
'sccpline' => array(
|
||||||
|
'directed_pickup' => array('create' => "enum('on','off') NULL default NULL", 'modify' => "enum('on','off')"),
|
||||||
|
),
|
||||||
|
'sccpuser' => array(
|
||||||
|
'id' => array('create' => "varchar(20) NOT NULL", 'modify' => "VARCHAR(20)" ),
|
||||||
|
'name' => array('create' => "varchar(45) NOT NULL", 'modify' => "VARCHAR(45)" ),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($sccp_compatible >= 433 ) {
|
if ($sccp_compatible >= 433 ) {
|
||||||
|
if ($mobile_hw == '1') {
|
||||||
|
return $db_config_v4M;
|
||||||
|
}
|
||||||
return $db_config_v4;
|
return $db_config_v4;
|
||||||
}
|
}
|
||||||
if ($sccp_compatible >= 430) {
|
if ($sccp_compatible >= 430) {
|
||||||
|
@ -417,40 +454,6 @@ function InstallDB_Buttons() {
|
||||||
if (db::IsError($check)) {
|
if (db::IsError($check)) {
|
||||||
die_freepbx("Can not create sccpbuttonconfig table, error:$check\n");
|
die_freepbx("Can not create sccpbuttonconfig table, error:$check\n");
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
} else {
|
|
||||||
$db_result = $db->getAll("SELECT TABLE_NAME, COLUMN_NAME, CONSTRAINT_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE "
|
|
||||||
. "WHERE TABLE_SCHEMA = 'asterisk' AND TABLE_NAME = 'buttonconfig' AND REFERENCED_COLUMN_NAME IS NOT NULL;");
|
|
||||||
|
|
||||||
if (DB::IsError($db_result)) {
|
|
||||||
die_freepbx("Can not get informations TABLE_SCHEMA\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = '';
|
|
||||||
$sql = 'RENAME TABLE `buttonconfig` TO `sccpbuttonconfig`;';
|
|
||||||
$sql .= "ALTER TABLE `sccpbuttonconfig` ADD COLUMN `user` VARCHAR(20) NOT NULL DEFAULT '' AFTER `device`;";
|
|
||||||
$check = $db->query($sql);
|
|
||||||
if (db::IsError($check)) {
|
|
||||||
die_freepbx("Can not create sccpsettings table, error:$check\n");
|
|
||||||
}
|
|
||||||
$sql = '';
|
|
||||||
foreach ($db_result as $tabl_data) {
|
|
||||||
$fld_id = $tabl_data[2];
|
|
||||||
if (!empty($fld_id)) {
|
|
||||||
$sql .= "ALTER TABLE `sccpbuttonconfig` DROP FOREIGN KEY `".$fld_id."`\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql .= "ALTER TABLE `sccpbuttonconfig` CHANGE COLUMN `device` `device` varchar(15) NULL default NULL";
|
|
||||||
$sql .= "ALTER TABLE `sccpbuttonconfig` ADD FOREIGN KEY (device) REFERENCES sccpdevice(name) ON DELETE CASCADE;";
|
|
||||||
|
|
||||||
$check = $db->query($sql);
|
|
||||||
if (DB::IsError($db_result)) {
|
|
||||||
die_freepbx("Can not get drop old FOREIGN KEY \n");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -494,10 +497,10 @@ function InstallDB_sccpdevmodel() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function InstallDB_sccpusers() {
|
function InstallDB_sccpuser() {
|
||||||
global $db;
|
global $db;
|
||||||
outn("<li>" . _("Creating sccpusers table...") . "</li>");
|
outn("<li>" . _("Creating sccpuser table...") . "</li>");
|
||||||
$sql = "CREATE TABLE IF NOT EXISTS `sccpusers` (
|
$sql = "CREATE TABLE IF NOT EXISTS `sccpuser` (
|
||||||
`name` VARCHAR(20) NULL DEFAULT NULL,
|
`name` VARCHAR(20) NULL DEFAULT NULL,
|
||||||
`pin` VARCHAR(7) NULL DEFAULT NULL,
|
`pin` VARCHAR(7) NULL DEFAULT NULL,
|
||||||
`password` VARCHAR(7) NULL DEFAULT NULL,
|
`password` VARCHAR(7) NULL DEFAULT NULL,
|
||||||
|
@ -671,49 +674,26 @@ function InstallDB_createButtonConfigTrigger() {
|
||||||
global $db;
|
global $db;
|
||||||
outn("<li>" . _("(Re)Create buttonconfig trigger") . "</li>");
|
outn("<li>" . _("(Re)Create buttonconfig trigger") . "</li>");
|
||||||
$sql = "DROP TRIGGER IF EXISTS sccp_trg_buttonconfig;";
|
$sql = "DROP TRIGGER IF EXISTS sccp_trg_buttonconfig;";
|
||||||
/* $sql = "DELIMITER $$
|
|
||||||
CREATE TRIGGER sccp_trg_buttonconfig BEFORE INSERT ON sccpbuttonconfig
|
$sql .= "CREATE TRIGGER `sccp_trg_buttonconfig` BEFORE INSERT ON `sccpbuttonconfig` FOR EACH ROW BEGIN
|
||||||
FOR EACH ROW
|
IF NEW.`reftype` = 'sccpdevice' THEN
|
||||||
BEGIN
|
IF (SELECT COUNT(*) FROM `sccpdevice` WHERE `sccpdevice`.`name` = NEW.`ref` ) = 0 THEN
|
||||||
IF NEW.`reftype` = 'sccpdevice' THEN
|
UPDATE `Foreign key contraint violated: ref does not exist in sccpdevice` SET x=1;
|
||||||
IF (SELECT COUNT(*) FROM `sccpdevice` WHERE `sccpdevice`.`name` = NEW.`ref` ) = 0 THEN
|
END IF;
|
||||||
UPDATE `Foreign key contraint violated: ref does not exist in sccpdevice` SET x=1;
|
|
||||||
END IF;
|
END IF;
|
||||||
END IF;
|
IF NEW.`reftype` = 'sccpline' THEN
|
||||||
IF NEW.`reftype` = 'sccpline' THEN
|
IF (SELECT COUNT(*) FROM `sccpline` WHERE `sccpline`.`name` = NEW.`ref`) = 0 THEN
|
||||||
IF (SELECT COUNT(*) FROM `sccpline` WHERE `sccpline`.`name` = NEW.`ref`) = 0 THEN
|
UPDATE `Foreign key contraint violated: ref does not exist in sccpline` SET x=1;
|
||||||
UPDATE `Foreign key contraint violated: ref does not exist in sccpline` SET x=1;
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
END IF;
|
IF NEW.`buttontype` = 'line' THEN
|
||||||
IF NEW.`buttontype` = 'line' THEN
|
SET @line_x = SUBSTRING_INDEX(NEW.`name`,'!',1);
|
||||||
SET @line_x = SUBSTRING_INDEX(NEW.`name`,'!',1);
|
SET @line_x = SUBSTRING_INDEX(@line_x,'@',1);
|
||||||
SET @line_x = SUBSTRING_INDEX(@line_x,'@',1);
|
IF (SELECT COUNT(*) FROM `sccpline` WHERE `sccpline`.`name` = @line_x ) = 0 THEN
|
||||||
IF (SELECT COUNT(*) FROM `sccpline` WHERE `sccpline`.`name` = @line_x ) = 0 THEN
|
UPDATE `Foreign key contraint violated: line does not exist in sccpline` SET x=1;
|
||||||
UPDATE `Foreign key contraint violated: line does not exist in sccpline` SET x=1;
|
END IF;
|
||||||
END IF;
|
END IF;
|
||||||
END IF;
|
END;";
|
||||||
END $$
|
|
||||||
DELIMITER ;";*/
|
|
||||||
$sql .= "
|
|
||||||
CREATE TRIGGER `sccp_trg_buttonconfig` BEFORE INSERT ON `sccpbuttonconfig` FOR EACH ROW BEGIN
|
|
||||||
IF NEW.`reftype` = 'sccpdevice' THEN
|
|
||||||
IF (SELECT COUNT(*) FROM `sccpdevice` WHERE `sccpdevice`.`name` = NEW.`ref` ) = 0 THEN
|
|
||||||
UPDATE `Foreign key contraint violated: ref does not exist in sccpdevice` SET x=1;
|
|
||||||
END IF;
|
|
||||||
END IF;
|
|
||||||
IF NEW.`reftype` = 'sccpline' THEN
|
|
||||||
IF (SELECT COUNT(*) FROM `sccpline` WHERE `sccpline`.`name` = NEW.`ref`) = 0 THEN
|
|
||||||
UPDATE `Foreign key contraint violated: ref does not exist in sccpline` SET x=1;
|
|
||||||
END IF;
|
|
||||||
END IF;
|
|
||||||
IF NEW.`buttontype` = 'line' THEN
|
|
||||||
SET @line_x = SUBSTRING_INDEX(NEW.`name`,'!',1);
|
|
||||||
SET @line_x = SUBSTRING_INDEX(@line_x,'@',1);
|
|
||||||
IF (SELECT COUNT(*) FROM `sccpline` WHERE `sccpline`.`name` = @line_x ) = 0 THEN
|
|
||||||
UPDATE `Foreign key contraint violated: line does not exist in sccpline` SET x=1;
|
|
||||||
END IF;
|
|
||||||
END IF;
|
|
||||||
END";
|
|
||||||
$check = $db->query($sql);
|
$check = $db->query($sql);
|
||||||
if (DB::IsError($check)) {
|
if (DB::IsError($check)) {
|
||||||
die_freepbx("Can not modify sccpdevice table\n");
|
die_freepbx("Can not modify sccpdevice table\n");
|
||||||
|
@ -775,22 +755,42 @@ function InstallDB_CreateSccpDeviceConfigView($sccp_compatible) {
|
||||||
LEFT JOIN sccpbuttonconfig userbutton ON ( userbutton.ref = sccpdevice._loginname )
|
LEFT JOIN sccpbuttonconfig userbutton ON ( userbutton.ref = sccpdevice._loginname )
|
||||||
LEFT JOIN sccpline ON ( sccpline.name = sccpdevice._loginname)
|
LEFT JOIN sccpline ON ( sccpline.name = sccpdevice._loginname)
|
||||||
GROUP BY sccpdevice.name;";
|
GROUP BY sccpdevice.name;";
|
||||||
*/
|
*/
|
||||||
$sql = "
|
$sql = "DROP VIEW IF EXISTS `sccpdeviceconfig`;
|
||||||
CREATE OR REPLACE
|
DROP VIEW IF EXISTS `sccpuserconfig`;";
|
||||||
ALGORITHM = MERGE
|
/// global $hw_mobil;
|
||||||
VIEW sccpdeviceconfig AS
|
|
||||||
SELECT case sccpdevice._profileid
|
global $mobile_hw;
|
||||||
when 0 then
|
if ($mobile_hw == '1') {
|
||||||
(select GROUP_CONCAT(CONCAT_WS( ',', defbutton.buttontype, defbutton.name, defbutton.options ) SEPARATOR ';') from `sccpbuttonconfig` as defbutton where defbutton.ref = sccpdevice.name ORDER BY defbutton.instance )
|
$sql .= "CREATE OR REPLACE ALGORITHM = MERGE VIEW sccpdeviceconfig AS
|
||||||
when 1 then
|
SELECT GROUP_CONCAT( CONCAT_WS( ',', sccpbuttonconfig.buttontype, sccpbuttonconfig.name, sccpbuttonconfig.options )
|
||||||
(select GROUP_CONCAT(CONCAT_WS( ',', userbutton.buttontype, userbutton.name, userbutton.options ) SEPARATOR ';') from `sccpbuttonconfig` as userbutton where userbutton.ref = sccpdevice._loginname ORDER BY userbutton.instance )
|
ORDER BY instance ASC SEPARATOR ';' ) AS sccpbutton, sccpdevice.*
|
||||||
when 2 then
|
FROM sccpdevice
|
||||||
(select GROUP_CONCAT(CONCAT_WS( ',', homebutton.buttontype, homebutton.name, homebutton.options ) SEPARATOR ';') from `sccpbuttonconfig` as homebutton where homebutton.ref = sccpusers.homedevice ORDER BY homebutton.instance )
|
LEFT JOIN sccpbuttonconfig ON (sccpbuttonconfig.reftype = 'sccpdevice' AND sccpbuttonconfig.ref = sccpdevice.name )
|
||||||
end as button, sccpdevice.*, if(sccpdevice._profileid = 0, sccpdevice._description, sccpusers.description) as description
|
GROUP BY sccpdevice.name; ";
|
||||||
FROM sccpdevice
|
$sql .= "CREATE OR REPLACE ALGORITHM = MERGE VIEW sccpuserconfig AS
|
||||||
LEFT JOIN sccpusers sccpusers ON ( sccpusers.name = sccpdevice._loginname )
|
SELECT GROUP_CONCAT( CONCAT_WS( ',', sccpbuttonconfig.buttontype, sccpbuttonconfig.name, sccpbuttonconfig.options )
|
||||||
GROUP BY sccpdevice.name;";
|
ORDER BY instance ASC SEPARATOR ';' ) AS button, sccpuser.*
|
||||||
|
FROM sccpuser
|
||||||
|
LEFT JOIN sccpbuttonconfig ON ( sccpbuttonconfig.reftype = 'sccpuser' AND sccpbuttonconfig.ref = sccpuser.id)
|
||||||
|
GROUP BY sccpuser.name; ";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$sql .= "CREATE OR REPLACE
|
||||||
|
ALGORITHM = MERGE
|
||||||
|
VIEW sccpdeviceconfig AS
|
||||||
|
SELECT case sccpdevice._profileid
|
||||||
|
when 0 then
|
||||||
|
(select GROUP_CONCAT(CONCAT_WS( ',', defbutton.buttontype, defbutton.name, defbutton.options ) SEPARATOR ';') from `sccpbuttonconfig` as defbutton where defbutton.ref = sccpdevice.name ORDER BY defbutton.instance )
|
||||||
|
when 1 then
|
||||||
|
(select GROUP_CONCAT(CONCAT_WS( ',', userbutton.buttontype, userbutton.name, userbutton.options ) SEPARATOR ';') from `sccpbuttonconfig` as userbutton where userbutton.ref = sccpdevice._loginname ORDER BY userbutton.instance )
|
||||||
|
when 2 then
|
||||||
|
(select GROUP_CONCAT(CONCAT_WS( ',', homebutton.buttontype, homebutton.name, homebutton.options ) SEPARATOR ';') from `sccpbuttonconfig` as homebutton where homebutton.ref = sccpuser.homedevice ORDER BY homebutton.instance )
|
||||||
|
end as button, if(sccpdevice._profileid = 0, sccpdevice._description, sccpuser.description) as description, sccpdevice.*
|
||||||
|
FROM sccpdevice
|
||||||
|
LEFT JOIN sccpuser sccpuser ON ( sccpuser.name = sccpdevice._loginname )
|
||||||
|
GROUP BY sccpdevice.name;";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$results = $db->query($sql);
|
$results = $db->query($sql);
|
||||||
if (DB::IsError($check)) {
|
if (DB::IsError($check)) {
|
||||||
|
@ -907,7 +907,7 @@ $sccp_db_ver = CheckSCCPManagerDBVersion();
|
||||||
// BackUp Old config
|
// BackUp Old config
|
||||||
CreateBackUpConfig();
|
CreateBackUpConfig();
|
||||||
|
|
||||||
InstallDB_sccpusers();
|
InstallDB_sccpuser();
|
||||||
InstallDB_Buttons();
|
InstallDB_Buttons();
|
||||||
|
|
||||||
InstallDB_sccpsettings();
|
InstallDB_sccpsettings();
|
||||||
|
|
|
@ -11,7 +11,7 @@ $dev_new = null;
|
||||||
if (!empty($_REQUEST['ru_id'])) {
|
if (!empty($_REQUEST['ru_id'])) {
|
||||||
$dev_id = $_REQUEST['ru_id'];
|
$dev_id = $_REQUEST['ru_id'];
|
||||||
$def_val['id'] = array("keyword" => 'id', "data" => $dev_id, "seq" => "99");
|
$def_val['id'] = array("keyword" => 'id', "data" => $dev_id, "seq" => "99");
|
||||||
$db_res = $this->dbinterface->get_db_SccpTableData('get_sccpdusers', array("id" => $dev_id));
|
$db_res = $this->dbinterface->get_db_SccpTableData('get_sccpuser', array("id" => $dev_id));
|
||||||
if (!empty($db_res) ) {
|
if (!empty($db_res) ) {
|
||||||
foreach ($db_res as $key => $val) {
|
foreach ($db_res as $key => $val) {
|
||||||
if (!empty($val)) {
|
if (!empty($val)) {
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-checkbox="true"></th>
|
<th data-checkbox="true"></th>
|
||||||
<th data-sortable="true" data-field="mac"><?php echo _('Device SEP ID') ?></th>
|
<th data-sortable="true" data-field="mac"><?php echo _('Device SEP ID') ?></th>
|
||||||
<th data-sortable="true" data-field="description"><?php echo _('Device Descriptions') ?></th>
|
<th data-sortable="true" data-field="description"><?php echo _('Device Descriptions') ?></th>
|
||||||
<th data-sortable="true" data-formatter="DispayTypeFormatter" data-field="type"><?php echo _('Device type') ?></th>
|
<th data-sortable="true" data-formatter="DispayTypeFormatter" data-field="type"><?php echo _('Device type') ?></th>
|
||||||
<th data-sortable="false" data-field="button" data-formatter="LineFormatter"><?php echo _('Line') ?></th>
|
<th data-sortable="false" data-field="button" data-formatter="LineFormatter"><?php echo _('Line') ?></th>
|
||||||
|
@ -73,6 +73,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function LineFormatter(value, row, index) {
|
function LineFormatter(value, row, index) {
|
||||||
|
if (value === null) {
|
||||||
|
return '-- EMPTY --';
|
||||||
|
}
|
||||||
var data = value.split(";");
|
var data = value.split(";");
|
||||||
result = '';
|
result = '';
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
|
Loading…
Reference in a new issue