diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ListBox_asHTML.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ListBox_asHTML.xml index 88e8c14fe2286dd217f1c073ee1ff1dc489a13f6..4d6b3aea5bf3bc59fcccbf76b3ac559558ec30bb 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ListBox_asHTML.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ListBox_asHTML.xml @@ -112,6 +112,7 @@ <tal:block tal:define="global box_relative_url python: request.get(\'box_relative_url\', \'\');\n global box python: real_context.restrictedTraverse(box_relative_url); \n global box_id python: \'%s_content\' %box_relative_url.replace(\'/\', \'_\');\n + global box_id python: \'%s_content\' %real_context.getRelativeUrl().replace(\'/\', \'_\');\n global dom_id python: request.get(\'dom_id\',None) or box_id;\n global field_prefix string:${box_id}_">\n <input tal:condition="python:form_id" \n @@ -156,14 +157,18 @@ <td colspan="1" \n class="listbox-table-domain-tree-cell"\n tal:attributes="colspan python: total_depth - report_tree.depth + 1">\n - <a href="method" class="tree-open"\n - tal:condition="report_tree/is_open"\n - tal:attributes="href string:foldDomain?domain_url=${report_tree/domain_url}&form_id=${form_id}&list_selection_name=${selection_name}&domain_depth:int=${report_tree/depth}"\n - tal:content="report_tree/obj/getCompactTranslatedTitle"/>\n - <a href="method" class="tree-closed"\n - tal:condition="not: report_tree/is_open"\n - tal:attributes="href string:unfoldDomain?domain_url=${report_tree/domain_url}&form_id=${form_id}&list_selection_name=${selection_name}&domain_depth:int=${report_tree/depth}"\n - tal:content="report_tree/obj/getCompactTranslatedTitle"/>\n + <button type="submit"\n + name="foldDomain:method"\n + class="tree-open"\n + tal:condition="report_tree/is_open"\n + tal:content="report_tree/obj/getCompactTranslatedTitle"\n + tal:attributes="value string:${report_tree/domain_url}.${report_tree/depth}"/>\n + <button type="submit"\n + name="unfoldDomain:method"\n + class="tree-closed"\n + tal:condition="not: report_tree/is_open"\n + tal:content="report_tree/obj/getCompactTranslatedTitle"\n + tal:attributes="value string:${report_tree/domain_url}.${report_tree/depth}"/>\n </td>\n </tr>\n </table>\n diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_listbox.css.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_listbox.css.xml index 80276cd8964233d6cf7ccf9f83f680a5bc9ff1fd..8e866371215c58fab82564f2b75f6d816fd8552a 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_listbox.css.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5_listbox.css.xml @@ -561,6 +561,25 @@ div.listbox-list-style-selection li a.selected,\n font-weight: bold;\n }\n \n +/* Domain / Report tree buttons */\n +button.tree-open,\n +button.tree-closed{\n + background: none;\n + border: none;\n + cursor: pointer;\n +}\n +button.tree-open{\n + background: url("./images/tree_open.png") no-repeat scroll left center transparent;\n + font-weight: bold;\n + padding-left: 15px;\n +}\n +\n +button.tree-closed{\n + background: url("./images/tree_closed.png") no-repeat scroll left center transparent;\n + padding-left: 15px;\n +}\n +\n +\n /* Listbox full text search bar */\n div.listbox-full-text-search {\n }\n diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision index f3cd427b0f556c04c614e4f411ab5bdba5fd7835..3af7d09ab54671e35c1084b51d08ba85a99b1471 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision +++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision @@ -1 +1 @@ -1069 \ No newline at end of file +1070 \ No newline at end of file diff --git a/product/ERP5Form/Tool/SelectionTool.py b/product/ERP5Form/Tool/SelectionTool.py index 0a4c37945014d7c7f0640af770085dc688f4c974..8fa0df7b6bedc3039b0e582dce1ad3c03fefe0c8 100644 --- a/product/ERP5Form/Tool/SelectionTool.py +++ b/product/ERP5Form/Tool/SelectionTool.py @@ -942,8 +942,11 @@ class SelectionTool( BaseTool, SimpleItem ): """ 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, SimpleItem ): """ 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])