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
Tatuya Kamada
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
Show 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 @@
...
@@ -52,7 +52,9 @@
<item>
<item>
<key>
<string>
group_list
</string>
</key>
<key>
<string>
group_list
</string>
</key>
<value>
<value>
<tuple/>
<tuple>
<string>
document
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -93,6 +95,12 @@
...
@@ -93,6 +95,12 @@
<key>
<string>
type_class
</string>
</key>
<key>
<string>
type_class
</string>
</key>
<value>
<string>
TextDocument
</string>
</value>
<value>
<string>
TextDocument
</string>
</value>
</item>
</item>
<item>
<key>
<string>
type_interface
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<item>
<key>
<string>
type_mixin
</string>
</key>
<key>
<string>
type_mixin
</string>
</key>
<value>
<value>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionModule_viewDiscussionThreadList/listbox.xml
View file @
3c356997
...
@@ -83,6 +83,10 @@
...
@@ -83,6 +83,10 @@
<string>
title
</string>
<string>
title
</string>
<string>
Title
</string>
<string>
Title
</string>
</tuple>
</tuple>
<tuple>
<string>
reference
</string>
<string>
Reference
</string>
</tuple>
<tuple>
<tuple>
<string>
translated_validation_state_title
</string>
<string>
translated_validation_state_title
</string>
<string>
State
</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
...
@@ -57,27 +57,39 @@ from DateTime import DateTime\n
\n
\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
version = \'001\'\n
\n
language = portal.Localizer.get_selected_language()\n
discussion_thread = context\n
discussion_post = context.newContent(\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
portal_type = "Discussion Post",\n
title = title,\n
title = title,\n
text_content = text_content,\n
text_content = text_content,\n
source_value = person,\n
source_value = person,\n
predecessor_value = predecessor,\n
predecessor_value = predecessor,\n
version =
version
,\n
version =
\'001\'
,\n
language =
language
,\n
language =
portal.Localizer.get_selected_language()
,\n
text_format = \'text/html\')\n
text_format = \'text/html\')\n
\n
\n
# depending on security model Post can be submited for review\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
\n
# a parent thread is actually just a logical container so it\'s modified\n
# a parent thread is actually just a logical container so it\'s modified\n
# whenever a new post is done\n
# whenever a new post is done\n
context
.edit(modification_date = DateTime())\n
discussion_thread
.edit(modification_date = DateTime())\n
\n
\n
return context.Base_redirect(form_id,\n
if not is_temp_object:\n
keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\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>
</string>
</value>
</item>
</item>
<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
...
@@ -69,7 +69,10 @@ if site_list in MARKER:\n
# set predicate settings for current Web Section\n
# set predicate settings for current Web Section\n
membership_criterion_category_list = context.getMembershipCriterionCategoryList()\n
membership_criterion_category_list = context.getMembershipCriterionCategoryList()\n
multimembership_criterion_base_category_list = context.getMultimembershipCriterionBaseCategoryList()\n
multimembership_criterion_base_category_list = context.getMultimembershipCriterionBaseCategoryList()\n
\n
# XXX: what if reference duplicates : add some random part ?\n
reference = title.replace(\' \', \'-\')\n
reference = title.replace(\' \', \'-\')\n
\n
create_kw = dict(title = title,\n
create_kw = dict(title = title,\n
source_value = person,\n
source_value = person,\n
reference = reference,\n
reference = reference,\n
...
@@ -95,8 +98,8 @@ discussion_post = discussion_thread.newContent(\n
...
@@ -95,8 +98,8 @@ discussion_post = discussion_thread.newContent(\n
language = language)\n
language = language)\n
\n
\n
# depending on security model Thread and Post can be directly published or shared\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
portal_status_message = "New discussion created
in backgroud
."\n
discussion_thread.
submit
()\n
discussion_thread.
publish
()\n
\n
\n
if send_notification_text not in (\'\', None):\n
if send_notification_text not in (\'\', None):\n
# we can send notifications\n
# we can send notifications\n
...
@@ -135,7 +138,7 @@ if send_notification_text not in (\'\', None):\n
...
@@ -135,7 +138,7 @@ if send_notification_text not in (\'\', None):\n
message_text_format=notification_message.getContentType(),\n
message_text_format=notification_message.getContentType(),\n
store_as_event=False)\n
store_as_event=False)\n
\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
keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\n
</string>
</value>
</string>
</value>
</item>
</item>
...
@@ -143,6 +146,14 @@ return discussion_thread.Base_redirect(form_id,\n
...
@@ -143,6 +146,14 @@ return discussion_thread.Base_redirect(form_id,\n
<key>
<string>
_params
</string>
</key>
<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>
<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>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
</tuple>
</value>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSection_createNewDiscussionThread
</string>
</value>
<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 @@
...
@@ -244,6 +244,10 @@
<key>
<string>
url_columns
</string>
</key>
<key>
<string>
url_columns
</string>
</key>
<value>
<value>
<list>
<list>
<tuple>
<string>
title
</string>
<string>
Listbox_getDiscussionThreadPermanentUrl
</string>
</tuple>
<tuple>
<tuple>
<string>
modification_date
</string>
<string>
modification_date
</string>
<string></string>
<string></string>
...
...
bt5/erp5_discussion/bt/revision
View file @
3c356997
107
108
\ No newline at end of file
\ 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