[Erp5-report] r45717 ivan - /erp5/trunk/products/ERP5Form/Tool/SelectionTool.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Apr 28 10:52:12 CEST 2011
Author: ivan
Date: Thu Apr 28 10:52:11 2011
New Revision: 45717
URL: http://svn.erp5.org?rev=45717&view=rev
Log:
Use buttons to fold / unfold domain in order to save rest of form's input elements' values.
Modified:
erp5/trunk/products/ERP5Form/Tool/SelectionTool.py
Modified: erp5/trunk/products/ERP5Form/Tool/SelectionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/Tool/SelectionTool.py?rev=45717&r1=45716&r2=45717&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/Tool/SelectionTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/Tool/SelectionTool.py [utf8] Thu Apr 28 10:52:11 2011
@@ -942,8 +942,11 @@ class SelectionTool( BaseTool, SimpleIte
"""
selection_name = REQUEST.list_selection_name
selection = self.getSelectionFor(selection_name, REQUEST)
- domain_url = REQUEST.form.get('domain_url',None)
- domain_depth = REQUEST.form.get('domain_depth',0)
+
+ unfoldDomain = REQUEST.form.get('unfoldDomain', None)
+ domain_url, domain_depth = unfoldDomain.split('.', 2)
+ domain_depth = int(domain_depth)
+
domain_list = list(selection.getDomainList())
domain_list = domain_list[0:min(domain_depth, len(domain_list))]
if isinstance(domain_url, str):
@@ -960,8 +963,11 @@ class SelectionTool( BaseTool, SimpleIte
"""
selection_name = REQUEST.list_selection_name
selection = self.getSelectionFor(selection_name, REQUEST)
- domain_url = REQUEST.form.get('domain_url',None)
- domain_depth = REQUEST.form.get('domain_depth',0)
+
+ foldDomain = REQUEST.form.get('foldDomain', None)
+ domain_url, domain_depth = foldDomain.split('.', 2)
+ domain_depth = int(domain_depth)
+
domain_list = list(selection.getDomainList())
domain_list = domain_list[0:min(domain_depth, len(domain_list))]
selection.edit(domain_list=[x for x in domain_list if x != domain_url])
More information about the Erp5-report
mailing list