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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mukul
erp5
Commits
a927c92b
Commit
a927c92b
authored
Jan 11, 2018
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity: rename parameter getters and add letter preview
parent
71e32c0a
Changes
21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
711 additions
and
319 deletions
+711
-319
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getCustomTemplateProxyParameter.py
...orporate_identity/Base_getCustomTemplateProxyParameter.py
+0
-14
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getDestinationDict.py
..._skins/erp5_corporate_identity/Base_getDestinationDict.py
+6
-6
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getSourceDict.py
...ortal_skins/erp5_corporate_identity/Base_getSourceDict.py
+18
-12
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateParameter.py
...kins/erp5_corporate_identity/Base_getTemplateParameter.py
+0
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateParameter.xml
...ins/erp5_corporate_identity/Base_getTemplateParameter.xml
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.py
...erp5_corporate_identity/Base_getTemplateProxyParameter.py
+2
-2
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.xml
...rp5_corporate_identity/Base_getTemplateProxyParameter.xml
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getThemeDict.py
...portal_skins/erp5_corporate_identity/Base_getThemeDict.py
+9
-9
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsLetter.py
...portal_skins/erp5_corporate_identity/Base_viewAsLetter.py
+279
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsLetter.xml
...ortal_skins/erp5_corporate_identity/Base_viewAsLetter.xml
+2
-2
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsReport.py
...portal_skins/erp5_corporate_identity/Base_viewAsReport.py
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewAsLetter.py
...rtal_skins/erp5_corporate_identity/Letter_viewAsLetter.py
+26
-264
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/Letter_viewPreview/content.xml
...ns/erp5_corporate_identity/Letter_viewPreview/content.xml
+145
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewPreview/document_title.xml
..._corporate_identity/Letter_viewPreview/document_title.xml
+111
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_exportAsLetter.py
...l_skins/erp5_corporate_identity/WebPage_exportAsLetter.py
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_printAsLetter.py
...al_skins/erp5_corporate_identity/WebPage_printAsLetter.py
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_validateImage.py
...al_skins/erp5_corporate_identity/WebPage_validateImage.py
+3
-3
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsBook.py
...ortal_skins/erp5_corporate_identity/WebPage_viewAsBook.py
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLetter.py
...tal_skins/erp5_corporate_identity/WebPage_viewAsLetter.py
+41
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLetter.xml
...al_skins/erp5_corporate_identity/WebPage_viewAsLetter.xml
+62
-0
No files found.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getCustomTemplateProxyParameter.py
deleted
100644 → 0
View file @
71e32c0a
"""
================================================================================
Lookup a (hardcoded) custom parameter (default image, css-path etc)
================================================================================
"""
# parameters:
# ------------------------------------------------------------------------------
# parameter Parameter to lookup
# override_data Portal Type or relative url passed along
customProxyHandler
=
getattr
(
context
,
"WebPage_getCustomProxyParameter"
,
None
)
if
customProxyHandler
!=
None
:
source_data
=
override_data
or
context
.
getUid
()
return
customProxyHandler
(
parameter
=
parameter
,
source_data
=
source_data
)
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getDestinationDict.py
View file @
a927c92b
...
@@ -22,19 +22,19 @@ if destination == None:
...
@@ -22,19 +22,19 @@ if destination == None:
# destination person
# destination person
if
override_destination_person_title
!=
None
or
override_destination_person_title
==
blank
:
if
override_destination_person_title
!=
None
or
override_destination_person_title
==
blank
:
destination_person_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"override_person"
,
override_destination_person_title
)
destination_person_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"override_person"
,
source_data
=
override_destination_person_title
)
if
len
(
destination_person_list
)
==
0
:
if
len
(
destination_person_list
)
==
0
:
destination_person_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"person"
,
None
)
destination_person_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"person"
,
source_data
=
None
)
if
len
(
destination_person_list
)
>
0
:
if
len
(
destination_person_list
)
>
0
:
destination_person
=
destination_person_list
[
0
]
destination_person
=
destination_person_list
[
0
]
# destination organisation
# destination organisation
if
override_destination_organisation_title
!=
None
or
override_destination_organisation_title
==
blank
:
if
override_destination_organisation_title
!=
None
or
override_destination_organisation_title
==
blank
:
destination_organisation_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"override_organisation"
,
override_destination_organisation_title
)
destination_organisation_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"override_organisation"
,
source_data
=
override_destination_organisation_title
)
if
len
(
destination_organisation_list
)
==
0
:
if
len
(
destination_organisation_list
)
==
0
:
destination_organisation_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"organisation"
,
None
)
destination_organisation_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"organisation"
,
source_data
=
None
)
if
len
(
destination_organisation_list
)
==
0
and
destination_person
!=
None
:
if
len
(
destination_organisation_list
)
==
0
and
destination_person
!=
None
:
destination_organisation_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"source"
,
destination_person
.
get
(
"uid"
))
or
[]
destination_organisation_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"source"
,
source_data
=
destination_person
.
get
(
"uid"
))
or
[]
if
len
(
destination_organisation_list
)
>
0
:
if
len
(
destination_organisation_list
)
>
0
:
destination_organisation
=
destination_organisation_list
[
0
]
destination_organisation
=
destination_organisation_list
[
0
]
...
@@ -45,6 +45,6 @@ if destination == None:
...
@@ -45,6 +45,6 @@ if destination == None:
# destination => event
# destination => event
else
:
else
:
destination_uid
=
context
.
restrictedTraverse
(
destination
).
getUid
()
destination_uid
=
context
.
restrictedTraverse
(
destination
).
getUid
()
destination
=
context
.
Base_get
CustomTemplateProxyParameter
(
"destination"
,
destination_uid
)[
0
]
destination
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"destination"
,
source_data
=
destination_uid
)[
0
]
return
destination
return
destination
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getSourceDict.py
View file @
a927c92b
...
@@ -16,10 +16,10 @@ from Products.PythonScripts.standard import html_quote
...
@@ -16,10 +16,10 @@ from Products.PythonScripts.standard import html_quote
# ------------------------------- Set Source ----------------------------------
# ------------------------------- Set Source ----------------------------------
source_logo_url
=
None
source_logo_url
=
None
default_bank_account_uid
=
context
.
WebPage_getCustom
Parameter
(
"default_bank_account_uid"
)
default_bank_account_uid
=
context
.
Base_getTemplate
Parameter
(
"default_bank_account_uid"
)
if
source
==
None
:
if
source
==
None
:
default_company_title
=
context
.
WebPage_getCustom
Parameter
(
"default_company_title"
)
default_company_title
=
context
.
Base_getTemplate
Parameter
(
"default_company_title"
)
contributor_title_string
=
blank
contributor_title_string
=
blank
source_person
=
None
source_person
=
None
source_person_list
=
[]
source_person_list
=
[]
...
@@ -30,9 +30,9 @@ if source == None:
...
@@ -30,9 +30,9 @@ if source == None:
# source person
# source person
if
override_source_person_title
!=
None
or
override_source_person_title
==
blank
:
if
override_source_person_title
!=
None
or
override_source_person_title
==
blank
:
source_person_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"override_person"
,
override_source_person_title
)
source_person_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"override_person"
,
source_data
=
override_source_person_title
)
if
len
(
source_person_list
)
==
0
:
if
len
(
source_person_list
)
==
0
:
source_person_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"author"
,
None
)
or
[]
source_person_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"author"
,
source_data
=
None
)
or
[]
if
len
(
source_person_list
)
>
0
:
if
len
(
source_person_list
)
>
0
:
source_person
=
source_person_list
[
0
]
source_person
=
source_person_list
[
0
]
contributor_title_string
=
', '
.
join
(
x
.
get
(
"name"
,
blank
)
for
x
in
source_person_list
)
contributor_title_string
=
', '
.
join
(
x
.
get
(
"name"
,
blank
)
for
x
in
source_person_list
)
...
@@ -40,18 +40,18 @@ if source == None:
...
@@ -40,18 +40,18 @@ if source == None:
# source organisation
# source organisation
# order: override => follow-up => default_organisation_uid => default_company_title => source_person career subordinate
# order: override => follow-up => default_organisation_uid => default_company_title => source_person career subordinate
if
override_source_organisation_title
!=
None
or
override_source_organisation_title
==
blank
:
if
override_source_organisation_title
!=
None
or
override_source_organisation_title
==
blank
:
source_organisation_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"override_organisation"
,
override_source_organisation_title
)
source_organisation_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"override_organisation"
,
source_data
=
override_source_organisation_title
)
if
len
(
source_organisation_list
)
==
0
:
if
len
(
source_organisation_list
)
==
0
:
source_organisation_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"organisation"
)
source_organisation_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"organisation"
,
source_data
=
None
)
if
len
(
source_organisation_list
)
==
0
:
if
len
(
source_organisation_list
)
==
0
:
source_organisation_uid
=
context
.
WebPage_getCustom
Parameter
(
"default_source_organisation_uid"
)
source_organisation_uid
=
context
.
Base_getTemplate
Parameter
(
"default_source_organisation_uid"
)
if
source_organisation_uid
:
if
source_organisation_uid
:
source_organisation_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"sender"
,
source_organisation_uid
)
or
[]
source_organisation_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"sender"
,
source_data
=
source_organisation_uid
)
or
[]
if
len
(
source_organisation_list
)
==
0
and
default_company_title
:
if
len
(
source_organisation_list
)
==
0
and
default_company_title
:
source_organisation_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"override_organisation"
,
default_company_title
)
or
[]
source_organisation_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"override_organisation"
,
source_data
=
default_company_title
)
or
[]
if
len
(
source_organisation_list
)
==
0
and
source_person
!=
None
:
if
len
(
source_organisation_list
)
==
0
and
source_person
!=
None
:
for
organisation_candidate
in
source_person_list
:
for
organisation_candidate
in
source_person_list
:
organisation_candidate_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"source"
,
organisation_candidate
.
get
(
"uid"
))
or
[]
organisation_candidate_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"source"
,
source_data
=
organisation_candidate
.
get
(
"uid"
))
or
[]
if
len
(
organisation_candidate_list
)
>
0
:
if
len
(
organisation_candidate_list
)
>
0
:
source_organisation_list
=
organisation_candidate_list
source_organisation_list
=
organisation_candidate_list
break
break
...
@@ -66,17 +66,23 @@ if source == None:
...
@@ -66,17 +66,23 @@ if source == None:
# source => event
# source => event
else
:
else
:
source_uid
=
context
.
restrictedTraverse
(
source
).
getUid
()
source_uid
=
context
.
restrictedTraverse
(
source
).
getUid
()
source
=
context
.
Base_get
CustomTemplateProxyParameter
(
"source"
,
source_uid
)[
0
]
source
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"source"
,
source_data
=
source_uid
)[
0
]
# override specific bank account (no default to pick correct one if multiple exist)
# override specific bank account (no default to pick correct one if multiple exist)
if
default_bank_account_uid
!=
None
:
if
default_bank_account_uid
!=
None
:
override_bank_account_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"bank"
,
default_bank_account_uid
)
or
[]
override_bank_account_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"bank"
,
source_data
=
default_bank_account_uid
)
or
[]
if
len
(
override_bank_account_list
)
>
0
:
if
len
(
override_bank_account_list
)
>
0
:
override_bank_account
=
override_bank_account_list
[
0
]
override_bank_account
=
override_bank_account_list
[
0
]
source
[
"bank"
]
=
override_bank_account
.
get
(
"bank"
)
source
[
"bank"
]
=
override_bank_account
.
get
(
"bank"
)
source
[
"bic"
]
=
override_bank_account
.
get
(
"bic"
)
source
[
"bic"
]
=
override_bank_account
.
get
(
"bic"
)
source
[
"iban"
]
=
override_bank_account
.
get
(
"iban"
)
source
[
"iban"
]
=
override_bank_account
.
get
(
"iban"
)
# social capital currency and registered court fallbacks
if
source
.
get
(
"social_capital_currency"
)
is
blank
:
source
[
"social_capital_currency"
]
=
context
.
Base_getTemplateParameter
(
"default_source_company_capital_currency"
)
if
source
.
get
(
"corporate_registration_code"
)
is
blank
:
source
[
"corporate_registration_code"
]
=
context
.
Base_getTemplateParameter
(
"default_source_registered_court"
)
# XXX images stored on organisation (as do images in skin folders)
# XXX images stored on organisation (as do images in skin folders)
if
override_logo_reference
:
if
override_logo_reference
:
source_logo_url
=
html_quote
(
override_logo_reference
)
+
"?format=png"
source_logo_url
=
html_quote
(
override_logo_reference
)
+
"?format=png"
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/
WebPage_getCustom
Parameter.py
→
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/
Base_getTemplate
Parameter.py
View file @
a927c92b
File moved
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/
WebPage_getCustom
Parameter.xml
→
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/
Base_getTemplate
Parameter.xml
View file @
a927c92b
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebPage_getCustom
Parameter
</string>
</value>
<value>
<string>
Base_getTemplate
Parameter
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/
WebPage_getCustom
ProxyParameter.py
→
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/
Base_getTemplate
ProxyParameter.py
View file @
a927c92b
...
@@ -178,14 +178,14 @@ def getSubstringFromProduct(my_candidate, my_as_is):
...
@@ -178,14 +178,14 @@ def getSubstringFromProduct(my_candidate, my_as_is):
return
software_title
.
split
(
software_match_string
)[
0
].
lower
()
return
software_title
.
split
(
software_match_string
)[
0
].
lower
()
def
callSelf
(
my_parameter
,
my_source_id
,
my_flag_site
):
def
callSelf
(
my_parameter
,
my_source_id
,
my_flag_site
):
return
context
.
WebPage_getCustom
ProxyParameter
(
return
context
.
Base_getTemplate
ProxyParameter
(
parameter
=
my_parameter
,
parameter
=
my_parameter
,
source_uid
=
my_source_id
,
source_uid
=
my_source_id
,
flag_site
=
my_flag_site
flag_site
=
my_flag_site
)
)
pass_parameter
=
kw
.
get
(
"parameter"
,
None
)
pass_parameter
=
kw
.
get
(
"parameter"
,
None
)
pass_source_data
=
kw
.
get
(
"source_data"
,
None
)
pass_source_data
=
kw
.
get
(
"source_data"
,
None
)
or
context
.
getUid
()
pass_flag_site
=
kw
.
get
(
"flag_site"
,
None
)
pass_flag_site
=
kw
.
get
(
"flag_site"
,
None
)
if
pass_parameter
!=
None
and
pass_source_data
!=
None
:
if
pass_parameter
!=
None
and
pass_source_data
!=
None
:
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/
WebPage_getCustom
ProxyParameter.xml
→
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/
Base_getTemplate
ProxyParameter.xml
View file @
a927c92b
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebPage_getCustom
ProxyParameter
</string>
</value>
<value>
<string>
Base_getTemplate
ProxyParameter
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getThemeDict.py
View file @
a927c92b
...
@@ -22,16 +22,16 @@ theme_logo_list = []
...
@@ -22,16 +22,16 @@ theme_logo_list = []
theme_logo_dict
=
{}
theme_logo_dict
=
{}
theme_reference
=
None
theme_reference
=
None
theme
=
(
theme
=
(
context
.
Base_get
CustomTemplateProxyParameter
(
"theme"
)
or
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"theme"
,
source_data
=
None
)
or
context
.
WebPage_getCustom
Parameter
(
"theme"
)
or
context
.
Base_getTemplate
Parameter
(
"theme"
)
or
context
.
WebPage_getCustom
Parameter
(
"default_company_title"
)
context
.
Base_getTemplate
Parameter
(
"default_company_title"
)
)
)
if
theme
!=
None
:
if
theme
!=
None
:
theme
=
theme
.
lower
()
theme
=
theme
.
lower
()
theme_logo_prefix
=
context
.
WebPage_getCustom
Parameter
(
"default_logo_prefix"
)
theme_logo_prefix
=
context
.
Base_getTemplate
Parameter
(
"default_logo_prefix"
)
if
theme_logo_prefix
:
if
theme_logo_prefix
:
theme_reference
=
theme_logo_prefix
+
theme
.
capitalize
()
theme_reference
=
theme_logo_prefix
+
theme
.
capitalize
()
theme_logo_list
=
context
.
Base_get
CustomTemplateProxyParameter
(
"logo"
,
theme_reference
)
theme_logo_list
=
context
.
Base_get
TemplateProxyParameter
(
parameter
=
"logo"
,
source_data
=
theme_reference
)
if
len
(
theme_logo_list
)
>
0
:
if
len
(
theme_logo_list
)
>
0
:
theme_logo_dict
=
theme_logo_list
[
0
]
theme_logo_dict
=
theme_logo_list
[
0
]
if
theme
==
None
:
if
theme
==
None
:
...
@@ -40,11 +40,11 @@ if theme == None:
...
@@ -40,11 +40,11 @@ if theme == None:
theme_dict
=
{}
theme_dict
=
{}
theme_dict
[
"theme"
]
=
theme
theme_dict
[
"theme"
]
=
theme
theme_dict
[
"theme_logo_description"
]
=
theme_logo_dict
.
get
(
"description"
,
blank
)
theme_dict
[
"theme_logo_description"
]
=
theme_logo_dict
.
get
(
"description"
,
blank
)
theme_dict
[
"theme_logo_url"
]
=
context
.
WebPage_getCustom
Parameter
(
"fallback_image"
)
theme_dict
[
"theme_logo_url"
]
=
context
.
Base_getTemplate
Parameter
(
"fallback_image"
)
if
theme_logo_dict
.
get
(
"relative_url"
,
None
)
!=
None
:
if
theme_logo_dict
.
get
(
"relative_url"
,
None
)
!=
None
:
theme_dict
[
"theme_logo_url"
]
=
theme_logo_dict
.
get
(
"relative_url"
)
+
param
theme_dict
[
"theme_logo_url"
]
=
theme_logo_dict
.
get
(
"relative_url"
)
+
param
theme_dict
[
"template_css_url"
]
=
css_path
+
pdf
+
".css"
theme_dict
[
"template_css_url"
]
=
css_path
+
pdf
+
".css"
theme_dict
[
"fallback_img_url"
]
=
context
.
WebPage_getCustom
Parameter
(
"fallback_image"
)
or
blank
theme_dict
[
"fallback_img_url"
]
=
context
.
Base_getTemplate
Parameter
(
"fallback_image"
)
or
blank
theme_dict
[
"theme_css_font_list"
]
=
context
.
WebPage_getCustom
Parameter
(
font
)
or
[]
theme_dict
[
"theme_css_font_list"
]
=
context
.
Base_getTemplate
Parameter
(
font
)
or
[]
theme_dict
[
"theme_css_url"
]
=
context
.
WebPage_getCustomParameter
(
css
)
or
context
.
WebPage_getCustom
Parameter
(
css
)
or
blank
theme_dict
[
"theme_css_url"
]
=
context
.
Base_getTemplateParameter
(
css
)
or
context
.
Base_getTemplate
Parameter
(
css
)
or
blank
return
theme_dict
return
theme_dict
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsLetter.py
0 → 100644
View file @
a927c92b
This diff is collapsed.
Click to expand it.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_
getCustomTemplateProxyParame
ter.xml
→
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_
viewAsLet
ter.xml
View file @
a927c92b
...
@@ -50,11 +50,11 @@
...
@@ -50,11 +50,11 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
parameter=None, override_data=None
</string>
</value>
<value>
<string>
*args,**kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_
getCustomTemplateProxyParame
ter
</string>
</value>
<value>
<string>
Base_
viewAsLet
ter
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsReport.py
View file @
a927c92b
...
@@ -59,7 +59,7 @@ doc_requirement_relative_url = kw.get('requirement_relative_url', None)
...
@@ -59,7 +59,7 @@ doc_requirement_relative_url = kw.get('requirement_relative_url', None)
# -------------------------- Document Parameters ------------------------------
# -------------------------- Document Parameters ------------------------------
doc_localiser
=
doc
.
getPortalObject
().
Localizer
doc_localiser
=
doc
.
getPortalObject
().
Localizer
doc_relative_url
=
doc
.
getRelativeUrl
()
doc_relative_url
=
doc
.
getRelativeUrl
()
doc_rendering_fix
=
doc
.
WebPage_getCustom
Parameter
(
'wkhtmltopdf_rendering_fix'
)
or
blank
doc_rendering_fix
=
doc
.
Base_getTemplate
Parameter
(
'wkhtmltopdf_rendering_fix'
)
or
blank
doc_report
=
getattr
(
doc
,
doc_report_name
)
doc_report
=
getattr
(
doc
,
doc_report_name
)
doc_aggregate_list
=
[]
doc_aggregate_list
=
[]
doc_revision
=
"1"
doc_revision
=
"1"
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewAsLetter.py
View file @
a927c92b
This diff is collapsed.
Click to expand it.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewAsLetter.xml
View file @
a927c92b
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
*args
,**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
,**kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewPreview/content.xml
0 → 100644
View file @
a927c92b
<?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>
gadget_url
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
content
</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>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</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>
gadget_url
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</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>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_iframe_gadget_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Content
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: context.Base_getRelevantContext(context_url=context.getRelativeUrl()).getData().encode("base64")
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: field.restrictedTraverse(\'pdf_js/pdfjs.gadget.html\').absolute_url() + "?auto_focus=1"
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Letter_viewPreview/document_title.xml
0 → 100644
View file @
a927c92b
<?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>
css_class
</string>
<string>
description
</string>
<string>
display_width
</string>
<string>
editable
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document_title
</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>
css_class
</string>
</key>
<value>
<string>
headline
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
The title is display as main content title and page title.
</string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<int>
40
</int>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_event_title
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewCRMFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_exportAsLetter.py
View file @
a927c92b
...
@@ -25,7 +25,7 @@ Export this web page as letter in specified format
...
@@ -25,7 +25,7 @@ Export this web page as letter in specified format
# override_destination_person_title: overide event recipient
# override_destination_person_title: overide event recipient
# override_date to use instead of current date
# override_date to use instead of current date
return
context
.
Letter
_viewAsLetter
(
return
context
.
WebPage
_viewAsLetter
(
format
=
format
,
format
=
format
,
display_head
=
display_head
,
display_head
=
display_head
,
display_svg
=
display_svg
,
display_svg
=
display_svg
,
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_printAsLetter.py
View file @
a927c92b
...
@@ -24,7 +24,7 @@ Print letter in any of the supported formats
...
@@ -24,7 +24,7 @@ Print letter in any of the supported formats
# override_destination_person_title: overide event recipient
# override_destination_person_title: overide event recipient
# override_date to use instead of current date
# override_date to use instead of current date
return
context
.
Letter
_viewAsLetter
(
return
context
.
WebPage
_viewAsLetter
(
format
=
format
,
format
=
format
,
display_head
=
display_head
,
display_head
=
display_head
,
display_svg
=
display_svg
,
display_svg
=
display_svg
,
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_validateImage.py
View file @
a927c92b
...
@@ -12,17 +12,17 @@ Upgrade image for the specific type of display
...
@@ -12,17 +12,17 @@ Upgrade image for the specific type of display
# img_svg_format display image as svg (default png/None)
# img_svg_format display image as svg (default png/None)
import
re
import
re
from
OFS.Traversable
import
NotFound
from
zExceptions
import
NotFound
if
img_string
==
None
or
img_string
==
""
:
if
img_string
==
None
or
img_string
==
""
:
return
img_string
return
img_string
img_src
=
re
.
findall
(
"src=['
\
"
](.*?)['
\
"
]"
,
img_string
)[
0
]
img_src
=
re
.
findall
(
"src=['
\
"
](.*?)['
\
"
]"
,
img_string
)[
0
]
img_obj
=
context
.
restrictedTraverse
(
img_src
.
split
(
"?"
)[
0
])
img_obj
=
context
.
restrictedTraverse
(
img_src
.
split
(
"?"
)[
0
]
,
None
)
img_type
=
img_obj
.
getContentType
()
img_type
=
img_obj
.
getContentType
()
# flag broken link until further notice
# flag broken link until further notice
if
img_obj
is
None
:
if
img_obj
==
None
:
raise
NotFound
(
'The following image could not be found in erp5: %s'
%
(
img_src
.
split
(
"?"
)[
0
]))
raise
NotFound
(
'The following image could not be found in erp5: %s'
%
(
img_src
.
split
(
"?"
)[
0
]))
# ensure alt attributes are set
# ensure alt attributes are set
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsBook.py
View file @
a927c92b
...
@@ -75,7 +75,7 @@ override_batch_mode = book.Base_setToNone(param=kw.get('batch_mode', None))
...
@@ -75,7 +75,7 @@ override_batch_mode = book.Base_setToNone(param=kw.get('batch_mode', None))
book_localiser
=
book
.
getPortalObject
().
Localizer
book_localiser
=
book
.
getPortalObject
().
Localizer
book_relative_url
=
book
.
getRelativeUrl
()
book_relative_url
=
book
.
getRelativeUrl
()
book_prefix
=
"Book."
book_prefix
=
"Book."
book_rendering_fix
=
book
.
WebPage_getCustom
Parameter
(
'wkhtmltopdf_rendering_fix'
)
or
blank
book_rendering_fix
=
book
.
Base_getTemplate
Parameter
(
'wkhtmltopdf_rendering_fix'
)
or
blank
book_content
=
book
.
getTextContent
()
book_content
=
book
.
getTextContent
()
book_aggregate_list
=
[]
book_aggregate_list
=
[]
book_revision
=
book
.
getRevision
()
book_revision
=
book
.
getRevision
()
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLetter.py
0 → 100644
View file @
a927c92b
"""
================================================================================
View a WebPage as Letter in the defined output format
================================================================================
"""
# ERP5 web uses format= argument, which is also a python builtin
# pylint: disable=redefined-builtin
# parameters (*default)
# ------------------------------------------------------------------------------
# format: output format
# batch_mode: used for tests
# display_source_address display source (!) adress in adress field or not*
# display_svg display images in svg or png*
# display_head display letter adress head (1)* or not (0)
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# override_source_organisation_title: override event sender career subordinate
# override_source_person_title: override event sender title
# override_destination_organisation_title: override event recipient subordinate
# override_destination_person_title: overide event recipient
# override_date to use instead of current date
return
context
.
Base_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
)
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLetter.xml
0 → 100644
View file @
a927c92b
<?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>
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,**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebPage_viewAsLetter
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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