From 038ab62759618b89578ba78d127337319ae37695 Mon Sep 17 00:00:00 2001 From: anuko Date: Sat, 30 Dec 2017 13:54:49 +0000 Subject: [PATCH] Added a field for note value in week view to apply to new entries. --- WEB-INF/lib/ttTimeHelper.class.php | 1 + WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/week.tpl | 4 ++++ week.php | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index cf521b60..8bc2012e 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -1074,6 +1074,7 @@ class ttTimeHelper { $fields4insert['billable'] = ttTimeHelper::parseFromWeekViewRow($fields['row_id'], 'bl'); $fields4insert['project'] = ttTimeHelper::parseFromWeekViewRow($fields['row_id'], 'pr'); $fields4insert['task'] = ttTimeHelper::parseFromWeekViewRow($fields['row_id'], 'ts'); + $fields4insert['note'] = $fields['note']; // Try to insert a record. $id = ttTimeHelper::insert($fields4insert); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 44ffd6c7..c7cbc49f 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- {/if} + + + +
 Anuko Time Tracker 1.13.2.3710| Copyright © Anuko | +  Anuko Time Tracker 1.13.2.3711| Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/week.tpl b/WEB-INF/templates/week.tpl index 74d14419..97a5a302 100644 --- a/WEB-INF/templates/week.tpl +++ b/WEB-INF/templates/week.tpl @@ -51,6 +51,10 @@ {$forms.weekTimeForm.task.control}
{$i18n.label.note}:{$forms.weekTimeForm.note.control}
diff --git a/week.php b/week.php index d457837b..3cb4ea73 100644 --- a/week.php +++ b/week.php @@ -106,6 +106,7 @@ $cl_project = $request->getParameter('project', ($request->getMethod()=='POST'? $_SESSION['project'] = $cl_project; $cl_task = $request->getParameter('task', ($request->getMethod()=='POST'? null : @$_SESSION['task'])); $_SESSION['task'] = $cl_task; +$cl_note = trim($request->getParameter('note')); // Get the data we need to display week view. // Get column headers, which are day numbers in month. @@ -257,6 +258,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { 'datakeys'=>array('id','name'), 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); } +$form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_note)); // Add other controls. $form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // calendar @@ -353,6 +355,7 @@ if ($request->isPost()) { $record['task_id'] = $cl_task; $record['cf_1_value'] = $cl_cf_1; $fields['row_id'] = ttTimeHelper::makeRecordIdentifier($record).'_0'; + $fields['note'] = $cl_note; } $fields['day_header'] = $dayHeader; $fields['start_date'] = $startDate->toString(DB_DATEFORMAT); // To be able to determine date for the entry using $dayHeader. -- 2.20.1