Fix "jump to" on person : best performance and standard (tested) API

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41621 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 48dd98e0
......@@ -75,7 +75,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:here.Person_getCredentialRequestUrl()</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Base_jumpToRelatedObject?base_category=destination_decision&portal_type=Credential+Request
]]></string> </value>
</item>
</dictionary>
</pickle>
......@@ -88,7 +92,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:here.getDestinationDecisionRelated(portal_type=\'Credential Request\') is not None</string> </value>
<value> <string>python: portal.Base_checkPermission(\'credential_request_module\', \'View\')</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jump</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_jump</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>jump_to_credential_update</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>30.2</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Credential Update</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Base_jumpToRelatedObject?base_category=destination_decision&portal_type=Credential+Update
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: portal.Base_checkPermission(\'credential_update_module\', \'View\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
""" Return url of subscription request attach to current object.\n
Usefull in jump list"""\n
from ZTUtils import make_query\n
\n
result = context.portal_catalog(\n
portal_type=\'Credential Request\',\n
destination_decision_portal_type=\'Person\',\n
destination_decision_uid=context.getUid()\n
)\n
\n
length = len(result)\n
if length==1:\n
return result[0].absolute_url()\n
elif length>1:\n
return \'%s?%s\' % (context.credential_request_module.absolute_url(),\n
make_query(reset=1,\n
destination_decision_portal_type=\'Person\',\n
destination_decision_uid=context.getUid())\n
)\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Person_getCredentialRequestUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
321
\ No newline at end of file
322
\ No newline at end of file
......@@ -8,4 +8,5 @@ Credential Update Module | view
Credential Update | view
Person | credential
Person | jump_to_credential_request
Person | jump_to_credential_update
System Preference | credential_preference
\ No newline at end of file
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