Commit 221429d9 authored by Sebastien Robin's avatar Sebastien Robin

2008-09-12 Seb

* In the monthly report, do not display parts of the projects if not task were assigned to this parts for a particular month
* merge depth 1, depth > 1 code

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23582 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 533e809b
...@@ -9,22 +9,10 @@ ...@@ -9,22 +9,10 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>Script_magic</string> </key> <key> <string>Script_magic</string> </key>
<value> <int>3</int> </value> <value> <int>3</int> </value>
</item> </item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>_bind_names</string> </key>
<value> <value>
...@@ -110,15 +98,33 @@ if depth == 0:\n ...@@ -110,15 +98,33 @@ if depth == 0:\n
))\n ))\n
i += 1\n i += 1\n
\n \n
elif depth == 1:\n
category_list = here.contentValues(portal_type=project_line_portal_type)\n
\n
else:\n else:\n
if depth == 1:\n
parent_category_list = [\'source_project/\' + here.getRelativeUrl()]\n
else:\n
parent_category_list = parent.getMembershipCriterionCategoryList()\n
category_list = []\n category_list = []\n
parent_category_list = parent.getMembershipCriterionCategoryList()\n # Very specific to the monthly report, if no data, we do not display the current tree part\n
# sor first, for performance, build a dict with all relative urls of project line that will\n
# need to be displayed for this month\n
object_dict = here.object_dict\n
object_sub_dict = object_dict.get(getattr(parent, \'string_index\'), {})\n
object_url_dict = {}\n
for object_url in object_sub_dict.keys():\n
if not object_url_dict.has_key(object_url):\n
splitted_object_url = object_url.split(\'/\')\n
for x in xrange(0, len(splitted_object_url)):\n
object_url_dict[\'/\'.join(splitted_object_url[0:x+1])] = 1\n
for parent_category in parent_category_list:\n for parent_category in parent_category_list:\n
parent_category = \'/\'.join(parent_category.split(\'/\')[1:])\n parent_category = \'/\'.join(parent_category.split(\'/\')[1:])\n
category_list.extend(context.restrictedTraverse(parent_category).contentValues(portal_type=project_line_portal_type))\n context.log(\'string_index\', getattr(parent, \'string_index\'))\n
context.log(\'parent_category\', parent_category)\n
context.log(\'object_sub_dict\', object_sub_dict)\n
if object_url_dict.has_key(parent_category):\n
category_child_list = context.restrictedTraverse(parent_category).contentValues(portal_type=project_line_portal_type)\n
for category_child in category_child_list:\n
if object_url_dict.has_key(category_child.getRelativeUrl()):\n
category_list.append(category_child)\n
\n \n
\n \n
i = 0\n i = 0\n
...@@ -150,12 +156,6 @@ return domain_list\n ...@@ -150,12 +156,6 @@ return domain_list\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>depth, parent, **kw</string> </value> <value> <string>depth, parent, **kw</string> </value>
...@@ -215,9 +215,19 @@ return domain_list\n ...@@ -215,9 +215,19 @@ return domain_list\n
<string>month_dict_list</string> <string>month_dict_list</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>parent_category_list</string> <string>parent_category_list</string>
<string>object_dict</string>
<string>getattr</string>
<string>object_sub_dict</string>
<string>object_url_dict</string>
<string>object_url</string>
<string>splitted_object_url</string>
<string>xrange</string>
<string>len</string>
<string>x</string>
<string>parent_category</string> <string>parent_category</string>
<string>category_child_list</string>
<string>category_child</string>
<string>category</string> <string>category</string>
<string>getattr</string>
<string>string_index</string> <string>string_index</string>
<string>domain</string> <string>domain</string>
<string>script</string> <string>script</string>
...@@ -239,12 +249,6 @@ return domain_list\n ...@@ -239,12 +249,6 @@ return domain_list\n
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Project_generateMonthDomain</string> </value> <value> <string>Project_generateMonthDomain</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>
......
594 596
\ 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