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
Frederic Thoma
erp5
Commits
5fc1ae1f
Commit
5fc1ae1f
authored
Aug 13, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity: add parameter to display sender organisation address above recipient
parent
368ed35d
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
139 additions
and
7 deletions
+139
-7
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsLetter.py
...portal_skins/erp5_corporate_identity/Base_viewAsLetter.py
+3
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_createLetter.zpt
...tal_skins/erp5_corporate_identity/Letter_createLetter.zpt
+1
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_createLetterContent.zpt
...ns/erp5_corporate_identity/Letter_createLetterContent.zpt
+9
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewAsLetter.py
...rtal_skins/erp5_corporate_identity/Letter_viewAsLetter.py
+1
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewAsLetter.xml
...tal_skins/erp5_corporate_identity/Letter_viewAsLetter.xml
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_exportAsLetter.py
...l_skins/erp5_corporate_identity/WebPage_exportAsLetter.py
+1
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_exportAsLetter.xml
..._skins/erp5_corporate_identity/WebPage_exportAsLetter.xml
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_updateLetterDialog.py
...ins/erp5_corporate_identity/WebPage_updateLetterDialog.py
+1
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_updateLetterDialog.xml
...ns/erp5_corporate_identity/WebPage_updateLetterDialog.xml
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLetter.py
...tal_skins/erp5_corporate_identity/WebPage_viewAsLetter.py
+1
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLetter.xml
...al_skins/erp5_corporate_identity/WebPage_viewAsLetter.xml
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewExportAsLetterDialog.xml
...5_corporate_identity/WebPage_viewExportAsLetterDialog.xml
+1
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewExportAsLetterDialog/content.xml
...ate_identity/WebPage_viewExportAsLetterDialog/content.xml
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewExportAsLetterDialog/display_sender_company_above_recipient.xml
...AsLetterDialog/display_sender_company_above_recipient.xml
+102
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/template_css/letter.css.css
...skins/erp5_corporate_identity/template_css/letter.css.css
+6
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/template_css/letter.pdf.css.css
...s/erp5_corporate_identity/template_css/letter.pdf.css.css
+6
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity_letter/WebPage_viewAsWeb.py
...skins/erp5_corporate_identity_letter/WebPage_viewAsWeb.py
+1
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity_letter/WebPage_viewAsWeb.xml
...kins/erp5_corporate_identity_letter/WebPage_viewAsWeb.xml
+1
-1
No files found.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsLetter.py
View file @
5fc1ae1f
...
...
@@ -49,6 +49,7 @@ override_date = kw.get("override_date")
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
)
# -------------------------- Document Parameters ------------------------------
letter_portal_type
=
letter
.
getPortalType
()
letter_relative_url
=
letter
.
getRelativeUrl
()
...
...
@@ -119,7 +120,6 @@ for image in re.findall('(<img.*?/>)', letter_content):
img_svg_format
=
letter_display_svg
)
)
# ============================= Format: html ===================================
if
letter_format
==
"html"
:
letter_output
=
letter
.
Letter_createLetter
(
...
...
@@ -152,6 +152,7 @@ if letter_format == "html":
letter_source_country_code
=
letter_source
.
get
(
"codification"
,
blank
),
letter_content
=
letter_content
,
letter_display_source_adress
=
letter_display_source_adress
,
letter_display_sender_company_above_recipient
=
display_sender_company_above_recipient
,
letter_source_vat
=
letter_source
.
get
(
"vat"
,
blank
),
letter_source_corporate_registration
=
letter_source
.
get
(
"corporate_registration"
,
blank
),
letter_source_phone
=
letter_source
.
get
(
"phone"
,
blank
),
...
...
@@ -216,6 +217,7 @@ if letter_format == "pdf":
letter_source_city
=
letter_source
.
get
(
"city"
,
blank
),
letter_source_country_code
=
letter_source
.
get
(
"codification"
,
blank
),
letter_display_source_adress
=
letter_display_source_adress
,
letter_display_sender_company_above_recipient
=
display_sender_company_above_recipient
,
letter_content
=
letter_content
)
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_createLetter.zpt
View file @
5fc1ae1f
...
...
@@ -38,6 +38,7 @@ Generates the complete letter
letter_content python: options.get('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_source_company python: options.get('letter_source_company');
letter_source_address python: options.get('letter_source_address');
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_createLetterContent.zpt
View file @
5fc1ae1f
...
...
@@ -28,6 +28,7 @@ Generates the letter Content
letter_destination_city python: options.get('letter_destination_city');
letter_destination_country python: options.get('letter_destination_country');
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_content python: options.get('letter_content');"
>
<!DOCTYPE html>
...
...
@@ -51,6 +52,14 @@ Generates the letter Content
<tal:block
tal:condition=
"python: False"
>
<tal:block
metal:define-macro=
"letter_destination"
>
<td
class=
"ci-letter-destination"
>
<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>
<tal:block
tal:define=
"dummy python: address.append(letter_source_country_code) if letter_source_country_code else ''"
></tal:block>
<tal:block
tal:define=
"dummy python: address.append(letter_source_postal_code) if letter_source_postal_code else ''"
></tal:block>
<tal:block
tal:define=
"dummy python: address.append(letter_source_city) if letter_source_city else ''"
></tal:block>
<div
class=
'ci-letter-sender-company-above-recipient'
tal:content=
"python: ','.join(address)"
></div>
</tal:block>
<span
tal:content=
"python: letter_destination_company or ' '"
></span>
<span
tal:content=
"python: letter_destination_person or ' '"
></span>
<tal:block
tal:repeat=
"address python: letter_destination_address.split('\n')"
>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewAsLetter.py
View file @
5fc1ae1f
...
...
@@ -38,5 +38,6 @@ return context.Base_viewAsLetter(
document_download
=
document_download
,
batch_mode
=
batch_mode
,
destination_position_in_letter
=
destination_position_in_letter
,
display_sender_company_above_recipient
=
display_sender_company_above_recipient
,
**
kw
)
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewAsLetter.xml
View file @
5fc1ae1f
...
...
@@ -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\', **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,
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_exportAsLetter.py
View file @
5fc1ae1f
...
...
@@ -39,5 +39,6 @@ return context.WebPage_viewAsLetter(
document_download
=
document_download
,
batch_mode
=
batch_mode
,
destination_position_in_letter
=
destination_position_in_letter
,
display_sender_company_above_recipient
=
display_sender_company_above_recipient
,
**
kw
)
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_exportAsLetter.xml
View file @
5fc1ae1f
...
...
@@ -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\', **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,
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_updateLetterDialog.py
View file @
5fc1ae1f
...
...
@@ -47,6 +47,7 @@ if dialog_id is not None:
document_download
=
document_download
,
document_save
=
document_save
,
destination_position_in_letter
=
destination_position_in_letter
,
display_sender_company_above_recipient
=
display_sender_company_above_recipient
,
**
kw
)
)
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_updateLetterDialog.xml
View file @
5fc1ae1f
...
...
@@ -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\', *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,
*args,**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLetter.py
View file @
5fc1ae1f
...
...
@@ -38,5 +38,6 @@ return context.Base_viewAsLetter(
document_download
=
document_download
,
batch_mode
=
batch_mode
,
destination_position_in_letter
=
destination_position_in_letter
,
display_sender_company_above_recipient
=
display_sender_company_above_recipient
,
**
kw
)
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLetter.xml
View file @
5fc1ae1f
...
...
@@ -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\',**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,
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewExportAsLetterDialog.xml
View file @
5fc1ae1f
...
...
@@ -78,6 +78,7 @@
<string>
portal_skin
</string>
<string>
display_head
</string>
<string>
display_source_address
</string>
<string>
display_sender_company_above_recipient
</string>
<string>
display_svg
</string>
<string>
document_save
</string>
</list>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewExportAsLetterDialog/content.xml
View file @
5fc1ae1f
...
...
@@ -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&override_source_person_title=%s&override_source_organisation_title=%s&override_destination_person_title=%s&override_destination_organisation_title=%s&display_head=%s&override_date=%s&display_source_address=%s&display_svg=%s&destination_position_in_letter=%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"
))
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&override_source_person_title=%s&override_source_organisation_title=%s&override_destination_person_title=%s&override_destination_organisation_title=%s&display_head=%s&override_date=%s&display_source_address=%s&display_svg=%s&destination_position_in_letter=%s
&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
))
]]>
</string>
</value>
</item>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewExportAsLetterDialog/display_sender_company_above_recipient.xml
0 → 100644
View file @
5fc1ae1f
<?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>
default
</string>
<string>
description
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
display_sender_company_above_recipient
</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>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<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>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Display Sender Company Address Above Recipient
</string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_checkbox
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Display Sender Company Address Above Recipient
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/template_css/letter.css.css
View file @
5fc1ae1f
...
...
@@ -124,6 +124,12 @@ html{
line-height
:
20px
;
}
.ci-letter
.ci-letter-destination
div
.ci-letter-sender-company-above-recipient
{
font-size
:
small
;
border-bottom
:
1px
solid
black
;
display
:
inline-block
;
}
/* === adress-right === */
.ci-letter
.ci-letter-head-right
table
tr
td
:nth-child
(
1
)
{
width
:
50%
;
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/template_css/letter.pdf.css.css
View file @
5fc1ae1f
...
...
@@ -132,6 +132,12 @@ html {
vertical-align
:
middle
;
}
.ci-letter
.ci-letter-destination
div
.ci-letter-sender-company-above-recipient
{
font-size
:
small
;
border-bottom
:
1px
solid
black
;
display
:
inline-block
;
}
/* === adress-right === */
.ci-letter
.ci-letter-head-right
table
tr
td
:nth-child
(
1
)
{
width
:
43%
;
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity_letter/WebPage_viewAsWeb.py
View file @
5fc1ae1f
...
...
@@ -40,5 +40,6 @@ return context.Letter_viewAsLetter(
document_download
=
document_download
,
batch_mode
=
batch_mode
,
destination_position_in_letter
=
destination_position_in_letter
,
display_sender_company_above_recipient
=
display_sender_company_above_recipient
,
**
kw
)
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity_letter/WebPage_viewAsWeb.xml
View file @
5fc1ae1f
...
...
@@ -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\',**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,
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
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