summaryrefslogtreecommitdiffstats
path: root/modules-available/locations/inc
diff options
context:
space:
mode:
authorChristian Klinger2016-08-09 12:59:33 +0200
committerChristian Klinger2016-08-09 12:59:33 +0200
commit93e0274ef130b72b9375d3e0adcfe88ba5d16702 (patch)
treeec19f3f61bbcf3b8c98ec0411fbccad9198494df /modules-available/locations/inc
parentloading & saving of roomconfig. (diff)
downloadslx-admin-93e0274ef130b72b9375d3e0adcfe88ba5d16702.tar.gz
slx-admin-93e0274ef130b72b9375d3e0adcfe88ba5d16702.tar.xz
slx-admin-93e0274ef130b72b9375d3e0adcfe88ba5d16702.zip
Added link from locations module to roomplanner.
Diffstat (limited to 'modules-available/locations/inc')
-rw-r--r--modules-available/locations/inc/location.inc.php11
1 files changed, 11 insertions, 0 deletions
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) {