]> wagnertech.de Git - timetracker.git/commitdiff
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 e4fb3c0a31b16d547362756dede2099c96d82aa8..c0dd256d5ef85b11f6156c4332ceda5c04fc8e9c 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 f64a76c09ea0194afdbd23658b366a058a35e055..915d241f292ca329ae0944e89b803016c46b1eb8 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 130cc3d66efa4c822c75b836c8eeda34bbe596f9..af0960ae6d2d1b8bc5ec8cab7791bbead5e4ea98 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 08e3fc067b3bdb57a15916ab42d3d41574c5d7e6..523fabf84890ca8519eb7edeb3c98e02fa79ae3b 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 0a300d8e454be63003517c4fca5a44ea0c4cc437..dd3c68bbcd2830c31dd9c203cebeae0728189bb3 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 262c4f45fb020c8c737fa51f023a293cf57d7f6e..41cbcec6230de0018e18ab06d761c3fee3db3225 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 7a9b178ca2bf1ec032c39a215dc81fee11a7277e..a9771451751a9df3c2d469649c0702515f2a68be 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 e5330ca96e515fb6e96eb19232c31eb3a7003afb..73f15638ab49de76e795a0ae9c09a2addc546cd1 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 0caf6e50ba1fd06e33b4b71c07170c96262f6435..b6b487dece8591abe2bb79d2d6963c93d97986a5 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 69a71332aa5ecfcd36f1b6847953fb745ecbef62..ea56258bcd500fcb6dba71b8f95edbccbaa189f7 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 d4d9eb91ac8b6e4b297aeac20481305d283702a0..116de7cefaa45cf929bb0039124036eb6aa5abd6 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 6becda6be61ca688678812aca76f627f72b159e7..f1c98c9846fe6a691e8fa8538b81184952068c00 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 eb39469f7d714341aaf119aa91384c6330955747..288eaa512e20526240a22310c82aabaedd189c80 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 9ce2735b025788cf71a4f6d9648daae3f4364855..70e6d0782ecc56c6fd02acb26601164014fbf18f 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 dd94782e9e667d50ad11f28c8cf0dd4577bd54cd..e9e3a8bdb2ba7ae8bafb27ff9a3299ad1ae92a31 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 074abd55709e1abb553a459e868c30189f734210..396dbfe4e2adcff586177a9f48c3e6cafe6cfc8b 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 e20543955828bb5956907468c36f2e4408e152ae..e89da2ff50e2190c9d85d66b286202189564e08e 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 6948e80416e74d62aad1fe5d24b8143ea2921bf2..c77f4b89dea40cc576c30d5c6e782c2e790808af 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 ec5fa51157b21035d37ae1ed3fd26bb27dfcfd79..13040d669d202f3092c195c0c7bb1f6a747e9f50 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 1cf774644f8a05d99735bc45bf9523e75377cdce..c71fdabd7948abc028b19649b5243ef01bb186b6 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 7ea5e96efea9226e7e88784dba3bc69efd91143b..9d833c3b934e58502eea77b1b8bc72cc6e54b9e6 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 a832f7e67b47955b40d072f51c1d70411634c59e..0e4f76de0483f728b2bb8baee462cc15d322b8af 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 b0923333ab9427c22ceb630a69dd5f0ccf6dea0a..52617669e7a78ce04961f6691bf0d00986ac3444 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 3dfc9fdcdee85bf323b38e1516c57aed95d44ef4..d3a6ef99769952a4df812b485607ee423feaabde 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 76e78705e247a94c2f0a685dc522e857a3cf4034..13a2446fd4e75d7194f5f7e79691c64867a9ae85 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 81bcc7259aa37f6ef0c9567d90c8af49602e1dc3..d0ebdc3ece20d5be1085549983e35e022d6166f3 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 bdf54a49997b408e0ef76eeaad54ff557f241a07..0cc067f2f0d4412370b596fbec1aa467a8022dc7 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 519f9a136903456815b0ea8129d7561e83ee60df..ea3ec697255f0d4781dc84dadb0cb2fed824d52a 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 567bb5445a184a171445a0304409c0a3087849bd..dc9a3eecab131044c9222b2b2898c24798c2c710 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 ce0d563afeeb9c31a49ded19bd53b5b4baabbfd9..c0f8f9786138e31c59e2ed3acb0e8261ba96978d 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 59b4916fff1b94f66f1888da632379268f20d17f..26d80a5d2246a1e15699f237f83e6db3910468a5 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 bd66279d9dc4883bfa253bc449b264380cfc9dc3..b40cfc321c7c69ef25b76ef5ceec79d2646350bc 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 b95b9d85c003349f62c0c007a55253bdffc11c18..66f277324edc0b677a4eeacde429d5ae47b02e49 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 420a1985af811e096d852f1f4bd963eb5de5336e..51d01cc2b6a183e6d193ba3c4230195619b76753 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 d7d815c34310500c41d67f07bb5ffabdaba8805f..f13c7919e0f92eae9028eecba743002d47361dbc 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 2d1c53064352b6ae597ae4793b2cd0e57e2e5c43..99418276b38f2eb7d84504f98e74f9078614c937 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 c2df1abb65e1bfd4a2d91c7907dcbe12ab5d75da..69c13eccaa7369708b3eaae75683094c6bf8ed38 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 790a7ace0966a8b62424930168304c134f637fe8..dd8e87c0a1fbf4954c05e052d9949c5635de5c49 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 2b1f8395bd3a40372724cb4b2ee11c9bb556b7d3..827eadcaeaa8dfefb0efb3ccbd40629c83a43380 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 81337c9c2ff0adb8237b1cb90f24cfb17eb83153..1e1a3897d662e920608d8001124e807090d9d709 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 1fa6c137750291a96e06a21b67e079595eaf43a5..95790311d53c937d2dcd86ac664758fd0bfc80b2 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 7ce14f66af7698f5f1fce658ec67473c85ad49fe..fc13d0c5f97abc962a862d37f0d686bba0257df3 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 11f95c49ea4106b8484b97b93261e4d04219b7b9..9fca8898a9a54d87f5bc6db04650c35618ec9823 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 d24d7f19b8a8b9c004a4687a822a8358c5ede327..6071997147ed27e5660537da4d8f9343122c1ed6 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'));