delegate or move work item: select target party or task via FilteringSelect widget
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@4199 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
080b3a79f5
commit
5202421654
3 changed files with 37 additions and 22 deletions
|
@ -142,8 +142,9 @@ only available for privileged users.
|
||||||
>>> form.actions
|
>>> form.actions
|
||||||
[{'name': 'plan', 'title': 'plan'}, {'name': 'accept', 'title': 'accept'},
|
[{'name': 'plan', 'title': 'plan'}, {'name': 'accept', 'title': 'accept'},
|
||||||
{'name': 'start', 'title': 'start working'}, {'name': 'work', 'title': 'work'},
|
{'name': 'start', 'title': 'start working'}, {'name': 'work', 'title': 'work'},
|
||||||
{'name': 'finish', 'title': 'finish'}, {'name': 'move', 'title': 'move'},
|
{'name': 'finish', 'title': 'finish'}, {'name': 'delegate', 'title': 'delegate'},
|
||||||
{'name': 'cancel', 'title': 'cancel'}, {'name': 'modify', 'title': 'modify'}]
|
{'name': 'move', 'title': 'move'}, {'name': 'cancel', 'title': 'cancel'},
|
||||||
|
{'name': 'modify', 'title': 'modify'}]
|
||||||
|
|
||||||
|
|
||||||
Work Item Queries
|
Work Item Queries
|
||||||
|
|
|
@ -336,22 +336,32 @@ class CreateWorkItemForm(ObjectForm, BaseTrackView):
|
||||||
@Lazy
|
@Lazy
|
||||||
def actions(self):
|
def actions(self):
|
||||||
result = [dict(name=t.name, title=t.title)
|
result = [dict(name=t.name, title=t.title)
|
||||||
for t in self.track.getAvailableTransitions()
|
for t in self.track.getAvailableTransitions()]
|
||||||
if t.name != 'delegate' or
|
#if t.name != 'delegate' or
|
||||||
checkPermission('loops.ManageSite', self.context)]
|
# checkPermission('loops.ManageSite', self.context)]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def getTypesParamsForFilteringSelect(self, types=['person']):
|
||||||
|
result = []
|
||||||
|
for t in types:
|
||||||
|
result.append('searchType=loops:concept:%s' % t)
|
||||||
|
if result:
|
||||||
|
return '?' + '&'.join(result)
|
||||||
|
return ''
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def candidates(self):
|
def x_candidates(self):
|
||||||
ptype = self.conceptManager['person']
|
ptype = self.conceptManager['person']
|
||||||
persons = ptype.getChildren([self.typePredicate])
|
persons = ptype.getChildren([self.typePredicate])
|
||||||
return [dict(name=util.getUidForObject(p), title=p.title)
|
return [dict(name=util.getUidForObject(p), title=p.title)
|
||||||
for p in persons]
|
for p in persons]
|
||||||
|
|
||||||
|
taskTypes = ['task', 'event']
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def tasks(self):
|
def x_tasks(self):
|
||||||
tasks = []
|
tasks = []
|
||||||
tnames = ['task', 'event']
|
tnames = self.taskTypes
|
||||||
ttypes = [self.conceptManager.get(tname) for tname in tnames]
|
ttypes = [self.conceptManager.get(tname) for tname in tnames]
|
||||||
for ttype in ttypes:
|
for ttype in ttypes:
|
||||||
if ttype is not None:
|
if ttype is not None:
|
||||||
|
|
|
@ -67,9 +67,8 @@
|
||||||
|
|
||||||
<metal:block define-macro="create_workitem">
|
<metal:block define-macro="create_workitem">
|
||||||
<form method="post" id="addWorkitem_form" class="dialog"
|
<form method="post" id="addWorkitem_form" class="dialog"
|
||||||
dojoType="dijit.form.Form">
|
xx_dojoType="dijit.form.Form">
|
||||||
<input type="hidden" name="form.action" value="create_workitem" />
|
<input type="hidden" name="form.action" value="create_workitem" />
|
||||||
<!--<input type="hidden" name="workitem.action" value="finish" />-->
|
|
||||||
<input type="hidden" name="id"
|
<input type="hidden" name="id"
|
||||||
tal:attributes="value request/form/id|nothing" />
|
tal:attributes="value request/form/id|nothing" />
|
||||||
<div class="heading" i18n:translate="">Add Work Item</div>
|
<div class="heading" i18n:translate="">Add Work Item</div>
|
||||||
|
@ -90,7 +89,6 @@
|
||||||
<div>
|
<div>
|
||||||
<label i18n:translate="" for="action">Action</label>
|
<label i18n:translate="" for="action">Action</label>
|
||||||
<select name="workitem.action" id="action"
|
<select name="workitem.action" id="action"
|
||||||
xonChange="showIf(this, 'delegate', 'party')"
|
|
||||||
onChange="showIfIn(this, [['move', 'target_task'],
|
onChange="showIfIn(this, [['move', 'target_task'],
|
||||||
['delegate', 'target_party']])">
|
['delegate', 'target_party']])">
|
||||||
<option tal:repeat="action view/actions"
|
<option tal:repeat="action view/actions"
|
||||||
|
@ -101,20 +99,27 @@
|
||||||
<span id="target_party" style="display: none">
|
<span id="target_party" style="display: none">
|
||||||
<label i18n:translate="delegate_to_party" for="input_party"
|
<label i18n:translate="delegate_to_party" for="input_party"
|
||||||
style="display: inline">to</label>
|
style="display: inline">to</label>
|
||||||
<select name="party" id="input_party">
|
<span dojoType="dojox.data.QueryReadStore" jsId="party_search_store"
|
||||||
<option tal:repeat="cand view/candidates"
|
tal:define="types view/getTypesParamsForFilteringSelect"
|
||||||
tal:attributes="value cand/name"
|
tal:attributes="url string:listConceptsForComboBox.js$types;" >
|
||||||
tal:content="cand/title" />
|
</span>
|
||||||
</select>
|
<input dojoType="dijit.form.FilteringSelect"
|
||||||
|
autoComplete="False" labelAttr="label" searchDelay="400"
|
||||||
|
name="party" id="input_party"
|
||||||
|
store="party_search_store" />
|
||||||
</span>
|
</span>
|
||||||
<span id="target_task" style="display: none">
|
<span id="target_task" style="display: none">
|
||||||
<label i18n:translate="move_to_task" for="input_task"
|
<label i18n:translate="move_to_task" for="input_task"
|
||||||
style="display: inline">to</label>
|
style="display: inline">to</label>
|
||||||
<select name="task" id="input_task">
|
<span dojoType="dojox.data.QueryReadStore" jsId="task_search_store"
|
||||||
<option tal:repeat="cand view/tasks"
|
tal:define="types python:
|
||||||
tal:attributes="value cand/name"
|
view.getTypesParamsForFilteringSelect(view.taskTypes)"
|
||||||
tal:content="cand/title" />
|
tal:attributes="url string:listConceptsForComboBox.js$types;" >
|
||||||
</select>
|
</span>
|
||||||
|
<input dojoType="dijit.form.FilteringSelect"
|
||||||
|
autoComplete="False" labelAttr="label" searchDelay="400"
|
||||||
|
name="task" id="input_task"
|
||||||
|
store="task_search_store" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -151,7 +156,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<input value="Save" type="submit"
|
<input value="Save" type="submit"
|
||||||
onClick="return closeDialog(true)"
|
|
||||||
i18n:attributes="value">
|
i18n:attributes="value">
|
||||||
<input type="button" value="Cancel"
|
<input type="button" value="Cancel"
|
||||||
onClick="return closeDialog(false)"
|
onClick="return closeDialog(false)"
|
||||||
|
|
Loading…
Add table
Reference in a new issue