Update install.php
This commit is contained in:
parent
84170e5f58
commit
4d4b95fc5b
30
install.php
30
install.php
|
@ -932,19 +932,23 @@ function InstallDB_CreateSccpDeviceConfigView($sccp_compatible)
|
||||||
GROUP BY sccpuser.name; ";
|
GROUP BY sccpuser.name; ";
|
||||||
} else {
|
} else {
|
||||||
$sql .= "CREATE OR REPLACE
|
$sql .= "CREATE OR REPLACE
|
||||||
ALGORITHM = MERGE
|
ALGORITHM = MERGE
|
||||||
VIEW sccpdeviceconfig AS
|
VIEW sccpdeviceconfig AS
|
||||||
SELECT case sccpdevice._profileid
|
SELECT CASE sccpdevice._profileid
|
||||||
when 0 then
|
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 )
|
(SELECT GROUP_CONCAT(CONCAT_WS( ',', defbutton.buttontype, defbutton.name, defbutton.options ) SEPARATOR ';')
|
||||||
when 1 then
|
FROM sccpbuttonconfig AS defbutton, sccpdevice WHERE defbutton.ref = sccpdevice.name ORDER BY defbutton.instance )
|
||||||
(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 1 THEN
|
||||||
when 2 then
|
(SELECT GROUP_CONCAT(CONCAT_WS( ',', userbutton.buttontype, userbutton.name, userbutton.options ) SEPARATOR ';')
|
||||||
(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 )
|
FROM sccpbuttonconfig AS userbutton, sccpdevice WHERE userbutton.ref = sccpdevice._loginname ORDER BY userbutton.instance )
|
||||||
end as button, if(sccpdevice._profileid = 0, sccpdevice._description, sccpuser.description) as description, sccpdevice.*
|
WHEN 2 THEN
|
||||||
FROM sccpdevice
|
(SELECT GROUP_CONCAT(CONCAT_WS( ',', homebutton.buttontype, homebutton.name, homebutton.options ) SEPARATOR ';')
|
||||||
LEFT JOIN sccpuser sccpuser ON ( sccpuser.name = sccpdevice._loginname )
|
FROM sccpbuttonconfig AS homebutton, sccpdevice WHERE homebutton.ref = sccpuser.homedevice ORDER BY homebutton.instance )
|
||||||
GROUP BY sccpdevice.name;";
|
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);
|
||||||
|
|
Loading…
Reference in a new issue