mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Working on task kanban
This commit is contained in:
parent
6fba242ac5
commit
f1b9bd3d8a
@ -100,6 +100,20 @@ class TaskKanbanController extends BaseController
|
|||||||
->where('sort_order', '>', $status->sort_order)
|
->where('sort_order', '>', $status->sort_order)
|
||||||
->decrement('sort_order');
|
->decrement('sort_order');
|
||||||
|
|
||||||
|
$firstStatus = TaskStatus::scope()
|
||||||
|
->orderBy('sort_order')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
// Move linked tasks to the end of the first status
|
||||||
|
if ($firstStatus) {
|
||||||
|
$firstCount = $firstStatus->tasks->count();
|
||||||
|
Task::scope()
|
||||||
|
->where('task_status_id', '=', $status->id)
|
||||||
|
->increment('task_status_sort_order', $firstCount, [
|
||||||
|
'task_status_id' => $firstStatus->id
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
return response()->json(['message' => RESULT_SUCCESS]);
|
return response()->json(['message' => RESULT_SUCCESS]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,4 +37,13 @@ class TaskStatus extends EntityModel
|
|||||||
{
|
{
|
||||||
return ENTITY_TASK_STATUS;
|
return ENTITY_TASK_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function tasks()
|
||||||
|
{
|
||||||
|
return $this->hasMany('App\Models\Task')->orderBy('task_status_sort_order');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,8 @@
|
|||||||
sweetConfirm(function() {
|
sweetConfirm(function() {
|
||||||
var url = '{{ url('/task_statuses') }}/' + self.public_id();
|
var url = '{{ url('/task_statuses') }}/' + self.public_id();
|
||||||
model.ajax('delete', url, null, function(response) {
|
model.ajax('delete', url, null, function(response) {
|
||||||
model.statuses.remove(self);
|
//model.statuses.remove(self);
|
||||||
|
location.reload();
|
||||||
})
|
})
|
||||||
}, "{{ trans('texts.archive_status')}}");
|
}, "{{ trans('texts.archive_status')}}");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user