provide basic work delegation functionality

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3596 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2009-10-20 17:16:30 +00:00
parent 8c7f688324
commit dddc43086d
5 changed files with 42 additions and 9 deletions

View file

@ -8,8 +8,13 @@ $Id$
New features New features
- delegation of work items basically working
- show "parents" portlet for anonymous, controlled by global option
``showParentsForAnonymous``
- use Lighbox view for media asset listings
- new view: ``list_children.html`` - new view: ``list_children.html``
- evaluate action settings also on queries - evaluate action settings also on queries
- new action: ``create institution``
- "send email" feature, controlled by global option ``organize.allowSendEmail`` - "send email" feature, controlled by global option ``organize.allowSendEmail``
- presence: portlet showing other users logged-in and working within the - presence: portlet showing other users logged-in and working within the
same loops site, controlled by global option ``organize.showPresence`, same loops site, controlled by global option ``organize.showPresence`,
@ -33,6 +38,9 @@ New features
Bug fixes Bug fixes
- use correct target view for identifying target concept upon editing
(problem with personal_info query: query was updated instead of person)
- check/evaluate language settings in dialogs
- relations: store relation objects explicitly in relation registry - relations: store relation objects explicitly in relation registry
- external collection: now works correctly (without creating empty files - external collection: now works correctly (without creating empty files
in the var directory); resource type of generated object controlled by in the var directory); resource type of generated object controlled by

View file

@ -29,6 +29,11 @@ function validate(nodeName, required) {
} }
} }
function showIf(node, value, targetName) {
var display = (node.value == value) ? 'inline' : 'none';
dojo.byId(targetName).style.display = display;
}
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);

View file

@ -139,8 +139,8 @@ work item, the form will be pre-filled with some of the item's data.
>>> 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': 'cancel', 'title': 'cancel'}, {'name': 'finish', 'title': 'finish'}, {'name': 'delegate', 'title': 'delegate'},
{'name': 'modify', 'title': 'modify'}] {'name': 'cancel', 'title': 'cancel'}, {'name': 'modify', 'title': 'modify'}]
Work Item Queries Work Item Queries

View file

@ -214,7 +214,8 @@ class BaseWorkItemsView(object):
state = form.get('wi_state') or self.options.wi_state state = form.get('wi_state') or self.options.wi_state
if not state: if not state:
result['state'] = ['planned', 'accepted', 'running', 'done', 'done_x', result['state'] = ['planned', 'accepted', 'running', 'done', 'done_x',
'finished', 'delegated'] 'finished', 'delegated',
'cancelled']
elif state != 'all': elif state != 'all':
result['state'] = state result['state'] = state
return result return result
@ -325,6 +326,13 @@ class CreateWorkItemForm(ObjectForm, BaseTrackView):
return [dict(name=t.name, title=t.title) return [dict(name=t.name, title=t.title)
for t in self.track.getAvailableTransitions()] for t in self.track.getAvailableTransitions()]
@Lazy
def candidates(self):
ptype = self.conceptManager['person']
persons = ptype.getChildren([self.typePredicate])
return [dict(name=util.getUidForObject(p), title=p.title)
for p in persons]
@Lazy @Lazy
def duration(self): def duration(self):
if self.state == 'running': if self.state == 'running':
@ -374,6 +382,8 @@ class CreateWorkItem(EditObject, BaseTrackView):
result[k] = v result[k] = v
for k in ('title', 'description', 'comment'): for k in ('title', 'description', 'comment'):
setValue(k) setValue(k)
if action == 'delegate':
setValue('party')
startDate = form.get('start_date', '').strip() startDate = form.get('start_date', '').strip()
startTime = form.get('start_time', '').strip().replace('T', '') or '00:00:00' startTime = form.get('start_time', '').strip().replace('T', '') or '00:00:00'
endTime = form.get('end_time', '').strip().replace('T', '') or '00:00:00' endTime = form.get('end_time', '').strip().replace('T', '') or '00:00:00'

View file

@ -89,11 +89,21 @@
</div> </div>
<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"
onChange="showIf(this, 'delegate', 'party')">
<option tal:repeat="action view/actions" <option tal:repeat="action view/actions"
tal:attributes="value action/name" tal:attributes="value action/name"
tal:content="action/title" /> tal:content="action/title" />
</select> </select>
<span id="party" style="display: none">&nbsp;
<label i18n:translate="" 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>
</div> </div>
<div> <div>
<label i18n:translate="" for="start-end">Start - End</label> <label i18n:translate="" for="start-end">Start - End</label>