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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Binh
erp5
Commits
d6baaf8e
Commit
d6baaf8e
authored
Jul 17, 2013
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make it possible to add attachments to a post.
parent
76282344
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
331 additions
and
5 deletions
+331
-5
bt5/erp5_discussion/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
...PortalTypeBaseCategoryTemplateItem/base_category_list.xml
+3
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionPost_getAttachmentList.xml
...kins/erp5_discussion/DiscussionPost_getAttachmentList.xml
+84
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionPost_getSummaryAsHTML.xml
...skins/erp5_discussion/DiscussionPost_getSummaryAsHTML.xml
+13
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_createNewDiscussionPost.xml
...5_discussion/DiscussionThread_createNewDiscussionPost.xml
+14
-1
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_viewCreateNewDiscussionPostDialog.xml
...on/DiscussionThread_viewCreateNewDiscussionPostDialog.xml
+1
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_viewCreateNewDiscussionPostDialog/your_file.xml
...ionThread_viewCreateNewDiscussionPostDialog/your_file.xml
+96
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml
.../erp5_discussion/WebSection_createNewDiscussionThread.xml
+15
-1
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewCreateNewDiscussionThreadDialog.xml
...ussion/WebSection_viewCreateNewDiscussionThreadDialog.xml
+1
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewCreateNewDiscussionThreadDialog/your_file.xml
...Section_viewCreateNewDiscussionThreadDialog/your_file.xml
+96
-0
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/erp5_discussion.css.xml
...Item/portal_skins/erp5_discussion/erp5_discussion.css.xml
+6
-2
bt5/erp5_discussion/bt/revision
bt5/erp5_discussion/bt/revision
+1
-1
bt5/erp5_discussion/bt/template_portal_type_base_category_list
...rp5_discussion/bt/template_portal_type_base_category_list
+1
-0
No files found.
bt5/erp5_discussion/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
View file @
d6baaf8e
<base_category_list>
<base_category_list>
<portal_type
id=
"Discussion Post"
>
<item>
successor
</item>
</portal_type>
<portal_type
id=
"Discussion Thread"
>
<portal_type
id=
"Discussion Thread"
>
<item>
contributor
</item>
<item>
contributor
</item>
<item>
source
</item>
<item>
source
</item>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionPost_getAttachmentList.xml
0 → 100644
View file @
d6baaf8e
<?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
Return list of attachments for a post.\n
We use proxy roles as not in all cases current user is allowed to get attachments but still we need\n
to provide a link to them which when used will ask for login.\n
"""\n
result = []\n
for successor in context.getSuccessorValueList():\n
result.append({\'title\': successor.getTitle(),\n
\'url\': successor.absolute_url()})\n
return result\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></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>
DiscussionPost_getAttachmentList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionPost_getSummaryAsHTML.xml
View file @
d6baaf8e
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
discussion_post_creation_date python: here.Base_FormatDate(discussion_post_object.getCreationDate());\n
discussion_post_creation_date python: here.Base_FormatDate(discussion_post_object.getCreationDate());\n
discussion_post_validation_state_title discussion_post_object/getTranslatedValidationStateTitle;\n
discussion_post_validation_state_title discussion_post_object/getTranslatedValidationStateTitle;\n
discussion_post_stripped_html discussion_post_object/asStrippedHTML;\n
discussion_post_stripped_html discussion_post_object/asStrippedHTML;\n
attachment_list discussion_post_object/DiscussionPost_getAttachmentList;\n
isUserAllowedToPost python: discussion_post_object.getParentValue().DiscussionThread_isUserAllowedToPost()">
\n
isUserAllowedToPost python: discussion_post_object.getParentValue().DiscussionThread_isUserAllowedToPost()">
\n
\n
\n
<div
class=
"discussion-post-header"
>
\n
<div
class=
"discussion-post-header"
>
\n
...
@@ -76,6 +77,18 @@
...
@@ -76,6 +77,18 @@
\n
\n
<div
class=
"discussion-post-body-container"
\n
<div
class=
"discussion-post-body-container"
\n
tal:content=
"structure discussion_post_stripped_html"
></div>
\n
tal:content=
"structure discussion_post_stripped_html"
></div>
\n
\n
<div
class=
"attachment"
\n
tal:condition=
"python: len(attachment_list)"
>
\n
<p>
Attachments:
</p>
\n
<ul>
\n
<li
tal:repeat=
"attachment attachment_list"
>
\n
<a
tal:attributes=
"href attachment/url"
\n
tal:content=
"attachment/title"
></a>
\n
</li>
\n
</ul>
\n
</div>
\n
\n
\n
\n
<div
tal:condition=
"python: author_signature is not None"
\n
<div
tal:condition=
"python: author_signature is not None"
\n
class=
"discussion-post-author-signature-container"
\n
class=
"discussion-post-author-signature-container"
\n
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_createNewDiscussionPost.xml
View file @
d6baaf8e
...
@@ -78,6 +78,19 @@ discussion_post = discussion_thread.newContent(\n
...
@@ -78,6 +78,19 @@ discussion_post = discussion_thread.newContent(\n
language = portal.Localizer.get_selected_language(),\n
language = portal.Localizer.get_selected_language(),\n
text_format = \'text/html\')\n
text_format = \'text/html\')\n
\n
\n
# handle attachments\n
if getattr(file, \'filename\', \'\') != \'\':\n
document_kw = {\'batch_mode\': True,\n
\'redirect_to_document\': False,\n
\'file\': file}\n
document = context.Base_contribute(**document_kw)\n
\n
# set relation between post and document\n
discussion_post.setSuccessorValueList([document])\n
\n
# depending on security model this should be changed accordingly\n
document.publish()\n
\n
# depending on security model Post can be submitted for review\n
# depending on security model Post can be submitted for review\n
portal_status_message = context.Base_translateString("New post created.")\n
portal_status_message = context.Base_translateString("New post created.")\n
\n
\n
...
@@ -104,7 +117,7 @@ else:\n
...
@@ -104,7 +117,7 @@ else:\n
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
title, text_content, form_id=\'view\', predecessor=None,**kw
</string>
</value>
<value>
<string>
title, text_content, form_id=\'view\', predecessor=None,
file=None,
**kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_viewCreateNewDiscussionPostDialog.xml
View file @
d6baaf8e
...
@@ -95,6 +95,7 @@
...
@@ -95,6 +95,7 @@
<list>
<list>
<string>
your_title
</string>
<string>
your_title
</string>
<string>
your_text_content
</string>
<string>
your_text_content
</string>
<string>
your_file
</string>
<string>
your_captcha
</string>
<string>
your_captcha
</string>
</list>
</list>
</value>
</value>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/DiscussionThread_viewCreateNewDiscussionPostDialog/your_file.xml
0 → 100644
View file @
d6baaf8e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_file
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_file_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
File Attachment
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_createNewDiscussionThread.xml
View file @
d6baaf8e
...
@@ -127,6 +127,19 @@ discussion_post = discussion_thread.newContent(\n
...
@@ -127,6 +127,19 @@ discussion_post = discussion_thread.newContent(\n
portal_status_message = "New discussion created in background."\n
portal_status_message = "New discussion created in background."\n
discussion_thread.publish()\n
discussion_thread.publish()\n
\n
\n
# handle attachments\n
if getattr(file, \'filename\', \'\') != \'\':\n
document_kw = {\'batch_mode\': True,\n
\'redirect_to_document\': False,\n
\'file\': file}\n
document = context.Base_contribute(**document_kw)\n
\n
# set relation between post and document\n
discussion_post.setSuccessorValueList([document])\n
\n
# depending on security model this should be changed accordingly\n
document.publish()\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
person_list = []\n
person_list = []\n
...
@@ -171,13 +184,14 @@ return context.Base_redirect(form_id,\n
...
@@ -171,13 +184,14 @@ return context.Base_redirect(form_id,\n
</item>
</item>
<item>
<item>
<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,
file=None,
**kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<value>
<tuple>
<tuple>
<string>
Assignor
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewCreateNewDiscussionThreadDialog.xml
View file @
d6baaf8e
...
@@ -96,6 +96,7 @@
...
@@ -96,6 +96,7 @@
<string>
your_title
</string>
<string>
your_title
</string>
<string>
your_send_notification_text
</string>
<string>
your_send_notification_text
</string>
<string>
your_text_content
</string>
<string>
your_text_content
</string>
<string>
your_file
</string>
<string>
your_captcha
</string>
<string>
your_captcha
</string>
</list>
</list>
</value>
</value>
...
...
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/WebSection_viewCreateNewDiscussionThreadDialog/your_file.xml
0 → 100644
View file @
d6baaf8e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
your_file
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_file_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
File Attachment
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_discussion/SkinTemplateItem/portal_skins/erp5_discussion/erp5_discussion.css.xml
View file @
d6baaf8e
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_EtagSupport__etag
</string>
</key>
<key>
<string>
_EtagSupport__etag
</string>
</key>
<value>
<string>
ts
51500035.8
</string>
</value>
<value>
<string>
ts
74061029.5
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
__name__
</string>
</key>
<key>
<string>
__name__
</string>
</key>
...
@@ -27,6 +27,10 @@
...
@@ -27,6 +27,10 @@
<value>
<string>
/*\n
<value>
<string>
/*\n
ERP5 discussion forum.\n
ERP5 discussion forum.\n
*/\n
*/\n
.attachment {\n
width:100%;\n
float:left;\n
}\n
\n
\n
.discussion-post-header{\n
.discussion-post-header{\n
background-color: #efefef;\n
background-color: #efefef;\n
...
@@ -96,7 +100,7 @@ blockquote {\n
...
@@ -96,7 +100,7 @@ blockquote {\n
</item>
</item>
<item>
<item>
<key>
<string>
size
</string>
</key>
<key>
<string>
size
</string>
</key>
<value>
<int>
964
</int>
</value>
<value>
<int>
1008
</int>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
...
...
bt5/erp5_discussion/bt/revision
View file @
d6baaf8e
135
136
\ No newline at end of file
\ No newline at end of file
bt5/erp5_discussion/bt/template_portal_type_base_category_list
View file @
d6baaf8e
Discussion Post | successor
Discussion Thread | contributor
Discussion Thread | contributor
Discussion Thread | source
Discussion Thread | source
\ 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