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