Commit a8469ee8 authored by Fabien Morin's avatar Fabien Morin

improve a bit AssignToUserAction_getUserList script removing hardcoded values

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23239 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 08088902
...@@ -65,12 +65,17 @@ ...@@ -65,12 +65,17 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>\'\'\'This script return the list of all users assigned to this service\'\'\'\n <value> <string>\'\'\'This script return the list of all users that is possible to assign the application\'\'\'\n
\n \n
#XXX Just for test\n # XXX for now, it returns every people who works in cge\n
#person_list = context.person_module.contentValues()\n # in future, the site and function should be take into account\n
#return [(\'\', \'\')] + [(i.getTitleOrId(), i.getRelativeUrl()) for i in person_list]\n \n
return [(\'admin\',\'admin\'), (\'chef\',\'chef\'), (\'jp\',\'jp\'), (\'citoyen\',\'citoyen\'), (\'agent-test\',\'agent-test\'), (\'agentkaolak\',\'agentkaolak\')]\n cat = context.restrictedTraverse(\'portal_categories/group/dgid/di/cge\')\n
cat_uid = cat.getUid()\n
agent_list = context.portal_catalog(portal_type=\'Assignment\',\n
group_uid=cat_uid)\n
\n
return [(agent.getParentValue().getReference(), agent.getParentValue().getId()) for agent in agent_list if agent.getParentValue().getReference()]\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -95,6 +100,14 @@ return [(\'admin\',\'admin\'), (\'chef\',\'chef\'), (\'jp\',\'jp\'), (\'citoyen\ ...@@ -95,6 +100,14 @@ return [(\'admin\',\'admin\'), (\'chef\',\'chef\'), (\'jp\',\'jp\'), (\'citoyen\
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
<value> <value>
...@@ -118,7 +131,17 @@ return [(\'admin\',\'admin\'), (\'chef\',\'chef\'), (\'jp\',\'jp\'), (\'citoyen\ ...@@ -118,7 +131,17 @@ return [(\'admin\',\'admin\'), (\'chef\',\'chef\'), (\'jp\',\'jp\'), (\'citoyen\
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple/> <tuple>
<string>_getattr_</string>
<string>context</string>
<string>cat</string>
<string>cat_uid</string>
<string>agent_list</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>agent</string>
</tuple>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -136,6 +159,12 @@ return [(\'admin\',\'admin\'), (\'chef\',\'chef\'), (\'jp\',\'jp\'), (\'citoyen\ ...@@ -136,6 +159,12 @@ return [(\'admin\',\'admin\'), (\'chef\',\'chef\'), (\'jp\',\'jp\'), (\'citoyen\
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>AssignToUserAction_getUserList</string> </value> <value> <string>AssignToUserAction_getUserList</string> </value>
</item> </item>
<item>
<key> <string>uid</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
<value> <value>
......
250 252
\ 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