From 759621718acb3321e844381f94704e585a964cd4 Mon Sep 17 00:00:00 2001 From: anuko Date: Thu, 28 Dec 2017 17:50:22 +0000 Subject: [PATCH] Disabled controls in week view with null values for TYPE_START_FINISH entry mode. --- WEB-INF/templates/footer.tpl | 2 +- week.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 8f482093..ab87268a 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.13.0.3702| Copyright © Anuko | +  Anuko Time Tracker 1.13.0.3703| Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/week.php b/week.php index a015e85d..d6fb6a3b 100644 --- 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(); } -- 2.20.1