provide report for listing qualifications for a competence
This commit is contained in:
parent
e675a95871
commit
50b45b2c56
4 changed files with 57 additions and 2 deletions
|
@ -37,4 +37,16 @@
|
||||||
set_schema="loops.expert.report.IReportInstance" />
|
set_schema="loops.expert.report.IReportInstance" />
|
||||||
</zope:class>
|
</zope:class>
|
||||||
|
|
||||||
|
<zope:adapter
|
||||||
|
name="qualifications"
|
||||||
|
factory="loops.knowledge.qualification.report.Qualifications"
|
||||||
|
provides="loops.expert.report.IReportInstance"
|
||||||
|
trusted="True" />
|
||||||
|
<zope:class class="loops.knowledge.qualification.report.Qualifications">
|
||||||
|
<require permission="zope.View"
|
||||||
|
interface="loops.expert.report.IReportInstance" />
|
||||||
|
<require permission="zope.ManageContent"
|
||||||
|
set_schema="loops.expert.report.IReportInstance" />
|
||||||
|
</zope:class>
|
||||||
|
|
||||||
</configure>
|
</configure>
|
||||||
|
|
|
@ -33,7 +33,7 @@ from loops import util
|
||||||
|
|
||||||
class QualificationOverview(ReportInstance):
|
class QualificationOverview(ReportInstance):
|
||||||
|
|
||||||
type = "qualification_overview"
|
type = 'qualification_overview'
|
||||||
label = u'Qualification Overview'
|
label = u'Qualification Overview'
|
||||||
|
|
||||||
rowFactory = WorkRow
|
rowFactory = WorkRow
|
||||||
|
@ -60,3 +60,40 @@ class QualificationOverview(ReportInstance):
|
||||||
for wi in workItems.query(taskId=uid, state=self.states):
|
for wi in workItems.query(taskId=uid, state=self.states):
|
||||||
result.append(wi)
|
result.append(wi)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
class Qualifications(QualificationOverview):
|
||||||
|
|
||||||
|
type = 'qualifications'
|
||||||
|
label = u'Qualifications'
|
||||||
|
|
||||||
|
taskTypeNames = ('competence',)
|
||||||
|
|
||||||
|
def getOptions(self, option):
|
||||||
|
return self.view.typeOptions(option)
|
||||||
|
|
||||||
|
def selectObjects(self, parts):
|
||||||
|
result = []
|
||||||
|
workItems = self.recordManager['work']
|
||||||
|
target = self.view.context
|
||||||
|
tasks = [target] + self.getAllSubtasks(target)
|
||||||
|
for t in tasks:
|
||||||
|
uid = util.getUidForObject(t)
|
||||||
|
for wi in workItems.query(taskId=uid, state=self.states):
|
||||||
|
result.append(wi)
|
||||||
|
return result
|
||||||
|
|
||||||
|
def getAllSubtasks(self, concept):
|
||||||
|
result = []
|
||||||
|
for c in concept.getChildren([self.view.defaultPredicate]):
|
||||||
|
if c.conceptType in self.taskTypes:
|
||||||
|
result.append(c)
|
||||||
|
result.extend(self.getAllSubtasks(c))
|
||||||
|
return result
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
def taskTypes(self):
|
||||||
|
return [c for c in [self.conceptManager.get(name)
|
||||||
|
for name in self.taskTypeNames]
|
||||||
|
if c is not None]
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -3,7 +3,7 @@ msgstr ""
|
||||||
|
|
||||||
"Project-Id-Version: 0.13.0\n"
|
"Project-Id-Version: 0.13.0\n"
|
||||||
"POT-Creation-Date: 2007-05-22 12:00 CET\n"
|
"POT-Creation-Date: 2007-05-22 12:00 CET\n"
|
||||||
"PO-Revision-Date: 2014-06-03 12:00 CET\n"
|
"PO-Revision-Date: 2014-07-11 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"
|
||||||
|
@ -849,6 +849,12 @@ msgstr "Beginn"
|
||||||
msgid "End date"
|
msgid "End date"
|
||||||
msgstr "Ende"
|
msgstr "Ende"
|
||||||
|
|
||||||
|
msgid "Start Day"
|
||||||
|
msgstr "Beginn"
|
||||||
|
|
||||||
|
msgid "End Day"
|
||||||
|
msgstr "Ende"
|
||||||
|
|
||||||
msgid "Knowledge"
|
msgid "Knowledge"
|
||||||
msgstr "Kompetenzen"
|
msgstr "Kompetenzen"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue