X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=WEB-INF%2Flib%2FttUser.class.php;h=9de260b84c058721c22c53135bba31532256db2c;hb=e489a39d1dd1ad0293c45d887433d47b7734979f;hp=c00bd9f42cd62ec8563aff8426ff76d174b387f3;hpb=fafb0ae8f7098ffafa6799627891bd40f4811a52;p=timetracker.git diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index c00bd9f4..9de260b8 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -144,7 +144,7 @@ class ttUser { $this->allow_overlap = $config->getDefinedValue('allow_overlap'); $this->future_entries = $config->getDefinedValue('future_entries'); if ($this->isPluginEnabled('wu')) { - $minutes_in_unit = $config->getIntValue('minutes_in_unit'); + $minutes_in_unit = $config->getIntValue('minutes_in_unit', 15); if ($minutes_in_unit) $this->minutes_in_unit = $minutes_in_unit; $first_unit_threshold = $config->getIntValue('1st_unit_threshold'); if ($first_unit_threshold) $this->first_unit_threshold = $first_unit_threshold; @@ -235,6 +235,12 @@ class ttUser { return $config->getDefinedValue($name); } + // getConfigInt retruns an integer value defined in a group, or false. + function getConfigInt($name, $defaultVal) { + $config = new ttConfigHelper($this->getConfig()); + return $config->getIntValue($name, $defaultVal); + } + // can - determines whether user has a right to do something. function can($do_something) { return in_array($do_something, $this->rights); @@ -294,8 +300,11 @@ class ttUser { $mdb2 = getConnection(); $tasks = implode(',', $task_ids); // This is a comma-separated list of task ids. + $group_id = $this->getGroup(); + $org_id = $this->org_id; + $sql = "select id, name, description from tt_tasks". - " where group_id = $this->group_id and status = 1 and id in ($tasks) order by name"; + " where group_id = $group_id and org_id = $org_id and status = 1 and id in ($tasks) order by name"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { while ($val = $res->fetchRow()) {