Disabled controls in week view with null values for TYPE_START_FINISH entry mode.
authoranuko <support@anuko.com>
Thu, 28 Dec 2017 17:50:22 +0000 (17:50 +0000)
committeranuko <support@anuko.com>
Thu, 28 Dec 2017 17:50:22 +0000 (17:50 +0000)
WEB-INF/templates/footer.tpl
week.php

index 8f48209..ab87268 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.13.0.3702| Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.13.0.3703| Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index a015e85..d6fb6a3 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();
   }