diff --git a/resources/views/tasks/time_tracker.blade.php b/resources/views/tasks/time_tracker.blade.php index a8f0e57e0af9..cc01dc47edce 100644 --- a/resources/views/tasks/time_tracker.blade.php +++ b/resources/views/tasks/time_tracker.blade.php @@ -214,6 +214,30 @@ ->label(trans('texts.project')) !!} + + @if (Auth::user()->hasFeature(FEATURE_INVOICE_SETTINGS)) +
+ @if ($customLabel = $account->customLabel('task1')) +
+ @include('partials.custom_field', [ + 'field' => 'custom_value1', + 'label' => $customLabel, + 'databind' => "value: selectedTask().custom_value1, valueUpdate: 'afterkeydown'", + ]) +
+ @endif + @if ($customLabel = $account->customLabel('task2')) +
+ @include('partials.custom_field', [ + 'field' => 'custom_value2', + 'label' => $customLabel, + 'databind' => "value: selectedTask().custom_value2, valueUpdate: 'afterkeydown'", + ]) +
+ @endif +
+ @endif +
{!! Former::textarea('description') ->data_bind("value: selectedTask().description, valueUpdate: 'afterkeydown'") diff --git a/resources/views/tasks/time_tracker_knockout.blade.php b/resources/views/tasks/time_tracker_knockout.blade.php index 28515e958fb6..f9c959b2b36f 100644 --- a/resources/views/tasks/time_tracker_knockout.blade.php +++ b/resources/views/tasks/time_tracker_knockout.blade.php @@ -606,6 +606,8 @@ self.isHovered = ko.observable(false); self.created_at = ko.observable(moment.utc().format('YYYY-MM-DD HH:mm:ss')); self.task_status_id = ko.observable(); + self.custom_value1 = ko.observable(); + self.custom_value2 = ko.observable(); self.mapping = { 'client': { @@ -688,6 +690,8 @@ + '&project_id=' + self.project_id() + '&project_name=' + encodeURIComponent(self.project() ? self.project().name() : '') + '&description=' + encodeURIComponent(self.description()) + + '&custom_value1=' + encodeURIComponent(self.custom_value1()) + + '&custom_value2=' + encodeURIComponent(self.custom_value2()) + '&time_log=' + JSON.stringify(self.times()); var url = '{{ url('/tasks') }}'; @@ -871,6 +875,12 @@ if (data.description != self.description()) { return true; } + if (data.custom_value1 != self.custom_value1()) { + return true; + } + if (data.custom_value2 != self.custom_value2()) { + return true; + } var times = data.time_log instanceof Array ? JSON.stringify(data.time_log) : data.time_log; if (times != JSON.stringify(self.times())) { return true;