From e2e9fee43442d763d279b767220058ce067971da Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Fri, 18 Mar 2011 10:21:14 +0000 Subject: [PATCH] [drupal] plot sensors based on chart field in {logger_meters} --- server/drupal/modules/logger/logger.module | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/server/drupal/modules/logger/logger.module b/server/drupal/modules/logger/logger.module index 8db0159..09a9e3e 100644 --- a/server/drupal/modules/logger/logger.module +++ b/server/drupal/modules/logger/logger.module @@ -319,10 +319,18 @@ function _logger_dashboard($type, $function, $interval) { WHERE uid = %d AND type = '%s' AND function = '%s' ORDER BY created", $user->uid, $type, $function)); - $result_me = db_query("SELECT meter, function - FROM {logger_meters} - WHERE uid = %d AND type = '%s' - ORDER BY function", $user->uid, $type); + if (in_array('pro', array_values($user->roles))) + $result_me = db_query("SELECT meter, function + FROM {logger_meters} + WHERE uid = %d AND type = '%s' and chart = %d + ORDER BY function", $user->uid, $type, 1); + + else + $result_me = db_query("SELECT meter, function + FROM {logger_meters} + WHERE uid = %d AND type = '%s' + ORDER BY function", $user->uid, $type); + $meter_me = db_fetch_object($result_me); $result_sub = db_query("SELECT u.name, lm.meter, lu.private