Commit 0f42911a authored by Alexandre Boeglin's avatar Alexandre Boeglin

1/ Replaced static accessors defined in Entity.py with dynamic accessors created

from PropertySheet 'acquired_property_id' property.

2/ Changed the behaviour of Coordinate so that getText and _setText use
methods defined in subclasses if they exist.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7116 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a6ebc1e6
......@@ -137,7 +137,12 @@ class Coordinate(Base):
security.declareProtected( Permissions.AccessContentsInformation,
'getText')
getText = asText
def getText(self):
"""
calls asText
"""
return self.asText()
security.declareProtected( Permissions.ModifyPortalContent, 'fromText' )
def fromText(self, coordinate_text):
......@@ -150,7 +155,11 @@ class Coordinate(Base):
return script(text=coordinate_text)
security.declareProtected(Permissions.ModifyPortalContent, '_setText')
_setText = fromText
def _setText(self, value):
"""
calls fromText
"""
return self.fromText(value)
security.declareProtected( Permissions.AccessContentsInformation,
'standardTextFormat')
......
This diff is collapsed.
......@@ -34,7 +34,7 @@ from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5.Core.MetaNode import MetaNode
class Organisation(Entity, MetaNode, XMLObject):
class Organisation(MetaNode, XMLObject):
"""
An Organisation object holds the information about
an organisation (ex. a division in a company, a company,
......
......@@ -49,7 +49,7 @@ try :
except ImportError:
pw_encrypt = lambda pw:pw
class Person(Entity, Node, XMLObject):
class Person(Node, XMLObject):
"""
An Person object holds the information about
an person (ex. you, me, someone in the company,
......
......@@ -62,10 +62,16 @@ class Url(Coordinate, Base):
security.declareProtected(Permissions.AccessContentsInformation,
'asText')
def asText(self):
"""
Returns a text representation of the Url
"""
return self.url_string
security.declareProtected(Permissions.ModifyPortalContent, 'fromText')
def fromText(self, text):
"""
set the Url from its text representation
"""
self.url_string = text
security.declareProtected(Permissions.AccessContentsInformation,
......
......@@ -105,6 +105,8 @@ class Organisation:
'description' : 'The default address of this organisations',
'type' : 'content',
'portal_type' : ('Address'),
'acquired_property_id' : ( 'text', 'street_address', 'city',
'zip_code', 'region', 'region_title'),
'acquisition_base_category' : ('region', ),
'acquisition_portal_type' : ('Category',),
'acquisition_copy_value' : 0,
......@@ -118,6 +120,7 @@ class Organisation:
'description' : 'The default phone for this organisation',
'type' : 'content',
'portal_type' : ('Telephone'),
'acquired_property_id' : ( 'text', 'telephone_number' ),
'acquisition_base_category' : ('region', ),
'acquisition_portal_type' : ('Category',),
'acquisition_copy_value' : 0,
......@@ -131,6 +134,7 @@ class Organisation:
'description' : 'A default mobile phone for this organisation',
'type' : 'content',
'portal_type' : ('Telephone'),
'acquired_property_id' : ( 'text', 'telephone_number' ),
'acquisition_base_category' : ('region', ),
'acquisition_portal_type' : ('Category',),
'acquisition_copy_value' : 0,
......@@ -144,6 +148,7 @@ class Organisation:
'description' : 'The defaut fax phone number for this organisation',
'type' : 'content',
'portal_type' : ('Fax'),
'acquired_property_id' : ( 'text', 'telephone_number' ),
'acquisition_base_category' : ('region', ),
'acquisition_portal_type' : ('Category',),
'acquisition_copy_value' : 0,
......@@ -157,6 +162,7 @@ class Organisation:
'description' : 'The default email address for this organisation',
'type' : 'content',
'portal_type' : ('Email'),
'acquired_property_id' : ( 'text', ),
'acquisition_base_category' : ('region', ),
'acquisition_portal_type' : ('Category',),
'acquisition_copy_value' : 0,
......@@ -170,6 +176,7 @@ class Organisation:
'description' : 'An alternate email address for this organisation',
'type' : 'content',
'portal_type' : ('Email'),
'acquired_property_id' : ( 'text', ),
'acquisition_base_category' : ('region', ),
'acquisition_portal_type' : ('Category',),
'acquisition_copy_value' : 0,
......
......@@ -98,6 +98,8 @@ class Person:
, 'description' : 'The current address of the person'
, 'type' : 'content'
, 'portal_type' : ( 'Address', )
, 'acquired_property_id' : ( 'text', 'street_address', 'city',
'zip_code', 'region', 'region_title')
, 'acquisition_base_category': ( 'subordination', )
, 'acquisition_portal_type' : ( 'Organisation', )
, 'acquisition_copy_value' : 0
......@@ -113,6 +115,7 @@ class Person:
, 'description' : 'The current telephone of the person'
, 'type' : 'content'
, 'portal_type' : ( 'Telephone', )
, 'acquired_property_id' : ( 'text', 'telephone_number' )
, 'acquisition_base_category': ( 'subordination', )
, 'acquisition_portal_type' : ( 'Organisation', )
, 'acquisition_copy_value' : 0
......@@ -127,6 +130,7 @@ class Person:
, 'description' : 'The current mobile telephone of the person'
, 'type' : 'content'
, 'portal_type' : ( 'Telephone', )
, 'acquired_property_id' : ( 'text', 'telephone_number' )
, 'acquisition_base_category': ( 'subordination', )
, 'acquisition_portal_type' : ( 'Organisation', )
, 'acquisition_copy_value' : 0
......@@ -141,6 +145,7 @@ class Person:
, 'description' : 'The current fax of the person'
, 'type' : 'content'
, 'portal_type' : ( 'Fax', )
, 'acquired_property_id' : ( 'text', 'telephone_number' )
, 'acquisition_base_category': ( 'subordination', )
, 'acquisition_portal_type' : ( 'Organisation', )
, 'acquisition_copy_value' : 0
......@@ -155,6 +160,7 @@ class Person:
, 'description' : 'The current email of the person'
, 'type' : 'content'
, 'portal_type' : ( 'Email', )
, 'acquired_property_id' : ( 'text', )
, 'acquisition_base_category': ( 'subordination', )
, 'acquisition_portal_type' : ( 'Organisation', )
, 'acquisition_copy_value' : 0
......@@ -169,6 +175,7 @@ class Person:
, 'description' : 'An alternate email of the person'
, 'type' : 'content'
, 'portal_type' : ( 'Email', )
, 'acquired_property_id' : ( 'text', )
, 'acquisition_base_category': ( 'subordination', )
, 'acquisition_portal_type' : ( 'Organisation', )
, 'acquisition_copy_value' : 0
......
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