A fix for work units in totals only report.
[timetracker.git] / WEB-INF / lib / ttUser.class.php
index 2d7f1c9..9de260b 100644 (file)
@@ -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);