Commit 03efb0ee authored by Vincent Pelletier's avatar Vincent Pelletier

Unify user caption generation.

parent b17db176
......@@ -6,7 +6,7 @@
<tal:block tal:condition="not: here/portal_membership/isAnonymousUser">
<span class="logged_txt"><tal:block i18n:translate=""
i18n:domain="ui">User</tal:block> :</span><span class="login">
<tal:block tal:replace="python:here.portal_membership.getAuthenticatedMember().getId()" />
<tal:block tal:replace="python: here.Base_getUserCaption()" />
</span>
</tal:block>
<!--<tal:block tal:condition="here/portal_membership/isAnonymousUser">
......
......@@ -13,7 +13,7 @@
<tal:block tal:define="current_web_site python:request.get('current_web_site', here);
portal_path python:request.get('current_web_site_url', current_web_site.absolute_url());
user_name python: here.portal_membership.getAuthenticatedMember();
user_name python: here.Base_getUserCaption();
is_anonymous_user here/portal_membership/isAnonymousUser">
<tal:block tal:condition="not:is_anonymous_user">
......
......@@ -38,7 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<!--
<tal:block tal:condition="not: here/portal_membership/isAnonymousUser">
<span class="link2" i18n:translate="" i18n:domain="ui">of</span>
<span class="link2" tal:content="python:here.portal_catalog(reference=here.portal_membership.getAuthenticatedMember().getId(), portal_type='Person')[0].getObject().getTitle()+' :'" />
<span class="link2" tal:content="python: here.Base_getUserCaption() + ' :'" />
</tal:block>
-->
</div>
......@@ -134,7 +134,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<span class="link2"></span>
<tal:block tal:condition="not: here/portal_membership/isAnonymousUser">
<span class="modu" i18n:translate="" i18n:domain="ui">Logged In as :</span>
<span class="link2" tal:content="python:here.portal_membership.getAuthenticatedMember().getId()" />
<span class="link2" tal:content="python: here.Base_getUserCaption()" />
</tal:block>
<span class="link2"></span>
</div> -->
......
<?xml version='1.0' encoding='utf-8'?>
<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:ooo="http://openoffice.org/2004/office" xmlns:metal="http://xml.zope.org/namespaces/metal" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:i18n="http://xml.zope.org/namespaces/i18n" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:tal="http://xml.zope.org/namespaces/tal" office:version="1.2" tal:attributes="dummy python:request.RESPONSE.setHeader('Content-Type', 'text/html;; charset=utf-8')">
<office:meta i18n:domain="ui" tal:define="user context/ERP5Site_getAuthenticatedMemberPersonValue;
username python:(user is None) and context.getPortalObject().portal_membership.getAuthenticatedMember() or user.getTitle()">
<office:meta i18n:domain="ui" tal:define="username python: context.Base_getUserCaption()">
<meta:generator>ERP5</meta:generator>
<meta:creation-date tal:content="python:modules['DateTime'].DateTime().ISO8601()">2007-07-04T15:43:50</meta:creation-date>
<meta:initial-creator tal:content="username"/>
......
<?xml version='1.0' encoding='utf-8'?>
<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:ooo="http://openoffice.org/2004/office" xmlns:metal="http://xml.zope.org/namespaces/metal" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:i18n="http://xml.zope.org/namespaces/i18n" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:tal="http://xml.zope.org/namespaces/tal" office:version="1.2" tal:attributes="dummy python:request.RESPONSE.setHeader('Content-Type', 'text/html;; charset=utf-8')">
<office:meta i18n:domain="ui" tal:define="user context/ERP5Site_getAuthenticatedMemberPersonValue;
username python:(user is None) and context.getPortalObject().portal_membership.getAuthenticatedMember() or user.getTitle()">
<office:meta i18n:domain="ui" tal:define="username python: context.Base_getUserCaption()">
<meta:generator>ERP5</meta:generator>
<meta:creation-date tal:content="python:modules['DateTime'].DateTime().ISO8601()">2007-07-04T15:43:50</meta:creation-date>
<meta:initial-creator tal:content="username"/>
......
......@@ -6,11 +6,10 @@ howto_dict = context.Zuite_getHowToInfo()
isTransitionPossible = portal.portal_workflow.isTransitionPossible
# in testExpressUserDocumentationOutgoingEvent we relly that loged in user is an ERP5 Person
logged_in_user = str(context.portal_membership.getAuthenticatedMember())
current_person = context.portal_catalog.getResultValue(portal_type='Person',
reference=logged_in_user)
logged_in_user = context.portal_membership.getAuthenticatedMember()
current_person = logged_in_user.getUserValue()
if current_person is None:
return 'You need to be logged with an ERP5User for this test %s' %logged_in_user
return 'You need to be logged with an ERP5User for this test %s' % (logged_in_user.getId(), )
# check if there is already the euro curency on the instance
currency = context.portal_catalog.getResultValue(portal_type='Currency',
......
......@@ -31,8 +31,8 @@
</tal:block>
<span style="float:right;" tal:condition="python:not here.portal_membership.isAnonymousUser()">
Logged in as: <a style="color:blue;" tal:define="user here/portal_membership/getAuthenticatedMember"
tal:content="user"
Logged in as: <a style="color:blue;"
tal:content="python: here.Base_getUserCaption()"
tal:attributes="href python:'WebSite_redirectToUserView?%s&user=%s' % (
request.get('http_parameters', None), user)">userid</a>
request.get('http_parameters', None), here.getPortalObject().portal_membership.getAuthenticatedMember().getId())"></a>
</span>
......@@ -104,7 +104,7 @@
<div id="logged_in_as" class="logged_in_as">
<tal:block tal:condition="not: portal/portal_membership/isAnonymousUser">
<span class="logged_txt" i18n:translate="" i18n:domain="ui">Logged In as :</span>
<tal:block tal:replace="python:portal.portal_membership.getAuthenticatedMember().getId()" />
<tal:block tal:replace="python: portal.Base_getUserCaption()" />
</tal:block>
</div>
<p class="clear"></p>
......
......@@ -3,7 +3,7 @@
<a tal:condition="python: context.getModificationDate() is not None">
<a tal:content="python: 'Updated %s by' % context.getModificationDate().ISO()"/>
</a>
<a tal:content="here/portal_membership/getAuthenticatedMember"/>
<a tal:content="python: here.Base_getUserCaption()"/>
<button onclick="javascript:clickSaveButton('Base_edit')"
name="Base_edit:method"
class="save" type="submit"
......
......@@ -6,7 +6,7 @@
<a id="login" href="#" i18n:translate="" i18n:domain="ui">Sign in</a>
</tal:block>
<tal:block tal:condition="python:not here.portal_membership.isAnonymousUser()">
| <a tal:content="here/portal_membership/getAuthenticatedMember"/>
| <a tal:content="python: here.Base_getUserCaption()"/>
</tal:block>
<tal:block tal:condition="python: not here.portal_membership.isAnonymousUser()">
| <a id="settings" href="#" i18n:translate="" i18n:domain="ui">Settings</a>
......
......@@ -90,7 +90,7 @@ IDEAS:
<div id="logged_in_as">
<tal:block tal:condition="not: portal/portal_membership/isAnonymousUser">
<span class="logged_txt" i18n:translate="" i18n:domain="ui">Logged In as :</span>
<tal:block tal:replace="python:portal.portal_membership.getAuthenticatedMember().getId()" />
<tal:block tal:replace="python:portal.Base_getUserCaption()" />
</tal:block>
</div>
-->
......
......@@ -8,7 +8,7 @@
<div id="logged_in_as" class="logged_in_as">
<tal:block tal:condition="not: portal/portal_membership/isAnonymousUser">
<span class="logged_txt" i18n:translate="" i18n:domain="ui">Logged In as :</span>
<tal:block tal:replace="python:portal.portal_membership.getAuthenticatedMember().getId()" />
<tal:block tal:replace="python:portal.Base_getUserCaption()" />
</tal:block>
</div>
......
......@@ -84,7 +84,7 @@
i18n:translate="" i18n:domain="ui">Login</a></span>
<span id="tiologin"
tal:define="user_name python:here.portal_membership.getAuthenticatedMember().getId()"
tal:define="user_name python:here.Base_getUserCaption()"
tal:condition="not:here/portal_membership/isAnonymousUser"><a href="#" id="link-login"
tal:attributes="href string:${context_url}/logout"
i18n:translate="" i18n:domain="ui">Logout</a>
......
# Proxy roles: Manager in case user cannot access their own document.
user = context.getPortalObject().portal_membership.getAuthenticatedMember()
user_value = user.getUserValue()
try:
return user_value.getReference()
except AttributeError:
return user.getId()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getUserCaption</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -56,7 +56,7 @@ DEPRECATION:
<div id="logged_in_as" class="logged_in_as">
<tal:block tal:condition="not: portal/portal_membership/isAnonymousUser">
<span class="logged_txt" i18n:translate="" i18n:domain="ui">Logged In as :</span>
<tal:block tal:replace="python:portal.portal_membership.getAuthenticatedMember().getId()" />
<tal:block tal:replace="python:portal.Base_getUserCaption()" />
</tal:block>
</div>
<p class="clear"></p>
......
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