Yealink directory listing for extensions, groups, users contacts (#1588)

* Fix Yealink provisioning for contacts/groups

Fix the Yealink provision templates to allow for directory_extensions,
groups and users.

* Fix group_uuid and user_uuid messup

* Yealink directory and provisioning changes

Includes the changes from PR 1582 with some fixes to the SQL.

Also merged all the directory_* options into ONE directory.xml

Will need to call the it with any of these:

http://mydomain/app/provision/?file=directory.xml&contacts=groups

http://mydomain/app/provision/?file=directory.xml&contacts=users

http://mydomain/app/provision/?file=directory.xml&contacts=extensions

http://mydomain/app/provision/?file=directory.xml&contacts=all
This commit is contained in:
Chris Black
2016-05-12 10:22:40 -07:00
committed by FusionPBX
parent 8e01682c3c
commit 7b99a14f67
14 changed files with 465 additions and 173 deletions

View File

@@ -76,13 +76,13 @@ else {
$sql .= "and ( \n"; //only contacts assigned to current user's group(s) and those not assigned to any group
$sql .= " contact_uuid in ( \n";
$sql .= " select contact_uuid from v_contact_groups ";
$sql .= " where group_uuid in ('".implode("','", $user_group_uuids)."') ";
$sql .= " where group_uuid in ('".implode("','", array_filter($user_group_uuids))."') ";
$sql .= " and domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= " ) \n";
$sql .= " or \n";
$sql .= " contact_uuid not in ( \n";
$sql .= " select contact_uuid from v_contact_groups ";
$sql .= " where user_uuid = '".$_SESSION['user_uuid']."' ";
$sql .= " where group_uuid = '".$_SESSION['group_uuid']."' ";
$sql .= " and domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= " ) \n";
$sql .= ") \n";
@@ -105,7 +105,7 @@ else {
$sql .= "and ( \n"; //only contacts assigned to current user's group(s) and those not assigned to any group
$sql .= " contact_uuid in ( \n";
$sql .= " select contact_uuid from v_contact_groups ";
$sql .= " where group_uuid in ('".implode("','", $user_group_uuids)."') ";
$sql .= " where group_uuid in ('".implode("','", array_filter($user_group_uuids))."') ";
$sql .= " and domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= " ) \n";
$sql .= " or contact_uuid in ( \n";