diff --git a/gen/plone25/mixins/__init__.py b/gen/plone25/mixins/__init__.py index 3323f40..7829084 100644 --- a/gen/plone25/mixins/__init__.py +++ b/gen/plone25/mixins/__init__.py @@ -217,13 +217,18 @@ class AbstractMixin: else: params = '?' + params return rq.RESPONSE.redirect(url+params) - def getAppyValue(self, name, appyType=None, useParamValue=False,value=None): + def getAppyValue(self, name, appyType=None, useParamValue=False, + value=None, forMasterId=False): '''Returns the value of field (or method) p_name for this object (p_self). If p_appyType (the corresponding Appy type) is provided, it gives additional information about the way to render the value. If p_useParamValue is True, the method uses p_value instead of the real field value (useful for rendering a value from the object - history, for example).''' + history, for example). + + If p_forMasterId is True, it returns the value as will be needed to + produce an identifier used within HTML pages for master/slave + relationships.''' # Which value will we use ? if useParamValue: v = value else: @@ -243,7 +248,7 @@ class AbstractMixin: res += ' %s' % v.strftime('%H:%M') return res elif vType == 'String': - if not v: return v + if not v or forMasterId: return v if appyType['isSelect']: validator = appyType['validator'] if isinstance(validator, Selection): diff --git a/gen/plone25/skin/macros.pt b/gen/plone25/skin/macros.pt index 7473154..762785c 100644 --- a/gen/plone25/skin/macros.pt +++ b/gen/plone25/skin/macros.pt @@ -72,6 +72,7 @@
+ @@ -80,7 +81,7 @@
- +
@@ -122,7 +123,7 @@ + id python: contextObj.getAppyValue(field.getName(), appyType, forMasterId=True)">
@@ -223,7 +224,7 @@ - + diff --git a/gen/plone25/wrappers/__init__.py b/gen/plone25/wrappers/__init__.py index 6cb54ad..598cf98 100644 --- a/gen/plone25/wrappers/__init__.py +++ b/gen/plone25/wrappers/__init__.py @@ -421,7 +421,7 @@ class FileWrapper: OpenOffice in server mode.''' if not filePath: filePath = '%s/file%f.%s' % (getOsTempFolder(), time.time(), - self.name) + normalizeString(self.name)) f = file(filePath, 'w') if self.content.__class__.__name__ == 'Pdata': # The file content is splitted in several chunks. diff --git a/shared/utils.py b/shared/utils.py index 51ffdf1..b5e2ad8 100644 --- a/shared/utils.py +++ b/shared/utils.py @@ -91,7 +91,7 @@ def normalizeString(s, usage='fileName'): elif not isinstance(s, unicode): s = unicode(s) if usage == 'fileName': # Remove any char that can't be found within a file name under - # Windows. + # Windows or that could lead to problems with OpenOffice. res = '' for char in s: if char not in unwantedChars: