Commit f277e8da authored by Sebastien Robin's avatar Sebastien Robin

2009-10-27 Seb

* Allows to select the state of project when call the milestone report

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30044 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc26619d
......@@ -62,12 +62,14 @@ listbox = []\n
translateString = context.Base_translateString\n
portal = context.getPortalObject()\n
\n
from Products.ZSQLCatalog.SQLCatalog import Query, NegatedQuery, ComplexQuery\n
query_kw = {}\n
query_kw[\'simulation_state\'] = [\'draft\', \'cancelled\']\n
\n
project_list = portal.portal_catalog(portal_type=\'Project\',\n
validation_state = NegatedQuery(Query(**query_kw)))\n
sql_kw = {}\n
if project_validation_state_list is not None and \\\n
len(project_validation_state_list):\n
sql_kw[\'validation_state\'] = project_validation_state_list\n
\n
project_list = portal.portal_catalog(portal_type=\'Project\', **sql_kw)\n
project_uid_list = [x.uid for x in project_list]\n
\n
\n
......@@ -92,8 +94,10 @@ select_dict = {}\n
select_dict[\'movement.stop_date\'] = None\n
select_dict[\'catalog.title\'] = None\n
select_dict[\'parent_title\'] = None\n
milestone_list = [x for x in portal.portal_catalog(parent_uid=project_uid_list,\n
portal_type=\'Project Milestone\', select_dict=select_dict, **sql_kw)]\n
milestone_list = []\n
if len(project_uid_list):\n
milestone_list = [x for x in portal.portal_catalog(parent_uid=project_uid_list,\n
portal_type=\'Project Milestone\', select_dict=select_dict, **sql_kw)]\n
\n
milestone_list.sort(key = lambda x: (x.parent_title, x.stop_date, x.title))\n
\n
......@@ -119,7 +123,7 @@ return context.ProjectModule_viewMilestoneReport()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>from_date=None, at_date=None, **kw</string> </value>
<value> <string>from_date=None, at_date=None, project_validation_state_list=None, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -147,7 +151,7 @@ return context.ProjectModule_viewMilestoneReport()\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -155,17 +159,17 @@ return context.ProjectModule_viewMilestoneReport()\n
<tuple>
<string>from_date</string>
<string>at_date</string>
<string>project_validation_state_list</string>
<string>kw</string>
<string>listbox</string>
<string>_getattr_</string>
<string>context</string>
<string>translateString</string>
<string>portal</string>
<string>Products.ZSQLCatalog.SQLCatalog</string>
<string>Query</string>
<string>NegatedQuery</string>
<string>ComplexQuery</string>
<string>query_kw</string>
<string>sql_kw</string>
<string>None</string>
<string>len</string>
<string>_write_</string>
<string>_apply_</string>
<string>project_list</string>
......@@ -174,10 +178,9 @@ return context.ProjectModule_viewMilestoneReport()\n
<string>_getiter_</string>
<string>x</string>
<string>project_uid_list</string>
<string>sql_kw</string>
<string>query_list</string>
<string>None</string>
<string>len</string>
<string>Query</string>
<string>ComplexQuery</string>
<string>select_dict</string>
<string>milestone_list</string>
<string>milestone</string>
......@@ -197,6 +200,7 @@ return context.ProjectModule_viewMilestoneReport()\n
<tuple>
<none/>
<none/>
<none/>
</tuple>
</value>
</item>
......
......@@ -63,6 +63,7 @@
<value>
<list>
<string>left</string>
<string>right</string>
</list>
</value>
</item>
......@@ -76,6 +77,14 @@
<list>
<string>my_from_date</string>
<string>my_at_date</string>
<string>my_project_validation_state_list</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>your_format</string>
<string>your_portal_skin</string>
</list>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>items</string>
<string>size</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_project_validation_state_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_multi_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>items</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [x[1] for x in field.get_value(\'items\') if x[1] not in (\'draft\', \'invalidated\')]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.Base_getTranslatedWorkflowStateItemList(wf_id=\'project_workflow\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: len(field.get_value(\'items\'))</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
683
\ No newline at end of file
684
\ 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