]> wagnertech.de Git - timetracker.git/blobdiff - week.php
Disabled controls in week view with null values for TYPE_START_FINISH entry mode.
[timetracker.git] / week.php
index a015e85dd028d6ac08ba91e1601b03c3f96b63b3..d6fb6a3b5d82eddd2ef1854237a30ae137dddc92 100644 (file)
--- a/week.php
+++ b/week.php
@@ -146,6 +146,12 @@ class TimeCellRenderer extends DefaultCellRenderer {
     $field->setFormName($table->getFormName());
     $field->setSize(2);
     $field->setValue($table->getValueAt($row,$column)['duration']);
+    // Disable control when time entry mode is TYPE_START_FINISH and there is no value in control
+    // because we can't supply start and finish times in week view - there are no fields for them.
+    global $user;
+    if (!$field->getValue() && TYPE_START_FINISH == $user->record_type) {
+        $field->setEnabled(false);
+    }
     $this->setValue($field->getHtml());
     return $this->toString();
   }