[gen] bugfixes in the pod field.
This commit is contained in:
parent
4d12293dc8
commit
f64493764f
|
@ -193,6 +193,9 @@ class Pod(Field):
|
||||||
self.stylesMapping = stylesMapping
|
self.stylesMapping = stylesMapping
|
||||||
# What are the output formats when generating documents from this pod ?
|
# What are the output formats when generating documents from this pod ?
|
||||||
self.formats = formats
|
self.formats = formats
|
||||||
|
if not formats: # Compute default ones
|
||||||
|
ext = self.getExtension(self.template[0])
|
||||||
|
self.formats = Pod.allFormats[ext]
|
||||||
# Parameter "getChecked" can specify the name of a Ref field belonging
|
# Parameter "getChecked" can specify the name of a Ref field belonging
|
||||||
# to the same gen class. If it is the case, the context of the pod
|
# to the same gen class. If it is the case, the context of the pod
|
||||||
# template will contain an additional object, name "_checked", and
|
# template will contain an additional object, name "_checked", and
|
||||||
|
@ -200,13 +203,6 @@ class Pod(Field):
|
||||||
# objects linked via the Ref field that are currently selected in the
|
# objects linked via the Ref field that are currently selected in the
|
||||||
# user interface.
|
# user interface.
|
||||||
self.getChecked = getChecked
|
self.getChecked = getChecked
|
||||||
if not formats:
|
|
||||||
# Compute default ones
|
|
||||||
ext = self.getExtension(self.template[0])
|
|
||||||
if ext == '.ods':
|
|
||||||
self.formats = ('xls', 'ods')
|
|
||||||
else:
|
|
||||||
self.formats = ('pdf', 'doc', 'odt')
|
|
||||||
Field.__init__(self, None, (0,1), default, show, page, group, layouts,
|
Field.__init__(self, None, (0,1), default, show, page, group, layouts,
|
||||||
move, indexed, searchable, specificReadPermission,
|
move, indexed, searchable, specificReadPermission,
|
||||||
specificWritePermission, width, height, None, colspan,
|
specificWritePermission, width, height, None, colspan,
|
||||||
|
@ -308,8 +304,9 @@ class Pod(Field):
|
||||||
for template in self.template:
|
for template in self.template:
|
||||||
formats = self.showTemplate(obj, template)
|
formats = self.showTemplate(obj, template)
|
||||||
if not formats: continue
|
if not formats: continue
|
||||||
formats = isManager and self.getAllFormats(template) or formats
|
if isManager: formats = self.getAllFormats(template)
|
||||||
if isinstance(formats, basestring): formats = (formats,)
|
elif isinstance(formats, bool): formats = self.formats
|
||||||
|
elif isinstance(formats, basestring): formats = (formats,)
|
||||||
res.append(Object(template=template, formats=formats,
|
res.append(Object(template=template, formats=formats,
|
||||||
freezeFormats=self.getFreezeFormats(obj, template)))
|
freezeFormats=self.getFreezeFormats(obj, template)))
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -741,10 +741,7 @@ class AbstractWrapper(object):
|
||||||
elif name == 'state': return self.o.State()
|
elif name == 'state': return self.o.State()
|
||||||
elif name == 'stateLabel':
|
elif name == 'stateLabel':
|
||||||
return self.o.translate(self.o.getWorkflowLabel())
|
return self.o.translate(self.o.getWorkflowLabel())
|
||||||
elif name == 'history':
|
elif name == 'history': return self.o.workflow_history['appy']
|
||||||
o = self.o
|
|
||||||
key = o.workflow_history.keys()[0]
|
|
||||||
return o.workflow_history[key]
|
|
||||||
elif name == 'user': return self.o.getTool().getUser()
|
elif name == 'user': return self.o.getTool().getUser()
|
||||||
elif name == 'fields': return self.o.getAllAppyTypes()
|
elif name == 'fields': return self.o.getAllAppyTypes()
|
||||||
elif name == 'siteUrl': return self.o.getTool().getSiteUrl()
|
elif name == 'siteUrl': return self.o.getTool().getSiteUrl()
|
||||||
|
|
Loading…
Reference in a new issue