mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on time tracker
This commit is contained in:
parent
f0a8b9d8a2
commit
4e70e7694e
@ -307,10 +307,14 @@ class TaskController extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
$count = $this->taskService->bulk($ids, $action);
|
$count = $this->taskService->bulk($ids, $action);
|
||||||
|
|
||||||
$message = Utils::pluralize($action.'d_task', $count);
|
if (request()->wantsJson()) {
|
||||||
Session::flash('message', $message);
|
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()
|
->large()
|
||||||
->withContents([
|
->withContents([
|
||||||
['label' => trans('texts.delete_task'), 'url' => '#'],
|
['label' => trans('texts.delete_task'), 'url' => 'javascript:model.onDeleteClick()'],
|
||||||
]
|
]
|
||||||
)->split() !!}
|
)->split() !!}
|
||||||
</span>
|
</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() {
|
self.onCancelClick = function() {
|
||||||
sweetConfirm(function() {
|
sweetConfirm(function() {
|
||||||
var task = self.selectedTask();
|
var task = self.selectedTask();
|
||||||
@ -425,7 +474,7 @@
|
|||||||
self.selectedTask(task);
|
self.selectedTask(task);
|
||||||
//self.filter('');
|
//self.filter('');
|
||||||
|
|
||||||
if (! task.project()) {
|
if (task && ! task.project()) {
|
||||||
$('select#client_id').trigger('change');
|
$('select#client_id').trigger('change');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -905,6 +954,10 @@
|
|||||||
}
|
}
|
||||||
ko.applyBindings(model);
|
ko.applyBindings(model);
|
||||||
model.tock();
|
model.tock();
|
||||||
|
|
||||||
|
$('.archive-dropdown:not(.dropdown-toggle)').click(function() {
|
||||||
|
model.onArchiveClick();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user