mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Working on time tracker
This commit is contained in:
parent
f0a8b9d8a2
commit
4e70e7694e
@ -307,10 +307,14 @@ class TaskController extends BaseController
|
||||
} else {
|
||||
$count = $this->taskService->bulk($ids, $action);
|
||||
|
||||
$message = Utils::pluralize($action.'d_task', $count);
|
||||
Session::flash('message', $message);
|
||||
if (request()->wantsJson()) {
|
||||
return response()->json($count);
|
||||
} else {
|
||||
$message = Utils::pluralize($action.'d_task', $count);
|
||||
Session::flash('message', $message);
|
||||
|
||||
return $this->returnBulk($this->entityType, $action, $ids);
|
||||
return $this->returnBulk($this->entityType, $action, $ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@
|
||||
])
|
||||
->large()
|
||||
->withContents([
|
||||
['label' => trans('texts.delete_task'), 'url' => '#'],
|
||||
['label' => trans('texts.delete_task'), 'url' => 'javascript:model.onDeleteClick()'],
|
||||
]
|
||||
)->split() !!}
|
||||
</span>
|
||||
@ -245,6 +245,55 @@
|
||||
});
|
||||
}
|
||||
|
||||
self.submitBulkAction = function(data, cb) {
|
||||
$.ajax({
|
||||
dataType: 'json',
|
||||
type: 'post',
|
||||
data: data,
|
||||
url: '{{ url('/tasks/bulk') }}',
|
||||
accepts: {
|
||||
json: 'application/json'
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
cb();
|
||||
},
|
||||
error: function(error) {
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
self.onDeleteClick = function() {
|
||||
sweetConfirm(function() {
|
||||
|
||||
}, "{{ trans('texts.delete_task') }}");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
self.onArchiveClick = function() {
|
||||
sweetConfirm(function() {
|
||||
var task = self.selectedTask();
|
||||
if (! task) {
|
||||
return false;
|
||||
}
|
||||
var data = {
|
||||
id: task.public_id(),
|
||||
action: 'archive',
|
||||
}
|
||||
self.submitBulkAction(data, function() {
|
||||
console.log('removing: ' + task);
|
||||
var task = self.selectedTask();
|
||||
self.removeTask(task);
|
||||
self.selectTask(false);
|
||||
});
|
||||
}, "{{ trans('texts.archive_task') }}");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
self.onCancelClick = function() {
|
||||
sweetConfirm(function() {
|
||||
var task = self.selectedTask();
|
||||
@ -425,7 +474,7 @@
|
||||
self.selectedTask(task);
|
||||
//self.filter('');
|
||||
|
||||
if (! task.project()) {
|
||||
if (task && ! task.project()) {
|
||||
$('select#client_id').trigger('change');
|
||||
}
|
||||
|
||||
@ -905,6 +954,10 @@
|
||||
}
|
||||
ko.applyBindings(model);
|
||||
model.tock();
|
||||
|
||||
$('.archive-dropdown:not(.dropdown-toggle)').click(function() {
|
||||
model.onArchiveClick();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user