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
1
Issues
1
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
Roque
erp5
Commits
74a2069d
Commit
74a2069d
authored
Feb 04, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity: possible to add custom header and footer
parent
cc7b8d71
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
11 deletions
+45
-11
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_printAsReport.py
...ortal_skins/erp5_corporate_identity/Base_printAsReport.py
+2
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_printAsReport.xml
...rtal_skins/erp5_corporate_identity/Base_printAsReport.xml
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsReport.py
...portal_skins/erp5_corporate_identity/Base_viewAsReport.py
+18
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_createBook.zpt
...rtal_skins/erp5_corporate_identity/WebPage_createBook.zpt
+2
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_createBookFooter.zpt
...kins/erp5_corporate_identity/WebPage_createBookFooter.zpt
+15
-9
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_createBookHeader.zpt
...kins/erp5_corporate_identity/WebPage_createBookHeader.zpt
+7
-1
No files found.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_printAsReport.py
View file @
74a2069d
...
@@ -50,6 +50,8 @@ return context.Base_viewAsReport(
...
@@ -50,6 +50,8 @@ return context.Base_viewAsReport(
display_milestone
=
display_milestone
,
display_milestone
=
display_milestone
,
report_name
=
report_name
,
report_name
=
report_name
,
report_title
=
report_title
,
report_title
=
report_title
,
report_header
=
report_header
,
report_footer
=
report_footer
,
start_date
=
start_date
,
start_date
=
start_date
,
stop_date
=
stop_date
,
stop_date
=
stop_date
,
batch_mode
=
batch_mode
,
batch_mode
=
batch_mode
,
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_printAsReport.xml
View file @
74a2069d
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
format=\'pdf\', batch_mode=None, override_source_organisation_title=None, document_save=None, display_milestone=None, document_download=None, document_language=None, document_reference=None, document_version=None, display_header=None, display_detail=None, display_comment=None, document_title=None, display_depth=None, report_title=None, display_orphan=None, report_name=None, start_date=None, stop_date=None, *args,**kw
</string>
</value>
<value>
<string>
format=\'pdf\', batch_mode=None, override_source_organisation_title=None, document_save=None, display_milestone=None, document_download=None, document_language=None, document_reference=None, document_version=None, display_header=None, display_detail=None, display_comment=None, document_title=None, display_depth=None, report_title=None, display_orphan=None, report_name=None, start_date=None, stop_date=None,
report_header=None, report_footer=None,
*args,**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/Base_viewAsReport.py
View file @
74a2069d
...
@@ -34,6 +34,7 @@ MAIN FILE: generate report (book header/footer and report content)
...
@@ -34,6 +34,7 @@ MAIN FILE: generate report (book header/footer and report content)
# --------
# --------
# report_name report to generate
# report_name report to generate
# report_title report title
# report_title report title
# report_header custom report header
from
Products.PythonScripts.standard
import
html_quote
from
Products.PythonScripts.standard
import
html_quote
from
base64
import
b64encode
from
base64
import
b64encode
...
@@ -95,6 +96,19 @@ doc_translated_title = translateText(doc_report_title) if doc_report_title else
...
@@ -95,6 +96,19 @@ doc_translated_title = translateText(doc_report_title) if doc_report_title else
if
doc_language
is
None
or
doc_language
==
""
:
if
doc_language
is
None
or
doc_language
==
""
:
doc_language
=
doc_localiser
.
get_selected_language
()
or
doc_localiser
.
get_default_language
()
or
"en"
doc_language
=
doc_localiser
.
get_selected_language
()
or
doc_localiser
.
get_default_language
()
or
"en"
# custom header
doc_header
=
None
doc_report_header
=
kw
.
get
(
'report_header'
,
None
)
if
doc_report_header
:
doc_report_header
=
getattr
(
doc
,
doc_report_header
)
doc_header
=
doc_report_header
()
doc_footer
=
None
doc_report_footer
=
kw
.
get
(
'report_footer'
,
None
)
if
doc_report_footer
:
doc_report_footer
=
getattr
(
doc
,
doc_report_footer
)
doc_footer
=
doc_report_footer
()
doc_content
,
report_override_doc_title
,
report_override_doc_subtitle
=
doc_report
(
doc_content
,
report_override_doc_title
,
report_override_doc_subtitle
=
doc_report
(
display_report
=
None
if
doc_embed
else
True
,
display_report
=
None
if
doc_embed
else
True
,
format
=
doc_format
,
format
=
doc_format
,
...
@@ -173,6 +187,8 @@ if doc_format == "html":
...
@@ -173,6 +187,8 @@ if doc_format == "html":
book_full_reference
=
doc_full_reference
,
book_full_reference
=
doc_full_reference
,
book_source_organisation_title
=
doc_source
.
get
(
"organisation_title"
)
or
blank
,
book_source_organisation_title
=
doc_source
.
get
(
"organisation_title"
)
or
blank
,
book_content
=
doc_content
,
book_content
=
doc_content
,
book_header
=
doc_header
,
book_footer
=
doc_footer
)
)
return
doc
.
Base_finishWebPageCreation
(
return
doc
.
Base_finishWebPageCreation
(
...
@@ -218,6 +234,7 @@ if doc_format == "pdf":
...
@@ -218,6 +234,7 @@ if doc_format == "pdf":
book_revision
=
doc_revision
,
book_revision
=
doc_revision
,
book_version
=
doc_version
,
book_version
=
doc_version
,
book_short_date
=
doc_short_date
,
book_short_date
=
doc_short_date
,
book_header
=
doc_header
)
)
doc_foot
=
doc
.
WebPage_createBookFooter
(
doc_foot
=
doc
.
WebPage_createBookFooter
(
...
@@ -231,6 +248,7 @@ if doc_format == "pdf":
...
@@ -231,6 +248,7 @@ if doc_format == "pdf":
book_template_css_url
=
doc_theme
.
get
(
"template_css_url"
),
book_template_css_url
=
doc_theme
.
get
(
"template_css_url"
),
book_full_reference
=
doc_full_reference
,
book_full_reference
=
doc_full_reference
,
book_source_organisation_title
=
doc_source
.
get
(
"organisation_title"
)
or
blank
,
book_source_organisation_title
=
doc_source
.
get
(
"organisation_title"
)
or
blank
,
book_footer
=
doc_footer
)
)
# ================ encode and build cloudoo elements =========================
# ================ encode and build cloudoo elements =========================
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_createBook.zpt
View file @
74a2069d
...
@@ -8,6 +8,8 @@ Generates the complete book (only called in HTML version)
...
@@ -8,6 +8,8 @@ Generates the complete book (only called in HTML version)
<tal:block
tal:define=
"book_raw_tables python: options.get('book_raw_tables');
<tal:block
tal:define=
"book_raw_tables python: options.get('book_raw_tables');
book_raw_report python: options.get('book_raw_report');
book_raw_report python: options.get('book_raw_report');
book_theme python: options.get('book_theme');
book_theme python: options.get('book_theme');
book_header python: options.get('book_header');
book_footer python: options.get('book_footer');
book_title python: options.get('book_title');
book_title python: options.get('book_title');
book_language python: options.get('book_language');
book_language python: options.get('book_language');
book_theme_css_font_list python: options.get('book_theme_css_font_list');
book_theme_css_font_list python: options.get('book_theme_css_font_list');
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_createBookFooter.zpt
View file @
74a2069d
...
@@ -7,6 +7,7 @@ Creates the Book footer.
...
@@ -7,6 +7,7 @@ Creates the Book footer.
</tal:comment>
</tal:comment>
<tal:block
tal:define=
"book_theme python: options.get('book_theme');
<tal:block
tal:define=
"book_theme python: options.get('book_theme');
book_title python: options.get('book_title');
book_title python: options.get('book_title');
book_footer python: options.get('book_footer');
book_language python: options.get('book_language');
book_language python: options.get('book_language');
book_theme_css_font_list python: options.get('book_theme_css_font_list');
book_theme_css_font_list python: options.get('book_theme_css_font_list');
book_theme_css_url python: options.get('book_theme_css_url');
book_theme_css_url python: options.get('book_theme_css_url');
...
@@ -41,6 +42,10 @@ Creates the Book footer.
...
@@ -41,6 +42,10 @@ Creates the Book footer.
<tal:block
tal:condition=
"python: False"
>
<tal:block
tal:condition=
"python: False"
>
<tal:block
metal:define-macro=
"book_footer"
>
<tal:block
metal:define-macro=
"book_footer"
>
<tal:block
tal:condition=
"python: book_footer"
>
<tal:block
tal:content=
"structure python: book_footer"
></tal:block>
</tal:block>
<tal:block
tal:condition=
"python: not book_footer"
>
<table
class=
"ci-book-footer"
>
<table
class=
"ci-book-footer"
>
<tbody>
<tbody>
<tr>
<tr>
...
@@ -51,4 +56,5 @@ Creates the Book footer.
...
@@ -51,4 +56,5 @@ Creates the Book footer.
</tbody>
</tbody>
</table>
</table>
</tal:block>
</tal:block>
</tal:block>
</tal:block>
</tal:block>
\ No newline at end of file
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_createBookHeader.zpt
View file @
74a2069d
...
@@ -7,6 +7,7 @@ Creates the Book header.
...
@@ -7,6 +7,7 @@ Creates the Book header.
</tal:comment>
</tal:comment>
<tal:block
tal:define=
"book_theme python: options.get('book_theme');
<tal:block
tal:define=
"book_theme python: options.get('book_theme');
book_title python: options.get('book_title');
book_title python: options.get('book_title');
book_header python: options.get('book_header');
book_language python: options.get('book_language');
book_language python: options.get('book_language');
book_theme_css_font_list python: options.get('book_theme_css_font_list');
book_theme_css_font_list python: options.get('book_theme_css_font_list');
book_theme_css_url python: options.get('book_theme_css_url');
book_theme_css_url python: options.get('book_theme_css_url');
...
@@ -66,6 +67,10 @@ Creates the Book header.
...
@@ -66,6 +67,10 @@ Creates the Book header.
<tal:block
tal:condition=
"python: False"
>
<tal:block
tal:condition=
"python: False"
>
<tal:block
metal:define-macro=
"book_header"
>
<tal:block
metal:define-macro=
"book_header"
>
<tal:block
tal:condition=
"python: book_header"
>
<tal:block
tal:content=
"structure python: book_header"
></tal:block>
</tal:block>
<tal:block
tal:condition=
"python: not book_header"
>
<table
class=
"ci-book-header"
>
<table
class=
"ci-book-header"
>
<tbody>
<tbody>
<tr>
<tr>
...
@@ -106,4 +111,5 @@ Creates the Book header.
...
@@ -106,4 +111,5 @@ Creates the Book header.
</tbody>
</tbody>
</table>
</table>
</tal:block>
</tal:block>
</tal:block>
</tal:block>
</tal:block>
\ No newline at end of file
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