From 4c63df1707fc6544e380af0e2e77ccdc84ab00a7 Mon Sep 17 00:00:00 2001 From: anuko Date: Sat, 6 May 2017 18:08:47 +0000 Subject: [PATCH] When task entry is required - pre-selected a task when there is only one task available. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/time_script.tpl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index d4ff45b8..66cf675f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.11.43.3629 | Copyright © Anuko | +  Anuko Time Tracker 1.11.43.3630 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/time_script.tpl b/WEB-INF/templates/time_script.tpl index 275f74c6..109f67ee 100644 --- a/WEB-INF/templates/time_script.tpl +++ b/WEB-INF/templates/time_script.tpl @@ -143,6 +143,11 @@ function fillTaskDropdown(id) { } } } + + // Select a task if user is required to do so and there is only one task available. + if ({$user->task_required} && dropdown.options.length == 2) { // 2 because of mandatory top option. + dropdown.options[1].selected = true; + } } } -- 2.20.1