Commit b4ad8c94 authored by Vincent Pelletier's avatar Vincent Pelletier

Cleanup script.

Get rid of dead (commented-out) code.
Reindent & factorise remaining code.
Add an XXX about bad script naming.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44340 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 976078df
...@@ -54,33 +54,26 @@ ...@@ -54,33 +54,26 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># return site of the user and possible counter on wich user can be assigned\n <value> <string># return site of the user and possible counter on wich user can be assigned\n
if context.getDestination() is None:\n # XXX: this script should be named "Assignment_getPossibleSiteList", as it is not used anywhere else\n
destination_value = context.getDestinationValue()\n
if destination_value is None:\n
# must have an organisation defined to limit site diplayed\n # must have an organisation defined to limit site diplayed\n
return [[\'\', \'\']]\n return [[\'\', \'\']]\n
\n \n
#dest_site_title = context.getDestinationValue().getSiteTitle()\n site_list = context.Delivery_getVaultItemList(\n
\n user_site=0,\n
site_list = context.Delivery_getVaultItemList(user_site=0, vault_type=("site", "site/surface/banque_interne/guichet", "site/surface/gros_paiement/guichet", "site/surface/gros_versement/guichet", "site/surface/operations_diverses/guichet"), first_level=1, strict_membership=1, leaf_node=0, base_site=context.getDestinationValue().getSite())\n vault_type=(\n
# now must filter again this list to remove useless categories\n \'site\',\n
#site_dict = {}\n \'site/surface/banque_interne/guichet\',\n
#for site in site_list:\n \'site/surface/gros_paiement/guichet\',\n
# site_dict[site[0]] = site[1]\n \'site/surface/gros_versement/guichet\',\n
# site_split = site[0].split(\'/\')\n \'site/surface/operations_diverses/guichet\',\n
# if dest_site_title in site_split:\n ),\n
# if len(site_split) == 4:\n first_level=1,\n
# # case of counter\n strict_membership=1,\n
# counter = "/".join(site_split[:-1])\n leaf_node=0,\n
# if not site_dict.has_key(counter):\n base_site=destination_value.getSite(),\n
# if not \'siege\' in site[1]:\n )\n
# site_dict[counter] = \'/\'.join(site[1].split("/")[:7])\n
# else:\n
# site_dict[counter] = \'/\'.join(site[1].split("/")[:6])\n
# else:\n
# site_dict[site[0]] = site[1]\n
\n
#list = site_dict.items()\n
#list.sort()\n
#return list\n
return site_list\n return site_list\n
</string> </value> </string> </value>
</item> </item>
...@@ -120,6 +113,7 @@ return site_list\n ...@@ -120,6 +113,7 @@ return site_list\n
<tuple> <tuple>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>destination_value</string>
<string>None</string> <string>None</string>
<string>site_list</string> <string>site_list</string>
</tuple> </tuple>
......
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