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:
except:
return ''
security.declareProtected(Permissions.View, 'getDefaultCollectiveAgreementTitle')
def getDefaultCollectiveAgreementTitle(self):
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, 'getDefaultCareerCollectiveAgreementTitle')
def getDefaultCareerCollectiveAgreementTitle(self):
"""
Returns the default address city as a text string
"""
......@@ -131,16 +141,6 @@ class Entity:
except:
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')
def getDefaultCareerSalaryLevel(self):
"""
......@@ -247,6 +247,14 @@ class Entity:
self._setDefaultCareerTitle(coordinate)
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')
def setDefaultCareerCollectiveAgreementTitle(self, coordinate):
"""
......@@ -255,14 +263,6 @@ class Entity:
self._setDefaultCareerCollectiveAgreementTitle(coordinate)
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')
def setDefaultCareerStartDate(self, coordinate):
"""
......@@ -441,13 +441,22 @@ class Entity:
security.declarePrivate('_setDefaultCareerDescription')
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')
if not hasattr(self,'default_career'):
self.invokeFactory( type_name='Career'
, id='default_career'
)
self.default_career.setDescription(coordinate)
self.default_career.setCollectiveAgreementTitle(coordinate)
security.declarePrivate('_setDefaultCareerStartDate')
def _setDefaultCareerStartDate(self, coordinate):
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