Commit 0a1c4c37 authored by Kevin Deldycke's avatar Kevin Deldycke

Clean setters an getters of the default career


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2575 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e9ee164e
...@@ -91,8 +91,18 @@ class Entity: ...@@ -91,8 +91,18 @@ class Entity:
except: except:
return '' return ''
security.declareProtected(Permissions.View, 'getDefaultCollectiveAgreementTitle') security.declareProtected(Permissions.View, 'getDefaultCareerDescription')
def getDefaultCollectiveAgreementTitle(self): def getDefaultCareerDescription(self):
"""
Returns the default address city as a text string
"""
try:
return self.getDefaultCareerValue().getDescription()
except:
return ''
security.declareProtected(Permissions.View, 'getDefaultCareerCollectiveAgreementTitle')
def getDefaultCareerCollectiveAgreementTitle(self):
""" """
Returns the default address city as a text string Returns the default address city as a text string
""" """
...@@ -131,16 +141,6 @@ class Entity: ...@@ -131,16 +141,6 @@ class Entity:
except: except:
return None return None
security.declareProtected(Permissions.View, 'getDefaultCareerDescription')
def getDefaultCareerDescription(self):
"""
Returns the default address city as a text string
"""
try:
return self.getDefaultCareerValue().getDescription()
except:
return ''
security.declareProtected(Permissions.View, 'getDefaultCareerSalaryLevel') security.declareProtected(Permissions.View, 'getDefaultCareerSalaryLevel')
def getDefaultCareerSalaryLevel(self): def getDefaultCareerSalaryLevel(self):
""" """
...@@ -247,6 +247,14 @@ class Entity: ...@@ -247,6 +247,14 @@ class Entity:
self._setDefaultCareerTitle(coordinate) self._setDefaultCareerTitle(coordinate)
self.reindexObject() self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerDescription')
def setDefaultCareerDescription(self, coordinate):
"""
Updates the default address from a standard text string
"""
self._setDefaultCareerDescription(coordinate)
self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerCollectiveAgreementTitle') security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerCollectiveAgreementTitle')
def setDefaultCareerCollectiveAgreementTitle(self, coordinate): def setDefaultCareerCollectiveAgreementTitle(self, coordinate):
""" """
...@@ -255,14 +263,6 @@ class Entity: ...@@ -255,14 +263,6 @@ class Entity:
self._setDefaultCareerCollectiveAgreementTitle(coordinate) self._setDefaultCareerCollectiveAgreementTitle(coordinate)
self.reindexObject() self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerDescription')
def setDefaultCareerDescription(self, coordinate):
"""
Updates the default address from a standard text string
"""
self._setDefaultCareerDescription(coordinate)
self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerStartDate') security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerStartDate')
def setDefaultCareerStartDate(self, coordinate): def setDefaultCareerStartDate(self, coordinate):
""" """
...@@ -441,13 +441,22 @@ class Entity: ...@@ -441,13 +441,22 @@ class Entity:
security.declarePrivate('_setDefaultCareerDescription') security.declarePrivate('_setDefaultCareerDescription')
def _setDefaultCareerDescription(self, coordinate): def _setDefaultCareerDescription(self, coordinate):
assertAttributePortalType(self, 'default_career', 'Career')
if not hasattr(self,'default_career'):
self.invokeFactory( type_name='Career'
, id='default_career'
)
self.default_career.setDescription(coordinate)
security.declarePrivate('_setDefaultCareerCollectiveAgreementTitle')
def _setDefaultCareerCollectiveAgreementTitle(self, coordinate):
assertAttributePortalType(self, 'default_career', 'Career') assertAttributePortalType(self, 'default_career', 'Career')
if not hasattr(self,'default_career'): if not hasattr(self,'default_career'):
self.invokeFactory( type_name='Career' self.invokeFactory( type_name='Career'
, id='default_career' , id='default_career'
) )
self.default_career.setDescription(coordinate) self.default_career.setCollectiveAgreementTitle(coordinate)
security.declarePrivate('_setDefaultCareerStartDate') security.declarePrivate('_setDefaultCareerStartDate')
def _setDefaultCareerStartDate(self, coordinate): def _setDefaultCareerStartDate(self, coordinate):
assertAttributePortalType(self, 'default_career', 'Career') assertAttributePortalType(self, 'default_career', 'Career')
......
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