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
|
||||
[{'name': 'plan', 'title': 'plan'}, {'name': 'accept', 'title': 'accept'},
|
||||
{'name': 'start', 'title': 'start working'}, {'name': 'work', 'title': 'work'},
|
||||
{'name': 'finish', 'title': 'finish'}, {'name': 'move', 'title': 'move'},
|
||||
{'name': 'cancel', 'title': 'cancel'}, {'name': 'modify', 'title': 'modify'}]
|
||||
{'name': 'finish', 'title': 'finish'}, {'name': 'delegate', 'title': 'delegate'},
|
||||
{'name': 'move', 'title': 'move'}, {'name': 'cancel', 'title': 'cancel'},
|
||||
{'name': 'modify', 'title': 'modify'}]
|
||||
|
||||
|
||||
Work Item Queries
|
||||
|
|
|
@ -336,22 +336,32 @@ class CreateWorkItemForm(ObjectForm, BaseTrackView):
|
|||
@Lazy
|
||||
def actions(self):
|
||||
result = [dict(name=t.name, title=t.title)
|
||||
for t in self.track.getAvailableTransitions()
|
||||
if t.name != 'delegate' or
|
||||
checkPermission('loops.ManageSite', self.context)]
|
||||
for t in self.track.getAvailableTransitions()]
|
||||
#if t.name != 'delegate' or
|
||||
# checkPermission('loops.ManageSite', self.context)]
|
||||
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
|
||||
def candidates(self):
|
||||
def x_candidates(self):
|
||||
ptype = self.conceptManager['person']
|
||||
persons = ptype.getChildren([self.typePredicate])
|
||||
return [dict(name=util.getUidForObject(p), title=p.title)
|
||||
for p in persons]
|
||||
|
||||
taskTypes = ['task', 'event']
|
||||
|
||||
@Lazy
|
||||
def tasks(self):
|
||||
def x_tasks(self):
|
||||
tasks = []
|
||||
tnames = ['task', 'event']
|
||||
tnames = self.taskTypes
|
||||
ttypes = [self.conceptManager.get(tname) for tname in tnames]
|
||||
for ttype in ttypes:
|
||||
if ttype is not None:
|
||||
|
|
|
@ -67,9 +67,8 @@
|
|||
|
||||
<metal:block define-macro="create_workitem">
|
||||
<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="workitem.action" value="finish" />-->
|
||||
<input type="hidden" name="id"
|
||||
tal:attributes="value request/form/id|nothing" />
|
||||
<div class="heading" i18n:translate="">Add Work Item</div>
|
||||
|
@ -90,7 +89,6 @@
|
|||
<div>
|
||||
<label i18n:translate="" for="action">Action</label>
|
||||
<select name="workitem.action" id="action"
|
||||
xonChange="showIf(this, 'delegate', 'party')"
|
||||
onChange="showIfIn(this, [['move', 'target_task'],
|
||||
['delegate', 'target_party']])">
|
||||
<option tal:repeat="action view/actions"
|
||||
|
@ -101,20 +99,27 @@
|
|||
<span id="target_party" style="display: none">
|
||||
<label i18n:translate="delegate_to_party" for="input_party"
|
||||
style="display: inline">to</label>
|
||||
<select name="party" id="input_party">
|
||||
<option tal:repeat="cand view/candidates"
|
||||
tal:attributes="value cand/name"
|
||||
tal:content="cand/title" />
|
||||
</select>
|
||||
<span dojoType="dojox.data.QueryReadStore" jsId="party_search_store"
|
||||
tal:define="types view/getTypesParamsForFilteringSelect"
|
||||
tal:attributes="url string:listConceptsForComboBox.js$types;" >
|
||||
</span>
|
||||
<input dojoType="dijit.form.FilteringSelect"
|
||||
autoComplete="False" labelAttr="label" searchDelay="400"
|
||||
name="party" id="input_party"
|
||||
store="party_search_store" />
|
||||
</span>
|
||||
<span id="target_task" style="display: none">
|
||||
<label i18n:translate="move_to_task" for="input_task"
|
||||
style="display: inline">to</label>
|
||||
<select name="task" id="input_task">
|
||||
<option tal:repeat="cand view/tasks"
|
||||
tal:attributes="value cand/name"
|
||||
tal:content="cand/title" />
|
||||
</select>
|
||||
<span dojoType="dojox.data.QueryReadStore" jsId="task_search_store"
|
||||
tal:define="types python:
|
||||
view.getTypesParamsForFilteringSelect(view.taskTypes)"
|
||||
tal:attributes="url string:listConceptsForComboBox.js$types;" >
|
||||
</span>
|
||||
<input dojoType="dijit.form.FilteringSelect"
|
||||
autoComplete="False" labelAttr="label" searchDelay="400"
|
||||
name="task" id="input_task"
|
||||
store="task_search_store" />
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -151,7 +156,6 @@
|
|||
</div>
|
||||
<div class="buttons">
|
||||
<input value="Save" type="submit"
|
||||
onClick="return closeDialog(true)"
|
||||
i18n:attributes="value">
|
||||
<input type="button" value="Cancel"
|
||||
onClick="return closeDialog(false)"
|
||||
|
|
Loading…
Add table
Reference in a new issue