Commit db887701 authored by Vincent Pelletier's avatar Vincent Pelletier

Use WebSite_getUrl when replacing action urls instead of...

Use WebSite_getUrl when replacing action urls instead of WebSite_getDocumentPhysicalPath : it fixes "tabs" when edditing a section.
Add support for displaying unpublished pages in section listbox.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6107 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 92721c0d
...@@ -375,7 +375,12 @@ ...@@ -375,7 +375,12 @@
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <value>
<list/> <list>
<tuple>
<string>only_published</string>
<string>False</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -426,7 +431,7 @@ ...@@ -426,7 +431,7 @@
</item> </item>
<item> <item>
<key> <string>list_action</string> </key> <key> <string>list_action</string> </key>
<value> <string>Folder_viewContentList</string> </value> <value> <string>WebSection_view</string> </value>
</item> </item>
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
...@@ -524,23 +529,23 @@ ...@@ -524,23 +529,23 @@
<list> <list>
<tuple> <tuple>
<string>reference</string> <string>reference</string>
<string>WebSite_getDocumentUrl</string> <string>WebSite_getUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>title</string> <string>title</string>
<string>WebSite_getDocumentUrl</string> <string>WebSite_getUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>portal_type</string> <string>portal_type</string>
<string>WebSite_getDocumentUrl</string> <string>WebSite_getUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>creation_date</string> <string>creation_date</string>
<string>WebSite_getDocumentUrl</string> <string>WebSite_getUrl</string>
</tuple> </tuple>
<tuple> <tuple>
<string>modification_date</string> <string>modification_date</string>
<string>WebSite_getDocumentUrl</string> <string>WebSite_getUrl</string>
</tuple> </tuple>
</list> </list>
</value> </value>
......
...@@ -72,8 +72,8 @@ if not context.getMembershipCriterionCategoryList() and not context.getSourceLis ...@@ -72,8 +72,8 @@ if not context.getMembershipCriterionCategoryList() and not context.getSourceLis
return []\n return []\n
\n \n
def content_cmp(c1, c2):\n def content_cmp(c1, c2):\n
c1_value = c1.getObject() \n c1_value = c1.getObject()\n
c2_value = c2.getObject() \n c2_value = c2.getObject()\n
#if hasattr(c1, \'getShortTitle\') and c1.getShortTitle() == \'Overview\': return -1\n #if hasattr(c1, \'getShortTitle\') and c1.getShortTitle() == \'Overview\': return -1\n
#if hasattr(c2, \'getShortTitle\') and c2.getShortTitle() == \'Overview\': return 1\n #if hasattr(c2, \'getShortTitle\') and c2.getShortTitle() == \'Overview\': return 1\n
return cmp(c1_value.getIntIndex(), c2_value.getIntIndex())\n return cmp(c1_value.getIntIndex(), c2_value.getIntIndex())\n
...@@ -82,6 +82,7 @@ if context.getMembershipCriterionCategoryList():\n ...@@ -82,6 +82,7 @@ if context.getMembershipCriterionCategoryList():\n
domain = DomainSelection(domain_dict = {\'web_site\': context})\n domain = DomainSelection(domain_dict = {\'web_site\': context})\n
kw[\'selection_domain\'] = domain\n kw[\'selection_domain\'] = domain\n
kw[\'portal_type\'] = \'Web Page\'\n kw[\'portal_type\'] = \'Web Page\'\n
if only_published is True:\n
kw[\'validation_state\'] = \'published\'\n kw[\'validation_state\'] = \'published\'\n
if not kw.has_key(\'sort_on\'): kw[\'sort_on\'] = \'int_index\'\n if not kw.has_key(\'sort_on\'): kw[\'sort_on\'] = \'int_index\'\n
brain_list = list(context.portal_catalog(**kw))\n brain_list = list(context.portal_catalog(**kw))\n
...@@ -124,7 +125,7 @@ return brain_list\n ...@@ -124,7 +125,7 @@ return brain_list\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>only_published=True, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -144,12 +145,13 @@ return brain_list\n ...@@ -144,12 +145,13 @@ return brain_list\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>only_published</string>
<string>kw</string> <string>kw</string>
<string>Products.ERP5Form.Selection</string> <string>Products.ERP5Form.Selection</string>
<string>DomainSelection</string> <string>DomainSelection</string>
...@@ -158,6 +160,7 @@ return brain_list\n ...@@ -158,6 +160,7 @@ return brain_list\n
<string>content_cmp</string> <string>content_cmp</string>
<string>domain</string> <string>domain</string>
<string>_write_</string> <string>_write_</string>
<string>True</string>
<string>list</string> <string>list</string>
<string>_apply_</string> <string>_apply_</string>
<string>brain_list</string> <string>brain_list</string>
...@@ -181,7 +184,9 @@ return brain_list\n ...@@ -181,7 +184,9 @@ return brain_list\n
<item> <item>
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<none/> <tuple>
<int>1</int>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -70,8 +70,8 @@ ...@@ -70,8 +70,8 @@
for pos in range(len(action)):\n for pos in range(len(action)):\n
if action[pos].has_key(\'url\'):\n if action[pos].has_key(\'url\'):\n
#context.log(\'WebSite_replaceActionUrl\',\'before : %s\' % action[pos][\'url\'])\n #context.log(\'WebSite_replaceActionUrl\',\'before : %s\' % action[pos][\'url\'])\n
action[pos].update({\'url\' : action[pos][\'url\'].replace(context.absolute_url(),context.WebSite_getDocumentPhysicalPath())})\n action[pos].update({\'url\' : action[pos][\'url\'].replace(context.absolute_url(),context.WebSite_getUrl())})\n
context.log(\'WebSite_replaceActionUrl\',\'after : %s\' % action[pos][\'url\'])\n #context.log(\'WebSite_replaceActionUrl\',\'after : %s\' % action[pos][\'url\'])\n
\n \n
return action\n return action\n
</string> </value> </string> </value>
......
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