Added Fax and Website fields to IContactDetails and IContactable.

This commit is contained in:
Thomas Desvenain 2013-10-04 10:57:34 +02:00
parent 97b94e57fd
commit b46651104f
3 changed files with 20 additions and 3 deletions

View File

@ -4,9 +4,14 @@ Changelog
1.1 (unreleased)
----------------
- Added Fax and Website fields to IContactDetails and IContactable.
[thomasdesvenain]
- Fixed javascript in @@add-organization view.
[vincentfretin]
- Fixed use parent address if we set Contact Details behaviour on held positions.
[thomasdesvenain]
1.0 (2013-09-13)

View File

@ -84,8 +84,10 @@ class IContactDetails(model.Schema):
label=_(u'Contact details'),
fields=('phone',
'cell_phone',
'fax',
'email',
'im_handle',
'website',
)
)
fieldset(
@ -119,6 +121,16 @@ class IContactDetails(model.Schema):
required=False,
)
fax = schema.TextLine(
title=_(u"Fax"),
required=False,
)
website = schema.TextLine(
title=_(u"Website"),
required=False,
)
im_handle = schema.TextLine(
title=_('Instant messenger handle'),
required=False,

View File

@ -46,7 +46,7 @@ class Contactable(grok.Adapter):
and IContactDetails.providedBy(related_item) \
and related_item not in contactables:
contactables.append(related_item)
return contactables
def _get_address(self, contactables):
@ -60,7 +60,7 @@ class Contactable(grok.Adapter):
def get_contact_details(self):
contact_details = {}
contact_details_fields = ['email', 'phone', 'cell_phone', 'im_handle']
contact_details_fields = ['email', 'phone', 'cell_phone', 'fax', 'website', 'im_handle']
for field in contact_details_fields:
# search the object that carries the field
for obj in self._get_contactables():
@ -71,7 +71,7 @@ class Contactable(grok.Adapter):
break
else:
contact_details[field] = ''
contactables = self._get_contactables()
contact_details['address'] = self._get_address(contactables)
return contact_details