Commit 99e0acee authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

merge

......@@ -24,7 +24,7 @@ class Person(EmailableMixIn, AnyEntity):
return self.name(True)
def name(self, civility=False):
if civility:
if civility and self.civility:
return u'%s %s %s' % (self.req._(self.civility),
self.firstname or u'', self.surname or u'')
return u'%s %s' % (self.firstname or u'', self.surname or u'')
......
......@@ -12,13 +12,13 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
msgid "Mr"
msgstr ""
msgstr "Mr"
msgid "Mrs"
msgstr ""
msgstr "Mrs"
msgid "Ms"
msgstr ""
msgstr "Ms"
msgid "New Person"
msgstr "New person"
......@@ -36,17 +36,20 @@ msgid "This Person"
msgstr "This person"
msgid "a physical person"
msgstr ""
msgstr "a physical person"
msgid "actions_addperson-fromemail"
msgstr "add person from sender"
msgid "actions_addperson-fromemail_description"
msgstr ""
msgstr "add person from sender"
msgid "add Person phone PhoneNumber subject"
msgstr "phone number"
msgid "add Person postal_address PostalAddress subject"
msgstr "address"
msgid "add Person use_email EmailAddress object"
msgstr "person"
......@@ -60,7 +63,7 @@ msgstr "add a person"
# subject and object forms for each relation type
# (no object form for final relation types)
msgid "civility"
msgstr ""
msgstr "civility"
msgid "creating EmailAddress (Person %(linkto)s use_email EmailAddress)"
msgstr "email address of %(linkto)s"
......@@ -68,18 +71,27 @@ msgstr "email address of %(linkto)s"
msgid "creating PhoneNumber (Person %(linkto)s phone PhoneNumber)"
msgstr "phone number of %(linkto)s"
msgid "creating PostalAddress (Person %(linkto)s postal_address PostalAddress)"
msgstr "address of %(linkto)s "
msgid "emails"
msgstr ""
msgstr "emails"
#, python-format
msgid "emails sent or received by %s"
msgstr ""
msgstr "emails sent or received by %s"
msgid "phone"
msgstr ""
msgstr "phone"
msgid "phone_object"
msgstr "phone of"
msgid "postal_address"
msgstr "address"
msgid "postal_address_object"
msgstr "address of"
msgid "remove this Person"
msgstr "remove this person"
......@@ -42,11 +42,14 @@ msgid "actions_addperson-fromemail"
msgstr "créer personne à partir de l'expéditeur"
msgid "actions_addperson-fromemail_description"
msgstr ""
msgstr "créer personne à partir de l'expéditeur"
msgid "add Person phone PhoneNumber subject"
msgstr "numéro de téléphone"
msgid "add Person postal_address PostalAddress subject"
msgstr "adresse"
msgid "add Person use_email EmailAddress object"
msgstr "personne"
......@@ -68,6 +71,9 @@ msgstr "adresse électronique de %(linkto)s"
msgid "creating PhoneNumber (Person %(linkto)s phone PhoneNumber)"
msgstr "numéro de téléphone de %(linkto)s"
msgid "creating PostalAddress (Person %(linkto)s postal_address PostalAddress)"
msgstr "adresse de %(linkto)s"
msgid "emails"
msgstr "courriels"
......@@ -81,5 +87,11 @@ msgstr "téléphone"
msgid "phone_object"
msgstr "téléphone de"
msgid "postal_address"
msgstr "adresse"
msgid "postal_address_object"
msgstr "adresse de"
msgid "remove this Person"
msgstr "supprimer cette personne"
add_relation_definition('Person', 'postal_address', 'PostalAddress')
......@@ -22,11 +22,14 @@ class Person(EntityType):
description = RichString(fulltextindexed=True)
if 'PhoneNumber' in defined_types: # from addressbook package
phone = SubjectRelation('PhoneNumber', composite='subject')
phone = SubjectRelation('PhoneNumber', composite='subject')
if 'PostalAddress' in defined_types:
postal_address = SubjectRelation('PostalAddress', composite='subject')
use_email = SubjectRelation('EmailAddress', cardinality='*1', composite='subject')
# allowing an email to be the primary email of multiple persons is necessary for
# test at least :-/
primary_email = SubjectRelation('EmailAddress', cardinality='??',
constraints= [RQLConstraint('S use_email O')])
......@@ -19,7 +19,7 @@ for rtype in ('phone', 'use_email', 'primary_email'):
uicfg.primaryview_section.tag_subject_of(('Person', rtype, '*'), 'hidden')
uicfg.autoform_is_inlined.tag_subject_of(('Person', 'phone', '*'), True)
uicfg.autoform_is_inlined.tag_subject_of(('Person', 'postal_address', '*'), True)
class PersonPrimaryView(primary.PrimaryView):
__select__ = implements('Person')
......@@ -35,6 +35,14 @@ class PersonPrimaryView(primary.PrimaryView):
if entity.use_email:
self.field('use_email',
', '.join(e.view('oneline') for e in entity.use_email))
if getattr(entity, 'postal_address', None):
self.w(u"<table>")
for postaladdress in entity.postal_address:
self.w(u'<tr><th class="labelCol">%s</th><td>%s</td></tr>' %
(display_name(self.req, 'PostalAddress'),
postaladdress.view('incontext')) )
self.w(u"</table>")
super(PersonPrimaryView, self).render_entity_attributes(entity)
def summary(self, entity):
......
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