diff --git a/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov_widget_library/WebSite_viewStatusBarRenderer.zpt b/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov_widget_library/WebSite_viewStatusBarRenderer.zpt index 982ffc3d10fccc75f97ec2c3b100c9ce1d7c9e7d..df5a153ff621ad47c93276b54dbab9f395d46851 100644 --- a/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov_widget_library/WebSite_viewStatusBarRenderer.zpt +++ b/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov_widget_library/WebSite_viewStatusBarRenderer.zpt @@ -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"> diff --git a/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewUserInformationWidget.zpt b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewUserInformationWidget.zpt index 3e7f7a524cbe1f975673cc5935ea1aecc141dc55..d9ea89cf2488553797e0cd9512987a0e163328d9 100644 --- a/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewUserInformationWidget.zpt +++ b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewUserInformationWidget.zpt @@ -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"> diff --git a/bt5/erp5_mobile/SkinTemplateItem/portal_skins/erp5_mobile_ui/index_html.zpt b/bt5/erp5_mobile/SkinTemplateItem/portal_skins/erp5_mobile_ui/index_html.zpt index 26989806968f3a09e70a029f42587a89f963c12e..62b4c68e60c2cb766741d6270816df04ebc01c28 100644 --- a/bt5/erp5_mobile/SkinTemplateItem/portal_skins/erp5_mobile_ui/index_html.zpt +++ b/bt5/erp5_mobile/SkinTemplateItem/portal_skins/erp5_mobile_ui/index_html.zpt @@ -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> --> diff --git a/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSMetaStyleSheet.oot b/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSMetaStyleSheet.oot index 355376abc164ef2e2d291f31535543b09c2ecb20..c4ef5cdf8d5947dfc19569512b25674704b81d77 100644 --- a/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSMetaStyleSheet.oot +++ b/bt5/erp5_ods_style/SkinTemplateItem/portal_skins/erp5_ods_style/Base_getODSMetaStyleSheet.oot @@ -1,7 +1,6 @@ <?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"/> diff --git a/bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_core/Base_getODTMetaStyleSheet.oot b/bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_core/Base_getODTMetaStyleSheet.oot index 355376abc164ef2e2d291f31535543b09c2ecb20..c4ef5cdf8d5947dfc19569512b25674704b81d77 100644 --- a/bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_core/Base_getODTMetaStyleSheet.oot +++ b/bt5/erp5_odt_style/SkinTemplateItem/portal_skins/erp5_odt_core/Base_getODTMetaStyleSheet.oot @@ -1,7 +1,6 @@ <?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"/> diff --git a/bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_setUpOutgoingEventTest.py b/bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_setUpOutgoingEventTest.py index c9b4f912ffeb7c931973b610f25036a1982bd771..de8fedcce80cf94a1302389a73cd8acbf39c6cef 100644 --- a/bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_setUpOutgoingEventTest.py +++ b/bt5/erp5_user_tutorial_ui_test/SkinTemplateItem/portal_skins/erp5_user_tutorial_ui_test/Zuite_setUpOutgoingEventTest.py @@ -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', diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/breadcrumb.zpt b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/breadcrumb.zpt index 8f6476c476961bf11f76b0adbd440a7b1bb98dd4..ba7e590d153c0c7597e85d1af46093d4c6835d7f 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/breadcrumb.zpt +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web_widget_library/breadcrumb.zpt @@ -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> diff --git a/bt5/erp5_web_minimal_simplicity/SkinTemplateItem/portal_skins/erp5_web_minimal_simplicity/template_erp5_xhtml_style.zpt b/bt5/erp5_web_minimal_simplicity/SkinTemplateItem/portal_skins/erp5_web_minimal_simplicity/template_erp5_xhtml_style.zpt index fff0f9054da3fd9aa0806e541b2f0b80e0a5d67a..d9626b6c2bb52da4674db2cc7611194a1229e869 100644 --- a/bt5/erp5_web_minimal_simplicity/SkinTemplateItem/portal_skins/erp5_web_minimal_simplicity/template_erp5_xhtml_style.zpt +++ b/bt5/erp5_web_minimal_simplicity/SkinTemplateItem/portal_skins/erp5_web_minimal_simplicity/template_erp5_xhtml_style.zpt @@ -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> diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_viewDocumentActionWidget.zpt b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_viewDocumentActionWidget.zpt index 2c46ab440366a236dedae26fb0c18d4571d7f0de..c477e03a5ecfaed2411c0a80f153ee1192f31fec 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_viewDocumentActionWidget.zpt +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_viewDocumentActionWidget.zpt @@ -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" diff --git a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_viewUserLoginWidget.zpt b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_viewUserLoginWidget.zpt index e11d6ff6bba84a2c85eb9ed4d024621e4cb41a78..98e59945ac51f48d8a58c59c38716306b1a51268 100644 --- a/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_viewUserLoginWidget.zpt +++ b/bt5/erp5_web_ung_theme/SkinTemplateItem/portal_skins/erp5_web_ung_theme/WebSection_viewUserLoginWidget.zpt @@ -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> diff --git a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/wizard_template_erp5_xhtml_style.zpt b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/wizard_template_erp5_xhtml_style.zpt index 4c626946071bdd365ee2cae8d356bb8ccfaff7c8..7a9b6197783edd3cda2dfba8c7bf55767075a41b 100644 --- a/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/wizard_template_erp5_xhtml_style.zpt +++ b/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/wizard_template_erp5_xhtml_style.zpt @@ -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> --> diff --git a/bt5/erp5_xhtml_gadget_style/SkinTemplateItem/portal_skins/erp5_xhtml_gadget_core/ERP5Site_renderBreadcrumb.zpt b/bt5/erp5_xhtml_gadget_style/SkinTemplateItem/portal_skins/erp5_xhtml_gadget_core/ERP5Site_renderBreadcrumb.zpt index 52cc601aec01b97dab6fa04ae490d66cd0e8f560..c4945f1cf97c0062e193fbd919c0916ee7383574 100644 --- a/bt5/erp5_xhtml_gadget_style/SkinTemplateItem/portal_skins/erp5_xhtml_gadget_core/ERP5Site_renderBreadcrumb.zpt +++ b/bt5/erp5_xhtml_gadget_style/SkinTemplateItem/portal_skins/erp5_xhtml_gadget_core/ERP5Site_renderBreadcrumb.zpt @@ -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> diff --git a/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/navigation_box_render.zpt b/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/navigation_box_render.zpt index 488fb9750e39d15ec159f9b5562069261f72f399..06c17109a4401b4518da07ccbc2d09721975a561 100644 --- a/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/navigation_box_render.zpt +++ b/bt5/tiolive_base/SkinTemplateItem/portal_skins/tiolive_base/navigation_box_render.zpt @@ -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> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getUserCaption.py b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getUserCaption.py new file mode 100644 index 0000000000000000000000000000000000000000..ecf20876a8fe95b4b552c51f58b965f6a65b9442 --- /dev/null +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getUserCaption.py @@ -0,0 +1,7 @@ +# 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() diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getUserCaption.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getUserCaption.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b1e7f6a211dd85fa31766a516681d3b4e440ad9 --- /dev/null +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getUserCaption.xml @@ -0,0 +1,70 @@ +<?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> diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/template_erp5_xhtml_style.zpt b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/template_erp5_xhtml_style.zpt index 2b96cfd7a95a034e5bca9757d0d8031b27d7447c..c7fbc75b411713ef943973cda1661a00987030b4 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/template_erp5_xhtml_style.zpt +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/template_erp5_xhtml_style.zpt @@ -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>