mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Support /tasks/kanban/{client_id}
This commit is contained in:
parent
27a25d429b
commit
818a781b31
@ -12,7 +12,7 @@ class TaskKanbanController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* @return \Illuminate\Contracts\View\View
|
* @return \Illuminate\Contracts\View\View
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index($clientPublicId = false)
|
||||||
{
|
{
|
||||||
$tasks = Task::scope()
|
$tasks = Task::scope()
|
||||||
->with(['project', 'client', 'task_status'])
|
->with(['project', 'client', 'task_status'])
|
||||||
@ -84,6 +84,7 @@ class TaskKanbanController extends BaseController
|
|||||||
'tasks' => $tasks,
|
'tasks' => $tasks,
|
||||||
'clients' => $clients,
|
'clients' => $clients,
|
||||||
'projects' => $projects,
|
'projects' => $projects,
|
||||||
|
'clientPublicId' => $clientPublicId,
|
||||||
];
|
];
|
||||||
|
|
||||||
return view('tasks.kanban', $data);
|
return view('tasks.kanban', $data);
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@elseif ($entityType == ENTITY_TASK)
|
@elseif ($entityType == ENTITY_TASK)
|
||||||
{!! Button::normal(trans('texts.kanban'))->asLinkTo(url('/tasks/kanban'))->appendIcon(Icon::create('th')) !!}
|
{!! Button::normal(trans('texts.kanban'))->asLinkTo(url('/tasks/kanban' . (! empty($clientId) ? '/' . $clientId : '')))->appendIcon(Icon::create('th')) !!}
|
||||||
{!! Button::normal(trans('texts.time_tracker'))->asLinkTo('javascript:openTimeTracker()')->appendIcon(Icon::create('time')) !!}
|
{!! Button::normal(trans('texts.time_tracker'))->asLinkTo('javascript:openTimeTracker()')->appendIcon(Icon::create('time')) !!}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@
|
|||||||
|
|
||||||
@section('top-right')
|
@section('top-right')
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" placeholder="{{ trans('texts.filter') }}" id="filter"
|
<input type="text" data-bind="value: filter" placeholder="{{ trans('texts.filter') }}" id="filter"
|
||||||
class="form-control" style="background-color: #FFFFFF !important"/>
|
class="form-control" style="background-color: #FFFFFF !important"/>
|
||||||
</div>
|
</div>
|
||||||
@stop
|
@stop
|
||||||
@ -560,14 +560,50 @@
|
|||||||
function ClientModel(data) {
|
function ClientModel(data) {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.name = ko.observable();
|
self.name = ko.observable();
|
||||||
|
self.contacts = ko.observableArray();
|
||||||
|
|
||||||
self.displayName = ko.computed(function() {
|
self.displayName = ko.computed(function() {
|
||||||
return self.name();
|
if (self.name()) {
|
||||||
|
return self.name();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self.contacts().length) {
|
||||||
|
return self.contacts()[0].displayName();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
self.mapping = {
|
||||||
|
'contacts': {
|
||||||
|
create: function(options) {
|
||||||
|
return new ContactModel(options.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data) {
|
||||||
|
ko.mapping.fromJS(data, self.mapping, this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ContactModel(data) {
|
||||||
|
var self = this;
|
||||||
|
self.public_id = ko.observable('');
|
||||||
|
self.first_name = ko.observable('');
|
||||||
|
self.last_name = ko.observable('');
|
||||||
|
self.email = ko.observable('');
|
||||||
|
self.phone = ko.observable('');
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
ko.mapping.fromJS(data, {}, this);
|
ko.mapping.fromJS(data, {}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.displayName = ko.computed(function() {
|
||||||
|
if (self.first_name() || self.last_name()) {
|
||||||
|
return self.first_name() + ' ' + self.last_name();
|
||||||
|
} else {
|
||||||
|
return self.email();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
@ -610,6 +646,14 @@
|
|||||||
window.model = new ViewModel();
|
window.model = new ViewModel();
|
||||||
ko.applyBindings(model);
|
ko.applyBindings(model);
|
||||||
|
|
||||||
|
if ({{ $clientPublicId ? 'true' : 'false' }}) {
|
||||||
|
var client = clientMap[{{ $clientPublicId ?: 0 }}];
|
||||||
|
if (client) {
|
||||||
|
model.filter_client_id({{ $clientPublicId }});
|
||||||
|
model.filter(client.displayName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$('.kanban').show();
|
$('.kanban').show();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ Route::group(['middleware' => ['lookup:user', 'auth:user']], function () {
|
|||||||
Route::get('clients/statement/{client_id}/{status_id?}/{start_date?}/{end_date?}', 'ClientController@statement');
|
Route::get('clients/statement/{client_id}/{status_id?}/{start_date?}/{end_date?}', 'ClientController@statement');
|
||||||
|
|
||||||
Route::get('time_tracker', 'TimeTrackerController@index');
|
Route::get('time_tracker', 'TimeTrackerController@index');
|
||||||
Route::get('tasks/kanban', 'TaskKanbanController@index');
|
Route::get('tasks/kanban/{client_id?}', 'TaskKanbanController@index');
|
||||||
Route::post('task_statuses', 'TaskKanbanController@storeStatus');
|
Route::post('task_statuses', 'TaskKanbanController@storeStatus');
|
||||||
Route::put('task_statuses/{task_status_id}', 'TaskKanbanController@updateStatus');
|
Route::put('task_statuses/{task_status_id}', 'TaskKanbanController@updateStatus');
|
||||||
Route::delete('task_statuses/{task_status_id}', 'TaskKanbanController@deleteStatus');
|
Route::delete('task_statuses/{task_status_id}', 'TaskKanbanController@deleteStatus');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user