Added more custom fields

This commit is contained in:
Hillel Coren 2018-04-04 22:43:32 +03:00
parent 9834adc0a5
commit 48250ce2fc
2 changed files with 34 additions and 0 deletions

View File

@ -214,6 +214,30 @@
->label(trans('texts.project')) !!} ->label(trans('texts.project')) !!}
</div> </div>
</div> </div>
@if (Auth::user()->hasFeature(FEATURE_INVOICE_SETTINGS))
<div class="row">
@if ($customLabel = $account->customLabel('task1'))
<div style="padding-bottom: 20px; padding-right:6px;" class="col-md-6 no-padding-mobile">
@include('partials.custom_field', [
'field' => 'custom_value1',
'label' => $customLabel,
'databind' => "value: selectedTask().custom_value1, valueUpdate: 'afterkeydown'",
])
</div>
@endif
@if ($customLabel = $account->customLabel('task2'))
<div style="padding-bottom: 20px; padding-left:6px;" class="col-md-6 no-padding-mobile">
@include('partials.custom_field', [
'field' => 'custom_value2',
'label' => $customLabel,
'databind' => "value: selectedTask().custom_value2, valueUpdate: 'afterkeydown'",
])
</div>
@endif
</div>
@endif
<div style="padding-bottom: 20px"> <div style="padding-bottom: 20px">
{!! Former::textarea('description') {!! Former::textarea('description')
->data_bind("value: selectedTask().description, valueUpdate: 'afterkeydown'") ->data_bind("value: selectedTask().description, valueUpdate: 'afterkeydown'")

View File

@ -606,6 +606,8 @@
self.isHovered = ko.observable(false); self.isHovered = ko.observable(false);
self.created_at = ko.observable(moment.utc().format('YYYY-MM-DD HH:mm:ss')); self.created_at = ko.observable(moment.utc().format('YYYY-MM-DD HH:mm:ss'));
self.task_status_id = ko.observable(); self.task_status_id = ko.observable();
self.custom_value1 = ko.observable();
self.custom_value2 = ko.observable();
self.mapping = { self.mapping = {
'client': { 'client': {
@ -688,6 +690,8 @@
+ '&project_id=' + self.project_id() + '&project_id=' + self.project_id()
+ '&project_name=' + encodeURIComponent(self.project() ? self.project().name() : '') + '&project_name=' + encodeURIComponent(self.project() ? self.project().name() : '')
+ '&description=' + encodeURIComponent(self.description()) + '&description=' + encodeURIComponent(self.description())
+ '&custom_value1=' + encodeURIComponent(self.custom_value1())
+ '&custom_value2=' + encodeURIComponent(self.custom_value2())
+ '&time_log=' + JSON.stringify(self.times()); + '&time_log=' + JSON.stringify(self.times());
var url = '{{ url('/tasks') }}'; var url = '{{ url('/tasks') }}';
@ -871,6 +875,12 @@
if (data.description != self.description()) { if (data.description != self.description()) {
return true; 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; var times = data.time_log instanceof Array ? JSON.stringify(data.time_log) : data.time_log;
if (times != JSON.stringify(self.times())) { if (times != JSON.stringify(self.times())) {
return true; return true;