edit work item: reset times on work, finish
This commit is contained in:
parent
17f15429c8
commit
841eb204eb
2 changed files with 17 additions and 5 deletions
|
@ -65,6 +65,17 @@ function setIf(node, cond, acts) {
|
|||
}
|
||||
}
|
||||
|
||||
function setIfN(node, conds, acts) {
|
||||
dojo.forEach(conds, function(cond) {
|
||||
if (node.value == cond) {
|
||||
dojo.forEach(acts, function(act) {
|
||||
target = dijit.byId(act[0]);
|
||||
target.setValue(act[1]);
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function destroyWidgets(node) {
|
||||
dojo.forEach(dojo.query('[widgetId]', node), function(n) {
|
||||
w = dijit.byNode(n);
|
||||
|
|
|
@ -611,7 +611,7 @@ class CreateWorkItemForm(ObjectForm, BaseTrackView):
|
|||
self.actionJs['showIf'],
|
||||
self.actionJs['setIfStart']]
|
||||
if self.state in ('done',):
|
||||
js.append(self.actionJs['setIfFinish'])
|
||||
js.append(self.actionJs['setIfWF'])
|
||||
return ';\n'.join(js)
|
||||
|
||||
actionJs = dict(setDefault="defValue = this.form.default_date.value",
|
||||
|
@ -624,10 +624,11 @@ setIf(this, 'start', [['start_date', defValue],
|
|||
['end_time', null],
|
||||
['duration', ''],
|
||||
['effort', '']])""",
|
||||
setIfFinish="""
|
||||
setIf(this, 'finish', [['start_date', defValue],
|
||||
['start_time', defValue],
|
||||
['end_time', defValue],
|
||||
setIfWF="""
|
||||
setIfN(this, ['work', 'finish'], [
|
||||
['start_date', defValue],
|
||||
['start_time', null],
|
||||
['end_time', null],
|
||||
['duration', ''],
|
||||
['effort', '']])""",
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue