Commit ba26d463 authored by Vincent Pelletier's avatar Vincent Pelletier

Add helper scripts for actions on modules.

Remove useless id_generator property from this BT.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9433 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 50e21bf5
...@@ -82,6 +82,8 @@ request = context.REQUEST\n ...@@ -82,6 +82,8 @@ request = context.REQUEST\n
kw[\'selection_name\']=selection_name\n kw[\'selection_name\']=selection_name\n
kw[\'ignore_layout\']=ignore_layout\n kw[\'ignore_layout\']=ignore_layout\n
\n \n
context.ERP5XhtmlStyle_prepareAction(**kw)\n
\n
# If this is an object, a workflow or a folder, then jump to that view\n # If this is an object, a workflow or a folder, then jump to that view\n
if doAction0 in (\'object\', \'workflow\', \'folder\'):\n if doAction0 in (\'object\', \'workflow\', \'folder\'):\n
redirect_url = \' \'.join(Base_doAction[1:])\n redirect_url = \' \'.join(Base_doAction[1:])\n
...@@ -181,6 +183,7 @@ return context.ERP5XhtmlStyle_redirect(redirect_url, keep_items=preserved_parame ...@@ -181,6 +183,7 @@ return context.ERP5XhtmlStyle_redirect(redirect_url, keep_items=preserved_parame
<string>doAction0</string> <string>doAction0</string>
<string>request</string> <string>request</string>
<string>_write_</string> <string>_write_</string>
<string>_apply_</string>
<string>redirect_url</string> <string>redirect_url</string>
<string>new_id</string> <string>new_id</string>
<string>type_name</string> <string>type_name</string>
...@@ -192,7 +195,6 @@ return context.ERP5XhtmlStyle_redirect(redirect_url, keep_items=preserved_parame ...@@ -192,7 +195,6 @@ return context.ERP5XhtmlStyle_redirect(redirect_url, keep_items=preserved_parame
<string>preference</string> <string>preference</string>
<string>new_content_list</string> <string>new_content_list</string>
<string>new_content_id</string> <string>new_content_id</string>
<string>_apply_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</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># Return the checked item list in given selection, or the whole selection (filters applied) if nothing is checked.\n
portal_selections = context.getPortalObject().portal_selections\n
uids = portal_selections.getSelectionCheckedUidsFor(selection_name)\n
if len(uids) == 0:\n
uids = [x.getUid() for x in portal_selections.getSelectionFor(selection_name)(context=context)]\n
return uids\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>selection_name</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>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>selection_name</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_selections</string>
<string>uids</string>
<string>len</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</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>ERP5XhtmlStyle_getSelectionCheckedUidListFor</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</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># Script to call in action scripts before executig the actual action.\n
\n
# Update checked uids\n
if None not in (selection_name, uids, listbox_uid):\n
context.getPortalObject().portal_selections.updateSelectionCheckedUidList(selection_name, uids=uids, listbox_uid=listbox_uid, REQUEST=context.REQUEST)\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>selection_name=None, uids=None, listbox_uid=None, **kw</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>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>selection_name</string>
<string>uids</string>
<string>listbox_uid</string>
<string>kw</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5XhtmlStyle_prepareAction</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
110 116
\ No newline at end of file \ 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