FUTURE_ENTRIES option is now configurable as per issue #53.
authorNik Okuntseff <support@anuko.com>
Wed, 14 Feb 2018 23:15:00 +0000 (23:15 +0000)
committerNik Okuntseff <support@anuko.com>
Wed, 14 Feb 2018 23:15:00 +0000 (23:15 +0000)
44 files changed:
WEB-INF/config.php.dist
WEB-INF/lib/ttUser.class.php
WEB-INF/lib/ttWeekViewHelper.class.php
WEB-INF/resources/ca.lang.php
WEB-INF/resources/cs.lang.php
WEB-INF/resources/da.lang.php
WEB-INF/resources/de.lang.php
WEB-INF/resources/en.lang.php
WEB-INF/resources/es.lang.php
WEB-INF/resources/et.lang.php
WEB-INF/resources/fa.lang.php
WEB-INF/resources/fi.lang.php
WEB-INF/resources/fr.lang.php
WEB-INF/resources/he.lang.php
WEB-INF/resources/hu.lang.php
WEB-INF/resources/it.lang.php
WEB-INF/resources/ja.lang.php
WEB-INF/resources/ko.lang.php
WEB-INF/resources/nl.lang.php
WEB-INF/resources/no.lang.php
WEB-INF/resources/pl.lang.php
WEB-INF/resources/pt-br.lang.php
WEB-INF/resources/pt.lang.php
WEB-INF/resources/ro.lang.php
WEB-INF/resources/ru.lang.php
WEB-INF/resources/sk.lang.php
WEB-INF/resources/sl.lang.php
WEB-INF/resources/sr.lang.php
WEB-INF/resources/sv.lang.php
WEB-INF/resources/tr.lang.php
WEB-INF/resources/zh-cn.lang.php
WEB-INF/resources/zh-tw.lang.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/profile_edit.tpl
expense_edit.php
expenses.php
mobile/expense_edit.php
mobile/expenses.php
mobile/time.php
mobile/time_edit.php
mobile/timer.php
profile_edit.php
time.php
time_edit.php

index e4fb3c0..c0dd256 100644 (file)
@@ -81,11 +81,6 @@ define('COST_ON_REPORTS', true);
 // define('READONLY_START_FINISH', false);
 
 
-// FUTURE_ENTRIES - defines whether users can create entries for future dates. Defaults to true.
-//
-// define('FUTURE_ENTRIES', false);
-
-
 // WEEKEND_START_DAY
 //
 // This option defines which days are highlighted with weekend color.
index f64a76c..915d241 100644 (file)
@@ -47,6 +47,7 @@ class ttUser {
   var $task_required = 0;       // Whether task selection is required on time entires.
   var $record_type = 0;         // Record type (duration vs start and finish, or both).
   var $allow_overlap = 0;       // Whether to allow overlapping time entries.
+  var $future_entries = 0;      // Whether to allow creating future entries.
   var $uncompleted_indicators = 0; // Uncompleted time entry indicators (show nowhere or on users page).
   var $bcc_email = null;        // Bcc email.
   var $currency = null;         // Currency.
@@ -115,6 +116,7 @@ class ttUser {
       // Set user config options.
       $this->show_holidays = in_array('show_holidays', $config_array);
       $this->allow_overlap = in_array('allow_overlap', $config_array);
+      $this->future_entries = in_array('future_entries', $config_array);
       $this->uncompleted_indicators = in_array('uncompleted_indicators', $config_array);
 
       // Set "on behalf" id and name.
index 130cc3d..af0960a 100644 (file)
@@ -482,7 +482,7 @@ class ttWeekViewHelper {
     $objEntryDate = new DateAndTime(DB_DATEFORMAT, $entry_date);
 
     // Prohibit creating entries in future.
-    if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES) && $fields['browser_today']) {
+    if (!$user->future_entries && $fields['browser_today']) {
       $objBrowserToday = new DateAndTime(DB_DATEFORMAT, $fields['browser_today']);
       if ($objEntryDate->after($objBrowserToday)) {
         $err->add($i18n->getKey('error.future_date'));
index 08e3fc0..523fabf 100644 (file)
@@ -486,6 +486,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 0a300d8..dd3c68b 100644 (file)
@@ -501,6 +501,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 262c4f4..41cbcec 100644 (file)
@@ -434,6 +434,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'Varighed',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 'form.profile.uncompleted_indicators' => 'Uafsluttede indikatore',
 'form.profile.plugins' => 'Plugins',
 
index 7a9b178..a977145 100644 (file)
@@ -432,6 +432,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'Dauer',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'Erweiterungen',
 
index e5330ca..73f1563 100644 (file)
@@ -427,6 +427,7 @@ $i18n_key_words = array(
 'form.profile.type_start_finish' => 'start and finish',
 'form.profile.type_duration' => 'duration',
 'form.profile.allow_overlap' => 'Allow overlap',
+'form.profile.future_entries' => 'Future entries',
 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'Plugins',
 
index 0caf6e5..b6b487d 100644 (file)
@@ -499,6 +499,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 69a7133..ea56258 100644 (file)
@@ -497,6 +497,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index d4d9eb9..116de7c 100644 (file)
@@ -463,6 +463,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'مدت زمان',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'پلاگین ها',
 
index 6becda6..f1c98c9 100644 (file)
@@ -441,6 +441,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'kesto',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'Lisäosat',
 
index eb39469..288eaa5 100644 (file)
@@ -431,6 +431,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'Durée',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'Plugins',
 
index 9ce2735..70e6d07 100644 (file)
@@ -468,6 +468,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'משך זמן',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'תוספים',
 
index dd94782..e9e3a8b 100644 (file)
@@ -496,6 +496,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 074abd5..396dbfe 100644 (file)
@@ -434,6 +434,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'durata',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 'form.profile.uncompleted_indicators' => 'Indicatori incompleti',
 // TODO: translate the following. If the translation is the same word, indicate so. Plugini, perhaps?
 // 'form.profile.plugins' => 'Plugins',
index e205439..e89da2f 100644 (file)
@@ -486,6 +486,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 6948e80..c77f4b8 100644 (file)
@@ -488,6 +488,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index ec5fa51..13040d6 100644 (file)
@@ -430,6 +430,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'duur',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 'form.profile.uncompleted_indicators' => 'Onvolledige indicatoren',
 'form.profile.plugins' => 'Plugins',
 
index 1cf7746..c71fdab 100644 (file)
@@ -484,6 +484,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 7ea5e96..9d833c3 100644 (file)
@@ -444,6 +444,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'czas trwania',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'Dodatkowe moduły',
 
index a832f7e..0e4f76d 100644 (file)
@@ -439,6 +439,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'duração',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'Plugins',
 
index b092333..5261766 100644 (file)
@@ -477,6 +477,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 3dfc9fd..d3a6ef9 100644 (file)
@@ -494,6 +494,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 76e7870..13a2446 100644 (file)
@@ -425,6 +425,7 @@ $i18n_key_words = array(
 'form.profile.type_start_finish' => 'начало и конец',
 'form.profile.type_duration' => 'длительность',
 'form.profile.allow_overlap' => 'Возможное перекрывание',
+'form.profile.future_entries' => 'Будущие записи',
 'form.profile.uncompleted_indicators' => 'Индикаторы незавершения',
 'form.profile.plugins' => 'Плагины',
 
index 81bcc72..d0ebdc3 100644 (file)
@@ -460,6 +460,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'trvanie',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'Doplnkové moduly',
 
index bdf54a4..0cc067f 100644 (file)
@@ -473,6 +473,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 519f9a1..ea3ec69 100644 (file)
@@ -442,6 +442,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'trajanje',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 'form.profile.plugins' => 'Dodaci',
 
index 567bb54..dc9a3ee 100644 (file)
@@ -439,6 +439,7 @@ $i18n_key_words = array(
 'form.profile.type_duration' => 'Varaktighet',
 // TODO: translate the following.
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 'form.profile.uncompleted_indicators' => 'Indikatorer för oavslutad registrering',
 'form.profile.plugins' => 'Tillägg',
 
index ce0d563..c0f8f97 100644 (file)
@@ -505,6 +505,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index 59b4916..26d80a5 100644 (file)
@@ -473,6 +473,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index bd66279..b40cfc3 100644 (file)
@@ -483,6 +483,7 @@ $i18n_key_words = array(
 // 'form.profile.type_start_finish' => 'start and finish',
 // 'form.profile.type_duration' => 'duration',
 // 'form.profile.allow_overlap' => 'Allow overlap',
+// 'form.profile.future_entries' => 'Future entries',
 // 'form.profile.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.profile.plugins' => 'Plugins',
 
index b95b9d8..66f2773 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.17.19.3991 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.20.3992 | 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 420a198..51d01cc 100644 (file)
@@ -176,6 +176,10 @@ function handlePluginCheckboxes() {
             <td align="right" nowrap>{$i18n.form.profile.allow_overlap}:</td>
             <td>{$forms.profileForm.allow_overlap.control} <a href="https://www.anuko.com/lp/tt_16.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
           </tr>
+          <tr>
+            <td align="right" nowrap>{$i18n.form.profile.future_entries}:</td>
+            <td>{$forms.profileForm.future_entries.control} <a href="https://www.anuko.com/lp/tt_17.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+          </tr>
           <tr>
             <td align="right" nowrap>{$i18n.form.profile.uncompleted_indicators}:</td>
             <td>{$forms.profileForm.uncompleted_indicators.control} <a href="https://www.anuko.com/lp/tt_15.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
index d7d815c..f13c791 100644 (file)
@@ -162,7 +162,7 @@ if ($request->isPost()) {
   $new_date = new DateAndTime($user->date_format, $cl_date);
 
   // Prohibit creating entries in future.
-  if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) {
+  if (!$user->future_entries) {
     $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
     if ($new_date->after($browser_today))
       $err->add($i18n->getKey('error.future_date'));
index 2d1c530..9941827 100644 (file)
@@ -159,7 +159,7 @@ if ($request->isPost()) {
     if (!ttValidFloat($cl_cost)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cost'));
 
     // Prohibit creating entries in future.
-    if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) {
+    if (!$user->future_entries) {
       $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
       if ($selected_date->after($browser_today))
         $err->add($i18n->getKey('error.future_date'));
index c2df1ab..69c13ec 100644 (file)
@@ -144,7 +144,7 @@ if ($request->isPost()) {
   $new_date = new DateAndTime($user->date_format, $cl_date);
 
   // Prohibit creating entries in future.
-  if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) {
+  if (!$user->future_entries) {
     $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
     if ($new_date->after($browser_today))
       $err->add($i18n->getKey('error.future_date'));
index 790a7ac..dd8e87c 100644 (file)
@@ -150,7 +150,7 @@ if ($request->isPost()) {
     if (!ttValidFloat($cl_cost)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.cost'));
 
     // Prohibit creating entries in future.
-    if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) {
+    if (!$user->future_entries) {
       $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
       if ($selected_date->after($browser_today))
         $err->add($i18n->getKey('error.future_date'));
index 2b1f839..827eadc 100644 (file)
@@ -225,7 +225,7 @@ if ($request->isPost()) {
     // Finished validating user input.
 
     // Prohibit creating entries in future.
-    if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) {
+    if (!$user->future_entries) {
       $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
       if ($selected_date->after($browser_today))
         $err->add($i18n->getKey('error.future_date'));
index 81337c9..1e1a389 100644 (file)
@@ -253,7 +253,7 @@ if ($request->isPost()) {
   $new_date = new DateAndTime($user->date_format, $cl_date);
 
   // Prohibit creating entries in future.
-  if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) {
+  if (!$user->future_entries) {
     $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
     if ($new_date->after($browser_today))
       $err->add($i18n->getKey('error.future_date'));
index 1fa6c13..9579031 100644 (file)
@@ -200,7 +200,7 @@ if ($request->isPost()) {
     // Finished validating user input.
 
     // Prohibit creating entries in future.
-    if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) {
+    if (!$user->future_entries) {
       $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
       if ($selected_date->after($browser_today))
         $err->add($i18n->getKey('error.future_date'));
index 7ce14f6..fc13d0c 100644 (file)
@@ -63,6 +63,7 @@ if ($request->isPost()) {
     $cl_task_required = $request->getParameter('task_required');
     $cl_record_type = $request->getParameter('record_type');
     $cl_allow_overlap = $request->getParameter('allow_overlap');
+    $cl_future_entries = $request->getParameter('future_entries');
     $cl_uncompleted_indicators = $request->getParameter('uncompleted_indicators');
     $cl_bcc_email = trim($request->getParameter('bcc_email'));
 
@@ -98,6 +99,7 @@ if ($request->isPost()) {
     $cl_task_required = $user->task_required;
     $cl_record_type = $user->record_type;
     $cl_allow_overlap = $user->allow_overlap;
+    $cl_future_entries = $user->future_entries;
     $cl_uncompleted_indicators = $user->uncompleted_indicators;
     $cl_bcc_email = $user->bcc_email;
 
@@ -194,6 +196,9 @@ if ($user->canManageTeam()) {
   // Allow overlap checkbox.
   $form->addInput(array('type'=>'checkbox','name'=>'allow_overlap','value'=>$cl_allow_overlap));
 
+  // Future entries checkbox.
+  $form->addInput(array('type'=>'checkbox','name'=>'future_entries','value'=>$cl_future_entries));
+
   // Uncompleted indicators checkbox.
   $form->addInput(array('type'=>'checkbox','name'=>'uncompleted_indicators','value'=>$cl_uncompleted_indicators));
 
@@ -290,6 +295,8 @@ if ($request->isPost()) {
         $config .= ',show_holidays';
       if ($cl_allow_overlap)
         $config .= ',allow_overlap';
+      if ($cl_future_entries)
+        $config .= ',future_entries';
       if ($cl_uncompleted_indicators)
         $config .= ',uncompleted_indicators';
       $config = trim($config, ',');
index 11f95c4..9fca889 100644 (file)
--- a/time.php
+++ b/time.php
@@ -260,7 +260,7 @@ if ($request->isPost()) {
     // Finished validating user input.
 
     // Prohibit creating entries in future.
-    if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) {
+    if (!$user->future_entries) {
       $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
       if ($selected_date->after($browser_today))
         $err->add($i18n->getKey('error.future_date'));
index d24d7f1..6071997 100644 (file)
@@ -259,7 +259,7 @@ if ($request->isPost()) {
   $new_date = new DateAndTime($user->date_format, $cl_date);
 
   // Prohibit creating entries in future.
-  if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) {
+  if (!$user->future_entries) {
     $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null));
     if ($new_date->after($browser_today))
       $err->add($i18n->getKey('error.future_date'));