diff --git a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml index dadd86f60bcc8b410cde83e90d538a6d7e70cfb1..515ac29dc93ceb8586831e2056e0817ac532ddf1 100644 --- a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml +++ b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml @@ -160,7 +160,8 @@ if send_notification_text not in (\'\', None):\n store_as_event=False)\n \n return context.Base_redirect(form_id,\n - keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\n + keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message),\n + thread_relative_url=discussion_thread.getRelativeUrl()))\n </string> </value> </item> <item> diff --git a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_getDiscussionThreadList.xml b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_getDiscussionThreadList.xml new file mode 100644 index 0000000000000000000000000000000000000000..5c950b59a9990c801b56fa9917aa83c0e7cd274c --- /dev/null +++ b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_getDiscussionThreadList.xml @@ -0,0 +1,78 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_body</string> </key> + <value> <string>"""\n + This script gets list of Discussion Thread for a Forum using catalog. \n + Due to asynchronous nature of catalog it can use\n + passed from REQUEST not index yet threads.\n +"""\n +thread_relative_url = context.REQUEST.get(\'thread_relative_url\')\n +discussion_thread_list = [x.getObject() for x in context.getDocumentValueList(**kw)]\n +if thread_relative_url is not None:\n + thread = context.restrictedTraverse(thread_relative_url)\n + if thread is not None and thread not in discussion_thread_list:\n + discussion_thread_list = [thread] + discussion_thread_list\n +return discussion_thread_list\n +</string> </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>**kw</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>WebSection_getDiscussionThreadList</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewDiscussionThreadForm/listbox.xml b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewDiscussionThreadForm/listbox.xml index 3691895f97537aa3517ae5977cd664e2de6ad8f4..af05f3d4706e2238b6357863a45e4b84f4e0b77b 100644 --- a/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewDiscussionThreadForm/listbox.xml +++ b/bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewDiscussionThreadForm/listbox.xml @@ -17,6 +17,7 @@ <string>list_method</string> <string>search</string> <string>search_columns</string> + <string>selection_name</string> <string>sort</string> <string>sort_columns</string> <string>title</string> @@ -210,6 +211,10 @@ </list> </value> </item> + <item> + <key> <string>selection_name</string> </key> + <value> <string></string> </value> + </item> <item> <key> <string>sort</string> </key> <value> @@ -281,7 +286,7 @@ <dictionary> <item> <key> <string>method_name</string> </key> - <value> <string>getDocumentValueList</string> </value> + <value> <string>WebSection_getDiscussionThreadList</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_discussion/bt/revision b/bt5/erp5_discussion/bt/revision index 00c98bb3ad211a42593f1edacdbda5289d16094c..afbe847262c0a530b87f33d06d3526a72dd1d9a4 100644 --- a/bt5/erp5_discussion/bt/revision +++ b/bt5/erp5_discussion/bt/revision @@ -1 +1 @@ -125 \ No newline at end of file +126 \ No newline at end of file