created customizable signature box

This commit is contained in:
skyanth 2019-06-14 11:06:13 +02:00
parent 8d33e75c67
commit 9650c1cb07
7 changed files with 203 additions and 173 deletions

View File

@ -62,7 +62,7 @@
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="organizational_readiness_assessment"> <xs:element name="organizational_readiness_assessment">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
@ -71,7 +71,7 @@
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="team"> <xs:element name="team">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
@ -79,7 +79,7 @@
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="member"> <xs:element name="member">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
@ -88,15 +88,15 @@
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="expertise" type="xs:string"/> <xs:element name="expertise" type="xs:string"/>
<xs:element name="security_incident_management" type="ir_service"/> <xs:element name="security_incident_management" type="ir_service"/>
<xs:element name="technical_artefact_analysis" type="ir_service"/> <xs:element name="technical_artefact_analysis" type="ir_service"/>
<xs:complexType name="ir_service"> <xs:complexType name="ir_service">
<xs:sequence> <xs:sequence>
<xs:element ref="rate"/> <xs:element ref="rate"/>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
<xs:element name="fee"> <xs:element name="fee">
@ -203,7 +203,7 @@
<xs:element ref="contact"/> <xs:element ref="contact"/>
<xs:element ref="generate_targets"/> <xs:element ref="generate_targets"/>
<xs:element name="generate_teammembers"/> <xs:element name="generate_teammembers"/>
<xs:element ref="generate_offer_signature_box"/> <xs:element ref="signature_box"/>
</xs:choice> </xs:choice>
</xs:sequence> </xs:sequence>
<xs:attribute name="id" use="optional" type="xs:ID"/> <xs:attribute name="id" use="optional" type="xs:ID"/>
@ -223,13 +223,32 @@
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="generate_offer_signature_box"/>
<xs:element name="generate_permission_parties"/> <xs:element name="generate_permission_parties"/>
<xs:element name="signature_box">
<xs:complexType>
<xs:all>
<xs:element ref="client_side"/>
<xs:element ref="company_side"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="client_side" type="signature_box_column"/>
<xs:element name="company_side" type="signature_box_column"/>
<xs:complexType name="signature_box_column">
<xs:sequence>
<xs:element name="signee" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="date"/>
<xs:element name="place"/>
</xs:sequence>
</xs:complexType>
<!-- Placeholders --> <!-- Placeholders -->
<xs:group name="placeholders"> <xs:group name="placeholders">
<xs:choice> <xs:choice>
<xs:element name="latest_version_date"/>
<xs:element name="client_long"/> <xs:element name="client_long"/>
<xs:element name="client_short"/> <xs:element name="client_short"/>
<xs:element name="client_street"/> <xs:element name="client_street"/>

View File

@ -385,6 +385,7 @@
<!-- Placeholders --> <!-- Placeholders -->
<xs:group name="placeholders"> <xs:group name="placeholders">
<xs:choice> <xs:choice>
<xs:element name="latest_version_date"/>
<xs:element name="client_long"/> <xs:element name="client_long"/>
<xs:element name="client_short"/> <xs:element name="client_short"/>
<xs:element name="client_street"/> <xs:element name="client_street"/>

View File

@ -2,22 +2,15 @@
<section> <section>
<title>Terms and Conditions</title> <title>Terms and Conditions</title>
<p> <p>
<company_short/> will only perform the <company_short/> will only perform the <company_svc_short/> if it has obtained the permission
<company_svc_short/> if it has obtained the permission from from <generate_permission_parties/> as set out in the penetration testing waiver, attached as
<generate_permission_parties/> as set out in the penetration testing waiver, <b>Annex 2</b>, or provided in a separate document. </p>
attached as <b>Annex 2</b>, or provided in a separate document.
</p>
<p> <p>
<company_short/> <company_short/> performs this assignment on the basis of its general terms and conditions,
performs this assignment on the basis of its general terms and conditions, which are attached to this offer as Annex 1. <company_short/> rejects any general terms and
which are attached to this offer as Annex 1. conditions used by <client_short/>. </p>
<company_short/> rejects any general terms and conditions used by <p>In order to agree to this offer, please sign this letter in duplicate and return it to: </p>
<client_short/>.
</p>
<p>In order to agree to this offer, please sign this letter in duplicate and
return it to:
</p>
<contact> <contact>
<name> <name>
<company_legal_rep/> <company_legal_rep/>
@ -30,7 +23,22 @@
<company_postalcode/> <company_postalcode/>
<company_city/> <company_city/>
</address> </address>
<email><company_email/></email> <email>
<company_email/>
</email>
</contact> </contact>
<generate_offer_signature_box/>
</section> <signature_box>
<client_side>
<signee><client_legal_rep/></signee>
<date><latest_version_date/></date>
<place><client_city/></place>
</client_side>
<company_side>
<signee><company_legal_rep/></signee>
<signee>Its-a-meee!</signee>
<date><latest_version_date/></date>
<place><company_city/></place>
</company_side>
</signature_box>
</section>

View File

@ -129,8 +129,8 @@
<xsl:template name="findingsSummaryContent"> <xsl:template name="findingsSummaryContent">
<fo:table-row xsl:use-attribute-sets="TableFont"> <fo:table-row xsl:use-attribute-sets="TableFont">
<xsl:if test="position() mod 2 != 0"> <xsl:if test="position() mod 2 != 0">
<xsl:attribute name="background-color">#ededed</xsl:attribute> <xsl:attribute name="background-color">#ededed</xsl:attribute>
</xsl:if> </xsl:if>
<fo:table-cell xsl:use-attribute-sets="td"> <fo:table-cell xsl:use-attribute-sets="td">
<fo:block> <fo:block>
<!-- attach id to first finding of each threatLevel so pie charts can link to it --> <!-- attach id to first finding of each threatLevel so pie charts can link to it -->
@ -231,8 +231,8 @@
<xsl:template name="recommendationsSummaryContent"> <xsl:template name="recommendationsSummaryContent">
<fo:table-row xsl:use-attribute-sets="TableFont"> <fo:table-row xsl:use-attribute-sets="TableFont">
<xsl:if test="position() mod 2 != 0"> <xsl:if test="position() mod 2 != 0">
<xsl:attribute name="background-color">#ededed</xsl:attribute> <xsl:attribute name="background-color">#ededed</xsl:attribute>
</xsl:if> </xsl:if>
<fo:table-cell xsl:use-attribute-sets="td"> <fo:table-cell xsl:use-attribute-sets="td">
<fo:block> <fo:block>
<fo:basic-link xsl:use-attribute-sets="link"> <fo:basic-link xsl:use-attribute-sets="link">
@ -252,7 +252,8 @@
<fo:block> <fo:block>
<xsl:choose> <xsl:choose>
<xsl:when test="recommendation_summary"> <xsl:when test="recommendation_summary">
<xsl:apply-templates select="recommendation_summary" mode="summarytable"/> <xsl:apply-templates select="recommendation_summary" mode="summarytable"
/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:apply-templates select="recommendation" mode="summarytable"/> <xsl:apply-templates select="recommendation" mode="summarytable"/>
@ -308,142 +309,6 @@
</fo:block> </fo:block>
</xsl:template> </xsl:template>
<xsl:template match="generate_offer_signature_box">
<xsl:call-template name="generateSignatureBox">
<xsl:with-param name="latestVersionDate" select="$latestVersionDate"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="generateSignatureBox">
<xsl:param name="latestVersionDate"/>
<fo:block keep-together.within-page="always" xsl:use-attribute-sets="signaturebox">
<fo:block xsl:use-attribute-sets="title-client">
<xsl:call-template name="getString">
<xsl:with-param name="stringID" select="'signed_dupe'"/>
</xsl:call-template>
</fo:block>
<fo:block>
<fo:table xsl:use-attribute-sets="fwtable borders">
<fo:table-column column-width="proportional-column-width(50)"
xsl:use-attribute-sets="borders"/>
<fo:table-column column-width="proportional-column-width(50)"
xsl:use-attribute-sets="borders"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>
<xsl:value-of select="$latestVersionDate"/>
</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>
<xsl:value-of select="$latestVersionDate"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>
<xsl:value-of select="/*/meta/permission_parties/client/city"/>
</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>
<xsl:value-of select="/*/meta/company/city"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>&#160;</fo:block>
<fo:block>&#160;</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>&#160;</fo:block>
<fo:block>&#160;</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>
<xsl:choose>
<xsl:when test="/offerte">
<xsl:value-of
select="/*/meta/permission_parties/client/legal_rep"/>
</xsl:when>
<xsl:when test="/quickscope">
<xsl:value-of select="/*/customer/legal_rep"/>
</xsl:when>
</xsl:choose>
</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>
<xsl:choose>
<xsl:when test="/offerte">
<xsl:value-of select="/*/meta/company/legal_rep"/>
</xsl:when>
<xsl:when test="/quickscope">
<xsl:value-of select="/*/company/legal_rep"/>
</xsl:when>
</xsl:choose>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block xsl:use-attribute-sets="bold">
<xsl:choose>
<xsl:when test="/offerte">
<xsl:value-of
select="/*/meta/permission_parties/client/full_name"/>
</xsl:when>
<xsl:when test="/quickscope">
<xsl:value-of select="/*/customer/full_name"/>
</xsl:when>
</xsl:choose>
</fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block xsl:use-attribute-sets="bold">
<xsl:choose>
<xsl:when test="/offerte">
<xsl:value-of select="/*/meta/company/full_name"/>
</xsl:when>
<xsl:when test="/quickscope">
<xsl:value-of select="/*/company/full_name"/>
</xsl:when>
</xsl:choose>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:block>
</xsl:template>
<xsl:template match="generate_permission_parties"> <xsl:template match="generate_permission_parties">
<xsl:for-each select="/*/meta/permission_parties/client | /*/meta/permission_parties/party"> <xsl:for-each select="/*/meta/permission_parties/client | /*/meta/permission_parties/party">
<xsl:if test="self::party and not(following-sibling::party)"> <xsl:if test="self::party and not(following-sibling::party)">

View File

@ -32,15 +32,15 @@
<xsl:apply-templates/> <xsl:apply-templates/>
</fo:block> </fo:block>
</xsl:template> </xsl:template>
<xsl:template match="li/p"> <xsl:template match="li/p">
<fo:block xsl:use-attribute-sets="li"> <fo:block xsl:use-attribute-sets="li">
<xsl:apply-templates/> <xsl:apply-templates/>
</fo:block> </fo:block>
</xsl:template> </xsl:template>
<!-- special case for p in summary table to avoid checkiflast - all other elements can ignore mode --> <!-- special case for p in summary table to avoid checkiflast - all other elements can ignore mode -->
<xsl:template match="*" mode="summarytable"> <xsl:template match="*" mode="summarytable">
<xsl:apply-templates select="."/> <xsl:apply-templates select="."/>
</xsl:template> </xsl:template>
@ -49,8 +49,8 @@
<xsl:template match="p" mode="summarytable"> <xsl:template match="p" mode="summarytable">
<xsl:apply-templates mode="summarytable"/> <xsl:apply-templates mode="summarytable"/>
</xsl:template> </xsl:template>
<xsl:template match="pre"> <xsl:template match="pre">
<fo:block xsl:use-attribute-sets="pre"> <fo:block xsl:use-attribute-sets="pre">
@ -67,4 +67,125 @@
</fo:block> </fo:block>
</xsl:template> </xsl:template>
<xsl:template match="signature_box">
<xsl:variable name="signee-difference"
select="count(client_side/signee) - count(company_side/signee)"/>
<fo:block keep-together.within-page="always" xsl:use-attribute-sets="signaturebox">
<fo:block xsl:use-attribute-sets="title-client">
<xsl:call-template name="getString">
<xsl:with-param name="stringID" select="'signed_dupe'"/>
</xsl:call-template>
</fo:block>
<fo:block>
<fo:table xsl:use-attribute-sets="fwtable borders">
<fo:table-column column-width="proportional-column-width(50)"
xsl:use-attribute-sets="borders"/>
<fo:table-column column-width="proportional-column-width(50)"
xsl:use-attribute-sets="borders"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>For <fo:inline xsl:use-attribute-sets="bold"><xsl:value-of
select="//client/full_name"/></fo:inline></fo:block>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td">
<fo:block>For <fo:inline xsl:use-attribute-sets="bold"><xsl:value-of
select="//company/full_name"/></fo:inline></fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<!-- client side -->
<fo:table-cell xsl:use-attribute-sets="td">
<xsl:if test="$signee-difference &lt; 0">
<xsl:call-template name="insertEmptyBlocks">
<xsl:with-param name="times" select="abs($signee-difference)"/>
</xsl:call-template>
</xsl:if>
<xsl:for-each select="client_side/signee">
<xsl:call-template name="signeeBlock"/>
</xsl:for-each>
</fo:table-cell>
<!-- company side -->
<fo:table-cell xsl:use-attribute-sets="td">
<xsl:if test="$signee-difference > 0">
<xsl:call-template name="insertEmptyBlocks">
<xsl:with-param name="times" select="$signee-difference"/>
</xsl:call-template>
</xsl:if>
<xsl:for-each select="company_side/signee">
<xsl:call-template name="signeeBlock"/>
</xsl:for-each>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<xsl:for-each select="client_side/place">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:for-each>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td">
<xsl:for-each select="company_side/place">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:for-each>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell xsl:use-attribute-sets="td">
<xsl:for-each select="client_side/date">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:for-each>
</fo:table-cell>
<fo:table-cell xsl:use-attribute-sets="td">
<xsl:for-each select="company_side/date">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:for-each>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:block>
</xsl:template>
<xsl:template name="signeeBlock">
<fo:block-container xsl:use-attribute-sets="signee">
<fo:block xsl:use-attribute-sets="signee_dottedline">
<fo:leader leader-pattern="dots" leader-length="8cm"/>
</fo:block>
<fo:block xsl:use-attribute-sets="signee_name">
<xsl:apply-templates/>
</fo:block>
</fo:block-container>
</xsl:template>
<xsl:template name="emptyBlock">
<fo:block-container xsl:use-attribute-sets="signee">
<fo:block>&#160;
</fo:block>
</fo:block-container>
</xsl:template>
<xsl:template name="insertEmptyBlocks">
<xsl:param name="index" select="1"/>
<xsl:param name="times"/>
<xsl:call-template name="emptyBlock"/>
<xsl:if test="not($index = $times)">
<xsl:call-template name="insertEmptyBlocks">
<xsl:with-param name="index" select="$index + 1"/>
<xsl:with-param name="times" select="$times"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -25,6 +25,9 @@
<!-- PLACEHOLDERS --> <!-- PLACEHOLDERS -->
<xsl:template match="latest_version_date">
<xsl:value-of select="$latestVersionDate"/>
</xsl:template>
<xsl:template match="client_long"> <xsl:template match="client_long">
<xsl:param name="placeholderElement" select="/*/meta//client/full_name"/> <xsl:param name="placeholderElement" select="/*/meta//client/full_name"/>
<xsl:call-template name="checkPlaceholder"> <xsl:call-template name="checkPlaceholder">

View File

@ -26,4 +26,17 @@
<xsl:attribute-set name="region-body-cover"> <xsl:attribute-set name="region-body-cover">
</xsl:attribute-set> </xsl:attribute-set>
<!-- Signature box -->
<xsl:attribute-set name="signee">
<xsl:attribute name="height">2.75cm</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="signee_name">
<xsl:attribute name="text-align">right</xsl:attribute>
<xsl:attribute name="margin-right">0.75cm</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="signee_dottedline">
<xsl:attribute name="margin-top">1.75cm</xsl:attribute>
<xsl:attribute name="text-align">right</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet> </xsl:stylesheet>