Made Allow overlap a configurable option.
authorNik Okuntseff <support@anuko.com>
Tue, 13 Feb 2018 23:16:31 +0000 (23:16 +0000)
committerNik Okuntseff <support@anuko.com>
Tue, 13 Feb 2018 23:16:31 +0000 (23:16 +0000)
WEB-INF/config.php.dist
WEB-INF/lib/ttTimeHelper.class.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/profile_edit.tpl
profile_edit.php

index fed4eea..e4fb3c0 100644 (file)
@@ -70,12 +70,6 @@ define('APP_NAME', '');
 // define('OLD_PASSWORDS', true);
 
 
-// Holidays. At this time holiday days are defined in the localization files (one file per language).
-// The SHOW_HOLIDAYS option defines whether holidays are highlighted with holiday color.
-//
-define('SHOW_HOLIDAYS', true);
-
-
 // COST_ON_REPORTS - defines the availability of the Cost field on the Reports page.
 //
 define('COST_ON_REPORTS', true);
@@ -92,11 +86,6 @@ define('COST_ON_REPORTS', true);
 // define('FUTURE_ENTRIES', false);
 
 
-// ALLOW_OVERLAP - defines whether overlapping time entries are allowed. Defaults to false.
-//
-// define('ALLOW_OVERLAP', true);
-
-
 // WEEKEND_START_DAY
 //
 // This option defines which days are highlighted with weekend color.
index 7bc5e64..7cbf4dd 100644 (file)
@@ -595,8 +595,8 @@ class ttTimeHelper {
   //   $record_id - optional record id we may be editing, excluded from overlap set
   static function overlaps($user_id, $date, $start, $finish, $record_id = null) {
     // Do not bother checking if we allow overlaps.
-    if (defined('ALLOW_OVERLAP') && ALLOW_OVERLAP == true)
-      return false;
+    global $user;
+    if ($user->allow_overlap) return false;
 
     $mdb2 = getConnection();
 
index 78f5cec..3fd1c79 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.17.3987 | 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.18.3988 | 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 bb73a69..420a198 100644 (file)
@@ -166,12 +166,16 @@ function handlePluginCheckboxes() {
           </tr>
           <tr>
             <td align="right" nowrap>{$i18n.form.profile.tracking_mode}:</td>
-            <td>{$forms.profileForm.tracking_mode.control} {$forms.profileForm.task_required.control} <span id="task_required_label"><label for="task_required">{$i18n.label.required}</label></span></td></td>
+            <td>{$forms.profileForm.tracking_mode.control} {$forms.profileForm.task_required.control} <span id="task_required_label"><label for="task_required">{$i18n.label.required}</label></span></td>
           </tr>
           <tr>
             <td align="right" nowrap>{$i18n.form.profile.record_type}:</td>
             <td>{$forms.profileForm.record_type.control}</td>
           </tr>
+          <tr>
+            <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.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 575bafe..7ce14f6 100644 (file)
@@ -62,6 +62,7 @@ if ($request->isPost()) {
     $cl_project_required = $request->getParameter('project_required');
     $cl_task_required = $request->getParameter('task_required');
     $cl_record_type = $request->getParameter('record_type');
+    $cl_allow_overlap = $request->getParameter('allow_overlap');
     $cl_uncompleted_indicators = $request->getParameter('uncompleted_indicators');
     $cl_bcc_email = trim($request->getParameter('bcc_email'));
 
@@ -96,6 +97,7 @@ if ($request->isPost()) {
     $cl_project_required = $user->project_required;
     $cl_task_required = $user->task_required;
     $cl_record_type = $user->record_type;
+    $cl_allow_overlap = $user->allow_overlap;
     $cl_uncompleted_indicators = $user->uncompleted_indicators;
     $cl_bcc_email = $user->bcc_email;
 
@@ -189,6 +191,9 @@ if ($user->canManageTeam()) {
   $record_type_options[TYPE_DURATION] = $i18n->getKey('form.profile.type_duration');
   $form->addInput(array('type'=>'combobox','name'=>'record_type','style'=>'width: 150px;','data'=>$record_type_options,'value'=>$cl_record_type));
 
+  // Allow overlap checkbox.
+  $form->addInput(array('type'=>'checkbox','name'=>'allow_overlap','value'=>$cl_allow_overlap));
+
   // Uncompleted indicators checkbox.
   $form->addInput(array('type'=>'checkbox','name'=>'uncompleted_indicators','value'=>$cl_uncompleted_indicators));
 
@@ -283,6 +288,8 @@ if ($request->isPost()) {
       // Prepare config string.
       if ($cl_show_holidays)
         $config .= ',show_holidays';
+      if ($cl_allow_overlap)
+        $config .= ',allow_overlap';
       if ($cl_uncompleted_indicators)
         $config .= ',uncompleted_indicators';
       $config = trim($config, ',');