{capture assign=labelStyle }style="padding: 4px; border-bottom: 1px solid #999; background-color: #f7f7f7;"{/capture}
{capture assign=valueStyle }style="padding: 4px; border-bottom: 1px solid #999;"{/capture}
-<center>
<table id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left; width:100%; max-width:700px; padding:0; margin:0; border:0px;">
<!-- BEGIN HEADER -->
<td>
{assign var="greeting" value="{contact.email_greeting}"}{if $greeting}<p>{$greeting},</p>{/if}
- {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)}
+ {if !empty($event.confirm_email_text) AND (empty($isOnWaitlist) AND empty($isRequireApproval))}
<p>{$event.confirm_email_text|htmlize}</p>
{/if}
- {if $isOnWaitlist}
+ {if !empty($isOnWaitlist)}
<p>{ts}You have been added to the WAIT LIST for this event.{/ts}</p>
- {if $isPrimary}
+ {if !empty($isPrimary)}
<p>{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}</p>
{/if}
- {elseif $isRequireApproval}
+ {elseif !empty($isRequireApproval)}
<p>{ts}Your registration has been submitted.{/ts}</p>
- {if $isPrimary}
+ {if !empty($isPrimary)}
<p>{ts}Once your registration has been reviewed, you will receive an email with a link to a web page where you can complete the registration process.{/ts}</p>
{/if}
- {elseif $is_pay_later}
- <p>{$pay_later_receipt}</p> {* FIXME: this might be text rather than HTML *}
+ {elseif !empty($is_pay_later)}
+ <p>{if isset($pay_later_receipt)}{$pay_later_receipt}{/if}</p> {* FIXME: this might be text rather than HTML *}
{/if}
</td>
</td>
</tr>
- {if $event.participant_role neq 'Attendee' and $defaultRole}
+ {if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and !empty($defaultRole)}
<tr>
<td {$labelStyle}>
{ts}Participant Role{/ts}
</tr>
{/if}
- {if $isShowLocation}
+ {if !empty($isShowLocation)}
<tr>
<td colspan="2" {$valueStyle}>
{$location.address.1.display|nl2br}
</tr>
{/if}
- {if $location.phone.1.phone || $location.email.1.email}
+ {if !empty($location.phone.1.phone) || !empty($location.email.1.email)}
<tr>
<td colspan="2" {$labelStyle}>
{ts}Event Contacts:{/ts}
{/foreach}
{/if}
- {if $event.is_public}
+ {if !empty($event.is_public)}
<tr>
<td colspan="2" {$valueStyle}>
{capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture}
{/if}
- {if $event.is_monetary}
+ {if !empty($event.is_monetary)}
<tr>
<th {$headerStyle}>
- {$event.fee_label}
+ {if !empty($event.fee_label)}{$event.fee_label}{/if}
</th>
</tr>
- {if $lineItem}
+ {if !empty($lineItem)}
{foreach from=$lineItem item=value key=priceset}
{if $value neq 'skip'}
- {if $isPrimary}
+ {if !empty($isPrimary)}
{if $lineItem|@count GT 1} {* Header for multi participant registration cases. *}
<tr>
<td colspan="2" {$labelStyle}>
<th>{ts}Item{/ts}</th>
<th>{ts}Qty{/ts}</th>
<th>{ts}Each{/ts}</th>
- {if $dataArray}
+ {if !empty($dataArray)}
<th>{ts}SubTotal{/ts}</th>
<th>{ts}Tax Rate{/ts}</th>
<th>{ts}Tax Amount{/ts}</th>
{/if}
<th>{ts}Total{/ts}</th>
- {if $pricesetFieldsCount }<th>{ts}Total Participants{/ts}</th>{/if}
+ {if !empty($pricesetFieldsCount) }<th>{ts}Total Participants{/ts}</th>{/if}
</tr>
{foreach from=$value item=line}
<tr>
<td>
{$line.unit_price|crmMoney}
</td>
- {if $dataArray}
+ {if !empty($dataArray)}
<td>
{$line.unit_price*$line.qty|crmMoney}
</td>
- {if $line.tax_rate != "" || $line.tax_amount != ""}
+ {if isset($line.tax_rate) and ($line.tax_rate != "" || $line.tax_amount != "")}
<td>
{$line.tax_rate|string_format:"%.2f"}%
</td>
<td>
{$line.line_total+$line.tax_amount|crmMoney}
</td>
- {if $pricesetFieldsCount }
+ {if !empty($pricesetFieldsCount) }
<td>
{$line.participant_count}
</td>
</tr>
{/if}
{/foreach}
- {if $dataArray}
+ {if !empty($dataArray)}
+ {if isset($totalAmount) and isset($totalTaxAmount)}
<tr>
<td {$labelStyle}>
{ts}Amount Before Tax:{/ts}
{$totalAmount-$totalTaxAmount|crmMoney}
</td>
</tr>
+ {/if}
{foreach from=$dataArray item=value key=priceset}
<tr>
{if $priceset || $priceset == 0}
- <td> {$taxTerm} {$priceset|string_format:"%.2f"}%</td>
+ <td> {if isset($taxTerm)}{$taxTerm}{/if} {$priceset|string_format:"%.2f"}%</td>
<td> {$value|crmMoney:$currency}</td>
{else}
- <td> {ts}No{/ts} {$taxTerm}</td>
+ <td> {ts}No{/ts} {if isset($taxTerm)}{$taxTerm}{/if}</td>
<td> {$value|crmMoney:$currency}</td>
{/if}
</tr>
{/if}
{/if}
- {if $amount && !$lineItem}
+ {if !empty($amount) && !$lineItem}
{foreach from=$amount item=amnt key=level}
<tr>
<td colspan="2" {$valueStyle}>
</tr>
{/foreach}
{/if}
- {if $totalTaxAmount}
+ {if isset($totalTaxAmount)}
<tr>
<td {$labelStyle}>
{ts}Total Tax Amount{/ts}
</td>
</tr>
{/if}
- {if $isPrimary}
+ {if !empty($isPrimary)}
<tr>
<td {$labelStyle}>
- {if $balanceAmount}
+ {if isset($balanceAmount)}
{ts}Total Paid{/ts}
{else}
{ts}Total Amount{/ts}
{/if}
</td>
<td {$valueStyle}>
- {$totalAmount|crmMoney} {if $hookDiscount.message}({$hookDiscount.message}){/if}
+ {if !empty($totalAmount)}{$totalAmount|crmMoney}{/if} {if !empty($hookDiscount.message)}({$hookDiscount.message}){/if}
</td>
</tr>
- {if $balanceAmount}
+ {if isset($balanceAmount)}
<tr>
<td {$labelStyle}>
{ts}Balance{/ts}
</td>
</tr>
{/if}
- {if $pricesetFieldsCount }
+ {if !empty($pricesetFieldsCount) }
<tr>
<td {$labelStyle}>
{ts}Total Participants{/ts}</td>
</td>
</tr>
{/if}
- {if $is_pay_later}
+ {if !empty($is_pay_later)}
<tr>
<td colspan="2" {$labelStyle}>
- {$pay_later_receipt}
+ {if isset($pay_later_receipt)}{$pay_later_receipt}{/if}
</td>
</tr>
{/if}
</tr>
{/if}
- {if $receive_date}
+ {if !empty($receive_date)}
<tr>
<td {$labelStyle}>
{ts}Transaction Date{/ts}
</tr>
{/if}
- {if $financialTypeName}
+ {if !empty($financialTypeName)}
<tr>
<td {$labelStyle}>
{ts}Financial Type{/ts}
</tr>
{/if}
- {if $trxn_id}
+ {if !empty($trxn_id)}
<tr>
<td {$labelStyle}>
{ts}Transaction #{/ts}
</tr>
{/if}
- {if $paidBy}
+ {if !empty($paidBy)}
<tr>
<td {$labelStyle}>
{ts}Paid By{/ts}
</tr>
{/if}
- {if $checkNumber}
+ {if !empty($checkNumber)}
<tr>
<td {$labelStyle}>
{ts}Check Number{/ts}
</tr>
{/if}
- {if $billingName}
+ {if !empty($billingName)}
<tr>
<th {$headerStyle}>
{ts}Billing Name and Address{/ts}
</tr>
{/if}
- {if $credit_card_type}
+ {if !empty($credit_card_type)}
<tr>
<th {$headerStyle}>
{ts}Credit Card Information{/ts}
{/if} {* End of conditional section for Paid events *}
- {if $customPre}
+ {if !empty($customPre)}
<tr>
<th {$headerStyle}>
{$customPre_grouptitle}
</th>
</tr>
{foreach from=$customPre item=value key=customName}
- {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}
+ {if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)}
<tr>
<td {$labelStyle}>
{$customName}
{/foreach}
{/if}
- {if $customPost}
+ {if !empty($customPost)}
<tr>
<th {$headerStyle}>
{$customPost_grouptitle}
</th>
</tr>
{foreach from=$customPost item=value key=customName}
- {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields}
+ {if ( !empty($trackingFields) and ! in_array( $customName, $trackingFields ) ) or empty($trackingFields)}
<tr>
<td {$labelStyle}>
{$customName}
{/foreach}
{/if}
- {if $customProfile}
+ {if !empty($customProfile)}
{foreach from=$customProfile item=value key=customName}
<tr>
<th {$headerStyle}>
{/foreach}
{/if}
- {if $customGroup}
+ {if !empty($customGroup)}
{foreach from=$customGroup item=value key=customName}
<tr>
<th {$headerStyle}>
</tr>
</table>
-</center>
</body>
</html>