Commit d71752a9 authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: fix failing tests and update comparison files

parent d350f776
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts12573465.66</string> </value>
<value> <string>ts12657381.25</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>4c1cf220969355f26388f06d1810cc42</string> </value>
<value> <string>01e9562745001e64e4e5586aad609e0d</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>23735</int> </value>
<value> <int>23737</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62318.835.18585</string> </value>
<value> <string>963.63759.42227.48093</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1512573465.66</float>
<float>1512657381.25</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts12573476.52</string> </value>
<value> <string>ts12657392.3</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>2184c0d0cddbca1ccc071d64f8c45ab3</string> </value>
<value> <string>35e5eb2d46274694ae08ccbe0fd7b87f</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>25892</int> </value>
<value> <int>25894</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.42151.6200.37393</string> </value>
<value> <string>963.63759.54430.35481</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1512573476.53</float>
<float>1512657392.31</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts12573492.95</string> </value>
<value> <string>ts12657401.45</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>97de471b9a8620e9e622bf6efd75d20b</string> </value>
<value> <string>a4201d7774a45ed7585cb8b221159e9a</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>27171</int> </value>
<value> <int>25693</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62318.34310.55398</string> </value>
<value> <string>963.63760.10285.22920</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1512573492.99</float>
<float>1512657401.45</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts12573502.92</string> </value>
<value> <string>ts12657411.47</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>7629e1a6cfa91c00147a83a73a0d4428</string> </value>
<value> <string>33a76fdb032e5f26dbe6b8ef66ed5d0c</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>29305</int> </value>
<value> <int>29307</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62318.47282.38229</string> </value>
<value> <string>963.63652.19058.27272</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1512573502.92</float>
<float>1512657411.47</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62459.32541.24320</string> </value>
<value> <string>963.62573.58511.5990</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1512574913.5</float>
<float>1512657098.28</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1512574946.16</float>
<float>1512645747.61</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1512574959.35</float>
<float>1512645759.69</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1512574934.34</float>
<float>1512645735.17</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1512574973.21</float>
<float>1512645772.73</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>353623bd2712db4b34926b45913ac7ce</string> </value>
<value> <string>a071fe41b276bf475d8aceeccc226340</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62318.7891.25685</string> </value>
<value> <string>963.63759.43979.32853</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1512573467.51</float>
<float>1512657383.94</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>9b7274769891fed57cf8ae234372231d</string> </value>
<value> <string>7e80bd9d7e61df1d06bb54668e3e02ed</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62318.23858.2338</string> </value>
<value> <string>963.63759.56939.48213</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1512573478.43</float>
<float>1512657393.85</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>ae7f049e9d42e018dbc0156871affd07</string> </value>
<value> <string>d27f1e01f2dd7c97d6d773ec5ddab2cf</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62318.36191.33570</string> </value>
<value> <string>963.63760.12845.37529</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1512573494.71</float>
<float>1512657403.03</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>118f59eb487e78835c9991b382c095d5</string> </value>
<value> <string>ff5523f7add2f6010af54c709cf6e023</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62318.49131.29064</string> </value>
<value> <string>963.63760.26900.56661</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1512573504.66</float>
<float>1512657413.07</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62459.39645.52650</string> </value>
<value> <string>963.63753.60961.15940</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1512574915.48</float>
<float>1512657099.86</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62461.52678.47854</string> </value>
<value> <string>963.63649.50625.62788</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1512574948.6</float>
<float>1512645748.94</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62462.59148.54886</string> </value>
<value> <string>963.63649.64550.52616</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1512574960.83</float>
<float>1512645761.28</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62460.49393.40584</string> </value>
<value> <string>963.63649.37865.51626</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1512574936.06</float>
<float>1512645737.23</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62464.819.10666</string> </value>
<value> <string>963.63650.18258.56029</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1512574974.72</float>
<float>1512645774.3</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62316.60783.2901</string> </value>
<value> <string>963.63944.55312.61030</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1512573358.52</float>
<float>1512657222.99</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62317.28425.55859</string> </value>
<value> <string>963.63945.839.30105</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1512573374.18</float>
<float>1512657232.95</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62317.39204.15394</string> </value>
<value> <string>963.63945.15436.31061</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1512573385.03</float>
<float>1512657244.12</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62317.49755.29286</string> </value>
<value> <string>963.63759.23860.3686</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1512573396.89</float>
<float>1512657257.84</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -28,7 +28,7 @@
<tr>
<td></td>
<td class="ci-letter-timestamp">
<span>Date</span><span>2017-12-06</span>
<span>Date</span><span>2017-12-07</span>
</td>
<td></td>
</tr>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62300.48672.6809</string> </value>
<value> <string>963.63650.51992.36181</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1512573369.52</float>
<float>1512657230.22</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -28,7 +28,7 @@
<tr>
<td></td>
<td class="ci-letter-timestamp">
<span>Date</span><span>2017-12-06</span>
<span>Date</span><span>2017-12-07</span>
</td>
<td></td>
</tr>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62301.32165.33501</string> </value>
<value> <string>963.63650.64881.13124</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1512573382.07</float>
<float>1512657239.46</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,7 +16,7 @@
<div class="ci-letter-header">
<div class="ci-letter-bar">
<div class="ci-letter-bar-logo">
<img src="https://softinst73908.host.vifib.net/erp5/organisation_module/template_test_association/default_image?format=png&amp;display=small"
<img src="https://softinst73908.host.vifib.net/erp5/organisation_module/template_test_association/default_image?format=png"
alt="" />
<span></span>
</div>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62301.53465.546</string> </value>
<value> <string>963.63945.25009.3618</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1512573394.09</float>
<float>1512657255.3</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -28,7 +28,7 @@
<tr>
<td></td>
<td class="ci-letter-timestamp">
<span>Date</span><span>2017-12-06</span>
<span>Date</span><span>2017-12-07</span>
</td>
<td></td>
</tr>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.62302.10857.46148</string> </value>
<value> <string>963.63651.31597.41693</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1512573440.83</float>
<float>1512657264.66</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1512574813.08</float>
<float>1512657071.97</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
<div class="ci-slideshow-container-left">
<img alt="Logo"
src="Template.Test.Image.Logo.Alternativ?format=png&amp;display=small" />
src="Template.Test.Image.Logo.Alternativ?format=png&amp;display=small?format=png" />
</div>
<div class="ci-slideshow-container-center"></div>
......
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1512574828.27</float>
<float>1512657081.41</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1512574875.6</float>
<float>1512657088.14</float>
<string>UTC</string>
</tuple>
</state>
......
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>erp5_corporate_identity_leaflet</skin_folder>
<skin_selection>Leaflet</skin_selection>
</skin_folder_selection>
<skin_folder_selection>
<skin_folder>erp5_corporate_identity_letter</skin_folder>
<skin_selection>Letter</skin_selection>
......
......@@ -82,12 +82,14 @@ if default_bank_account_uid is not None:
source["bic"] = override_bank_account.get("bic")
source["iban"] = override_bank_account.get("iban")
# XXX: logos stored on organisation fail on base_convert or fallback images
# is not found in skin folder base_convert => drop conversion on fallback image
source_logo_url = override_logo_reference or source.get("logo_url", blank)
if source_logo_url != blank:
source_logo_url = html_quote(source_logo_url) + "?format=png&display=small"
if source_logo_url == blank and theme_logo_url is not None:
# XXX images stored on organisation (as do images in skin folders)
if override_logo_reference:
source_logo_url = html_quote(override_logo_reference) + "?format=png&display=small"
if source_logo_url is None:
source_logo_url = source.get("logo_url", blank)
if source_logo_url is not blank:
source_logo_url = source_logo_url + "?format=png"
if source_logo_url is blank and theme_logo_url is not None:
source_logo_url = theme_logo_url
source["enhanced_logo_url"] = source_logo_url
......
......@@ -36,7 +36,7 @@ img = getCommonParameter("fallback_image", blank)
pdf = ".pdf" if format == "pdf" else blank
css = "default_theme_css_url"
font = "default_theme_font_css_url_list"
param = "?display=png"
param = "?format=png"
theme_logo_alt = "Default Logo"
default_company_title = getCustomParameter("default_company_title", None)
......@@ -65,10 +65,11 @@ if theme is not None:
if theme is None:
theme = "default"
# XXX fallback images on portal_skin folders not found on convert
theme_dict = {}
theme_dict["theme"] = theme
theme_dict["theme_logo_description"] = theme_logo_description
theme_dict["theme_logo_url"] = (theme_logo_url + param) if theme_logo_url is not None else getCommonParameter("fallback_image", None) or blank
theme_dict["theme_logo_url"] = (theme_logo_url + param) if theme_logo_url is not None else getCommonParameter("fallback_image", None)
theme_dict["template_css_url"] = ''.join([url, css_path, pdf, ".css"])
theme_dict["fallback_img_url"] = ''.join([url, '/', img])
theme_dict["theme_css_font_list"] = getCustomParameter(font, None) or []
......
......@@ -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;head_display=%s&amp;override_date=%s&amp;display_source_address=%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("head_display", 1), context.REQUEST.get("override_date", ""), context.REQUEST.get("display_source_address", ""))
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" 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", ""), context.REQUEST.get("display_svg", "png"))
]]></string> </value>
</item>
......
......@@ -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;head_display=%s&amp;override_date=%s&amp;display_source_address=%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("head_display", 1), context.REQUEST.get("override_date", ""), context.REQUEST.get("display_source_address", ""))
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" 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", ""), context.REQUEST.get("display_svg", "png"))
]]></string> </value>
</item>
......
......@@ -69,12 +69,12 @@ def setToNone(param):
# -------------------------- Setup ---------------------------------------------
letter = context
letter_format = kw.get('format', 'html')
letter_display_head = kw.get('dislay_head', 1)
letter_display_svg = kw.get('display_svg', 'png')
letter_display_source_adress = kw.get('letter_display_source_adress', None)
letter_download = kw.get('document_download', None)
letter_save = kw.get('document_save', None)
letter_transformation = kw.get('transformation', None)
letter_display_head = setToNone(kw.get('dislay_head', 1))
letter_display_svg = setToNone(kw.get('display_svg', 'png'))
letter_download = setToNone(kw.get('document_download', None))
letter_save = setToNone(kw.get('document_save', None))
override_source_person_title = kw.get('override_source_person_title', None)
override_source_organisation_title = kw.get("override_source_organisation_title", None)
......@@ -105,7 +105,7 @@ if letter_portal_type == "Web Page":
letter_reference = letter.getReference()
letter_version = letter.getVersion() or "001"
else:
letter_save = setToNone(letter_save) or True
letter_save = letter_save or True
letter_dialog_id = None
letter_modification_date = letter_form['start_date'] or None or letter.getCreationDate()
letter_title = letter_form.get('title')
......@@ -157,14 +157,14 @@ letter_destination = letter.Base_getDestinationDict(
for image in re.findall('(<img.*?/>)', letter_content):
letter_content = letter_content.replace(
image,
context.WebPage_validateImage(img_string=image, img_svg_format=setToNone(letter_display_svg))
context.WebPage_validateImage(img_string=image, img_svg_format=letter_display_svg)
)
# ============================= Format: html ===================================
if letter_format == "html":
letter.REQUEST.RESPONSE.setHeader("Content-Type", "text/html;")
return letter.Letter_createLetter(
letter_display_head=setToNone(letter_display_head),
letter_display_head=letter_display_head,
letter_theme=letter_theme.get("theme"),
letter_title=letter_title,
letter_language=letter_language,
......@@ -191,7 +191,7 @@ if letter_format == "html":
letter_source_city=letter_source.get("city", blank),
letter_source_country_code=letter_source.get("codification", blank),
letter_content = letter_content,
letter_display_source_adress=setToNone(letter_display_source_adress),
letter_display_source_adress=letter_display_source_adress,
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),
......@@ -206,7 +206,7 @@ if letter_format == "html":
# ============================= Format: pdf ====================================
if letter_format == "pdf":
letter_head = letter.Letter_createLetterHeader(
letter_display_head=setToNone(letter_display_head),
letter_display_head=letter_display_head,
letter_theme=letter_theme.get("theme"),
letter_title=letter_title,
letter_language=letter_language,
......@@ -220,7 +220,7 @@ if letter_format == "pdf":
)
letter_content = letter.Letter_createLetterContent(
letter_display_head=setToNone(letter_display_head),
letter_display_head=letter_display_head,
letter_theme=letter_theme.get("theme"),
letter_title=letter_title,
letter_language=letter_language,
......@@ -241,7 +241,7 @@ if letter_format == "pdf":
letter_source_postal_code=letter_source.get("postal_code", blank),
letter_source_city=letter_source.get("city", blank),
letter_source_country_code=letter_source.get("codification", blank),
letter_display_source_adress=setToNone(letter_display_source_adress),
letter_display_source_adress=letter_display_source_adress,
letter_content = letter_content
)
......@@ -290,8 +290,8 @@ if letter_format == "pdf":
)
return letter.WebPage_finishPdfCreation(
doc_download=setToNone(letter_download),
doc_save=setToNone(letter_save),
doc_download=letter_download,
doc_save=letter_save,
doc_version=letter_version,
doc_title=letter_title,
doc_relative_url=letter_relative_url,
......
......@@ -169,11 +169,11 @@ doc_uid = doc.getUid()
doc_url = doc.getAbsoluteUrl()
doc_format = kw.get('format', 'html')
doc_transformation = kw.get('transformation', None)
doc_display_notes = kw.get('display_note', None)
doc_display_svg = kw.get('display_svg', 'png')
doc_download = kw.get('document_download', None)
doc_save = kw.get('document_save', None)
doc_ooo = kw.get('flag_ooo', None)
doc_display_notes = setToNone(kw.get('display_note', None))
doc_display_svg = setToNone(kw.get('display_svg', 'png'))
doc_download = setToNone(kw.get('document_download', None))
doc_save = setToNone(kw.get('document_save', None))
doc_ooo = setToNone(kw.get('flag_ooo', None))
override_logo_reference = kw.get('override_logo_reference', None)
override_source_organisation_title = kw.get("override_source_organisation_title", None)
......@@ -260,7 +260,7 @@ doc_source = doc.Base_getSourceDict(
for image in re.findall('(<img.*?/>)', doc_content):
doc_content = doc_content.replace(
image,
context.WebPage_validateImage(img_string=image, img_svg_format=setToNone(doc_display_svg))
context.WebPage_validateImage(img_string=image, img_svg_format=doc_display_svg)
)
# ========================= TRANSFORMATION: book ===============================
......
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