projects
/
Plinn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
360eff5
)
On s'assure que le dossier des pièces jointes existe.
author
Benoît Pin
<benoit.pin@gmail.com>
Wed, 9 Apr 2014 14:45:38 +0000
(16:45 +0200)
committer
Benoît Pin
<benoit.pin@gmail.com>
Wed, 9 Apr 2014 14:45:38 +0000
(16:45 +0200)
skins/custom_content/document_edit_form.py
patch
|
blob
|
history
diff --git
a/skins/custom_content/document_edit_form.py
b/skins/custom_content/document_edit_form.py
index
d652e57
..
d439bd7
100644
(file)
--- a/
skins/custom_content/document_edit_form.py
+++ b/
skins/custom_content/document_edit_form.py
@@
-1,25
+1,28
@@
##parameters=change='', change_and_view='', ajax=''
##parameters=change='', change_and_view='', ajax=''
-##
+from Products.CMFCore.utils import getToolByName
+atool = getToolByName(context, 'portal_attachment')
+attachments = atool.getAttachmentsFor(context)
+
form = context.REQUEST.form
text = form.get('text')
if text and same_type(text, []) :
form = context.REQUEST.form
text = form.get('text')
if text and same_type(text, []) :
-
# when javascript is disabled,
-
# there's a hidden textarea from epoz
-
# and an other from <noscript> tag
-
form.update({'text' : text[1]})
+ # when javascript is disabled,
+ # there's a hidden textarea from epoz
+ # and an other from <noscript> tag
+ form.update({'text' : text[1]})
if change and \
if change and \
-
context.validateTextFile(**form) and \
-
context.validateHTML(**form) and \
-
context.document_edit_control(text=form.get('text'), text_format='html') and \
-
context.setRedirect(context, 'object/edit', **{'ajax':ajax}):
-
return
+ context.validateTextFile(**form) and \
+ context.validateHTML(**form) and \
+ context.document_edit_control(text=form.get('text'), text_format='html') and \
+ context.setRedirect(context, 'object/edit', **{'ajax':ajax}):
+ return
elif change_and_view and \
elif change_and_view and \
-
context.validateTextFile(**form) and \
-
context.validateHTML(**form) and \
-
context.document_edit_control(text=form.get('text'), text_format='html') and \
-
context.setRedirect(context, 'object/view', **{'ajax':ajax}):
-
return
+ context.validateTextFile(**form) and \
+ context.validateHTML(**form) and \
+ context.document_edit_control(text=form.get('text'), text_format='html') and \
+ context.setRedirect(context, 'object/view', **{'ajax':ajax}):
+ return
options = {}
options = {}
@@
-29,6
+32,6
@@
target = context.getActionInfo('object/edit')['url']
buttons.append( {'name': 'change', 'value': 'Change'} )
buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
options['form'] = { 'action': target,
buttons.append( {'name': 'change', 'value': 'Change'} )
buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
options['form'] = { 'action': target,
-
'listButtonInfos': tuple(buttons) }
+ 'listButtonInfos': tuple(buttons) }
return context.document_edit_template(**options)
return context.document_edit_template(**options)