Commit aa53041b authored by Aurel's avatar Aurel

fix some script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14113 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0767fe01
......@@ -74,9 +74,13 @@ for a in valid_assignment_list:\n
new_site = a.getSiteValue()\n
while new_site.getVaultType()!=\'site\':\n
new_site = new_site.getParentValue()\n
site_url = new_site.getRelativeUrl()\n
if site_url not in site_list:\n
site_list.append(site_url)\n
if object:\n
if new_site not in site_list:\n
site_list.append(new_site)\n
else:\n
site_url = new_site.getRelativeUrl()\n
if site_url not in site_list:\n
site_list.append(site_url)\n
return site_list\n
</string> </value>
</item>
......@@ -100,7 +104,7 @@ return site_list\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>user_id=None, **kw</string> </value>
<value> <string>user_id=None, object=0, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -128,13 +132,14 @@ return site_list\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>user_id</string>
<string>object</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
......@@ -157,6 +162,7 @@ return site_list\n
<value>
<tuple>
<none/>
<int>0</int>
</tuple>
</value>
</item>
......
......@@ -70,7 +70,7 @@
user_id = context.portal_membership.getAuthenticatedMember().getUserName()\n
\n
def getUserSiteUid(user_id):\n
return context.Baobab_getUserAssignmentList(user_id)[0].getSiteUid()\n
return context.Baobab_getUserAssignedRootSiteList(user_id=user_id, object=1)[0].getSiteUid()\n
\n
\n
getUserSiteUid = CachingMethod(getUserSiteUid, id=\'Baobab_getUserUserSiteUid\', cache_factory=\'erp5_ui_medium\')\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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># Get the id of the user which last passed given transition on given workflow.\n
workflow_item_list = context.Base_getWorkflowHistoryItemList(workflow_id, display=0)\n
workflow_item_list.reverse()\n
previous_state = None\n
found_given_state = 0\n
for workflow_item in workflow_item_list:\n
current_state = workflow_item.getProperty(\'state\')\n
context.log(\'current_state\',current_state)\n
if current_state == state:\n
found_given_state = 1\n
continue\n
if found_given_state and (current_state != state):\n
previous_state = current_state\n
break\n
return previous_state\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>workflow_id, state</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>workflow_id</string>
<string>state</string>
<string>_getattr_</string>
<string>context</string>
<string>workflow_item_list</string>
<string>None</string>
<string>previous_state</string>
<string>found_given_state</string>
<string>_getiter_</string>
<string>workflow_item</string>
<string>current_state</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getPreviousState</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
199
\ No newline at end of file
201
\ 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