mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:14:40 -04:00
Working on time tracker
This commit is contained in:
parent
d7371aed2b
commit
6c5dc29749
@ -2455,6 +2455,7 @@ $LANG = array(
|
|||||||
'no_description' => 'No Description',
|
'no_description' => 'No Description',
|
||||||
'time_tracker_login' => 'Time Tracker Login',
|
'time_tracker_login' => 'Time Tracker Login',
|
||||||
'save_or_discard' => 'Please save or discard your changes',
|
'save_or_discard' => 'Please save or discard your changes',
|
||||||
|
'discard_changes' => 'Discard Changes',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -362,15 +362,21 @@
|
|||||||
model.onArchiveClick();
|
model.onArchiveClick();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
$(window).on('beforeunload', function () {
|
$(window).on('beforeunload', function () {
|
||||||
|
console.log('beforeunload');
|
||||||
if (model.selectedTask() && model.formChanged()) {
|
if (model.selectedTask() && model.formChanged()) {
|
||||||
|
console.log('changed');
|
||||||
swal("{{ trans('texts.save_or_discard') }}");
|
swal("{{ trans('texts.save_or_discard') }}");
|
||||||
return false;
|
return false;
|
||||||
|
//return trans('texts.save_or_discard');
|
||||||
} else {
|
} else {
|
||||||
|
console.log('not changed');
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$( window ).scroll(function() {
|
$( window ).scroll(function() {
|
||||||
$('.footer').
|
$('.footer').
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
task.update(task.data);
|
task.update(task.data);
|
||||||
}
|
}
|
||||||
self.formChanged(false);
|
self.formChanged(false);
|
||||||
});
|
}, "{{ trans('texts.discard_changes') }}");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -430,8 +430,10 @@
|
|||||||
for (var i=0; i<parts.length; i++) {
|
for (var i=0; i<parts.length; i++) {
|
||||||
var part = parts[i];
|
var part = parts[i];
|
||||||
var isMatch = false;
|
var isMatch = false;
|
||||||
if (self.description().toLowerCase().indexOf(part) >= 0) {
|
if (self.description()) {
|
||||||
isMatch = true;
|
if (self.description().toLowerCase().indexOf(part) >= 0) {
|
||||||
|
isMatch = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (self.project()) {
|
if (self.project()) {
|
||||||
var projectName = self.project().name();
|
var projectName = self.project().name();
|
||||||
@ -457,7 +459,6 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.isStartEnabled(false);
|
|
||||||
if (self.isRunning()) {
|
if (self.isRunning()) {
|
||||||
var data = 'is_running=0&';
|
var data = 'is_running=0&';
|
||||||
var time = self.lastTime();
|
var time = self.lastTime();
|
||||||
@ -468,7 +469,11 @@
|
|||||||
time.startTime(moment().unix());
|
time.startTime(moment().unix());
|
||||||
self.addTime(time);
|
self.addTime(time);
|
||||||
}
|
}
|
||||||
self.save(data + 'time_log=' + JSON.stringify(self.times()));
|
|
||||||
|
if (self.public_id()) {
|
||||||
|
self.isStartEnabled(false);
|
||||||
|
self.save(data + 'time_log=' + JSON.stringify(self.times()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.listItemState = ko.computed(function() {
|
self.listItemState = ko.computed(function() {
|
||||||
@ -515,6 +520,9 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.description.truncated = ko.computed(function() {
|
self.description.truncated = ko.computed(function() {
|
||||||
|
if (! self.description()) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
return truncate(self.description(), self.actionButtonVisible() ? 35 : 60);
|
return truncate(self.description(), self.actionButtonVisible() ? 35 : 60);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user