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,20 +247,20 @@ class Entity: ...@@ -247,20 +247,20 @@ class Entity:
self._setDefaultCareerTitle(coordinate) self._setDefaultCareerTitle(coordinate)
self.reindexObject() self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerCollectiveAgreementTitle') security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerDescription')
def setDefaultCareerCollectiveAgreementTitle(self, coordinate): def setDefaultCareerDescription(self, coordinate):
""" """
Updates the default address from a standard text string Updates the default address from a standard text string
""" """
self._setDefaultCareerCollectiveAgreementTitle(coordinate) self._setDefaultCareerDescription(coordinate)
self.reindexObject() self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerDescription') security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerCollectiveAgreementTitle')
def setDefaultCareerDescription(self, coordinate): def setDefaultCareerCollectiveAgreementTitle(self, coordinate):
""" """
Updates the default address from a standard text string Updates the default address from a standard text string
""" """
self._setDefaultCareerDescription(coordinate) self._setDefaultCareerCollectiveAgreementTitle(coordinate)
self.reindexObject() self.reindexObject()
security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerStartDate') security.declareProtected(Permissions.ModifyPortalContent, 'setDefaultCareerStartDate')
...@@ -448,6 +448,15 @@ class Entity: ...@@ -448,6 +448,15 @@ class Entity:
) )
self.default_career.setDescription(coordinate) self.default_career.setDescription(coordinate)
security.declarePrivate('_setDefaultCareerCollectiveAgreementTitle')
def _setDefaultCareerCollectiveAgreementTitle(self, coordinate):
assertAttributePortalType(self, 'default_career', 'Career')
if not hasattr(self,'default_career'):
self.invokeFactory( type_name='Career'
, id='default_career'
)
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