Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
erp5
Commits
3c356997
Commit
3c356997
authored
May 31, 2012
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use permanent URL for navigation in a forum intead of just redirecting to discussion_thread_module.
This provides consistent UI.
parent
078a2430
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
121 additions
and
14 deletions
+121
-14
bt5/erp5_discussion/PortalTypeTemplateItem/portal_types/Discussion%20Thread.xml
...rtalTypeTemplateItem/portal_types/Discussion%20Thread.xml
+9
-1
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionModule_viewDiscussionThreadList/listbox.xml
...ion/DiscussionModule_viewDiscussionThreadList/listbox.xml
+4
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_createNewDiscussionPost.xml
...5_discussion/DiscussionThread_createNewDiscussionPost.xml
+21
-9
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/Listbox_getDiscussionThreadPermanentUrl.xml
...p5_discussion/Listbox_getDiscussionThreadPermanentUrl.xml
+68
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml
.../erp5_discussion/WebSection_createNewDiscussionThread.xml
+14
-3
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewDiscussionThreadForm/listbox.xml
...iscussion/WebSection_viewDiscussionThreadForm/listbox.xml
+4
-0
bt5/erp5_discussion/bt/revision
bt5/erp5_discussion/bt/revision
+1
-1
No files found.
bt5/erp5_discussion/PortalTypeTemplateItem/portal_types/Discussion%20Thread.xml
View file @
3c356997
...
...
@@ -52,7 +52,9 @@
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<tuple/>
<tuple>
<string>
document
</string>
</tuple>
</value>
</item>
<item>
...
...
@@ -93,6 +95,12 @@
<key>
<string>
type_class
</string>
</key>
<value>
<string>
TextDocument
</string>
</value>
</item>
<item>
<key>
<string>
type_interface
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
type_mixin
</string>
</key>
<value>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionModule_viewDiscussionThreadList/listbox.xml
View file @
3c356997
...
...
@@ -83,6 +83,10 @@
<string>
title
</string>
<string>
Title
</string>
</tuple>
<tuple>
<string>
reference
</string>
<string>
Reference
</string>
</tuple>
<tuple>
<string>
translated_validation_state_title
</string>
<string>
State
</string>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_createNewDiscussionPost.xml
View file @
3c356997
...
...
@@ -57,27 +57,39 @@ from DateTime import DateTime\n
\n
portal = context.getPortalObject()\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
version = \'001\'\n
language = portal.Localizer.get_selected_language()\n
discussion_post = context.newContent(\n
\n
discussion_thread = context\n
is_temp_object = discussion_thread.isTempObject()\n
\n
if is_temp_object:\n
# this is a temporary object accessed by its reference\n
# we need to get real ZODB one\n
discussion_thread = getattr(discussion_thread.original_container, discussion_thread.original_id)\n
\n
discussion_post = discussion_thread.newContent(\n
portal_type = "Discussion Post",\n
title = title,\n
text_content = text_content,\n
source_value = person,\n
predecessor_value = predecessor,\n
version =
version
,\n
language =
language
,\n
version =
\'001\'
,\n
language =
portal.Localizer.get_selected_language()
,\n
text_format = \'text/html\')\n
\n
# depending on security model Post can be submited for review\n
portal_status_message =
"New post created in background."
\n
portal_status_message =
context.Base_translateString("New post created in background.")
\n
\n
# a parent thread is actually just a logical container so it\'s modified\n
# whenever a new post is done\n
context
.edit(modification_date = DateTime())\n
discussion_thread
.edit(modification_date = DateTime())\n
\n
return context.Base_redirect(form_id,\n
keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\n
if not is_temp_object:\n
return discussion_thread.Base_redirect(form_id,\n
keep_items = dict(portal_status_message=portal_status_message))\n
else:\n
# redirect using again reference\n
redirect_url = \'%s?portal_status_message=%s\' %(context.REQUEST[\'URL1\'],portal_status_message)\n
context.REQUEST.RESPONSE.redirect(redirect_url)\n
</string>
</value>
</item>
<item>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/Listbox_getDiscussionThreadPermanentUrl.xml
0 → 100644
View file @
3c356997
<?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>
ob=kw[\'brain\'].getObject()\n
return ob.getReference()\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Listbox_getDiscussionThreadPermanentUrl
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml
View file @
3c356997
...
...
@@ -69,7 +69,10 @@ if site_list in MARKER:\n
# set predicate settings for current Web Section\n
membership_criterion_category_list = context.getMembershipCriterionCategoryList()\n
multimembership_criterion_base_category_list = context.getMultimembershipCriterionBaseCategoryList()\n
\n
# XXX: what if reference duplicates : add some random part ?\n
reference = title.replace(\' \', \'-\')\n
\n
create_kw = dict(title = title,\n
source_value = person,\n
reference = reference,\n
...
...
@@ -95,8 +98,8 @@ discussion_post = discussion_thread.newContent(\n
language = language)\n
\n
# depending on security model Thread and Post can be directly published or shared\n
portal_status_message = "New discussion created
. Your post will be reviewed for approval
."\n
discussion_thread.
submit
()\n
portal_status_message = "New discussion created
in backgroud
."\n
discussion_thread.
publish
()\n
\n
if send_notification_text not in (\'\', None):\n
# we can send notifications\n
...
...
@@ -135,7 +138,7 @@ if send_notification_text not in (\'\', None):\n
message_text_format=notification_message.getContentType(),\n
store_as_event=False)\n
\n
return
discussion_thread
.Base_redirect(form_id,\n
return
context
.Base_redirect(form_id,\n
keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\n
</string>
</value>
</item>
...
...
@@ -143,6 +146,14 @@ return discussion_thread.Base_redirect(form_id,\n
<key>
<string>
_params
</string>
</key>
<value>
<string>
title, text_content, form_id=\'view\', predecessor=None, description=None, subject_list=None, classification=None, group_list=None, site_list=None, send_notification_text=None, reference=None,**kw
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSection_createNewDiscussionThread
</string>
</value>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewDiscussionThreadForm/listbox.xml
View file @
3c356997
...
...
@@ -244,6 +244,10 @@
<key>
<string>
url_columns
</string>
</key>
<value>
<list>
<tuple>
<string>
title
</string>
<string>
Listbox_getDiscussionThreadPermanentUrl
</string>
</tuple>
<tuple>
<string>
modification_date
</string>
<string></string>
...
...
bt5/erp5_discussion/bt/revision
View file @
3c356997
107
\ No newline at end of file
108
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment