Merge branch 'master' into bbmaster

This commit is contained in:
Helmut Merz 2012-03-17 11:56:38 +01:00
commit 90466aad79
3 changed files with 18 additions and 14 deletions

View file

@ -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):

View file

@ -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)

View file

@ -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