From 21a4caf9b07233e69ad230a4d4d5248b589c205b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 13 Feb 2018 23:16:31 +0000 Subject: [PATCH] Made Allow overlap a configurable option. --- WEB-INF/config.php.dist | 11 ----------- WEB-INF/lib/ttTimeHelper.class.php | 4 ++-- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/profile_edit.tpl | 6 +++++- profile_edit.php | 7 +++++++ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/WEB-INF/config.php.dist b/WEB-INF/config.php.dist index fed4eea5..e4fb3c0a 100644 --- a/WEB-INF/config.php.dist +++ b/WEB-INF/config.php.dist @@ -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. diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 7bc5e646..7cbf4dda 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -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(); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 78f5cec1..3fd1c79f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- - + + + + + diff --git a/profile_edit.php b/profile_edit.php index 575bafe6..7ce14f66 100644 --- a/profile_edit.php +++ b/profile_edit.php @@ -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, ','); -- 2.20.1
 Anuko Time Tracker 1.17.17.3987 | Copyright © Anuko | +  Anuko Time Tracker 1.17.18.3988 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/profile_edit.tpl b/WEB-INF/templates/profile_edit.tpl index bb73a69e..420a1985 100644 --- a/WEB-INF/templates/profile_edit.tpl +++ b/WEB-INF/templates/profile_edit.tpl @@ -166,12 +166,16 @@ function handlePluginCheckboxes() {
{$i18n.form.profile.tracking_mode}:{$forms.profileForm.tracking_mode.control} {$forms.profileForm.task_required.control} {$forms.profileForm.tracking_mode.control} {$forms.profileForm.task_required.control}
{$i18n.form.profile.record_type}: {$forms.profileForm.record_type.control}
{$i18n.form.profile.allow_overlap}:{$forms.profileForm.allow_overlap.control} {$i18n.label.what_is_it}
{$i18n.form.profile.uncompleted_indicators}: {$forms.profileForm.uncompleted_indicators.control} {$i18n.label.what_is_it}