diff --git a/expert/field.py b/expert/field.py index 9448d0f..4bf1ae6 100644 --- a/expert/field.py +++ b/expert/field.py @@ -216,6 +216,12 @@ class RelationField(Field): class TargetField(RelationField): + def getSortValue(self, row): + value = self.getRawValue(row) + if value is not None: + value = util.getObjectForUid(value) + return value.title + def getValue(self, row): value = self.getRawValue(row) if value is None: diff --git a/knowledge/qualification/configure.zcml b/knowledge/qualification/configure.zcml index f5f1487..e4f02c9 100644 --- a/knowledge/qualification/configure.zcml +++ b/knowledge/qualification/configure.zcml @@ -49,4 +49,16 @@ set_schema="loops.expert.report.IReportInstance" /> + + + + + + diff --git a/knowledge/qualification/report.py b/knowledge/qualification/report.py index b7991eb..7849b70 100644 --- a/knowledge/qualification/report.py +++ b/knowledge/qualification/report.py @@ -41,6 +41,8 @@ class QualificationOverview(ReportInstance): fields = Jeep((task, party, workTitle, dayStart, dayEnd, state)) # +deadline? defaultOutputFields = fields + defaultSortCriteria = (party, task,) + def getOptions(self, option): return self.view.options(option) @@ -97,3 +99,20 @@ class Qualifications(QualificationOverview): for name in self.taskTypeNames] if c is not None] + +class PersonQualifications(QualificationOverview): + + type = 'person_qualifications' + label = u'Qualifications for Person' + + defaultSortCriteria = (task,) + + def getOptions(self, option): + return self.view.typeOptions(option) + + def selectObjects(self, parts): + workItems = self.recordManager['work'] + person = self.view.context + uid = util.getUidForObject(person) + return workItems.query(userName=uid, state=self.states) + diff --git a/organize/work/report.py b/organize/work/report.py index 1da2e3f..e13ac3d 100644 --- a/organize/work/report.py +++ b/organize/work/report.py @@ -114,7 +114,7 @@ timeEnd = TrackTimeField('end', u'End', executionSteps=['output']) task = TargetField('taskId', u'Task', description=u'The task to which work items belong.', - executionSteps=['output']) + executionSteps=['sort', 'output']) party = TargetField('userName', u'Party', description=u'The party (usually a person) who did the work.', fieldType='selection',