Commit a391c104 authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: add basic letter support in event module

parent d2441a3d
...@@ -64,6 +64,6 @@ if destination is None: ...@@ -64,6 +64,6 @@ if destination is None:
# destination => event # destination => event
else: else:
destination_uid = context.restrictedTraverse(destination).getUid() destination_uid = context.restrictedTraverse(destination).getUid()
destination = getCommonProxyParameter("destination", destination_uid) destination = getCommonProxyParameter("destination", destination_uid)[0]
return destination return destination
...@@ -31,9 +31,9 @@ def getCommonProxyParameter(my_parameter, my_override_data): ...@@ -31,9 +31,9 @@ def getCommonProxyParameter(my_parameter, my_override_data):
return commonProxyHandler(parameter=my_parameter, source_data=source_data) return commonProxyHandler(parameter=my_parameter, source_data=source_data)
# ------------------------------- Set Source ---------------------------------- # ------------------------------- Set Source ----------------------------------
source_logo_url = None
if source is None: if source is None:
contributor_title_string = blank contributor_title_string = blank
source_logo_url = None
source_person = None source_person = None
source_person_list = [] source_person_list = []
source_organisation = None source_organisation = None
......
"""
================================================================================
Print letter in any of the supported formats
================================================================================
"""
new_skin_name = "Letter"
context.getPortalObject().portal_skins.changeSkin(new_skin_name)
if REQUEST is None:
REQUEST = context.REQUEST
REQUEST.set('portal_skin', new_skin_name)
return context.Letter_viewAsLetter(
format=format,
display_head=display_head,
display_svg=display_svg,
display_source_address=display_source_address,
override_source_organisation_title=override_source_organisation_title,
override_source_person_title=override_source_person_title,
override_destination_organisation_title=override_destination_organisation_title,
override_destination_person_title=override_destination_person_title,
override_date=override_date,
document_save=document_save,
document_download=document_download,
batch_mode=batch_mode,
**kw
)
<?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>_params</string> </key>
<value> <string>REQUEST=None, format="pdf", portal_skin=None, batch_mode=False, display_source_address=None, display_svg=None, display_head=1 ,document_download=None, document_save=1, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Letter_send</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -19,7 +19,8 @@ if doc_save == 1: ...@@ -19,7 +19,8 @@ if doc_save == 1:
source_reference=''.join([doc_reference, '.pdf']), source_reference=''.join([doc_reference, '.pdf']),
file=doc_pdf_file file=doc_pdf_file
) )
#context.setAggregateList((doc_aggregate_list or []) + [doc_relative_url])
context.setAggregate(document.getRelativeUrl())
message = context.Base_translateString( message = context.Base_translateString(
'%(portal_type)s created successfully as PDF Document.' % { '%(portal_type)s created successfully as PDF Document.' % {
'portal_type': document.getTranslatedPortalType() 'portal_type': document.getTranslatedPortalType()
......
...@@ -105,6 +105,7 @@ if letter_portal_type == "Web Page": ...@@ -105,6 +105,7 @@ if letter_portal_type == "Web Page":
letter_reference = letter.getReference() letter_reference = letter.getReference()
letter_version = letter.getVersion() or "001" letter_version = letter.getVersion() or "001"
else: else:
letter_format = 'pdf'
letter_save = letter_save or True letter_save = letter_save or True
letter_dialog_id = None letter_dialog_id = None
letter_modification_date = letter_form['start_date'] or None or letter.getCreationDate() letter_modification_date = letter_form['start_date'] or None or letter.getCreationDate()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment