From 9fa2baa127ef53fca03011ce2295e9306c40a306 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Benoi=CC=82t=20Pin?= <benoit.pin@gmail.com>
Date: Sun, 2 Jun 2013 00:43:11 +0200
Subject: [PATCH 1/1] =?utf8?q?=C3=89dition=20des=20propri=C3=A9t=C3=A9s=20?=
 =?utf8?q?des=20membres,=20=C3=A0=20partir=20de=20l'annuaire,=20=C3=A0=20n?=
 =?utf8?q?ouveau=20possible.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 MemberDataTool.py            | 44 +++++++++++++++++++++---------------
 skins/generic/gruf_macros.pt |  6 ++---
 2 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/MemberDataTool.py b/MemberDataTool.py
index a2c25db..4eea631 100755
--- a/MemberDataTool.py
+++ b/MemberDataTool.py
@@ -101,6 +101,12 @@ class MemberAdapter(BaseMemberAdapter, SimpleItem, DynamicType, CMFCatalogAware)
 	def getMemberSortableFormat(self) :
 		""" Return a specific format of full name for alphabetical sorting """
 		return self.getMemberFullName(nameBefore = 1).lower()
+	
+	# security overload
+	security.declareProtected(SetMemberProperties, 'setMemberProperties')
+	def setMemberProperties(self, mapping):
+		super(MemberAdapter, self).setMemberProperties(mapping)
+		self.reindexObject()
     
 
 InitializeClass(MemberAdapter)
@@ -144,24 +150,26 @@ class MemberData (BaseData, DynamicType, CMFCatalogAware):
 		if domains is not None:
 			u.domains = domains
 
-
-	def getMemberFullName(self, nameBefore=1) :
-		""" Return the best full name representation """
-		memberName = self.getProperty('name', default='')
-		memberGivenName = self.getProperty('given_name', default='')
-		memberId = self.getProperty('id', default='')
-		return formatFullName(memberName, memberGivenName, memberId, nameBefore=nameBefore)
-
-	def getMemberSortableFormat(self) :
-		""" Return a specific format of full name for alphabetical sorting """
-		return self.getMemberFullName(nameBefore = 1).lower()
-
-
-	## overload default security declaration
-	security.declareProtected(SetMemberProperties, 'setMemberProperties')
-	def setMemberProperties(self, mapping):
-		BaseData.setMemberProperties(self, mapping)
-		self.reindexObject()
+# migré
+#	def getMemberFullName(self, nameBefore=1) :
+#		""" Return the best full name representation """
+#		memberName = self.getProperty('name', default='')
+#		memberGivenName = self.getProperty('given_name', default='')
+#		memberId = self.getProperty('id', default='')
+#		return formatFullName(memberName, memberGivenName, memberId, nameBefore=nameBefore)
+
+# migré
+#	def getMemberSortableFormat(self) :
+#		""" Return a specific format of full name for alphabetical sorting """
+#		return self.getMemberFullName(nameBefore = 1).lower()
+
+
+# migré
+#	## overload default security declaration
+#	security.declareProtected(SetMemberProperties, 'setMemberProperties')
+#	def setMemberProperties(self, mapping):
+#		BaseData.setMemberProperties(self, mapping)
+#		self.reindexObject()
 
 	security.declarePrivate('manage_beforeDelete')
 	def manage_beforeDelete(self) :
diff --git a/skins/generic/gruf_macros.pt b/skins/generic/gruf_macros.pt
index e09c0fa..60c2d76 100755
--- a/skins/generic/gruf_macros.pt
+++ b/skins/generic/gruf_macros.pt
@@ -377,13 +377,13 @@
           <tr>
 	          <th nowrap="nowrap" i18n:translate="">Name</th>
 	          <td>
-	            <input type="text" name="name" size="40" tal:attributes="value selectedMember/name" />
+	            <input type="text" name="name" size="40" tal:attributes="value python:selectedMember.getProperty('name')" />
 	          </td>
 	        </tr>
           <tr>
 	          <th nowrap="nowrap" i18n:translate="">Given Name</th>
 	          <td>
-	            <input type="text" name="given_name" size="40" tal:attributes="value selectedMember/given_name" />
+	            <input type="text" name="given_name" size="40" tal:attributes="value python:selectedMember.getProperty('given_name')" />
 	          </td>
 	        </tr>
 	        <tr>
@@ -401,7 +401,7 @@
 	        <tr>
 	          <th nowrap="nowrap" i18n:translate="">Email address</th>
 	          <td>
-	            <input type="text" name="email" size="40" tal:attributes="value selectedMember/email" />
+	            <input type="text" name="email" size="40" tal:attributes="value python:selectedMember.getProperty('email')" />
 	          </td>
 	        </tr>
 	        <tr>
-- 
2.20.1