Commit 716b8171 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: let user to define position against to left

parent a235b1b5
......@@ -50,6 +50,7 @@ override_batch_mode = kw.get('batch_mode', None)
destination_position_in_letter = kw.get('destination_position_in_letter', 'right')
display_sender_company_above_recipient = kw.get('display_sender_company_above_recipient', 0)
destination_position_padding_left = kw.get('destination_position_padding_left', '100px')
# -------------------------- Document Parameters ------------------------------
letter_portal_type = letter.getPortalType()
letter_relative_url = letter.getRelativeUrl()
......@@ -140,6 +141,7 @@ if letter_format == "html":
letter_destination_city=letter_destination.get("city", blank),
letter_destination_country=letter_destination.get("country", blank),
letter_destination_position = destination_position_in_letter,
letter_destination_position_padding_left = destination_position_padding_left,
letter_source_company=letter_source.get("corporate_name", letter_source.get("organisation_title", blank)),
letter_source_company_corporate_name=letter_source.get("corporate_name", blank),
letter_source_company_capital=letter_source.get("social_capital", blank),
......@@ -211,6 +213,7 @@ if letter_format == "pdf":
letter_destination_city=letter_destination.get("city", blank),
letter_destination_country=letter_destination.get("country", blank),
letter_destination_position = destination_position_in_letter,
letter_destination_position_padding_left = destination_position_padding_left,
letter_source_company=letter_source.get("corporate_name", letter_source.get("organisation_title", blank)),
letter_source_address=letter_source.get("address", blank),
letter_source_postal_code=letter_source.get("postal_code", blank),
......
......@@ -35,6 +35,7 @@ Generates the complete letter
letter_destination_city python: options.get('letter_destination_city');
letter_destination_country python: options.get('letter_destination_country');
letter_destination_position python: options.get('letter_destination_position');
letter_destination_position_padding_left python: options.get('letter_destination_position_padding_left');
letter_content python: options.get('letter_content');
letter_display_source_address python: options.get('letter_display_source_address');
......
......@@ -30,6 +30,7 @@ Generates the letter Content
letter_display_source_address python: options.get('letter_display_source_address');
letter_display_sender_company_above_recipient python: options.get('letter_display_sender_company_above_recipient');
letter_destination_position python: options.get('letter_destination_position');
letter_destination_position_padding_left python: options.get('letter_destination_position_padding_left');
letter_content python: options.get('letter_content');">
<!DOCTYPE html>
<html tal:attributes="class python: ''.join(['ci-', letter_theme, ' ci-', letter_language])">
......@@ -51,7 +52,7 @@ Generates the letter Content
<tal:block tal:condition="python: False">
<tal:block metal:define-macro="letter_destination">
<td class="ci-letter-destination">
<td class="ci-letter-destination" tal:attributes="style python: 'padding-left: %s' % letter_destination_position_padding_left ">
<tal:block tal:condition="python: int(letter_display_sender_company_above_recipient)" tal:define='address python:[]'>
<tal:block tal:define="dummy python: address.append(letter_source_company) if letter_source_company else ''"></tal:block>
<tal:block tal:define="dummy python: address.append(letter_source_address) if letter_source_address else ''"></tal:block>
......
......@@ -39,5 +39,6 @@ return context.Base_viewAsLetter(
batch_mode=batch_mode,
destination_position_in_letter = destination_position_in_letter,
display_sender_company_above_recipient=display_sender_company_above_recipient,
destination_position_padding_left = destination_position_padding_left,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format=None, display_source_address=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter=\'right\', display_sender_company_above_recipient=0,**kw</string> </value>
<value> <string>format=None, display_source_address=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter=\'right\', display_sender_company_above_recipient=0,destination_position_padding_left=\'100px\',**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -40,5 +40,6 @@ return context.WebPage_viewAsLetter(
batch_mode=batch_mode,
destination_position_in_letter = destination_position_in_letter,
display_sender_company_above_recipient= display_sender_company_above_recipient,
destination_position_padding_left = destination_position_padding_left,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format="html", display_source_address=None, display_head=1, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=0, **kw</string> </value>
<value> <string>format="html", display_source_address=None, display_head=1, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=0, destination_position_padding_left=\'100px\',**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -26,7 +26,6 @@ Update the letter dialog with parameters manually entered
# override_destination_organisation_title: override event recipient subordinate
# override_destination_person_title: overide event recipient
# override_date to use instead of current date
from Products.ERP5Type.Message import translateString
if dialog_id is not None:
return context.Base_redirect(
......@@ -48,6 +47,7 @@ if dialog_id is not None:
document_save=document_save,
destination_position_in_letter = destination_position_in_letter,
display_sender_company_above_recipient=display_sender_company_above_recipient,
destination_position_padding_left = destination_position_padding_left,
**kw
)
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>override_source_organisation_title=None, display_source_address=None, display_svg=None,document_download=None, document_save=None, dialog_id=None, cancel_url=None, portal_skin=None,display_head=None, format=None, override_date=None, override_destination_person_title=None, override_source_person_title=None,override_destination_organisation_title=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=None,*args,**kw</string> </value>
<value> <string>override_source_organisation_title=None, display_source_address=None, display_svg=None,document_download=None, document_save=None, dialog_id=None, cancel_url=None, portal_skin=None,display_head=None, format=None, override_date=None, override_destination_person_title=None, override_source_person_title=None,override_destination_organisation_title=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=None,destination_position_padding_left=\'100px\',*args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -39,5 +39,6 @@ return context.Base_viewAsLetter(
batch_mode=batch_mode,
destination_position_in_letter = destination_position_in_letter,
display_sender_company_above_recipient=display_sender_company_above_recipient,
destination_position_padding_left = destination_position_padding_left,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format=None, display_source_address=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter = \'right\',display_sender_company_above_recipient=0,**kw</string> </value>
<value> <string>format=None, display_source_address=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter = \'right\',display_sender_company_above_recipient=0,destination_position_padding_left=\'100px\',**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -93,6 +93,7 @@
<string>override_destination_organisation_title</string>
<string>override_destination_person_title</string>
<string>destination_position_in_letter</string>
<string>destination_position_padding_left</string>
<string>override_date</string>
</list>
</value>
......
......@@ -301,7 +301,7 @@
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python: \'<iframe width="100%%" height="500" style="background-color:#FFFFFF;box-sizing:border-box;-wekbit-box-sizing:border-box;" src="%s/WebPage_viewAsWeb?portal_skin=Letter&amp;override_source_person_title=%s&amp;override_source_organisation_title=%s&amp;override_destination_person_title=%s&amp;override_destination_organisation_title=%s&amp;display_head=%s&amp;override_date=%s&amp;display_source_address=%s&amp;display_svg=%s&amp;destination_position_in_letter=%s&amp;display_sender_company_above_recipient=%s" name="default_version"></iframe>\' % (context.absolute_url(), context.REQUEST.get("override_source_person_title", ""), context.REQUEST.get("override_source_organisation_title", ""), context.REQUEST.get("override_destination_person_title", ""), context.REQUEST.get("override_destination_organisation_title", ""), context.REQUEST.get("display_head", 1), context.REQUEST.get("override_date", ""), context.REQUEST.get("display_source_address", 0), context.REQUEST.get("display_svg", "png"), context.REQUEST.get("destination_position_in_letter", "right"), context.REQUEST.get("display_sender_company_above_recipient", 0))
python: \'<iframe width="100%%" height="500" style="background-color:#FFFFFF;box-sizing:border-box;-wekbit-box-sizing:border-box;" src="%s/WebPage_viewAsWeb?portal_skin=Letter&amp;override_source_person_title=%s&amp;override_source_organisation_title=%s&amp;override_destination_person_title=%s&amp;override_destination_organisation_title=%s&amp;display_head=%s&amp;override_date=%s&amp;display_source_address=%s&amp;display_svg=%s&amp;destination_position_in_letter=%s&amp;display_sender_company_above_recipient=%s&amp;destination_position_padding_left=%s" name="default_version"></iframe>\' % (context.absolute_url(), context.REQUEST.get("override_source_person_title", ""), context.REQUEST.get("override_source_organisation_title", ""), context.REQUEST.get("override_destination_person_title", ""), context.REQUEST.get("override_destination_organisation_title", ""), context.REQUEST.get("display_head", 1), context.REQUEST.get("override_date", ""), context.REQUEST.get("display_source_address", 0), context.REQUEST.get("display_svg", "png"), context.REQUEST.get("destination_position_in_letter", "right"), context.REQUEST.get("display_sender_company_above_recipient", 0), context.REQUEST.get(\'destination_position_padding_left\', \'100px\'))
]]></string> </value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StringField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>destination_position_padding_left</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>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>100px</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<value> <string>text</string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Recipient Position Against To Left</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -135,7 +135,6 @@ html{
width: 50%;
}
.ci-letter .ci-letter-head-right table tr td:nth-child(2) {
padding-left:100px;
width: 48%;
}
.ci-letter .ci-letter-head-right table tr td:nth-child(3) {
......
......@@ -143,7 +143,6 @@ html {
width: 43%;
}
.ci-letter .ci-letter-head-right table tr td:nth-child(2) {
padding-left:100px;
width: 55%;
}
.ci-letter .ci-letter-head-right table tr td:nth-child(3) {
......
......@@ -25,7 +25,6 @@ Allow to render letters through the URL?portal_skin=Letter
# override_destination_organisation_title: use this organisation as recipient
# override_destination_person_title: use this person as recipient
# override_date: use this date as letter date (required field)
return context.Letter_viewAsLetter(
format=format,
display_head=display_head,
......@@ -41,5 +40,6 @@ return context.Letter_viewAsLetter(
batch_mode=batch_mode,
destination_position_in_letter = destination_position_in_letter,
display_sender_company_above_recipient = display_sender_company_above_recipient,
destination_position_padding_left = destination_position_padding_left,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format="html", display_source_address=None, display_svg=None,document_download=None, batch_mode=False, display_head=None,document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter=\'right\',display_sender_company_above_recipient=0,**kw</string> </value>
<value> <string>format="html", display_source_address=None, display_svg=None,document_download=None, batch_mode=False, display_head=None,document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter=\'right\',display_sender_company_above_recipient=0,destination_position_padding_left=\'100px\',**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
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