diff --git a/browser/common.py b/browser/common.py index 6fa7ead..69cfc5a 100644 --- a/browser/common.py +++ b/browser/common.py @@ -541,6 +541,8 @@ class BaseView(GenericView, I18NView): @Lazy def typeOptions(self): + if self.typeProvider is None: + return DummyOptions() return IOptions(adapted(self.typeProvider)) def getPredicateOptions(self, relation): diff --git a/browser/resource.py b/browser/resource.py index e2a9816..bb69813 100644 --- a/browser/resource.py +++ b/browser/resource.py @@ -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 # it under the terms of the GNU General Public License as published by @@ -207,7 +207,9 @@ class ResourceView(BaseView): data = context.data if useAttachment: 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) response.setHeader('Content-Disposition', 'attachment; filename=%s' % filename) diff --git a/organize/work/report.py b/organize/work/report.py index c658b48..1851464 100644 --- a/organize/work/report.py +++ b/organize/work/report.py @@ -130,18 +130,6 @@ state = Field('state', u'State', description=u'The state of the work.', 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 @@ -249,6 +237,18 @@ class WorkReportInstance(ReportInstance): # 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): pass