filter qualification reports by contact state
This commit is contained in:
parent
4a67756cf8
commit
74eb054bc9
5 changed files with 52 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2014 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2015 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,6 +22,7 @@ Qualification management report definitions.
|
||||||
|
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
|
||||||
|
from cybertools.composer.report.base import LeafQueryCriteria, CompoundQueryCriteria
|
||||||
from cybertools.util.jeep import Jeep
|
from cybertools.util.jeep import Jeep
|
||||||
from loops.expert.report import ReportInstance
|
from loops.expert.report import ReportInstance
|
||||||
from loops.organize.work.report import WorkRow
|
from loops.organize.work.report import WorkRow
|
||||||
|
@ -39,13 +40,12 @@ class QualificationOverview(ReportInstance):
|
||||||
|
|
||||||
rowFactory = WorkRow
|
rowFactory = WorkRow
|
||||||
|
|
||||||
fields = Jeep((task, party, workTitle, dayStart, dayEnd, state,))
|
fields = Jeep((task, party, workTitle, dayStart, dayEnd, state,
|
||||||
#partyState,)) # +deadline?
|
partyState,)) # +deadline?
|
||||||
|
|
||||||
defaultOutputFields = fields
|
defaultOutputFields = Jeep(list(fields)[:-1])
|
||||||
defaultSortCriteria = (party, task,)
|
defaultSortCriteria = (party, task,)
|
||||||
|
|
||||||
|
|
||||||
def getOptions(self, option):
|
def getOptions(self, option):
|
||||||
return self.view.options(option)
|
return self.view.options(option)
|
||||||
|
|
||||||
|
@ -53,6 +53,14 @@ class QualificationOverview(ReportInstance):
|
||||||
def states(self):
|
def states(self):
|
||||||
return self.getOptions('report_select_state' or ('planned',))
|
return self.getOptions('report_select_state' or ('planned',))
|
||||||
|
|
||||||
|
@property
|
||||||
|
def queryCriteria(self):
|
||||||
|
crit = self.context.queryCriteria or []
|
||||||
|
f = self.fields.partyState
|
||||||
|
crit.append(
|
||||||
|
LeafQueryCriteria(f.name, f.operator, 'active', f))
|
||||||
|
return CompoundQueryCriteria(crit)
|
||||||
|
|
||||||
def selectObjects(self, parts):
|
def selectObjects(self, parts):
|
||||||
result = []
|
result = []
|
||||||
workItems = self.recordManager['work']
|
workItems = self.recordManager['work']
|
||||||
|
@ -112,6 +120,11 @@ class PersonQualifications(QualificationOverview):
|
||||||
def getOptions(self, option):
|
def getOptions(self, option):
|
||||||
return self.view.typeOptions(option)
|
return self.view.typeOptions(option)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def queryCriteria(self):
|
||||||
|
crit = self.context.queryCriteria or []
|
||||||
|
return CompoundQueryCriteria(crit)
|
||||||
|
|
||||||
def selectObjects(self, parts):
|
def selectObjects(self, parts):
|
||||||
workItems = self.recordManager['work']
|
workItems = self.recordManager['work']
|
||||||
person = self.view.context
|
person = self.view.context
|
||||||
|
|
Binary file not shown.
|
@ -3,7 +3,7 @@ msgstr ""
|
||||||
|
|
||||||
"Project-Id-Version: 0.13.1\n"
|
"Project-Id-Version: 0.13.1\n"
|
||||||
"POT-Creation-Date: 2007-05-22 12:00 CET\n"
|
"POT-Creation-Date: 2007-05-22 12:00 CET\n"
|
||||||
"PO-Revision-Date: 2015-03-17 12:00 CET\n"
|
"PO-Revision-Date: 2015-03-20 12:00 CET\n"
|
||||||
"Last-Translator: Helmut Merz <helmutm@cy55.de>\n"
|
"Last-Translator: Helmut Merz <helmutm@cy55.de>\n"
|
||||||
"Language-Team: loops developers <helmutm@cy55.de>\n"
|
"Language-Team: loops developers <helmutm@cy55.de>\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -1134,6 +1134,9 @@ msgstr "Bemerkung"
|
||||||
msgid "desc_transition_comments"
|
msgid "desc_transition_comments"
|
||||||
msgstr "Notizen zum Statusübergang."
|
msgstr "Notizen zum Statusübergang."
|
||||||
|
|
||||||
|
msgid "contact_states"
|
||||||
|
msgstr "Kontaktstatus"
|
||||||
|
|
||||||
# state names
|
# state names
|
||||||
|
|
||||||
msgid "accepted"
|
msgid "accepted"
|
||||||
|
@ -1202,6 +1205,12 @@ msgstr "unklassifiziert"
|
||||||
msgid "verified"
|
msgid "verified"
|
||||||
msgstr "verifiziert"
|
msgstr "verifiziert"
|
||||||
|
|
||||||
|
msgid "prospective"
|
||||||
|
msgstr "künftig"
|
||||||
|
|
||||||
|
msgid "inactive"
|
||||||
|
msgstr "inaktiv"
|
||||||
|
|
||||||
# transitions
|
# transitions
|
||||||
|
|
||||||
msgid "accept"
|
msgid "accept"
|
||||||
|
@ -1276,6 +1285,15 @@ msgstr "verifizieren"
|
||||||
msgid "work"
|
msgid "work"
|
||||||
msgstr "bearbeiten"
|
msgstr "bearbeiten"
|
||||||
|
|
||||||
|
msgid "activate"
|
||||||
|
msgstr "aktivieren"
|
||||||
|
|
||||||
|
msgid "inactivate"
|
||||||
|
msgstr "inaktiv setzen"
|
||||||
|
|
||||||
|
msgid "reset"
|
||||||
|
msgstr "zurücksetzen"
|
||||||
|
|
||||||
# calendar
|
# calendar
|
||||||
|
|
||||||
msgid "Monday"
|
msgid "Monday"
|
||||||
|
|
|
@ -40,12 +40,12 @@ def contactStates():
|
||||||
return StatesDefinition('contact_states',
|
return StatesDefinition('contact_states',
|
||||||
State('prospective', 'prospective', ('activate', 'inactivate',),
|
State('prospective', 'prospective', ('activate', 'inactivate',),
|
||||||
color='blue'),
|
color='blue'),
|
||||||
State('active', 'active', ('retract', 'inactivate',),
|
State('active', 'active', ('reset', 'inactivate',),
|
||||||
color='green'),
|
color='green'),
|
||||||
State('inactive', 'inactive', ('activate',),
|
State('inactive', 'inactive', ('activate', 'reset'),
|
||||||
color='x'),
|
color='x'),
|
||||||
Transition('activate', 'activate', 'active'),
|
Transition('activate', 'activate', 'active'),
|
||||||
Transition('retract', 'retract', 'prospective'),
|
Transition('reset', 'reset', 'prospective'),
|
||||||
Transition('inactivate', 'inactivate', 'inactive'),
|
Transition('inactivate', 'inactivate', 'inactive'),
|
||||||
initialState='active')
|
initialState='active')
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,18 @@ class DurationField(Field):
|
||||||
|
|
||||||
class PartyStateField(StateField):
|
class PartyStateField(StateField):
|
||||||
|
|
||||||
|
def getValue(self, row):
|
||||||
|
context = row.context
|
||||||
|
if context is None:
|
||||||
|
return None
|
||||||
|
party = util.getObjectForUid(context.party)
|
||||||
|
ptype = adapted(party.conceptType)
|
||||||
|
stdefs = IOptions(ptype)('organize.stateful') or []
|
||||||
|
if self.statesDefinition in stdefs:
|
||||||
|
stf = getAdapter(party, IStateful,
|
||||||
|
name=self.statesDefinition)
|
||||||
|
return stf.state
|
||||||
|
|
||||||
def getContext(self, row):
|
def getContext(self, row):
|
||||||
if row.context is None:
|
if row.context is None:
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Reference in a new issue