Commit dc7fc5e8 authored by Xiaowu Zhang's avatar Xiaowu Zhang

corporate identity improvment

See merge request nexedi/erp5!1251
parents 65dc3807 a873edde
Pipeline #11314 failed with stage
in 0 seconds
...@@ -35,8 +35,7 @@ pref = context.getPortalObject().portal_preferences ...@@ -35,8 +35,7 @@ pref = context.getPortalObject().portal_preferences
# -------------------------- Setup --------------------------------------------- # -------------------------- Setup ---------------------------------------------
letter = context letter = context
letter_format = kw.get('format') or 'html' letter_format = kw.get('format') or 'html'
letter_display_source_adress = kw.get('letter_display_source_adress', None) letter_display_head = int(kw.get('display_head') or 0)
letter_display_head = int(kw.get('dislay_head') or 1)
letter_display_svg = kw.get('display_svg') or 'png' letter_display_svg = kw.get('display_svg') or 'png'
letter_download = int(kw.get('document_download') or 0) letter_download = int(kw.get('document_download') or 0)
letter_save = int(kw.get('document_save') or 0) letter_save = int(kw.get('document_save') or 0)
...@@ -155,7 +154,6 @@ if letter_format == "html": ...@@ -155,7 +154,6 @@ if letter_format == "html":
letter_source_country_code=letter_source.get("codification", blank), letter_source_country_code=letter_source.get("codification", blank),
letter_source_country=letter_source.get("country", blank), letter_source_country=letter_source.get("country", blank),
letter_content = letter_content, letter_content = letter_content,
letter_display_source_adress=letter_display_source_adress,
letter_display_sender_company_above_recipient = display_sender_company_above_recipient, letter_display_sender_company_above_recipient = display_sender_company_above_recipient,
letter_source_vat=letter_source.get("vat", blank), letter_source_vat=letter_source.get("vat", blank),
letter_source_corporate_registration=letter_source.get("corporate_registration", blank), letter_source_corporate_registration=letter_source.get("corporate_registration", blank),
...@@ -221,7 +219,6 @@ if letter_format == "pdf": ...@@ -221,7 +219,6 @@ if letter_format == "pdf":
letter_source_postal_code=letter_source.get("postal_code", blank), letter_source_postal_code=letter_source.get("postal_code", blank),
letter_source_city=letter_source.get("city", blank), letter_source_city=letter_source.get("city", blank),
letter_source_country_code=letter_source.get("codification", 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_display_sender_company_above_recipient = display_sender_company_above_recipient,
letter_content = letter_content letter_content = letter_content
) )
......
...@@ -16,18 +16,27 @@ Generates the complete letter ...@@ -16,18 +16,27 @@ Generates the complete letter
letter_template_css_url python: options.get('letter_template_css_url'); letter_template_css_url python: options.get('letter_template_css_url');
letter_timestamp python: options.get('letter_timestamp'); letter_timestamp python: options.get('letter_timestamp');
letter_source_company python: options.get('letter_source_company');
letter_source_company_corporate_name python: options.get('letter_source_company_corporate_name'); letter_source_company_corporate_name python: options.get('letter_source_company_corporate_name');
letter_source_company python: options.get('letter_source_company'); letter_source_company python: options.get('letter_source_company');
letter_source_company_capital python: options.get('letter_source_company_capital'); letter_source_company_capital python: options.get('letter_source_company_capital');
letter_source_company_capital_currency python: options.get('letter_source_company_capital_currency'); letter_source_company_capital_currency python: options.get('letter_source_company_capital_currency');
letter_source_registered_court python: options.get('letter_source_registered_court'); letter_source_registered_court python: options.get('letter_source_registered_court');
letter_source_ape_code python: options.get('letter_source_ape_code'); letter_source_ape_code python: options.get('letter_source_ape_code');
letter_source_address python: options.get('letter_source_address'); letter_source_address python: options.get('letter_source_address');
letter_source_country_code python: options.get('letter_source_country_code'); letter_source_country_code python: options.get('letter_source_country_code');
letter_source_postal_code python: options.get('letter_source_postal_code'); letter_source_postal_code python: options.get('letter_source_postal_code');
letter_source_city python: options.get('letter_source_city'); letter_source_city python: options.get('letter_source_city');
letter_source_country python: options.get('letter_source_country');
letter_source_vat python: options.get('letter_source_vat');
letter_source_corporate_registration python: options.get('letter_source_corporate_registration');
letter_source_phone python: options.get('letter_source_phone');
letter_source_fax python: options.get('letter_source_fax');
letter_source_mail python: options.get('letter_source_mail');
letter_source_website python: options.get('letter_source_website');
letter_source_bank python: options.get('letter_source_bank');
letter_source_bic python: options.get('letter_source_bic');
letter_source_iban python: options.get('letter_source_iban');
letter_destination_company python: options.get('letter_destination_company'); letter_destination_company python: options.get('letter_destination_company');
letter_destination_person python: options.get('letter_destination_person'); letter_destination_person python: options.get('letter_destination_person');
letter_destination_address python: options.get('letter_destination_address'); letter_destination_address python: options.get('letter_destination_address');
...@@ -38,23 +47,7 @@ Generates the complete letter ...@@ -38,23 +47,7 @@ Generates the complete letter
letter_destination_position_padding_left python: options.get('letter_destination_position_padding_left'); letter_destination_position_padding_left python: options.get('letter_destination_position_padding_left');
letter_content python: options.get('letter_content'); 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_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');
letter_source_postal_code python: options.get('letter_source_postal_code');
letter_source_city python: options.get('letter_source_city');
letter_source_country python: options.get('letter_source_country');
letter_source_vat python: options.get('letter_source_vat');
letter_source_corporate_registration python: options.get('letter_source_corporate_registration');
letter_source_phone python: options.get('letter_source_phone');
letter_source_fax python: options.get('letter_source_fax');
letter_source_mail python: options.get('letter_source_mail');
letter_source_website python: options.get('letter_source_website');
letter_source_bank python: options.get('letter_source_bank');
letter_source_bic python: options.get('letter_source_bic');
letter_source_iban python: options.get('letter_source_iban');">
<!DOCTYPE html> <!DOCTYPE html>
<html tal:attributes="class python: ''.join(['ci-', letter_theme, ' ci-', letter_language])"> <html tal:attributes="class python: ''.join(['ci-', letter_theme, ' ci-', letter_language])">
<head> <head>
......
...@@ -27,7 +27,6 @@ Generates the letter Content ...@@ -27,7 +27,6 @@ Generates the letter Content
letter_destination_postal_code python: options.get('letter_destination_postal_code'); letter_destination_postal_code python: options.get('letter_destination_postal_code');
letter_destination_city python: options.get('letter_destination_city'); letter_destination_city python: options.get('letter_destination_city');
letter_destination_country python: options.get('letter_destination_country'); 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_display_sender_company_above_recipient python: options.get('letter_display_sender_company_above_recipient');
letter_destination_position python: options.get('letter_destination_position'); letter_destination_position python: options.get('letter_destination_position');
letter_destination_position_padding_left python: options.get('letter_destination_position_padding_left'); letter_destination_position_padding_left python: options.get('letter_destination_position_padding_left');
...@@ -79,21 +78,7 @@ Generates the letter Content ...@@ -79,21 +78,7 @@ Generates the letter Content
<tal:block tal:condition="python: int(letter_display_head)"> <tal:block tal:condition="python: int(letter_display_head)">
<tr> <tr>
<td></td> <td></td>
<td class="ci-letter-source"> <td class="ci-letter-source"></td>
<tal:block tal:condition="python: letter_display_source_address is not None">
<tal:block tal:condition="python: letter_source_company">
<span tal:content="letter_source_company"></span><span class="ci-letter-separator">-</span>
</tal:block>
<tal:block tal:condition="python: letter_source_address">
<span tal:content="letter_source_address"></span><span class="ci-letter-separator">-</span>
</tal:block>
<tal:block tal:condition="python: letter_source_country_code">
<span tal:content="letter_source_country_code"></span><span class="ci-letter-separator">-</span>
</tal:block>
<span tal:content="letter_source_postal_code"></span>&nbsp;
<span tal:content="letter_source_city"></span>
</tal:block>
</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
...@@ -30,7 +30,6 @@ return context.Letter_viewAsLetter( ...@@ -30,7 +30,6 @@ return context.Letter_viewAsLetter(
format=format, format=format,
display_head=display_head, display_head=display_head,
display_svg=display_svg, display_svg=display_svg,
display_source_address=display_source_address,
override_source_organisation_title=override_source_organisation_title, override_source_organisation_title=override_source_organisation_title,
override_source_person_title=override_source_person_title, override_source_person_title=override_source_person_title,
override_destination_organisation_title=override_destination_organisation_title, override_destination_organisation_title=override_destination_organisation_title,
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>REQUEST=None, format="pdf", portal_skin=None, batch_mode=False, display_source_address=None, display_svg=None, display_head=1 ,document_download=None, document_save=1, 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> <value> <string>REQUEST=None, format="pdf", portal_skin=None, batch_mode=False, display_svg=None, display_head=1 ,document_download=None, document_save=1, 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>
......
...@@ -28,7 +28,6 @@ return context.Base_viewAsLetter( ...@@ -28,7 +28,6 @@ return context.Base_viewAsLetter(
format=format, format=format,
display_head=display_head, display_head=display_head,
display_svg=display_svg, display_svg=display_svg,
display_source_address=display_source_address,
override_source_organisation_title=override_source_organisation_title, override_source_organisation_title=override_source_organisation_title,
override_source_person_title=override_source_person_title, override_source_person_title=override_source_person_title,
override_destination_organisation_title=override_destination_organisation_title, override_destination_organisation_title=override_destination_organisation_title,
......
...@@ -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=None, display_source_address=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter=\'right\', display_sender_company_above_recipient=0,destination_position_padding_left=\'100px\',**kw</string> </value> <value> <string>format=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter=\'right\', display_sender_company_above_recipient=0,destination_position_padding_left=\'100px\',**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
<list> <list>
<string>my_preferred_corporate_identity_template_default_organisation_relative_url</string> <string>my_preferred_corporate_identity_template_default_organisation_relative_url</string>
<string>my_preferred_corporate_identity_template_default_theme</string> <string>my_preferred_corporate_identity_template_default_theme</string>
<string>my_preferred_corporate_identity_template_default_logo_prefix</string>
<string>my_preferred_corporate_identity_template_theme_css_relative_url</string> <string>my_preferred_corporate_identity_template_theme_css_relative_url</string>
<string>my_preferred_corporate_identity_template_fallback_logo_absolute_url</string> <string>my_preferred_corporate_identity_template_fallback_logo_absolute_url</string>
<string>my_preferred_corporate_identity_template_fallback_logo_relative_url</string> <string>my_preferred_corporate_identity_template_fallback_logo_relative_url</string>
......
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>default</string>
<string>description</string> <string>description</string>
<string>display_width</string>
<string>title</string> <string>title</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>display_source_address</string> </value> <value> <string>my_preferred_corporate_identity_template_default_logo_prefix</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -51,9 +51,15 @@ ...@@ -51,9 +51,15 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>default</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -74,16 +80,16 @@ ...@@ -74,16 +80,16 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>default</string> </key> <key> <string>description</string> </key>
<value> <int>0</int> </value> <value> <string>Prefix used loading theme related logos.</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>display_width</string> </key>
<value> <string>Display sender address in address window.</string> </value> <value> <int>30</int> </value>
</item> </item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value> <value> <string>my_string_field</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
...@@ -91,7 +97,7 @@ ...@@ -91,7 +97,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Display Source Address</string> </value> <value> <string>Default Logo Prefix</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
...@@ -99,4 +105,17 @@ ...@@ -99,4 +105,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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: preferences.getPreference(\'preferred_string_field_width\', 30)</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -78,10 +78,9 @@ if context.getPortalType() in ["Presentation"]: ...@@ -78,10 +78,9 @@ if context.getPortalType() in ["Presentation"]:
# slideshow will contain <header>, <content>, <header>, <content>... # slideshow will contain <header>, <content>, <header>, <content>...
# so we need to go through it two-slides at a time to assemble # so we need to go through it two-slides at a time to assemble
# slides # slides
slide_iter = iter(slideshow) for index in range(0, len(slideshow),2):
for slide in slide_iter: slide_1st = slideshow[index]
slide_1st = slide slide_2nd = slideshow[index+1]
slide_2nd = next(slide_iter)
# we don't know whether header is on first or second position # we don't know whether header is on first or second position
if '<h1' not in slide_1st[1]: if '<h1' not in slide_1st[1]:
...@@ -97,4 +96,4 @@ if context.getPortalType() in ["Presentation"]: ...@@ -97,4 +96,4 @@ if context.getPortalType() in ["Presentation"]:
output = output + section_start + go_1st + go_2nd + section_end output = output + section_start + go_1st + go_2nd + section_end
kw["remote_content"] = output kw["remote_content"] = output
return context.WebPage_viewAsSlideshowWIP(*args, **kw) return context.WebPage_viewAsSlideshow(*args, **kw)
...@@ -27,6 +27,7 @@ def digestCaption(my_caption, my_caption_title, my_count, my_shift): ...@@ -27,6 +27,7 @@ def digestCaption(my_caption, my_caption_title, my_count, my_shift):
if match_doubles.get(my_caption_title, None) is None: if match_doubles.get(my_caption_title, None) is None:
match_doubles[my_caption_title] = my_count match_doubles[my_caption_title] = my_count
caption_relevant_count = my_count caption_relevant_count = my_count
my_count += 1
else: else:
caption_relevant_count = match_doubles[my_caption_title] caption_relevant_count = match_doubles[my_caption_title]
caption_id = caption_abbreviation + "-" + str(caption_relevant_count) caption_id = caption_abbreviation + "-" + str(caption_relevant_count)
...@@ -41,7 +42,6 @@ def digestCaption(my_caption, my_caption_title, my_count, my_shift): ...@@ -41,7 +42,6 @@ def digestCaption(my_caption, my_caption_title, my_count, my_shift):
my_shift my_shift
) )
caption_list.append(caption_dict) caption_list.append(caption_dict)
my_count = my_count + 1
return my_count return my_count
# XXX single quotes? # XXX single quotes?
......
...@@ -12,22 +12,16 @@ import re ...@@ -12,22 +12,16 @@ import re
blank = "" blank = ""
for link in re.findall('([^[]<a.*?</a>[^]])', doc_content or blank): for link in re.findall('([^[]<a.*?</a>[^]])', doc_content or blank):
link_reference_list = re.findall('href=\"(.*?)\"', link) link_reference_list = re.findall('href=\"(.*?)\"', link)
if len(link_reference_list) == 0: if link_reference_list:
link_reference = re.findall("href=\'(.*?)\'", link)
if len(link_reference_list) == 0:
link_reference = None
else:
link_reference = link_reference_list[0] link_reference = link_reference_list[0]
if link_reference.find("report=") > -1: if link_reference.find("report=") == -1:
link_reference = None # only internal references can be embedded
if link_reference.lower().find("http") == -1:
# only internal references can be embedded try:
if link_reference is not None and link_reference.find("http") == -1: link_doc = context.restrictedTraverse(link_reference.split("?")[0])
try: doc_content = doc_content.replace(link, link_doc.asStrippedHTML())
link_doc = context.restrictedTraverse(link_reference.split("?")[0]) except LookupError:
doc_content = doc_content.replace(link, link_doc.asStrippedHTML()) raise LookupError(link_reference)
except LookupError:
raise LookupError(link_reference)
doc_content = doc_content.replace("${related_subject_list}", blank) doc_content = doc_content.replace("${related_subject_list}", blank)
doc_content = doc_content.replace("${table_of_content", blank) doc_content = doc_content.replace("${table_of_content", blank)
......
...@@ -13,45 +13,40 @@ import re ...@@ -13,45 +13,40 @@ import re
document = context document = context
# backcompat # backcompat, example: WebPage_insertFollowUpCostEffortReport
def getReportViaFancyName(my_report_name): def getReportViaFancyName(my_report_name, follow_up):
for follow_up in document_required_follow_up_list: #report_name = follow_up.split("insertFollowUp").pop().split("Report")[0]
#report_name = follow_up.split("insertFollowUp").pop().split("Report")[0] report_name = my_report_name.split("insertFollowUp").pop().split("Report")[0]
report_name = my_report_name.split("insertFollowUp").pop().split("Report")[0] detail_name = "Detail" in report_name
detail_name = "Detail" in report_name coverage_name = "Coverage" in report_name
coverage_name = "Coverage" in report_name # extra curl: CostEffortReport requires format (base|detailed)
if detail_name:
# extra curl: CostEffortReport requires format (base|detailed) report_name = report_name.replace("Detail", "")
#method_name = ''.join(['Base_render', report_name, 'TextDocumentReportAsHtml'])
method_name = ''.join(['Base_generate', report_name, 'Report'])
method_call = getattr(follow_up, method_name)
if method_call is not None:
# extra curl: Coverage report requires parameter details (1|0)
if coverage_name:
return method_call(comment_visibility=True)[0].encode(encoding='UTF-8')
if detail_name: if detail_name:
report_name = report_name.replace("Detail", "") return method_call(format='detailed',display_detail = 1)[0].encode(encoding='UTF-8')
return method_call()[0].encode(encoding='UTF-8')
#method_name = ''.join(['Base_render', report_name, 'TextDocumentReportAsHtml'])
method_name = ''.join(['Base_generate', report_name, 'Report'])
method_call = getattr(follow_up, method_name)
if method_call is not None:
# extra curl: Coverage report requires parameter details (1|0)
if coverage_name:
return method_call(comment_visibility=True)[0].encode(encoding='UTF-8')
elif detail_name:
return method_call(format='detailed',display_detail = 1)[0].encode(encoding='UTF-8')
else:
return method_call()[0].encode(encoding='UTF-8')
if (doc_content.find('${WebPage_')): if doc_content.find('${WebPage_') != -1:
document_allowed_portal_type_list = ["Project", "Sale Opportunity", "Sale Order"]
document_required_follow_up_list = [x.getObject() for x in document.portal_catalog( document_required_follow_up_list = [x.getObject() for x in document.portal_catalog(
portal_type=document_allowed_portal_type_list, portal_type=["Project", "Sale Opportunity", "Sale Order"],
follow_up_related_uid=document.getUid(), follow_up_related_uid=document.getUid(),
limit=1 limit=1
)] )]
substitution_list = re.findall(r'\${WebPage_(.*)}', doc_content) if document_required_follow_up_list:
for substitution_report in substitution_list: substitution_list = re.findall(r'\${WebPage_(.*)}', doc_content)
if substitution_report == 'insertTableOfReferences': for substitution_report in substitution_list:
continue if substitution_report == 'insertTableOfReferences':
placeholder = ''.join(['${WebPage_', substitution_report, '}']) continue
substitution_content = getReportViaFancyName(substitution_report) substitution_content = getReportViaFancyName(substitution_report, document_required_follow_up_list[0])
doc_content = doc_content.replace(placeholder, substitution_content) if substitution_content:
doc_content = doc_content.replace('${WebPage_%s}' % substitution_report, substitution_content)
# new handler # new handler
# fetch reports same way as embedding documents = via links, like: # fetch reports same way as embedding documents = via links, like:
...@@ -60,41 +55,34 @@ if (doc_content.find('${WebPage_')): ...@@ -60,41 +55,34 @@ if (doc_content.find('${WebPage_')):
# call it with the parameters provided # call it with the parameters provided
for link in re.findall('([^[]<a.*?</a>[^]])', doc_content): for link in re.findall('([^[]<a.*?</a>[^]])', doc_content):
link_reference = None
link_reference_list = re.findall('href=\"(.*?)\"', link) link_reference_list = re.findall('href=\"(.*?)\"', link)
if len(link_reference_list) == 0: if link_reference_list:
link_reference = re.findall("href=\'(.*?)\'", link)
if len(link_reference_list) == 0:
link_reference = None
if len(link_reference_list) > 0:
link_reference = link_reference_list[0] link_reference = link_reference_list[0]
if link_reference is not None and link_reference.find("report=") > -1:
# url for report, check if report can be found.
report_name = None
link_split = link_reference.split("?")
if len(link_split) > 1:
link_relative_url = link_split[0]
link_param_list = link_split[1].replace("&amp;", "&").split("&")
link_param_dict = {}
link_param_dict["document_language"] = doc_language
link_param_dict["format"] = doc_format
for param in link_param_list:
param_key, param_value = param.split("=")
if param_key == "report":
report_name = param_value
else:
link_param_dict[param_key] = param_value
if link_reference is not None and link_reference.find("report=") > -1: # XXX report must be callable directly and generate the full output
if report_name is not None:
# url for report, check if report can be found. target_context = document.restrictedTraverse(link_relative_url, None)
report_name = None if target_context is not None:
link_split = link_reference.split("?") target_caller = getattr(target_context, report_name, None)
if len(link_split) > 1: if target_caller is not None:
link_relative_url = link_split[0] substitution_content = target_caller(**link_param_dict)
link_param_list = link_split[1].replace("&amp;", "&").split("&") # Note: switched to report returning a tuple with (content, header-title, header-subtitle)
link_param_dict = {} doc_content = doc_content.replace(link, substitution_content[0].encode("utf-8").strip())
link_param_dict["document_language"] = doc_language
link_param_dict["format"] = doc_format
for param in link_param_list:
param_key, param_value = param.split("=")
if param_key == "report":
report_name = param_value
else:
link_param_dict[param_key] = param_value
# XXX report must be callable directly and generate the full output
if report_name is not None:
target_context = document.restrictedTraverse(link_relative_url, None)
if target_context is not None:
target_caller = getattr(target_context, report_name, None)
if target_caller is not None:
substitution_content = target_caller(**link_param_dict)
# Note: switched to report returning a tuple with (content, header-title, header-subtitle)
doc_content = doc_content.replace(link, substitution_content[0].encode("utf-8").strip())
return doc_content return doc_content
...@@ -28,7 +28,6 @@ return context.WebPage_viewAsLetter( ...@@ -28,7 +28,6 @@ return context.WebPage_viewAsLetter(
format=format, format=format,
display_head=display_head, display_head=display_head,
display_svg=display_svg, display_svg=display_svg,
display_source_address=display_source_address,
override_source_organisation_title=override_source_organisation_title, override_source_organisation_title=override_source_organisation_title,
override_source_person_title=override_source_person_title, override_source_person_title=override_source_person_title,
override_destination_organisation_title=override_destination_organisation_title, override_destination_organisation_title=override_destination_organisation_title,
......
...@@ -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="html", display_source_address=None, display_head=1, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=0, destination_position_padding_left=\'100px\',letter_header_margin_to_top=26,**kw</string> </value> <value> <string>format="html", display_head=1, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=0, destination_position_padding_left=\'100px\',letter_header_margin_to_top=26,**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -42,7 +42,6 @@ if dialog_id is not None: ...@@ -42,7 +42,6 @@ if dialog_id is not None:
format=format, format=format,
display_head=display_head, display_head=display_head,
display_svg=display_svg, display_svg=display_svg,
display_source_address=display_source_address,
document_download=document_download, document_download=document_download,
document_save=document_save, document_save=document_save,
destination_position_in_letter = destination_position_in_letter, destination_position_in_letter = destination_position_in_letter,
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>override_source_organisation_title=None, display_source_address=None, display_svg=None,document_download=None, document_save=None, dialog_id=None, cancel_url=None, portal_skin=None,display_head=None, format=None, override_date=None, override_destination_person_title=None, override_source_person_title=None,override_destination_organisation_title=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=None,destination_position_padding_left=\'100px\',letter_header_margin_to_top=26,*args,**kw</string> </value> <value> <string>override_source_organisation_title=None, display_svg=None,document_download=None, document_save=None, dialog_id=None, cancel_url=None, portal_skin=None,display_head=None, format=None, override_date=None, override_destination_person_title=None, override_source_person_title=None,override_destination_organisation_title=None, destination_position_in_letter = \'right\', display_sender_company_above_recipient=None,destination_position_padding_left=\'100px\',letter_header_margin_to_top=26,*args,**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -12,7 +12,6 @@ Upgrade image for the specific type of display ...@@ -12,7 +12,6 @@ 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 zExceptions import NotFound
if img_string is None or img_string == "": if img_string is None or img_string == "":
return img_string return img_string
...@@ -25,32 +24,26 @@ img_src = img_src[0] ...@@ -25,32 +24,26 @@ img_src = img_src[0]
if img_src.startswith('data:image/'): if img_src.startswith('data:image/'):
return img_string return img_string
img_type = None
# START user ignoring guidelines: # START user ignoring guidelines:
validation_freebie = None
new_src = None new_src = None
# Guideline: no relative links. we cover # Guideline: no relative links. we cover
if img_src.startswith("./"): if img_src.startswith("./"):
new_src = img_src.replace("./", "") new_src = img_src.replace("./", "")
img_string = img_string.replace(img_src, new_src) img_string = img_string.replace(img_src, new_src)
img_src = new_src
# Guideline: include format. we cover # Guideline: include format. we cover
img_src = new_src or img_src
if img_src.find("format=") == -1: if img_src.find("format=") == -1:
if img_src.find("?") == -1: if img_src.find("?") == -1:
new_src = img_src + "?format=" new_src = img_src + "?format="
else: else:
new_src = img_src + "&amp;format=" new_src = img_src + "&amp;format="
img_string = img_string.replace(img_src, new_src) img_string = img_string.replace(img_src, new_src)
img_src = new_src
# Guideline: images must be stored locally, don't complain if your pdf breaks # Guideline: images must be stored locally, don't complain if your pdf breaks
img_src = new_src or img_src if not img_src.lower().startswith("http"):
if img_src.startswith("http"):
validation_freebie = True
if validation_freebie is None:
#END user ignoring guidelines #END user ignoring guidelines
if img_src[0] == '/': if img_src[0] == '/':
img_src = img_src[1:] img_src = img_src[1:]
...@@ -58,21 +51,20 @@ if validation_freebie is None: ...@@ -58,21 +51,20 @@ if validation_freebie is None:
# flag broken link until further notice # flag broken link until further notice
if img_obj is None: if img_obj is None:
raise NotFound('The following image could not be found in erp5 OR is not following guidelines for links (eg no ./ prefix): %s' % (img_src.split("?")[0])) return '<p style="color:red">The following image could not be found in erp5 OR is not following guidelines for links (eg no ./ prefix): <span style="font-weight:bold">%s</span></p>' % (img_src.split("?")[0])
img_type = img_obj.getContentType()
# ensure alt attributes are set # ensure alt attributes are set
if img_string.find('alt=') == -1: if img_string.find('alt=') == -1:
img_string.replace ("src=", 'alt="%s" src=' % img_caption or img_obj.getTitle()) img_string.replace ("src=", 'alt="%s" src=' % img_caption or img_obj.getTitle())
img_type = img_obj.getContentType()
# force svg display as svg or png # force svg display as svg or png
if img_type == "image/svg+xml": if img_type == "image/svg+xml":
if img_svg_format == "png" or img_svg_format is None: if img_svg_format == "png":
img_string = img_string.replace('type="image/svg+xml"', '') img_string = img_string.replace('type="image/svg+xml"', '')
img_string = img_string.replace("type='image/svg+xml'", '') img_string = img_string.replace("type='image/svg+xml'", '')
img_string = img_string.replace('format=svg', 'format=png') img_string = img_string.replace('format=svg', 'format=png')
if img_svg_format == "svg": elif img_svg_format == "svg":
img_string = img_string.replace('src=', 'type="image/svg+xml" src=') img_string = img_string.replace('src=', 'type="image/svg+xml" src=')
img_string = img_string.replace('src=', "type='image/svg+xml' src=") img_string = img_string.replace('src=', "type='image/svg+xml' src=")
img_string = img_string.replace('format=png', 'format=svg') img_string = img_string.replace('format=png', 'format=svg')
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>img_string=None, img_wrap=None, img_svg_format=None, img_fullscreen_link=None, img_caption=None</string> </value> <value> <string>img_string=None, img_wrap=None, img_svg_format="png", img_fullscreen_link=None, img_caption=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -40,10 +40,6 @@ from base64 import b64encode ...@@ -40,10 +40,6 @@ from base64 import b64encode
blank = '' blank = ''
pref = context.getPortalObject().portal_preferences pref = context.getPortalObject().portal_preferences
# ------------------ HTML cleanup/converter methods ----------------------------
def translateText(snip):
return book_localiser.erp5_ui.gettext(snip, lang=book_language).encode('UTF-8').strip()
# -------------------------- Setup --------------------------------------------- # -------------------------- Setup ---------------------------------------------
book = context book = context
book_format = kw.get('format') or 'html' book_format = kw.get('format') or 'html'
...@@ -51,7 +47,7 @@ book_download = int(kw.get('document_download') or 0) ...@@ -51,7 +47,7 @@ book_download = int(kw.get('document_download') or 0)
book_save = int(kw.get('document_save') or 0) book_save = int(kw.get('document_save') or 0)
book_display_svg = kw.get('display_svg') or 'png' book_display_svg = kw.get('display_svg') or 'png'
book_include_content_table = int(kw.get('include_content_table') or 1) book_include_content_table = int(kw.get('include_content_table') or 0)
book_include_history_table = int(kw.get('include_history_table') or 0) book_include_history_table = int(kw.get('include_history_table') or 0)
book_include_reference_table = int(kw.get('include_reference_table') or 0) book_include_reference_table = int(kw.get('include_reference_table') or 0)
book_include_linked_content = int(kw.get('include_linked_content') or 0) book_include_linked_content = int(kw.get('include_linked_content') or 0)
...@@ -69,7 +65,6 @@ override_logo_reference = kw.get('override_logo_reference') ...@@ -69,7 +65,6 @@ override_logo_reference = kw.get('override_logo_reference')
override_batch_mode = kw.get('batch_mode') override_batch_mode = kw.get('batch_mode')
# -------------------------- Document Parameters ------------------------------ # -------------------------- Document Parameters ------------------------------
book_localiser = book.getPortalObject().Localizer
book_relative_url = book.getRelativeUrl() book_relative_url = book.getRelativeUrl()
book_prefix = pref.getPreferredCorporateIdentityTemplateBookDocumentPrefix() or "Book." book_prefix = pref.getPreferredCorporateIdentityTemplateBookDocumentPrefix() or "Book."
book_rendering_fix = book.WebPage_getPdfOutputRenderingFix() or blank book_rendering_fix = book.WebPage_getPdfOutputRenderingFix() or blank
...@@ -96,11 +91,12 @@ if override_batch_mode: ...@@ -96,11 +91,12 @@ if override_batch_mode:
book_revision = "1" book_revision = "1"
book_short_date = book_modification_date.strftime('%Y-%m-%d') book_short_date = book_modification_date.strftime('%Y-%m-%d')
if book_language and book_language != blank: if book_language:
book.REQUEST['AcceptLanguage'].set(book_language, 10) book.REQUEST['AcceptLanguage'].set(book_language, 10)
else: else:
book_language = blank book_language = blank
if book_reference is None:
if not book_reference:
book_reference = book_prefix + book_title.replace(" ", ".") book_reference = book_prefix + book_title.replace(" ", ".")
book_full_reference = '-'.join([book_reference, book_version, book_language]) book_full_reference = '-'.join([book_reference, book_version, book_language])
...@@ -136,11 +132,11 @@ if book_include_history_table: ...@@ -136,11 +132,11 @@ if book_include_history_table:
book_version_list = [] book_version_list = []
book_distribution_list = [] book_distribution_list = []
# old generate book # old generate book, this embed link like <a href="Template.Test.Book.Embeddable.Document">This link should be embedded</a>
if book_include_linked_content: if book_include_linked_content:
book_content = book.WebPage_embedLinkedDocumentList(doc_content=book_content) book_content = book.WebPage_embedLinkedDocumentList(doc_content=book_content)
# embed reports # embed reports, link like <a href="project_module/1234?report=bam>, which has report=
if book_include_report_content: if book_include_report_content:
book_report_css_list = pref.getPreferredCorporateIdentityTemplateReportCssList() or [] book_report_css_list = pref.getPreferredCorporateIdentityTemplateReportCssList() or []
book_report_js_list = pref.getPreferredCorporateIdentityTemplateReportJsList() or [] book_report_js_list = pref.getPreferredCorporateIdentityTemplateReportJsList() or []
...@@ -153,19 +149,19 @@ if book_include_reference_table: ...@@ -153,19 +149,19 @@ if book_include_reference_table:
image_link_list = book.WebPage_createImageOverview(book_content) image_link_list = book.WebPage_createImageOverview(book_content)
for referenced_document in book_link_list.get("reference_list", []): for referenced_document in book_link_list.get("reference_list", []):
book_reference_list.append(referenced_document.get("item")) book_reference_list.append(referenced_document.get("item"))
book_content = book_content.replace(referenced_document.get("input"), referenced_document.get("output")) book_content = book_content.replace(referenced_document.get("input"), referenced_document.get("output"),1)
for applicable_document in book_link_list.get("applicable_list", []): for applicable_document in book_link_list.get("applicable_list", []):
book_applicable_document_list.append(applicable_document.get("item")) book_applicable_document_list.append(applicable_document.get("item"))
book_content = book_content.replace(applicable_document.get("input"), applicable_document.get("output")) book_content = book_content.replace(applicable_document.get("input"), applicable_document.get("output"),1)
for abbreviation in book_link_list.get("abbreviation_list", []): for abbreviation in book_link_list.get("abbreviation_list", []):
book_abbreviation_list.append(abbreviation.get("item")) book_abbreviation_list.append(abbreviation.get("item"))
book_content = book_content.replace(abbreviation.get("input"), abbreviation.get("output")) book_content = book_content.replace(abbreviation.get("input"), abbreviation.get("output"),1)
for figure in image_link_list.get("figure_list", []): for figure in image_link_list.get("figure_list", []):
book_image_list.append(figure.get("item")) book_image_list.append(figure.get("item"))
book_content = book_content.replace(figure.get("input"), figure.get("output")) book_content = book_content.replace(figure.get("input"), figure.get("output"), 1)
for table in table_link_list.get("table_list", []): for table in table_link_list.get("table_list", []):
book_table_list.append(table.get("item")) book_table_list.append(table.get("item"))
book_content = book_content.replace(table.get("input"), table.get("output")) book_content = book_content.replace(table.get("input"), table.get("output"), 1)
# in order for the reference tables to be in the table of content, they must # in order for the reference tables to be in the table of content, they must
# be added beforehand to content # be added beforehand to content
...@@ -193,6 +189,7 @@ if book_include_reference_table: ...@@ -193,6 +189,7 @@ if book_include_reference_table:
# book_content = book_content.replace(book_history_section_list[-1], (book_history_section_list[-1] + book_references.encode('UTF-8').strip())) # book_content = book_content.replace(book_history_section_list[-1], (book_history_section_list[-1] + book_references.encode('UTF-8').strip()))
#else: #else:
# book_content = book_content.replace("${WebPage_insertTableOfReferences}", book_references.encode('UTF-8').strip()) # book_content = book_content.replace("${WebPage_insertTableOfReferences}", book_references.encode('UTF-8').strip())
book_references = book.Base_unescape(book_references)
book_content = book_content.replace("${WebPage_insertTableOfReferences}", book_references.encode('UTF-8').strip()) book_content = book_content.replace("${WebPage_insertTableOfReferences}", book_references.encode('UTF-8').strip())
else: else:
book_content = book_content.replace("${WebPage_insertTableOfReferences}", blank) book_content = book_content.replace("${WebPage_insertTableOfReferences}", blank)
...@@ -200,7 +197,7 @@ else: ...@@ -200,7 +197,7 @@ else:
# table of content has to be created manually to run over everything that # table of content has to be created manually to run over everything that
# should be indexed in the toc # should be indexed in the toc
if book_include_content_table: if book_include_content_table:
book_translated_toc_title = translateText("Table of Contents") book_translated_toc_title = context.Base_translateString("Table of Contents", lang=book_language)
if book_format == "pdf": if book_format == "pdf":
book_table_of_content = book.WebPage_createBookXslTableOfContent( book_table_of_content = book.WebPage_createBookXslTableOfContent(
book_toc_title=book_translated_toc_title, book_toc_title=book_translated_toc_title,
...@@ -270,11 +267,10 @@ if book_format == "html" or book_format == "mhtml": ...@@ -270,11 +267,10 @@ if book_format == "html" or book_format == "mhtml":
doc_html_file=book_output doc_html_file=book_output
) )
if book_format == "mhtml": return book.Base_convertHtmlToSingleFile(book_output, allow_script=True)
return book.Base_convertHtmlToSingleFile(book_output, allow_script=True)
# ============================= Format: pdf ==================================== # ============================= Format: pdf ====================================
if book_format == "pdf": elif book_format == "pdf":
book_cover = book.WebPage_createBookCover( book_cover = book.WebPage_createBookCover(
book_theme=book_theme.get("theme"), book_theme=book_theme.get("theme"),
book_title=book_title, book_title=book_title,
......
...@@ -42,7 +42,7 @@ leaflet_format = kw.get('format') or 'html' ...@@ -42,7 +42,7 @@ leaflet_format = kw.get('format') or 'html'
leaflet_display_svg = kw.get('display_svg') or "png" leaflet_display_svg = kw.get('display_svg') or "png"
leaflet_download = int(kw.get('document_download') or 0) leaflet_download = int(kw.get('document_download') or 0)
leaflet_save = int(kw.get('document_save') or 0) leaflet_save = int(kw.get('document_save') or 0)
leaflet_display_side = int(kw.get('display_side') or 1) leaflet_display_side = int(kw.get('display_side') or 0)
override_leaflet_header_title = kw.get('override_leaflet_header_title') override_leaflet_header_title = kw.get('override_leaflet_header_title')
override_source_person_title = kw.get('override_source_person_title', None) override_source_person_title = kw.get('override_source_person_title', None)
......
...@@ -28,7 +28,6 @@ return context.Base_viewAsLetter( ...@@ -28,7 +28,6 @@ return context.Base_viewAsLetter(
format=format, format=format,
display_head=display_head, display_head=display_head,
display_svg=display_svg, display_svg=display_svg,
display_source_address=display_source_address,
override_source_organisation_title=override_source_organisation_title, override_source_organisation_title=override_source_organisation_title,
override_source_person_title=override_source_person_title, override_source_person_title=override_source_person_title,
override_destination_organisation_title=override_destination_organisation_title, override_destination_organisation_title=override_destination_organisation_title,
......
...@@ -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=None, display_source_address=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter = \'right\',display_sender_company_above_recipient=0,destination_position_padding_left=\'100px\',letter_header_margin_to_top=26,**kw</string> </value> <value> <string>format=None, display_head=None, display_svg=None, batch_mode=False, document_download=None, document_save=None, override_source_organisation_title=None,override_source_person_title=None,override_destination_organisation_title=None,override_destination_person_title=None,override_date=None,destination_position_in_letter = \'right\',display_sender_company_above_recipient=0,destination_position_padding_left=\'100px\',letter_header_margin_to_top=26,**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -105,13 +105,8 @@ def removeLineBreaks(my_content): ...@@ -105,13 +105,8 @@ def removeLineBreaks(my_content):
def splitMultipleDetails(my_content): def splitMultipleDetails(my_content):
for slide in getSlideDetailsList(my_content): for slide in getSlideDetailsList(my_content):
detail_list = getDetailsList(slide) detail_list = getDetailsList(slide)
detail_list_len = len(detail_list) for detail in detail_list[:-1]:
if detail_list_len > 1: my_content = my_content.replace(detail, ''.join([detail, details_separator]))
counter = 0
for detail in detail_list:
counter += 1
if counter < (detail_list_len):
my_content = my_content.replace(detail, ''.join([detail, details_separator]))
return my_content return my_content
#def removeSlidesWithoutDetailsFromNotes(my_content): #def removeSlidesWithoutDetailsFromNotes(my_content):
...@@ -143,11 +138,12 @@ def removeEmptyDetails(my_content): ...@@ -143,11 +138,12 @@ def removeEmptyDetails(my_content):
return content return content
def addLastSlide(my_last_slide): def addLastSlide(my_last_slide):
# XXXX This condition is not accurate
if my_last_slide.count("<div") != 2: if my_last_slide.count("<div") != 2:
last_slide_relative_url = pref.getPreferredCorporateIdentityTemplateSlideLastSlideRelativeUrl() or None last_slide_relative_url = pref.getPreferredCorporateIdentityTemplateSlideLastSlideRelativeUrl()
if last_slide_relative_url: if last_slide_relative_url:
# try: # try:
last_slide = doc.restrictedTraverse(last_slide_relative_url) or None last_slide = doc.restrictedTraverse(last_slide_relative_url)
if last_slide is not None: if last_slide is not None:
return last_slide.getTextContent() return last_slide.getTextContent()
#except AttributeError: #except AttributeError:
...@@ -183,8 +179,6 @@ if doc_is_slideshow is None: ...@@ -183,8 +179,6 @@ if doc_is_slideshow is None:
doc_upgraded_content = setH1AndH2AsSlideHeaders(doc_upgraded_content) doc_upgraded_content = setH1AndH2AsSlideHeaders(doc_upgraded_content)
doc_upgraded_content = removeLineBreaks(doc_upgraded_content) doc_upgraded_content = removeLineBreaks(doc_upgraded_content)
doc_content = blank
last_slide_content = blank
section_start = '<section>' section_start = '<section>'
details_start = '<details open="open">' details_start = '<details open="open">'
details_end = '</details>' details_end = '</details>'
...@@ -204,6 +198,7 @@ if doc_is_slideshow is None: ...@@ -204,6 +198,7 @@ if doc_is_slideshow is None:
# fake_slide_list will be <h1>,<content>,<h1>,<content> so we need to go # fake_slide_list will be <h1>,<content>,<h1>,<content> so we need to go
# over two items at a time # over two items at a time
doc_slide_iter = iter(fake_slide_list) doc_slide_iter = iter(fake_slide_list)
doc_content = blank
for x in doc_slide_iter: for x in doc_slide_iter:
slide_header = x slide_header = x
...@@ -323,8 +318,8 @@ if getDetails(doc_content) > -1: ...@@ -323,8 +318,8 @@ if getDetails(doc_content) > -1:
# XXX split content above 1600 chars into multiple details tags? # XXX split content above 1600 chars into multiple details tags?
doc_content = doc_content.replace(slide, details) doc_content = doc_content.replace(slide, details)
# ======================== Format: html/mhtml ================================== # ======================== Format: html ==================================
if doc_format == "html": #or doc_format == "mhtml": if doc_format == "html":
doc_output = doc.WebPage_createSlideshow( doc_output = doc.WebPage_createSlideshow(
doc_format=doc_format, doc_format=doc_format,
doc_theme=doc_theme.get("theme"), doc_theme=doc_theme.get("theme"),
...@@ -343,25 +338,21 @@ if doc_format == "html": #or doc_format == "mhtml": ...@@ -343,25 +338,21 @@ if doc_format == "html": #or doc_format == "mhtml":
doc_content=doc_content doc_content=doc_content
) )
if doc_format == "html": return doc.Base_finishWebPageCreation(
return doc.Base_finishWebPageCreation( doc_download=doc_download,
doc_download=doc_download, doc_save=doc_save,
doc_save=doc_save, doc_version=doc_version,
doc_version=doc_version, doc_title=doc_title,
doc_title=doc_title, doc_relative_url=doc_relative_url,
doc_relative_url=doc_relative_url, doc_aggregate_list=doc_aggregate_list,
doc_aggregate_list=doc_aggregate_list, doc_language=doc_language,
doc_language=doc_language, doc_modification_date=doc_modification_date,
doc_modification_date=doc_modification_date, doc_reference=doc_reference,
doc_reference=doc_reference, doc_full_reference=doc_full_reference,
doc_full_reference=doc_full_reference, doc_html_file=doc_output
doc_html_file=doc_output )
)
if doc_format == "mhtml":
context.REQUEST.RESPONSE.setHeader("Content-Type", "text/html;")
return doc.Base_convertHtmlToSingleFile(doc_output, allow_script=True)
# ============================= Format: pdf ==================================== # ============================= Format: pdf/mhtml ====================================
if doc_format == "pdf" or doc_format == "mhtml": if doc_format == "pdf" or doc_format == "mhtml":
doc_slideshow_footer = doc.WebPage_createSlideshowFooter( doc_slideshow_footer = doc.WebPage_createSlideshowFooter(
doc_format=doc_format, doc_format=doc_format,
...@@ -390,20 +381,9 @@ if doc_format == "pdf" or doc_format == "mhtml": ...@@ -390,20 +381,9 @@ if doc_format == "pdf" or doc_format == "mhtml":
doc_css=doc_css, doc_css=doc_css,
doc_orientation="ci-orientation-portrait" if doc_display_notes else "ci-corientation-landscape" doc_orientation="ci-orientation-portrait" if doc_display_notes else "ci-corientation-landscape"
) )
# outputting just the content requires to drop wrapping <divs> (reveal/slides) # outputting just the content requires to drop wrapping <divs> (reveal/slides)
# and add extra css to recreate the same layout. so a separate output=content # and add extra css to recreate the same layout. so a separate output=content
# instead of defaulting to None # instead of defaulting to None
# doc_slideshow_content = doc.WebPage_createSlideshowContent(
# doc_format=doc_format,
# doc_theme=doc_theme.get("theme"),
# doc_title=doc_title,
# doc_language=doc_language,
# doc_template_css_url=doc_theme.get("template_css_url"),
# doc_theme_css_font_list=doc_theme.get("theme_css_font_list"),
# doc_theme_css_url=doc_theme.get("theme_css_url"),
# doc_content=doc_content
#)
if doc_display_notes: if doc_display_notes:
doc_slideshow_notes = doc.WebPage_createSlideshowNotes( doc_slideshow_notes = doc.WebPage_createSlideshowNotes(
doc_format=doc_format, doc_format=doc_format,
......
...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
<string>portal_skin</string> <string>portal_skin</string>
<string>display_head</string> <string>display_head</string>
<string>letter_header_margin_to_top</string> <string>letter_header_margin_to_top</string>
<string>display_source_address</string>
<string>display_sender_company_above_recipient</string> <string>display_sender_company_above_recipient</string>
<string>display_svg</string> <string>display_svg</string>
<string>document_save</string> <string>document_save</string>
......
...@@ -301,7 +301,7 @@ ...@@ -301,7 +301,7 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
python: \'<iframe width="100%%" height="500" style="background-color:#FFFFFF;box-sizing:border-box;-wekbit-box-sizing:border-box;" src="%s/WebPage_viewAsWeb?portal_skin=Letter&amp;override_source_person_title=%s&amp;override_source_organisation_title=%s&amp;override_destination_person_title=%s&amp;override_destination_organisation_title=%s&amp;display_head=%s&amp;override_date=%s&amp;display_source_address=%s&amp;display_svg=%s&amp;destination_position_in_letter=%s&amp;display_sender_company_above_recipient=%s&amp;destination_position_padding_left=%s" name="default_version"></iframe>\' % (context.absolute_url(), context.REQUEST.get("override_source_person_title", ""), context.REQUEST.get("override_source_organisation_title", ""), context.REQUEST.get("override_destination_person_title", ""), context.REQUEST.get("override_destination_organisation_title", ""), context.REQUEST.get("display_head", 1), context.REQUEST.get("override_date", ""), context.REQUEST.get("display_source_address", 0), context.REQUEST.get("display_svg", "png"), context.REQUEST.get("destination_position_in_letter", "right"), context.REQUEST.get("display_sender_company_above_recipient", 0), context.REQUEST.get(\'destination_position_padding_left\', \'100px\')) 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_svg=%s&amp;destination_position_in_letter=%s&amp;display_sender_company_above_recipient=%s&amp;destination_position_padding_left=%s" name="default_version"></iframe>\' % (context.absolute_url(), context.REQUEST.get("override_source_person_title", ""), context.REQUEST.get("override_source_organisation_title", ""), context.REQUEST.get("override_destination_person_title", ""), context.REQUEST.get("override_destination_organisation_title", ""), context.REQUEST.get("display_head", 1), context.REQUEST.get("override_date", ""), context.REQUEST.get("display_svg", "png"), context.REQUEST.get("destination_position_in_letter", "right"), context.REQUEST.get("display_sender_company_above_recipient", 0), context.REQUEST.get(\'destination_position_padding_left\', \'100px\'))
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -532,7 +532,7 @@ NOTE: logos will disappear in wkhtmltopdf if they go beyond the available space ...@@ -532,7 +532,7 @@ NOTE: logos will disappear in wkhtmltopdf if they go beyond the available space
.ci-book ul li, .ci-book ul li,
.ci-book ol li { .ci-book ol li {
padding-left: 16px; padding-left: 16px;
text-indent: -24px; /*text-indent: -24px;*/
} }
.ci-book ul li:before { .ci-book ul li:before {
content: "•"; content: "•";
......
...@@ -128,6 +128,7 @@ html{ ...@@ -128,6 +128,7 @@ html{
font-size: small; font-size: small;
border-bottom: 1px solid black; border-bottom: 1px solid black;
display: inline-block; display: inline-block;
margin-left: -1mm;
} }
/* === adress-right === */ /* === adress-right === */
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>602161ce4545becc5ab6757e7e5522f9</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/x-bmp</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>842</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_book_embed_report_bmp</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>595</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>0ed6524c4084a10b5fce633ad75f16d2</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/x-bmp</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>842</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_book_reference_table_unescape_bmp</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>595</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>36714bf753f927a01c4c631bdab7d825</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/x-bmp</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>595</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_convert_to_slideview_bmp</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>842</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>852236dc9379bfd4f91445fd4d01dcea</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/x-bmp</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>595</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_last_view_bmp</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>842</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>9e4f1c8416e0cfb1df66ad65f78166c9</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/x-bmp</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>842</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_leaflet_not_display_side_column_bmp</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>595</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</item> </item>
<item> <item>
<key> <string>content_md5</string> </key> <key> <string>content_md5</string> </key>
<value> <string>d1251e10d5377c3998da9757888c27b8</string> </value> <value> <string>854ac49c24a4c58b43ea3bc8c0d1bf62</string> </value>
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>616c0628cd7dc1debaed1d2558275fe3</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/x-bmp</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>842</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_letter_not_display_header_bmp</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>595</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>8dd4ece0e5b0ba3adf78433664e341ca</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/x-bmp</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>595</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_presentaion_odp_slide_view_bmp</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>842</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Image" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>8dd4ece0e5b0ba3adf78433664e341ca</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>image/x-bmp</string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>595</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_presentaion_pptx_slide_view_bmp</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Image</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>842</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Sale Opportunity" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_embed_sale_opportunity</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Sale Opportunity</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<h1>Reports</h1>
<p>
Embedding reports should work via links with a report name and subsequent parameters
specified. Reports are all custom, so if they don't exist, they will not be loaded.
</p>
<h2>Test back Reports</h2>
${WebPage_insertFollowUpCorporareIdentityTestReport}
<h2>Test Reports</h2>
<a href="sale_opportunity_module/template_test_embed_sale_opportunity?report=Base_generateCorporareIdentityTestReport&amp;test=23"></a>
<br/>
<p>
There should be reports embedded above.
</p>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>contributor/person_module/template_test_member</string>
<string>contributor/person_module/template_test_author</string>
<string>follow_up/sale_opportunity_module/template_test_embed_sale_opportunity</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Sample description</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_book_embed_reportdocument_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value> <string>Template Test Book.Embed.ReportDocument</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template Test Book.Embed.ReportDocument</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<section class="ci-book-table-of-content"><p class="ci-book-toc-faux-h1">Table of Contents</p><ol><li><div><a href="#introduction0_anchor">Introduction</div></a></li><li><div><a href="#synthese1_anchor">Synthese</div></a><ol><li><div><a href="#risks-and-measures2_anchor">Risks and measures</div></a><ol><li><div><a href="#risk-of-casualties-if-device-does-not-stop-and-destroys-itself3_anchor">Risk of casualties if device does not stop and destroys itself</div></a></li><li><div><a href="#risk-of-killing-birds-and-polluting-the-environment4_anchor">Risk of killing birds and polluting the environment</div></a></li><li><div><a href="#noise-and-vibration-levels5_anchor">Noise and vibration levels</div></a></li></ol></li></ol><li><div><a href="#reports6_anchor">Reports</div></a><ol><li><div><a href="#project-reports7_anchor">Project Reports</div></a></li><li><div><a href="#sale-order-reports8_anchor">Sale Order Reports</div></a></ol></ol></section>
<section> <section>
...@@ -204,9 +204,9 @@ ...@@ -204,9 +204,9 @@
</tbody> </tbody>
</table> </table>
</section> </section>
<h1><a name="introduction0_anchor"></a>Introduction<a class="custom-para" href=#introduction0_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1> <h1>Introduction</h1>
<h1><a name="synthese1_anchor"></a>Synthese<a class="custom-para" href=#synthese1_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1> <h1>Synthese</h1>
<p>This document is a high level overview measures taken by Foo for Bar project. </p> <p>This document is a high level overview measures taken by Foo for Bar project. </p>
<p> <p>
The purpose of this document is to show possible dangers and measures being The purpose of this document is to show possible dangers and measures being
...@@ -216,8 +216,8 @@ taken to prevent them from legal and ethics point of view. ...@@ -216,8 +216,8 @@ taken to prevent them from legal and ethics point of view.
<h2><a name="risks-and-measures2_anchor"></a>Risks and measures<a class="custom-para" href=#risks-and-measures2_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Risks and measures</h2>
<h3><a name="risk-of-casualties-if-device-does-not-stop-and-destroys-itself3_anchor"></a>Risk of casualties if device does not stop and destroys itself<a class="custom-para" href=#risk-of-casualties-if-device-does-not-stop-and-destroys-itself3_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h3> <h3>Risk of casualties if device does not stop and destroys itself</h3>
<p> <p>
When is it safe to turn off if we turn if off too early or are to risk-aversise, When is it safe to turn off if we turn if off too early or are to risk-aversise,
economic losses of the device not working can be incurred. If on the other hand economic losses of the device not working can be incurred. If on the other hand
...@@ -232,14 +232,14 @@ learning. Based on these findings another model / formula can be derived in ...@@ -232,14 +232,14 @@ learning. Based on these findings another model / formula can be derived in
which we can calculate risk and evaluate costs of insurance which can cover which we can calculate risk and evaluate costs of insurance which can cover
risk of casualties, et al. risk of casualties, et al.
</p> </p>
<h3><a name="risk-of-killing-birds-and-polluting-the-environment4_anchor"></a>Risk of killing birds and polluting the environment<a class="custom-para" href=#risk-of-killing-birds-and-polluting-the-environment4_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h3> <h3>Risk of killing birds and polluting the environment</h3>
<p>The software is set up on pre-existing devices which should have already <p>The software is set up on pre-existing devices which should have already
passed regulatory checks and certification concerning these risks. The use of passed regulatory checks and certification concerning these risks. The use of
smart sensors technology in no way compromises security as the software smart sensors technology in no way compromises security as the software
is solely responsible for shutting down and starting a device without is solely responsible for shutting down and starting a device without
affects its normal operation nor its structure. affects its normal operation nor its structure.
</p> </p>
<h3><a name="noise-and-vibration-levels5_anchor"></a>Noise and vibration levels<a class="custom-para" href=#noise-and-vibration-levels5_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h3> <h3>Noise and vibration levels</h3>
<p> <p>
During operation, sound and vibration continue to be emitted into the During operation, sound and vibration continue to be emitted into the
water body, potentially disturbing the communication and foraging behaviour water body, potentially disturbing the communication and foraging behaviour
...@@ -315,15 +315,15 @@ which should not be touched. ...@@ -315,15 +315,15 @@ which should not be touched.
web page, this time Google [<a href="https://www.google.com/" title="Google Website;Search;0;1">AD</a>], to web page, this time Google [<a href="https://www.google.com/" title="Google Website;Search;0;1">AD</a>], to
test whether the counter increments correctly. test whether the counter increments correctly.
</p> </p>
<h1><a name="reports6_anchor"></a>Reports<a class="custom-para" href=#reports6_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1> <h1>Reports</h1>
<p> <p>
Embedding reports should work via links with a report name and subsequent parameters Embedding reports should work via links with a report name and subsequent parameters
specified. Reports are all custom, so if they don't exist, they will not be loaded. specified. Reports are all custom, so if they don't exist, they will not be loaded.
</p> </p>
<h2><a name="project-reports7_anchor"></a>Project Reports<a class="custom-para" href=#project-reports7_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Project Reports</h2>
<a href="project_module/template_test_project?report=Base_generateLineBreakdownReport&amp;display_header=2">Line Breakdown Report</a> <a href="project_module/template_test_project?report=Base_generateLineBreakdownReport&amp;display_header=2">Line Breakdown Report</a>
<br/> <br/>
<h2><a name="sale-order-reports8_anchor"></a>Sale Order Reports<a class="custom-para" href=#sale-order-reports8_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Sale Order Reports</h2>
<a href="sale_order_module/template_test_sale_order?report=Base_generateCostEffortReport&amp;display_detail=detailed">Cost Effort Report</a> <a href="sale_order_module/template_test_sale_order?report=Base_generateCostEffortReport&amp;display_detail=detailed">Cost Effort Report</a>
<br/> <br/>
<a href="sale_order_module/template_test_sale_order?report=Base_generateDeliverableReport">Deliverable Report</a> <a href="sale_order_module/template_test_sale_order?report=Base_generateDeliverableReport">Deliverable Report</a>
......
...@@ -98,10 +98,10 @@ ...@@ -98,10 +98,10 @@
<section class="ci-book-table-of-content"><p class="ci-book-toc-faux-h1">Table of Contents</p><ol><li><div><a href="#synthese0_anchor">Synthese</div></a><ol><li><div><a href="#risks-and-measures1_anchor">Risks and measures</div></a><ol><li><div><a href="#risk-of-casualties-if-device-does-not-stop-and-destroys-itself2_anchor">Risk of casualties if device does not stop and destroys itself</div></a></li><li><div><a href="#risk-of-killing-birds-and-polluting-the-environment3_anchor">Risk of killing birds and polluting the environment</div></a></li><li><div><a href="#noise-and-vibration-levels4_anchor">Noise and vibration levels</div></a></li></ol></li></ol><li><div><a href="#reports5_anchor">Reports</div></a><ol><li><div><a href="#project-reports6_anchor">Project Reports</div></a></li><li><div><a href="#sale-order-reports7_anchor">Sale Order Reports</div></a></li></ol><li><div><a href="#backcompat/edge-cases8_anchor">Backcompat/Edge Cases</div></a><ol><li><div><a href="#old-style-task/milestone-boxes9_anchor">Old style task/milestone boxes</div></a></li><li><div><a href="#code-boxes10_anchor">Code Boxes</div></a></li><li><div><a href="#blockquote11_anchor">Blockquote</div></a></li><li><div><a href="#awesome-long-urls-embedded-in-text12_anchor">Awesome Long Urls Embedded in Text</div></a></ol></ol></section>
<h1><a name="synthese0_anchor"></a>Synthese<a class="custom-para" href=#synthese0_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1> <h1>Synthese</h1>
<p>This document is a high level overview measures taken by Foo for Bar project. </p> <p>This document is a high level overview measures taken by Foo for Bar project. </p>
<p> <p>
The purpose of this document is to show possible dangers and measures being The purpose of this document is to show possible dangers and measures being
...@@ -111,8 +111,8 @@ taken to prevent them from legal and ethics point of view. ...@@ -111,8 +111,8 @@ taken to prevent them from legal and ethics point of view.
<h2><a name="risks-and-measures1_anchor"></a>Risks and measures<a class="custom-para" href=#risks-and-measures1_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Risks and measures</h2>
<h3><a name="risk-of-casualties-if-device-does-not-stop-and-destroys-itself2_anchor"></a>Risk of casualties if device does not stop and destroys itself<a class="custom-para" href=#risk-of-casualties-if-device-does-not-stop-and-destroys-itself2_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h3> <h3>Risk of casualties if device does not stop and destroys itself</h3>
<p> <p>
When is it safe to turn off if we turn if off too early or are to risk-aversise, When is it safe to turn off if we turn if off too early or are to risk-aversise,
economic losses of the device not working can be incurred. If on the other hand economic losses of the device not working can be incurred. If on the other hand
...@@ -127,14 +127,14 @@ learning. Based on these findings another model / formula can be derived in ...@@ -127,14 +127,14 @@ learning. Based on these findings another model / formula can be derived in
which we can calculate risk and evaluate costs of insurance which can cover which we can calculate risk and evaluate costs of insurance which can cover
risk of casualties, et al. risk of casualties, et al.
</p> </p>
<h3><a name="risk-of-killing-birds-and-polluting-the-environment3_anchor"></a>Risk of killing birds and polluting the environment<a class="custom-para" href=#risk-of-killing-birds-and-polluting-the-environment3_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h3> <h3>Risk of killing birds and polluting the environment</h3>
<p>The software is set up on pre-existing devices which should have already <p>The software is set up on pre-existing devices which should have already
passed regulatory checks and certification concerning these risks. The use of passed regulatory checks and certification concerning these risks. The use of
smart sensors technology in no way compromises security as the software smart sensors technology in no way compromises security as the software
is solely responsible for shutting down and starting a device without is solely responsible for shutting down and starting a device without
affects its normal operation nor its structure. affects its normal operation nor its structure.
</p> </p>
<h3><a name="noise-and-vibration-levels4_anchor"></a>Noise and vibration levels<a class="custom-para" href=#noise-and-vibration-levels4_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h3> <h3>Noise and vibration levels</h3>
<p> <p>
During operation, sound and vibration continue to be emitted into the During operation, sound and vibration continue to be emitted into the
water body, potentially disturbing the communication and foraging behaviour water body, potentially disturbing the communication and foraging behaviour
...@@ -316,15 +316,15 @@ which should not be touched. ...@@ -316,15 +316,15 @@ which should not be touched.
</tbody> </tbody>
</table> </table>
<h1><a name="reports5_anchor"></a>Reports<a class="custom-para" href=#reports5_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1> <h1>Reports</h1>
<p> <p>
Embedding reports should work via links with a report name and subsequent parameters Embedding reports should work via links with a report name and subsequent parameters
specified. Reports are all custom, so if they don't exist, they will not be loaded. specified. Reports are all custom, so if they don't exist, they will not be loaded.
</p> </p>
<h2><a name="project-reports6_anchor"></a>Project Reports<a class="custom-para" href=#project-reports6_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Project Reports</h2>
<a href="project_module/template_test_project?report=Base_generateLineBreakdownReport&amp;display_header=2">Line Breakdown Report</a> <a href="project_module/template_test_project?report=Base_generateLineBreakdownReport&amp;display_header=2">Line Breakdown Report</a>
<br/> <br/>
<h2><a name="sale-order-reports7_anchor"></a>Sale Order Reports<a class="custom-para" href=#sale-order-reports7_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Sale Order Reports</h2>
<a href="sale_order_module/template_test_sale_order?report=Base_generateCostEffortReport&amp;display_detail=detailed">Cost Effort Report</a> <a href="sale_order_module/template_test_sale_order?report=Base_generateCostEffortReport&amp;display_detail=detailed">Cost Effort Report</a>
<br/> <br/>
<a href="sale_order_module/template_test_sale_order?report=Base_generateDeliverableReport">Deliverable Report</a> <a href="sale_order_module/template_test_sale_order?report=Base_generateDeliverableReport">Deliverable Report</a>
...@@ -338,11 +338,11 @@ specified. Reports are all custom, so if they don't exist, they will not be load ...@@ -338,11 +338,11 @@ specified. Reports are all custom, so if they don't exist, they will not be load
<p> <p>
There should be reports embedded above. There should be reports embedded above.
</p> </p>
<h1><a name="backcompat/edge-cases8_anchor"></a>Backcompat/Edge Cases<a class="custom-para" href=#backcompat/edge-cases8_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h1> <h1>Backcompat/Edge Cases</h1>
<p>Check old breakdown/milestones are also handled:</p> <p>Check old breakdown/milestones are also handled:</p>
<p>The recovery from backup is not automated for this stage, so after any important issue, BAM would make it&#39;s best effort to have the system running in a reasonable amount of time.</p> <p>The recovery from backup is not automated for this stage, so after any important issue, BAM would make it&#39;s best effort to have the system running in a reasonable amount of time.</p>
<h2><a name="old-style-task/milestone-boxes9_anchor"></a>Old style task/milestone boxes<a class="custom-para" href=#old-style-task/milestone-boxes9_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Old style task/milestone boxes</h2>
<div class="ci-document-box-offer"> <div class="ci-document-box-offer">
<div class="ci-document-box-id"><strong>ID</strong>: SO-XO.ABC.P-50.20</div> <div class="ci-document-box-id"><strong>ID</strong>: SO-XO.ABC.P-50.20</div>
...@@ -358,7 +358,7 @@ There should be reports embedded above. ...@@ -358,7 +358,7 @@ There should be reports embedded above.
<div class="ci-document-box-location"><strong>Location</strong>: Couscous</div> <div class="ci-document-box-location"><strong>Location</strong>: Couscous</div>
</div> </div>
<h2><a name="code-boxes10_anchor"></a>Code Boxes<a class="custom-para" href=#code-boxes10_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Code Boxes</h2>
<p> <p>
You can use the above command to see whether Re6st is working. The output You can use the above command to see whether Re6st is working. The output
should be similar to:</p><pre><code>● re6stnet.service - (null) should be similar to:</p><pre><code>● re6stnet.service - (null)
...@@ -378,7 +378,7 @@ There should be reports embedded above. ...@@ -378,7 +378,7 @@ There should be reports embedded above.
Mar 09 16:43:23 slapostest2 systemd[1]: Started (null).</code></pre> Mar 09 16:43:23 slapostest2 systemd[1]: Started (null).</code></pre>
<p>After this step Re6st is installed and the machine is accessable over IPv6.</p> <p>After this step Re6st is installed and the machine is accessable over IPv6.</p>
<h2><a name="blockquote11_anchor"></a>Blockquote<a class="custom-para" href=#blockquote11_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Blockquote</h2>
<blockquote> <blockquote>
<p>jio.get(&#39;image_module/2&quot;).push(function (image) { console.log(&quot;image : &quot;, image);}</p> <p>jio.get(&#39;image_module/2&quot;).push(function (image) { console.log(&quot;image : &quot;, image);}</p>
...@@ -387,7 +387,7 @@ There should be reports embedded above. ...@@ -387,7 +387,7 @@ There should be reports embedded above.
<p>image : Object {portal_type: &quot;Image Tile&quot;, title: &quot;Hot Springs, Arkansas&quot;, size: &quot;3489732&quot;, quality: &quot;high&quot;, product_line_list: [&quot;agriculture&quot;, &quot;forest&quot;], reference: &quot;8889-2223-238842&quot;}</p> <p>image : Object {portal_type: &quot;Image Tile&quot;, title: &quot;Hot Springs, Arkansas&quot;, size: &quot;3489732&quot;, quality: &quot;high&quot;, product_line_list: [&quot;agriculture&quot;, &quot;forest&quot;], reference: &quot;8889-2223-238842&quot;}</p>
</blockquote> </blockquote>
<h2><a name="awesome-long-urls-embedded-in-text12_anchor"></a>Awesome Long Urls Embedded in Text<a class="custom-para" href=#awesome-long-urls-embedded-in-text12_anchor><span style="font-size:.75em;line-height:1em;padding-left:.5em;">&para;</span></a></h2> <h2>Awesome Long Urls Embedded in Text</h2>
<p> <p>
Hybrid application are web/HTML5 application wrapped with libraries supporting native Hybrid application are web/HTML5 application wrapped with libraries supporting native
features. This approach is largely used theses days : in 2013, Gartner, already predicted that by features. This approach is largely used theses days : in 2013, Gartner, already predicted that by
......
<h1>Introduction</h1>
${WebPage_insertTableOfReferences}
<table>
<thead>
<tr>
<th colspan="4">Some Table</th>
</tr>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>123</td>
<td>456</td>
<td>Some text</td>
<td>More description</td>
</tr>
</tbody>
<caption>Table description &lt;abc&gt;</caption>
</table>
<p>There is more</p>
<table>
<thead>
<tr>
<th colspan="4">Some Table</th>
</tr>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>123</td>
<td>456</td>
<td>Some text</td>
<td style="text-align: center">More description</td>
</tr>
</tbody>
<caption>Table description</caption>
</table>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>Template.Test.Book.ReferenceTable.Unescape</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_book_reference_table_unescape_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template.Test.Book.ReferenceTable.Unescape</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<h1>1</h1>
<div>TEST1</div>
<h1>2</h1>
<div>TEST2</div>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>test.convert.to.slideview</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_convert_to_slideview</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Test Convert To SlideView</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<section class="master">
<h1>Thank You</h1>
<details open="">
<p>For more information</p>
</details>
</section>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>template.test.last.slide</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_test_last_slide_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template.Test.Last.Slide</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -50,9 +50,7 @@ ...@@ -50,9 +50,7 @@
<tr> <tr>
<td></td> <td></td>
<td class="ci-letter-source"> <td class="ci-letter-source"></td>
</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
...@@ -50,9 +50,7 @@ ...@@ -50,9 +50,7 @@
<tr> <tr>
<td></td> <td></td>
<td class="ci-letter-source"> <td class="ci-letter-source"></td>
</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
...@@ -50,9 +50,7 @@ ...@@ -50,9 +50,7 @@
<tr> <tr>
<td></td> <td></td>
<td class="ci-letter-source"> <td class="ci-letter-source"></td>
</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
......
...@@ -48,34 +48,6 @@ ...@@ -48,34 +48,6 @@
<table> <table>
<tbody> <tbody>
<tr>
<td></td>
<td class="ci-letter-source">
</td>
<td></td>
</tr>
<tr>
<td></td>
<td class="ci-letter-destination"
style="padding-left: 100px">
<span>Test Organisation</span>
<span>Test Recipient</span>
<span>Test Drive 123</span>
<span>12345 Test City</span>
<span> </span>
</td>
<td></td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
......
<?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>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_generateCorporareIdentityTestReport</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
##############################################################################
#
# Copyright (c) 2002-2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
class TestCorporateIdentityMethod(ERP5TypeTestCase):
def getTitle(self):
return "Test ERP5 Corporate Identity Method."
def getBusinessTemplateList(self):
return (
'erp5_base',
'erp5_font',
'erp5_web',
'erp5_dms',
'erp5_corporate_identity',
'erp5_corporate_identity_test',
'erp5_ui_test_core'
)
def afterSetUp(self):
test_person = self.portal.portal_catalog.getResultValue(
portal_type='Person',
reference = 'Person For Test Parameter')
if not test_person:
test_person = self.portal.person_module.newContent(
portal_type='Person',
reference='Person For Test Parameter',
first_name='Test',
last_name='Person Parameter',
default_email_url_string='test@info.com',
default_telephone_telephone_number="123",
default_address_street_address="street 1",
default_address_zip_code="456"
)
self.test_person = test_person
test_web_page = self.portal.portal_catalog.getResultValue(
portal_type='Web Page',
reference ='Web Page For Test Parameter')
if not test_web_page:
test_web_page = self.portal.web_page_module.newContent(
portal_type='Web Page',
reference='Web Page For Test Parameter')
self.test_web_page = test_web_page
test_organisation = self.portal.portal_catalog.getResultValue(
portal_type='Organisation',
reference='Organisation For Test Parameter')
if not test_organisation:
test_organisation = self.portal.organisation_module.newContent(
portal_type='Organisation',
reference='Organisation For Test Parameter',
title='Test Organisation Parameter',
default_email_url_string='test@test.com',
default_telephone_telephone_number="123",
default_address_street_address="street 1",
default_address_zip_code="456"
)
self.test_organisation = test_organisation
test_product = self.portal.portal_catalog.getResultValue(
portal_type='Product',
reference='Product For Test Parameter')
if not test_product:
test_product = self.portal.product_module.newContent(
portal_type='Product',
title='Product Software',
reference='Product For Test Parameter')
self.test_product = test_product
test_web_site = self.portal.portal_catalog.getResultValue(
portal_type='Web Site',
reference='Web Site For Test Parameter')
if not test_web_site:
test_web_site = self.portal.web_site_module.newContent(
portal_type='Web Site',
reference='Web Site For Test Parameter')
self.test_web_site = test_web_site
# Activating a system preference if none is activated
preference = self.getDefaultSystemPreference()
if preference.getPreferenceState() != "global":
preference.enable()
if self.portal.portal_preferences.default_site_preference.getPreferenceState() != "global":
self.portal.portal_preferences.default_site_preference.enable()
self.tic()
def test_validateImage(self):
web_page = self.portal.web_page_module.template_test_slideshow_input_001_en_html
img_string = ''
output_string = web_page.WebPage_validateImage(img_string=img_string)
self.assertEqual(output_string, img_string)
img_string = '<img alt="alt">'
output_string = web_page.WebPage_validateImage(img_string=img_string)
self.assertEqual(output_string, img_string)
img_string='<img src="data:image/png;;base64,iVBO">'
output_string = web_page.WebPage_validateImage(img_string=img_string)
self.assertEqual(output_string, img_string)
# add format
img_string='<img src="http://test.png">'
output_string = web_page.WebPage_validateImage(img_string=img_string)
self.assertEqual(output_string, '<img src="http://test.png?format=">')
img_string='<img src="http://test.png?version=1">'
output_string = web_page.WebPage_validateImage(img_string=img_string)
self.assertEqual(output_string, '<img src="http://test.png?version=1&amp;format=">')
img_string = '<img src="test.png?version=1">'
output_string = web_page.WebPage_validateImage(img_string=img_string)
self.assertTrue('The following image could not be found in erp5 OR is not following' in output_string)
img_string ='<img src="/Template.Test.Image.Map?version=1">'
output_string = web_page.WebPage_validateImage(img_string=img_string)
self.assertEqual(output_string, '<img src="/Template.Test.Image.Map?version=1&amp;format=">')
img_string = '<img src="Template.Test.Image.Map?version=1">'
output_string = web_page.WebPage_validateImage(img_string=img_string)
self.assertEqual(output_string, '<img src="Template.Test.Image.Map?version=1&amp;format=">')
img_string = '<img src="./Template.Test.Image.Map?version=1">'
output_string = web_page.WebPage_validateImage(img_string=img_string)
self.assertEqual(output_string, '<img src="Template.Test.Image.Map?version=1&amp;format=">')
img_string = '<img src="Template.Test.Image.Map?version=1">'
output_string = web_page.WebPage_validateImage(img_string=img_string, img_fullscreen_link=True)
self.assertEqual(output_string, '<a target="_blank" rel="noopener noreferrer" href="Template.Test.Image.Map?version=1&amp;format=" title="Template Test Image Map"><img src="Template.Test.Image.Map?version=1&amp;format="><a>')
img_string = '<img src="Template.Test.Image.Map?version=1">'
output_string = web_page.WebPage_validateImage(img_string=img_string, img_wrap=True)
self.assertEqual(output_string, '<p class="ci-book-img" style="text-align:center"><img src="Template.Test.Image.Map?version=1&amp;format="></p>')
def test_webPage_embedLinkedDocumentList(self):
web_page = self.portal.web_page_module.template_test_slideshow_input_001_en_html
doc_content = '<div> [<a href="Https://Template.Test.Book.Embeddable.Document">This link should be embedded</a>] </div>'
output =web_page.WebPage_embedLinkedDocumentList(doc_content)
self.assertEqual(doc_content, output)
doc_content = '<div> [<a href="Template.Test.Book.Embeddable.Document">This link should be embedded</a>] </div>'
output =web_page.WebPage_embedLinkedDocumentList(doc_content)
self.assertEqual(doc_content, output)
# be careful of space between <div> <a>
doc_content = '<div> <a href="Template.Test.Book.Embeddable.Document">This link should be embedded</a> </div>'
output =web_page.WebPage_embedLinkedDocumentList(doc_content)
self.assertEqual(output, '<div>%s</div>' %web_page.restrictedTraverse('Template.Test.Book.Embeddable.Document').asStrippedHTML())
def test_webPage_embedReportDocumentList(self):
web_page_no_follow_up = self.portal.web_page_module.template_test_slideshow_input_001_en_html
web_page_with_follow_up = self.portal.web_page_module.template_test_book_embed_reportdocument_html
doc_content = '<div>${WebPage_insertFollowUpCorporareIdentityTestReport}</div>'
output =web_page_no_follow_up.WebPage_embedReportDocumentList(doc_content)
self.assertEqual(output, doc_content)
output =web_page_with_follow_up.WebPage_embedReportDocumentList(doc_content)
self.assertEqual(output, '<div>%s</div>' % web_page_with_follow_up.Base_generateCorporareIdentityTestReport()[0])
# it has no matter with/without follow up
doc_content = '<div> <a href="sale_opportunity_module/template_test_embed_sale_opportunity?report=Base_generateCorporareIdentityTestReport&amp;test=23"></a> </div>'
output =web_page_with_follow_up.WebPage_embedReportDocumentList(doc_content)
self.assertEqual(output, '<div>test report {"test": "23", "document_language": null, "format": null}</div>')
doc_content = '<div> <a href="sale_opportunity_module/template_test_embed_sale_opportunity?report=Base_generateCorporareIdentityTestReport&amp;test=23"></a> </div>'
output =web_page_no_follow_up.WebPage_embedReportDocumentList(doc_content)
self.assertEqual(output, '<div>test report {"test": "23", "document_language": null, "format": null}</div>')
def test_getTemplateProxyParameter_override_person(self):
output_dict_list = self.test_person.Base_getTemplateProxyParameter(
parameter='override_person',
source_data=self.test_person.getTitle())
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
def test_getTemplateProxyParameter_author(self):
self.test_web_page.edit(
contributor_value=None)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='author')
self.assertEqual(len(output_dict_list), 0)
self.test_web_page.edit(
contributor_value=self.test_person)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='author')
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
def test_getTemplateProxyParameter_override_organisation(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='override_organisation',
source_data = self.test_organisation.getTitle()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
def test_getTemplateProxyParameter_override_organisation_relative_url(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='override_organisation_relative_url',
source_data = self.test_organisation.getRelativeUrl()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
def test_getTemplateProxyParameter_source(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='source',
source_data = self.test_person.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
self.test_person.edit(
career_subordination_value = self.test_organisation)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='source',
source_data = self.test_person.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='source',
source_data = self.test_organisation.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
self.test_person.edit(
career_subordination_value = None)
self.tic()
def test_getTemplateProxyParameter_destination(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='destination',
source_data = self.test_person.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
self.test_person.edit(
career_subordination_value = self.test_organisation)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='destination',
source_data = self.test_person.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='destination',
source_data = self.test_organisation.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
self.test_person.edit(
career_subordination_value = None)
self.tic()
def test_getTemplateProxyParameter_organisation(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='organisation',
)
self.assertEqual(len(output_dict_list), 0)
self.test_web_page.edit(
follow_up_value = self.test_organisation,
)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='organisation',
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
self.test_web_page.edit(
follow_up_value = None
)
self.tic()
def test_getTemplateProxyParameter_person(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='person',
)
self.assertEqual(len(output_dict_list), 0)
self.test_web_page.edit(
follow_up_value = self.test_person,
)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='person',
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
self.test_web_page.edit(
follow_up_value = None
)
self.tic()
def test_getTemplateProxyParameter_logo(self):
for lang in ['en','fr']:
self.test_web_page.edit(language=lang)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='logo',
source_data='Template.Test.Theme.Logo.Default'
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['reference'], self.portal.image_module.template_test_image_theme_logo_png.getReference())
self.assertEqual(output_dict['relative_url'], self.portal.image_module.template_test_image_theme_logo_png.getRelativeUrl())
self.assertEqual(output_dict['description'], self.portal.image_module.template_test_image_theme_logo_png.getDescription())
self.test_web_page.edit(language='fr')
self.tic()
def test_getTemplateProxyParameter_product(self):
self.test_web_page.edit(
follow_up_value = self.test_product)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='product',
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['title'], self.test_product.getTitle())
def test_getTemplateProxyParameter_theme(self):
self.test_product.edit(
title='Product Software')
self.test_web_page.edit(
follow_up_value = self.test_product)
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, self.test_product.getTitle().split(' ')[0].lower())
self.test_product.edit(
title='Product Software xxxx')
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, self.test_product.getTitle().split(' ')[0].lower())
self.test_product.edit(
title='Product xxxx')
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, None)
def test_getTemplateProxyParameter_theme_through_web_site(self):
self.test_web_site.edit(
membership_criterion_category_list = []
)
self.tic()
output = self.test_web_site.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, None)
self.test_product.edit(
title='Product Software')
self.test_web_site.edit(
membership_criterion_category_list = ['follow_up/%s' % self.test_product.getRelativeUrl()]
)
self.tic()
output = self.test_web_site.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, self.test_product.getTitle().split(' ')[0].lower())
self.test_product.edit(
title='Product Software xxxx')
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, self.test_product.getTitle().split(' ')[0].lower())
self.test_product.edit(
title='Product xxxx')
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, None)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testCorporateIdentityMethod</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testCorporateIdentityMethod</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -86,65 +86,6 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -86,65 +86,6 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
self.message_catalog.gettext('Press Release', add=1) self.message_catalog.gettext('Press Release', add=1)
self.message_catalog.message_edit('Press Release', 'de', 'Pressemeldung', '') self.message_catalog.message_edit('Press Release', 'de', 'Pressemeldung', '')
test_person = self.portal.portal_catalog.getResultValue(
portal_type='Person',
reference = 'Person For Test Parameter')
if not test_person:
test_person = self.portal.person_module.newContent(
portal_type='Person',
reference='Person For Test Parameter',
first_name='Test',
last_name='Person Parameter',
default_email_url_string='test@info.com',
default_telephone_telephone_number="123",
default_address_street_address="street 1",
default_address_zip_code="456"
)
self.test_person = test_person
test_web_page = self.portal.portal_catalog.getResultValue(
portal_type='Web Page',
reference ='Web Page For Test Parameter')
if not test_web_page:
test_web_page = self.portal.web_page_module.newContent(
portal_type='Web Page',
reference='Web Page For Test Parameter')
self.test_web_page = test_web_page
test_organisation = self.portal.portal_catalog.getResultValue(
portal_type='Organisation',
reference='Organisation For Test Parameter')
if not test_organisation:
test_organisation = self.portal.organisation_module.newContent(
portal_type='Organisation',
reference='Organisation For Test Parameter',
title='Test Organisation Parameter',
default_email_url_string='test@test.com',
default_telephone_telephone_number="123",
default_address_street_address="street 1",
default_address_zip_code="456"
)
self.test_organisation = test_organisation
test_product = self.portal.portal_catalog.getResultValue(
portal_type='Product',
reference='Product For Test Parameter')
if not test_product:
test_product = self.portal.product_module.newContent(
portal_type='Product',
title='Product Software',
reference='Product For Test Parameter')
self.test_product = test_product
test_web_site = self.portal.portal_catalog.getResultValue(
portal_type='Web Site',
reference='Web Site For Test Parameter')
if not test_web_site:
test_web_site = self.portal.web_site_module.newContent(
portal_type='Web Site',
reference='Web Site For Test Parameter')
self.test_web_site = test_web_site
# Activating a system preference if none is activated # Activating a system preference if none is activated
preference = self.getDefaultSystemPreference() preference = self.getDefaultSystemPreference()
if preference.getPreferenceState() != "global": if preference.getPreferenceState() != "global":
...@@ -299,7 +240,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -299,7 +240,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
) )
self.tic() self.tic()
else: else:
test_page = getattr(self.portal.web_page_module, id1) test_page = getattr(self.portal.web_page_module, id1, None) or getattr(self.portal.document_module, id1)
pdf_kw = dict( pdf_kw = dict(
reference=test_page.getReference(), reference=test_page.getReference(),
...@@ -441,6 +382,30 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -441,6 +382,30 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
) )
) )
def test_pdfPresentationOdpToSlideView(self):
self.runPdfTestPattern(
"template_test_presentation_odp",
"template_test_presentaion_odp_slide_view_bmp",
"template_test_image_source_pdf",
**dict(
page_number=3,
test_method="Presentation_viewAsSlideshow",
format="pdf"
)
)
def test_pdfPresentationPptxToSlideView(self):
self.runPdfTestPattern(
"template_test_presentation_pptx",
"template_test_presentaion_pptx_slide_view_bmp",
"template_test_image_source_pdf",
**dict(
page_number=3,
test_method="Presentation_viewAsSlideshow",
format="pdf"
)
)
@changeSkin('Slide') @changeSkin('Slide')
def test_pdfSlideShow(self): def test_pdfSlideShow(self):
""" """
...@@ -462,6 +427,42 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -462,6 +427,42 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
) )
) )
@changeSkin('Slide')
def test_pdfConvertToSlideView(self):
self.runPdfTestPattern(
"template_test_convert_to_slideview",
"template_test_convert_to_slideview_bmp",
"template_test_image_source_pdf",
**dict(
page_number=2,
use_skin="Slide",
test_method="WebPage_exportAsSlideshow",
format="pdf"
)
)
@changeSkin('Slide')
def test_pdfAddLastSlide(self):
self.portal.portal_preferences.default_site_preference.edit(
preferred_corporate_identity_template_slide_last_slide_relative_url='web_page_module/template_test_last_slide_html'
)
self.tic()
self.runPdfTestPattern(
"template_test_convert_to_slideview",
"template_test_last_view_bmp",
"template_test_image_source_pdf",
**dict(
page_number=4,
use_skin="Slide",
test_method="WebPage_exportAsSlideshow",
format="pdf"
)
)
self.portal.portal_preferences.default_site_preference.edit(
preferred_corporate_identity_template_slide_last_slide_relative_url=''
)
self.tic()
@changeSkin('Slide') @changeSkin('Slide')
def test_pdfSlideShowForAnonymous(self): def test_pdfSlideShowForAnonymous(self):
""" """
...@@ -633,7 +634,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -633,7 +634,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
"template_test_letter_output_expected_001_en_html", "template_test_letter_output_expected_001_en_html",
**dict( **dict(
test_method="WebPage_exportAsLetter", test_method="WebPage_exportAsLetter",
use_skin="Letter" use_skin="Letter",
display_head=1
) )
) )
...@@ -652,7 +654,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -652,7 +654,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
"template_test_letter_output_expected_002_en_html", "template_test_letter_output_expected_002_en_html",
**dict( **dict(
test_method="WebPage_exportAsLetter", test_method="WebPage_exportAsLetter",
use_skin="Letter" use_skin="Letter",
display_head=1
) )
) )
...@@ -677,7 +680,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -677,7 +680,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
override_destination_person_title="Test Association Member", override_destination_person_title="Test Association Member",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -718,7 +722,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -718,7 +722,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
page_number=0, page_number=0,
test_method="WebPage_exportAsLetter", test_method="WebPage_exportAsLetter",
format="pdf", format="pdf",
use_skin="Letter" use_skin="Letter",
display_head=1
) )
) )
...@@ -740,7 +745,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -740,7 +745,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
page_number=0, page_number=0,
test_method="WebPage_exportAsLetter", test_method="WebPage_exportAsLetter",
format="pdf", format="pdf",
use_skin="Letter" use_skin="Letter",
display_head=1
) )
) )
...@@ -768,7 +774,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -768,7 +774,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
override_destination_person_title="Test Association Member", override_destination_person_title="Test Association Member",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -792,7 +799,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -792,7 +799,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_position_in_letter = "right", destination_position_in_letter = "right",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -817,7 +825,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -817,7 +825,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_position_in_letter = "right", destination_position_in_letter = "right",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -841,7 +850,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -841,7 +850,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_position_in_letter = "left", destination_position_in_letter = "left",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -866,7 +876,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -866,7 +876,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_position_in_letter = "left", destination_position_in_letter = "left",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -891,7 +902,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -891,7 +902,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_position_in_letter = "right", destination_position_in_letter = "right",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -917,7 +929,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -917,7 +929,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_position_in_letter = "right", destination_position_in_letter = "right",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -942,7 +955,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -942,7 +955,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_position_in_letter = "left", destination_position_in_letter = "left",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -968,7 +982,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -968,7 +982,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_position_in_letter = "left", destination_position_in_letter = "left",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -995,7 +1010,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -995,7 +1010,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_position_in_letter = "left", destination_position_in_letter = "left",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -1021,7 +1037,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1021,7 +1037,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
use_skin="Letter", use_skin="Letter",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
self.portal.portal_preferences.default_site_preference.edit( self.portal.portal_preferences.default_site_preference.edit(
...@@ -1052,7 +1069,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1052,7 +1069,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_relative_url="organisation_module/template_test_organisation", destination_relative_url="organisation_module/template_test_organisation",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
) )
) )
...@@ -1079,7 +1097,30 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1079,7 +1097,30 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
destination_relative_url="person_module/template_test_no_member", destination_relative_url="person_module/template_test_no_member",
subfield_field_override_date_year="1999", subfield_field_override_date_year="1999",
subfield_field_override_date_month="12", subfield_field_override_date_month="12",
subfield_field_override_date_day="31" subfield_field_override_date_day="31",
display_head=1
)
)
@changeSkin('Letter')
def test_pdfLetterNotDisplayHead(self):
"""
Test:
- Web Page as Letter
- override date (needed to match output files)
- test multi-page letter with hidden header on first page
- export as pdf
"""
self.runPdfTestPattern(
"template_test_letter_input_004_de_html",
"template_test_letter_not_display_header_bmp",
"template_test_image_source_pdf",
**dict(
page_number=0,
test_method="WebPage_exportAsLetter",
format="pdf",
display_head=0,
use_skin="Letter"
) )
) )
...@@ -1121,7 +1162,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1121,7 +1162,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
**dict( **dict(
page_number=0, page_number=0,
test_method="WebPage_printAsLetter", test_method="WebPage_printAsLetter",
use_skin="Letter" use_skin="Letter",
display_head=1
) )
) )
...@@ -1138,7 +1180,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1138,7 +1180,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
"template_test_leaflet_output_expected_001_en_html", "template_test_leaflet_output_expected_001_en_html",
**dict( **dict(
test_method="WebPage_exportAsLeaflet", test_method="WebPage_exportAsLeaflet",
use_skin="Leaflet" use_skin="Leaflet",
display_side=1
) )
) )
...@@ -1158,7 +1201,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1158,7 +1201,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
override_source_person_title="Test Recipient", override_source_person_title="Test Recipient",
override_source_organisation_title="Test Association", override_source_organisation_title="Test Association",
override_leaflet_header_title="Couscous", override_leaflet_header_title="Couscous",
use_skin="Leaflet" use_skin="Leaflet",
display_side=1
) )
) )
...@@ -1175,7 +1219,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1175,7 +1219,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
"template_test_leaflet_output_expected_003_de_html", "template_test_leaflet_output_expected_003_de_html",
**dict( **dict(
test_method="WebPage_exportAsLeaflet", test_method="WebPage_exportAsLeaflet",
use_skin="Leaflet" use_skin="Leaflet",
display_side=1
) )
) )
...@@ -1195,7 +1240,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1195,7 +1240,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
page_number=1, page_number=1,
format="pdf", format="pdf",
test_method="WebPage_exportAsLeaflet", test_method="WebPage_exportAsLeaflet",
use_skin="Leaflet" use_skin="Leaflet",
display_side=1
) )
) )
...@@ -1218,7 +1264,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1218,7 +1264,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
use_skin="Leaflet", use_skin="Leaflet",
override_source_organisation_title="Test Association", override_source_organisation_title="Test Association",
override_source_person_title="Test Recipient", override_source_person_title="Test Recipient",
override_leaflet_header_title="Couscous" override_leaflet_header_title="Couscous",
display_side=1
) )
) )
...@@ -1238,7 +1285,28 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1238,7 +1285,28 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
page_number=0, page_number=0,
test_method="WebPage_exportAsLeaflet", test_method="WebPage_exportAsLeaflet",
use_skin="Leaflet", use_skin="Leaflet",
format="pdf" format="pdf",
display_side=1
)
)
@changeSkin('Leaflet')
def test_pdfLeafletNotDisplaySideColumn(self):
"""
Test:
- Web Page as Leaflet
- export as pdf
"""
self.runPdfTestPattern(
"template_test_leaflet_input_001_en_html",
"template_test_leaflet_not_display_side_column_bmp",
"template_test_image_source_pdf",
**dict(
page_number=0,
test_method="WebPage_exportAsLeaflet",
use_skin="Leaflet",
format="pdf",
display_side=0
) )
) )
...@@ -1256,7 +1324,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1256,7 +1324,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
**dict( **dict(
page_number=1, page_number=1,
test_method="WebPage_printAsLeaflet", test_method="WebPage_printAsLeaflet",
use_skin="Leaflet" use_skin="Leaflet",
display_side=1
) )
) )
...@@ -1280,7 +1349,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1280,7 +1349,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
) )
@changeSkin('Book') @changeSkin('Book')
def testhtmlBookAllOptions(self): def test_htmlBookAllOptions(self):
""" """
Test: Test:
- Web Page as Book - Web Page as Book
...@@ -1325,6 +1394,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1325,6 +1394,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
use_skin="Book", use_skin="Book",
test_method="WebPage_exportAsBook", test_method="WebPage_exportAsBook",
override_revision=1, override_revision=1,
include_content_table=1,
lang="de" lang="de"
) )
) )
...@@ -1366,13 +1436,14 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1366,13 +1436,14 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
use_skin="Book", use_skin="Book",
test_method="WebPage_exportAsBook", test_method="WebPage_exportAsBook",
format="pdf", format="pdf",
override_revision=1 override_revision=1,
include_content_table=1
) )
) )
# XXX change to a single pdf from which pics are generated! # XXX change to a single pdf from which pics are generated!
@changeSkin('Book') @changeSkin('Book')
def testpdfBookAllOptions(self): def test_pdfBookAllOptions(self):
""" """
Test: Test:
- Web Page as Book - Web Page as Book
...@@ -1407,7 +1478,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1407,7 +1478,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
# duplicate, just for page 5 # duplicate, just for page 5
@changeSkin('Book') @changeSkin('Book')
def testpdfBookAllOptionsDupe(self): def test_pdfBookAllOptionsDupe(self):
""" """
Test: Test:
- Web Page as Book - Web Page as Book
...@@ -1442,7 +1513,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1442,7 +1513,7 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
# duplicate, just for page 10 # duplicate, just for page 10
@changeSkin('Book') @changeSkin('Book')
def testpdfBookAllOptionsDoubleDupe(self): def test_pdfBookAllOptionsDoubleDupe(self):
""" """
Test: Test:
- Web Page as Book - Web Page as Book
...@@ -1492,7 +1563,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1492,7 +1563,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
test_method="WebPage_exportAsBook", test_method="WebPage_exportAsBook",
page_number=1, page_number=1,
format="pdf", format="pdf",
override_revision=1 override_revision=1,
include_content_table=1
) )
) )
...@@ -1514,7 +1586,46 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1514,7 +1586,46 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
use_skin="Book", use_skin="Book",
test_method="WebPage_exportAsBook", test_method="WebPage_exportAsBook",
format="pdf", format="pdf",
override_revision=1 override_revision=1,
include_content_table=1
)
)
@changeSkin('Book')
def test_pdfBookReferenceTableUnescape(self):
"""
"""
self.runPdfTestPattern(
"template_test_book_reference_table_unescape_html",
"template_test_book_reference_table_unescape_bmp",
"template_test_image_source_pdf",
**dict(
page_number=3,
use_skin="Book",
test_method="WebPage_exportAsBook",
format="pdf",
override_revision=1,
include_content_table=1,
include_reference_table = 1
)
)
@changeSkin('Book')
def test_pdfBookEmbedReport(self):
"""
"""
self.runPdfTestPattern(
"template_test_book_embed_reportdocument_html",
"template_test_book_embed_report_bmp",
"template_test_image_source_pdf",
**dict(
page_number=2,
use_skin="Book",
test_method="WebPage_exportAsBook",
format="pdf",
override_revision=1,
include_content_table=1,
include_report_content = 1
) )
) )
...@@ -1535,7 +1646,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1535,7 +1646,8 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
test_method="WebPage_printAsBook", test_method="WebPage_printAsBook",
page_number=1, page_number=1,
format="pdf", format="pdf",
override_revision=1 override_revision=1,
include_content_table=1
) )
) )
...@@ -1637,286 +1749,3 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase): ...@@ -1637,286 +1749,3 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
use_skin="Release" use_skin="Release"
) )
) )
def test_getTemplateProxyParameter_override_person(self):
output_dict_list = self.test_person.Base_getTemplateProxyParameter(
parameter='override_person',
source_data=self.test_person.getTitle())
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
def test_getTemplateProxyParameter_author(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='author')
self.assertEqual(len(output_dict_list), 0)
self.test_web_page.edit(
contributor_value=self.test_person)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='author')
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
def test_getTemplateProxyParameter_override_organisation(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='override_organisation',
source_data = self.test_organisation.getTitle()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
def test_getTemplateProxyParameter_override_organisation_relative_url(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='override_organisation_relative_url',
source_data = self.test_organisation.getRelativeUrl()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
def test_getTemplateProxyParameter_source(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='source',
source_data = self.test_person.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
self.test_person.edit(
career_subordination_value = self.test_organisation)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='source',
source_data = self.test_person.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='source',
source_data = self.test_organisation.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
self.test_person.edit(
career_subordination_value = None)
self.tic()
def test_getTemplateProxyParameter_destination(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='destination',
source_data = self.test_person.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
self.test_person.edit(
career_subordination_value = self.test_organisation)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='destination',
source_data = self.test_person.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='destination',
source_data = self.test_organisation.getUid()
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
self.test_person.edit(
career_subordination_value = None)
self.tic()
def test_getTemplateProxyParameter_organisation(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='organisation',
)
self.assertEqual(len(output_dict_list), 0)
self.test_web_page.edit(
follow_up_value = self.test_organisation,
)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='organisation',
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_organisation.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_organisation.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_organisation.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['organisation_title'], self.test_organisation.getTitle())
self.assertEqual(output_dict['phone'], self.test_organisation.getDefaultTelephoneValue().getCoordinateText())
self.test_web_page.edit(
follow_up_value = None
)
self.tic()
def test_getTemplateProxyParameter_person(self):
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='person',
)
self.assertEqual(len(output_dict_list), 0)
self.test_web_page.edit(
follow_up_value = self.test_person,
)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='person',
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['postal_code'], self.test_person.getDefaultAddress().getZipCode())
self.assertEqual(output_dict['address'], self.test_person.getDefaultAddress().getStreetAddress())
self.assertEqual(output_dict['email'], self.test_person.getDefaultEmail().getUrlString())
self.assertEqual(output_dict['name'], self.test_person.getTitle())
self.assertEqual(output_dict['phone'], self.test_person.getDefaultTelephoneValue().getCoordinateText())
self.test_web_page.edit(
follow_up_value = None
)
self.tic()
def test_getTemplateProxyParameter_logo(self):
for lang in ['en','fr']:
self.test_web_page.edit(language=lang)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='logo',
source_data='Template.Test.Theme.Logo.Default'
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['reference'], self.portal.image_module.template_test_image_theme_logo_png.getReference())
self.assertEqual(output_dict['relative_url'], self.portal.image_module.template_test_image_theme_logo_png.getRelativeUrl())
self.assertEqual(output_dict['description'], self.portal.image_module.template_test_image_theme_logo_png.getDescription())
self.test_web_page.edit(language='fr')
self.tic()
def test_getTemplateProxyParameter_product(self):
self.test_web_page.edit(
follow_up_value = self.test_product)
self.tic()
output_dict_list = self.test_web_page.Base_getTemplateProxyParameter(
parameter='product',
)
self.assertEqual(len(output_dict_list), 1)
output_dict = output_dict_list[0]
self.assertEqual(output_dict['title'], self.test_product.getTitle())
def test_getTemplateProxyParameter_theme(self):
self.test_product.edit(
title='Product Software')
self.test_web_page.edit(
follow_up_value = self.test_product)
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, self.test_product.getTitle().split(' ')[0].lower())
self.test_product.edit(
title='Product Software xxxx')
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, self.test_product.getTitle().split(' ')[0].lower())
self.test_product.edit(
title='Product xxxx')
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, None)
def test_getTemplateProxyParameter_theme_through_web_site(self):
self.test_web_site.edit(
membership_criterion_category_list = []
)
self.tic()
output = self.test_web_site.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, None)
self.test_product.edit(
title='Product Software')
self.test_web_site.edit(
membership_criterion_category_list = ['follow_up/%s' % self.test_product.getRelativeUrl()]
)
self.tic()
output = self.test_web_site.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, self.test_product.getTitle().split(' ')[0].lower())
self.test_product.edit(
title='Product Software xxxx')
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, self.test_product.getTitle().split(' ')[0].lower())
self.test_product.edit(
title='Product xxxx')
self.tic()
output = self.test_web_page.Base_getTemplateProxyParameter(
parameter='theme',
)
self.assertEqual(output, None)
document_module/template_test_image_source_pdf document_module/template_test_*
image_module/template_test_* image_module/template_test_*
image_module/template_test_image* image_module/template_test_image*
organisation_module/template_test* organisation_module/template_test*
......
document_module/template_test_image_source_pdf document_module/template_test_*
image_module/template_test_* image_module/template_test_*
image_module/template_test_image* image_module/template_test_image*
organisation_module/template_test* organisation_module/template_test*
...@@ -11,6 +11,7 @@ portal_categories/group/template* ...@@ -11,6 +11,7 @@ portal_categories/group/template*
portal_tests/template_test_zuite portal_tests/template_test_zuite
portal_tests/template_test_zuite/* portal_tests/template_test_zuite/*
product_module/template_test_product product_module/template_test_product
sale_opportunity_module/template_test_*
support_request_module/template_test_* support_request_module/template_test_*
web_page_module/template_test_* web_page_module/template_test_*
web_site_module/template_test_web_site web_site_module/template_test_web_site
\ No newline at end of file
test.erp5.testCorporateIdentityTemplateList test.erp5.testCorporateIdentityTemplateList
test.erp5.testFunctionalCorporateIdentityTemplateList test.erp5.testFunctionalCorporateIdentityTemplateList
\ No newline at end of file test.erp5.testCorporateIdentityMethod
\ No newline at end of file
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