From 93e0274ef130b72b9375d3e0adcfe88ba5d16702 Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Tue, 9 Aug 2016 12:59:33 +0200 Subject: Added link from locations module to roomplanner. --- modules-available/locations/inc/location.inc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modules-available/locations/inc') diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php index 69ddb4ee..a018208d 100644 --- a/modules-available/locations/inc/location.inc.php +++ b/modules-available/locations/inc/location.inc.php @@ -137,6 +137,7 @@ class Location 'locationid' => $node['locationid'], 'locationname' => $node['locationname'], 'locationpad' => str_repeat('--', $depth), + 'isleaf' => empty($node['children']), 'depth' => $depth ); if (!empty($node['children'])) { @@ -146,6 +147,15 @@ class Location return $output; } + public static function isLeaf($locationid) { + $result = Database::queryFirst('SELECT COUNT(locationid) = 0 AS isleaf ' + . 'FROM location ' + . 'WHERE parentlocationid = :locationid', ['locationid' => $locationid]); + $result = $result['isleaf']; + settype($result, 'bool'); + return $result; + } + public static function extractIds($tree) { $ids = array(); @@ -298,6 +308,7 @@ class Location return $locs; } + private static function findOverlap($locs, $subnets, &$overlapSelf, &$overlapOther) { if ($overlapSelf) { -- cgit v1.2.3-55-g7522