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) {
|
function destroyWidgets(node) {
|
||||||
dojo.forEach(dojo.query('[widgetId]', node), function(n) {
|
dojo.forEach(dojo.query('[widgetId]', node), function(n) {
|
||||||
w = dijit.byNode(n);
|
w = dijit.byNode(n);
|
||||||
|
|
|
@ -611,7 +611,7 @@ class CreateWorkItemForm(ObjectForm, BaseTrackView):
|
||||||
self.actionJs['showIf'],
|
self.actionJs['showIf'],
|
||||||
self.actionJs['setIfStart']]
|
self.actionJs['setIfStart']]
|
||||||
if self.state in ('done',):
|
if self.state in ('done',):
|
||||||
js.append(self.actionJs['setIfFinish'])
|
js.append(self.actionJs['setIfWF'])
|
||||||
return ';\n'.join(js)
|
return ';\n'.join(js)
|
||||||
|
|
||||||
actionJs = dict(setDefault="defValue = this.form.default_date.value",
|
actionJs = dict(setDefault="defValue = this.form.default_date.value",
|
||||||
|
@ -624,10 +624,11 @@ setIf(this, 'start', [['start_date', defValue],
|
||||||
['end_time', null],
|
['end_time', null],
|
||||||
['duration', ''],
|
['duration', ''],
|
||||||
['effort', '']])""",
|
['effort', '']])""",
|
||||||
setIfFinish="""
|
setIfWF="""
|
||||||
setIf(this, 'finish', [['start_date', defValue],
|
setIfN(this, ['work', 'finish'], [
|
||||||
['start_time', defValue],
|
['start_date', defValue],
|
||||||
['end_time', defValue],
|
['start_time', null],
|
||||||
|
['end_time', null],
|
||||||
['duration', ''],
|
['duration', ''],
|
||||||
['effort', '']])""",
|
['effort', '']])""",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue