Commit cfffbdc7 authored by Kevin Deldycke's avatar Kevin Deldycke

don't display inside the xml CPSDocuments


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@352 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c0fd255e
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
from Products.CPSDocument.CPSDocument import CPSDocument from Products.CPSDocument.CPSDocument import CPSDocument
from Products.CPSSchemas.BasicFields import CPSImageField, CPSFileField, CPSDateTimeField from Products.CPSSchemas.BasicFields import CPSImageField, CPSFileField, CPSDateTimeField
from Products.CPSSchemas.BasicFields import CPSStringField
from Products.ERP5Type.Base import Base from Products.ERP5Type.Base import Base
from Products.ERP5Type.Utils import UpperCase from Products.ERP5Type.Utils import UpperCase
from Acquisition import aq_base, aq_inner from Acquisition import aq_base, aq_inner
...@@ -36,29 +37,28 @@ class PatchedCPSDocument(CPSDocument): ...@@ -36,29 +37,28 @@ class PatchedCPSDocument(CPSDocument):
for schema in self.getTypeInfo().getSchemas(): for schema in self.getTypeInfo().getSchemas():
for field in schema.objectValues(): for field in schema.objectValues():
#LOG('testjp',0,'field: %s' % str(field)) #LOG('testjp',0,'field: %s' % str(field))
f_type = '' f_type = None
for p in field._properties: for p in field._properties:
if p['id'] == 'default': if p['id'] == 'default':
f_type = p['type'] f_type = p['type']
if isinstance(field,CPSImageField): if isinstance(field,CPSImageField):
#f_type = 'image'
f_type = 'object' f_type = 'object'
if isinstance(field,CPSDateTimeField): elif isinstance(field,CPSStringField):
f_type = 'string'
elif isinstance(field,CPSDateTimeField):
f_type = 'date' f_type = 'date'
if isinstance(field,CPSFileField): elif isinstance(field,CPSFileField):
#f_type = 'file'
f_type = 'object'
if isinstance(field,CPSDocument):
#f_type = 'document'
f_type = 'object' f_type = 'object'
elif isinstance(field,CPSDocument):
pass
prop_id = schema.getIdUnprefixed(field.id) prop_id = schema.getIdUnprefixed(field.id)
if prop_id in ('file_text','content','attachedFile', #if prop_id in ('file_text','content','attachedFile',
'attachedFile_html','attachedFile_text', 'content'): # 'attachedFile_html','attachedFile_text', 'content'):
f_type = 'object' # this should be string, but this strings # f_type = 'object' # this should be string, but this strings
# do so bad xml # do so bad xml
#if not (prop_id in ('file_text','content','attachedFile','attachedFile_html','attachedFile_text')): #if not (prop_id in ('file_text','content','attachedFile','attachedFile_html','attachedFile_text')):
#if 1: #if not (prop_id in ('content',)):
if not (prop_id in ('content',)): if f_type is not None:
property_sheet.append( property_sheet.append(
{ {
'id' : prop_id, 'id' : prop_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment