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
27813567b2
commit
5e0f838271
@ -152,12 +152,14 @@ class TaskRepository extends BaseRepository
|
||||
} elseif ($data['action'] == 'offline'){
|
||||
$task->is_running = $data['is_running'] ? 1 : 0;
|
||||
}
|
||||
} elseif (isset($data['is_running'])) {
|
||||
$task->is_running = $data['is_running'] ? 1 : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
if ($count = count($timeLog)) {
|
||||
$lastTime = $timeLog[$count - 1];
|
||||
$task->is_running = count($lastTime) == 2 && $lastTime[1];
|
||||
$task->is_running = count($lastTime) == 2 && intval($lastTime[1]);
|
||||
\Log::info('is running: ' . $task->is_running);
|
||||
}
|
||||
*/
|
||||
|
@ -431,14 +431,16 @@
|
||||
|
||||
self.onStartClick = function() {
|
||||
if (self.isRunning()) {
|
||||
var data = 'is_running=0&';
|
||||
var time = self.lastTime();
|
||||
time.endTime(moment().unix());
|
||||
} else {
|
||||
var data = 'is_running=1&';
|
||||
var time = new TimeModel();
|
||||
time.startTime(moment().unix());
|
||||
self.addTime(time);
|
||||
}
|
||||
self.save('time_log=' + JSON.stringify(self.times()));
|
||||
self.save(data + 'time_log=' + JSON.stringify(self.times()));
|
||||
}
|
||||
|
||||
self.listItemState = ko.computed(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user