Merge branch 'bbmaster' of ssh://git.cy55.de/home/git/loops into bbmaster
This commit is contained in:
commit
aa8bc152ba
4 changed files with 21 additions and 17 deletions
|
@ -541,6 +541,8 @@ class BaseView(GenericView, I18NView):
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def typeOptions(self):
|
def typeOptions(self):
|
||||||
|
if self.typeProvider is None:
|
||||||
|
return DummyOptions()
|
||||||
return IOptions(adapted(self.typeProvider))
|
return IOptions(adapted(self.typeProvider))
|
||||||
|
|
||||||
def getPredicateOptions(self, relation):
|
def getPredicateOptions(self, relation):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2012 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
|
||||||
|
@ -207,7 +207,9 @@ class ResourceView(BaseView):
|
||||||
data = context.data
|
data = context.data
|
||||||
if useAttachment:
|
if useAttachment:
|
||||||
filename = adapted(self.context).localFilename or getName(self.context)
|
filename = adapted(self.context).localFilename or getName(self.context)
|
||||||
if not self.typeOptions('no_normalize_download_filename'):
|
if self.typeOptions('no_normalize_download_filename'):
|
||||||
|
filename = '"%s"' % filename
|
||||||
|
else:
|
||||||
filename = NameChooser(getParent(self.context)).normalizeName(filename)
|
filename = NameChooser(getParent(self.context)).normalizeName(filename)
|
||||||
response.setHeader('Content-Disposition',
|
response.setHeader('Content-Disposition',
|
||||||
'attachment; filename=%s' % filename)
|
'attachment; filename=%s' % filename)
|
||||||
|
|
|
@ -93,7 +93,7 @@ class VocabularyField(Field):
|
||||||
return value
|
return value
|
||||||
items = self.getVocabularyItems(row)
|
items = self.getVocabularyItems(row)
|
||||||
for item in items:
|
for item in items:
|
||||||
if item['token'] == value:
|
if str(item['token']) == str(value):
|
||||||
return item['title']
|
return item['title']
|
||||||
|
|
||||||
def getVocabularyItems(self, row):
|
def getVocabularyItems(self, row):
|
||||||
|
@ -168,7 +168,7 @@ class TargetField(RelationField):
|
||||||
|
|
||||||
|
|
||||||
class MultiLineField(Field):
|
class MultiLineField(Field):
|
||||||
|
|
||||||
renderer = 'multiline'
|
renderer = 'multiline'
|
||||||
|
|
||||||
def getValue(self, row):
|
def getValue(self, row):
|
||||||
|
@ -197,4 +197,4 @@ class SubReportField(Field):
|
||||||
|
|
||||||
def getValue(self, row):
|
def getValue(self, row):
|
||||||
ri = self.getReportInstance(row)
|
ri = self.getReportInstance(row)
|
||||||
return ResultSet(ri, ri.getResults())
|
return ri.getResults()
|
||||||
|
|
|
@ -130,18 +130,6 @@ state = Field('state', u'State',
|
||||||
description=u'The state of the work.',
|
description=u'The state of the work.',
|
||||||
executionSteps=['query', 'output'])
|
executionSteps=['query', 'output'])
|
||||||
|
|
||||||
# task/event report fields
|
|
||||||
|
|
||||||
taskTitle = UrlField('title', u'Title',
|
|
||||||
description=u'The short description of the task.',
|
|
||||||
executionSteps=['output'])
|
|
||||||
taskDescription = TextField('description', u'Description',
|
|
||||||
description=u'The long description of the task.',
|
|
||||||
executionSteps=['output'])
|
|
||||||
workItems = SubReportField('workItems', u'Work Items',
|
|
||||||
description=u'A list of work items belonging to the task.',
|
|
||||||
executionSteps=['output'])
|
|
||||||
|
|
||||||
|
|
||||||
# basic definitions and work report instance
|
# basic definitions and work report instance
|
||||||
|
|
||||||
|
@ -249,6 +237,18 @@ class WorkReportInstance(ReportInstance):
|
||||||
|
|
||||||
# meeting minutes
|
# meeting minutes
|
||||||
|
|
||||||
|
taskTitle = UrlField('title', u'Title',
|
||||||
|
description=u'The short description of the task.',
|
||||||
|
executionSteps=['output'])
|
||||||
|
taskDescription = TextField('description', u'Description',
|
||||||
|
description=u'The long description of the task.',
|
||||||
|
executionSteps=['output'])
|
||||||
|
workItems = SubReportField('workItems', u'Work Items',
|
||||||
|
description=u'A list of work items belonging to the task.',
|
||||||
|
reportFactory=WorkReportInstance,
|
||||||
|
executionSteps=['output'])
|
||||||
|
|
||||||
|
|
||||||
class TaskRow(BaseRow):
|
class TaskRow(BaseRow):
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue