From adaa01fa3756fc93c2f728e3921fdb45f6bbe65e Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Mon, 23 Nov 2015 15:55:26 -0800 Subject: [PATCH] CRM-16761 - Form and message template fixes. ---------------------------------------- * CRM-16761: Self service view, update and cancel for CiviEvent https://issues.civicrm.org/jira/browse/CRM-16761 --- CRM/Event/Form/ManageEvent/Registration.php | 4 +- .../civicrm_msg_template.tpl | 1 + .../event_online_receipt_html.tpl | 526 ++++++++++++++++++ .../event_online_receipt_text.tpl | 310 +++++++++++ .../participant_confirm_html.tpl | 201 +++++++ .../participant_confirm_text.tpl | 93 ++++ .../Incremental/sql/4.7.beta1.mysql.tpl | 2 + .../Event/Form/ManageEvent/Registration.hlp | 15 + .../Event/Form/ManageEvent/Registration.tpl | 17 + .../event_online_receipt_html.tpl | 10 +- .../event_online_receipt_text.tpl | 4 +- .../participant_confirm_html.tpl | 12 +- .../participant_confirm_text.tpl | 6 +- 13 files changed, 1189 insertions(+), 12 deletions(-) create mode 100644 CRM/Upgrade/4.7.beta1.msg_template/civicrm_msg_template.tpl create mode 100644 CRM/Upgrade/4.7.beta1.msg_template/message_templates/event_online_receipt_html.tpl create mode 100644 CRM/Upgrade/4.7.beta1.msg_template/message_templates/event_online_receipt_text.tpl create mode 100644 CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_confirm_html.tpl create mode 100644 CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_confirm_text.tpl diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index b7ed542941..c322214cfb 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -289,8 +289,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent $this->add('text', 'expiration_time', ts('Pending participant expiration (hours)')); $this->addRule('expiration_time', ts('Please enter the number of hours (as an integer).'), 'integer'); - $this->addField('allow_selfcancelxfer', array('label' => ts('Allow self cancel/transfer?'), 'type' => 'advcheckbox')); - $this->add('text', 'selfcancelxfer_time', ts('Self cancel/transfer time limit (hours)')); + $this->addField('allow_selfcancelxfer', array('label' => ts('Allow self-service cancellation or transfer?'), 'type' => 'advcheckbox')); + $this->add('text', 'selfcancelxfer_time', ts('Cancellation or transfer time limit (hours)')); $this->addRule('selfcancelxfer_time', ts('Please enter the number of hours (as an integer).'), 'integer'); self::buildRegistrationBlock($this); self::buildConfirmationBlock($this); diff --git a/CRM/Upgrade/4.7.beta1.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.7.beta1.msg_template/civicrm_msg_template.tpl new file mode 100644 index 0000000000..51f6d364fc --- /dev/null +++ b/CRM/Upgrade/4.7.beta1.msg_template/civicrm_msg_template.tpl @@ -0,0 +1 @@ +{* TO DO: Add upgrade logic to update event_online msg templates and insert participant_transferred and cancelled msg templates. *} \ No newline at end of file diff --git a/CRM/Upgrade/4.7.beta1.msg_template/message_templates/event_online_receipt_html.tpl b/CRM/Upgrade/4.7.beta1.msg_template/message_templates/event_online_receipt_html.tpl new file mode 100644 index 0000000000..5f13bcc55e --- /dev/null +++ b/CRM/Upgrade/4.7.beta1.msg_template/message_templates/event_online_receipt_html.tpl @@ -0,0 +1,526 @@ + + + + + + + + +{capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture} +{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} +{capture assign=tdfirstStyle}style="width: 180px; padding-bottom: 15px;"{/capture} +{capture assign=tdStyle}style="width: 100px;"{/capture} +{capture assign=participantTotal}style="margin: 0.5em 0 0.5em;padding: 0.5em;background-color: #999999;font-weight: bold;color: #FAFAFA;border-radius: 2px;"{/capture} + + +
+ + + + + + + + + + + + + + +
+

{contact.email_greeting},

+ + {if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} +

{$event.confirm_email_text|htmlize}

+ + {else} +

Thank you for your participation. This letter is a confirmation that your registration has been received and your status has been updated to {if $participant_status}{$participant_status}{else}{if $isOnWaitlist}waitlisted{else}registered{/if}{/if}.

+ + {/if} + +

+ {if $isOnWaitlist} +

{ts}You have been added to the WAIT LIST for this event.{/ts}

+ {if $isPrimary} +

{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts}

+ {/if} + {elseif $isRequireApproval} +

{ts}Your registration has been submitted.{/ts}

+ {if $isPrimary} +

{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}

+ {/if} + {elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant} +

{$pay_later_receipt}

{* FIXME: this might be text rather than HTML *} + {else} +

{ts}Please print this confirmation for your records.{/ts}

+ {/if} + +
+ + + + + + + + + + {if $conference_sessions} + + + + + + + {/if} + + {if $event.participant_role neq 'Attendee' and $defaultRole} + + + + + {/if} + + {if $isShowLocation} + + + + {/if} + + {if $location.phone.1.phone || $location.email.1.email} + + + + {foreach from=$location.phone item=phone} + {if $phone.phone} + + + + + {/if} + {/foreach} + {foreach from=$location.email item=eventEmail} + {if $eventEmail.email} + + + + + {/if} + {/foreach} + {/if} + + {if $event.is_public} + + + + {/if} + + {if $event.is_share} + + + + {/if} + {if $payer.name} + + + + + + + {/if} + {if $event.is_monetary} + + + + + + {if $lineItem} + {foreach from=$lineItem item=value key=priceset} + {if $value neq 'skip'} + {if $isPrimary} + {if $lineItem|@count GT 1} {* Header for multi participant registration cases. *} + + + + {/if} + {/if} + + + + {/if} + {/foreach} + {if $dataArray} + + + + + {foreach from=$dataArray item=value key=priceset} + + {if $priceset || $priceset == 0} + + + {else} + + + {/if} + + {/foreach} + {/if} + {/if} + + {if $amounts && !$lineItem} + {foreach from=$amounts item=amnt key=level} + + + + {/foreach} + {/if} + + {if $totalTaxAmount} + + + + + {/if} + {if $isPrimary} + + + + + {if $pricesetFieldsCount } + + + + {/if} + + {if $register_date} + + + + + {/if} + + {if $receive_date} + + + + + {/if} + + {if $contributionTypeName} + + + + + {/if} + + {if $trxn_id} + + + + + {/if} + + {if $paidBy} + + + + + {/if} + + {if $checkNumber} + + + + + {/if} + + {if $contributeMode ne 'notify' and !$isAmountzero and (!$is_pay_later or $isBillingAddressRequiredForPayLater) and !$isOnWaitlist and !$isRequireApproval} + + + + + + + {/if} + + {if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval} + + + + + + + {/if} + + {/if} + + {/if} {* End of conditional section for Paid events *} + + +{if $customPre} +{foreach from=$customPre item=customPr key=i} + + {foreach from=$customPr item=customValue key=customName} + {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} + + + + + {/if} + {/foreach} +{/foreach} +{/if} + +{if $customPost} +{foreach from=$customPost item=customPos key=j} + + {foreach from=$customPos item=customValue key=customName} + {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} + + + + +{/if} +{/foreach} +{/foreach} +{/if} + +{if $customProfile} +{foreach from=$customProfile.profile item=eachParticipant key=participantID} + + {foreach from=$eachParticipant item=eachProfile key=pid} + + {foreach from=$eachProfile item=val key=field} + {foreach from=$val item=v key=f} + + + {/foreach} + + {/foreach} +{/foreach} +{/foreach} +{/if} + + {if $customGroup} + {foreach from=$customGroup item=value key=customName} + + + + {foreach from=$value item=v key=n} + + + + + {/foreach} + {/foreach} + {/if} + {if $event.allow_selfcancelxfer } + + + + {/if} +
+ {ts}Event Information and Location{/ts} +
+ {$event.event_title}
+ {$event.event_start_date|date_format:"%A"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:"%A"} {$event.event_end_date|crmDate}{/if}{/if} +
+ {ts}Your schedule:{/ts} +
+ {assign var='group_by_day' value='NA'} + {foreach from=$conference_sessions item=session} + {if $session.start_date|date_format:"%Y/%m/%d" != $group_by_day|date_format:"%Y/%m/%d"} + {assign var='group_by_day' value=$session.start_date} + {$group_by_day|date_format:"%m/%d/%Y"}
+ {/if} + {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
+ {if $session.location}    {$session.location}
{/if} + {/foreach} +
+ {ts}Participant Role{/ts} + + {$event.participant_role} +
+ {if $location.address.1.name} + {$location.address.1.name}
+ {/if} + {if $location.address.1.street_address} + {$location.address.1.street_address}
+ {/if} + {if $location.address.1.supplemental_address_1} + {$location.address.1.supplemental_address_1}
+ {/if} + {if $location.address.1.supplemental_address_2} + {$location.address.1.supplemental_address_2}
+ {/if} + {if $location.address.1.city} + {$location.address.1.city}, {$location.address.1.state_province} {$location.address.1.postal_code}{if $location.address.1.postal_code_suffix} - {$location.address.1.postal_code_suffix}{/if}
+ {/if} +
+ {ts}Event Contacts:{/ts} +
+ {if $phone.phone_type} + {$phone.phone_type_display} + {else} + {ts}Phone{/ts} + {/if} + + {$phone.phone} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if} +
+ {ts}Email{/ts} + + {$eventEmail.email} +
+ {capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture} + {ts}Download iCalendar File{/ts} +
+ {capture assign=eventUrl}{crmURL p='civicrm/event/info' q="id=`$event.id`&reset=1" a=true fe=1 h=1}{/capture} + {include file="CRM/common/SocialNetwork.tpl" emailMode=true url=$eventUrl title=$event.title pageURL=$eventUrl} +
+ {ts}You were registered by:{/ts} +
+ {$payer.name} +
+ {$event.fee_label} +
+ {ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info} +
+ {* FIXME: style this table so that it looks like the text version (justification, etc.) *} + + + + + {if $dataArray} + + + + {/if} + + {if $pricesetFieldsCount }{/if} + + {foreach from=$value item=line} + + + + + {if $dataArray} + + {if $line.tax_rate != "" || $line.tax_amount != ""} + + + {else} + + + {/if} + {/if} + + {if $pricesetFieldsCount } {/if} + + {/foreach} + {if $individual} + + + + + + + {/if} +
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}SubTotal{/ts}{ts}Tax Rate{/ts}{ts}Tax Amount{/ts}{ts}Total{/ts}{ts}Total Participants{/ts}
+ {if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description}
{$line.description|truncate:30:"..."}
{/if} +
+ {$line.qty} + + {$line.unit_price|crmMoney:$currency} + + {$line.unit_price*$line.qty|crmMoney} + + {$line.tax_rate|string_format:"%.2f"}% + + {$line.tax_amount|crmMoney} + + {$line.line_total+$line.tax_amount|crmMoney:$currency} + {$line.participant_count}
{ts}Participant Total{/ts}{$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney}{$individual.$priceset.totalTaxAmt|crmMoney}{$individual.$priceset.totalAmtWithTax|crmMoney}
+
+ {ts} Amount Before Tax: {/ts} + + {$totalAmount-$totalTaxAmount|crmMoney} +
 {$taxTerm} {$priceset|string_format:"%.2f"}% {$value|crmMoney:$currency} {ts}No{/ts} {$taxTerm} {$value|crmMoney:$currency}
+ {$amnt.amount|crmMoney:$currency} {$amnt.label} +
+ {ts}Total Tax Amount{/ts} + + {$totalTaxAmount|crmMoney:$currency} +
+ {ts}Total Amount{/ts} + + {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if} +
+ {ts}Total Participants{/ts} + {assign var="count" value= 0} + {foreach from=$lineItem item=pcount} + {assign var="lineItemCount" value=0} + {if $pcount neq 'skip'} + {foreach from=$pcount item=p_count} + {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count} + {/foreach} + {if $lineItemCount < 1 } + {assign var="lineItemCount" value=1} + {/if} + {assign var="count" value=$count+$lineItemCount} + {/if} + {/foreach} + {$count} +
+ {ts}Registration Date{/ts} + + {$register_date|crmDate} +
+ {ts}Transaction Date{/ts} + + {$receive_date|crmDate} +
+ {ts}Financial Type{/ts} + + {$contributionTypeName} +
+ {ts}Transaction #{/ts} + + {$trxn_id} +
+ {ts}Paid By{/ts} + + {$paidBy} +
+ {ts}Check Number{/ts} + + {$checkNumber} +
+ {ts}Billing Name and Address{/ts} +
+ {$billingName}
+ {$address|nl2br} +
+ {ts}Credit Card Information{/ts} +
+ {$credit_card_type}
+ {$credit_card_number}
+ {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} +
{$customPre_grouptitle.$i}
{$customName}{$customValue}
{$customPost_grouptitle.$j}
{$customName}{$customValue}
{ts 1=$participantID+2}Participant %1{/ts}
{$customProfile.title.$pid}
{$field}{$v}
+ {$customName} +
+ {$n} + + {$v} +
+ {ts 1=$event.selfcancelxfer_time}You may transfer your registration to another participant or cancel your registration up to %1 hours before the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}
+ {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} + {ts}Click here to transfer or cancel your registration.{/ts} +
+
+
+ + + diff --git a/CRM/Upgrade/4.7.beta1.msg_template/message_templates/event_online_receipt_text.tpl b/CRM/Upgrade/4.7.beta1.msg_template/message_templates/event_online_receipt_text.tpl new file mode 100644 index 0000000000..85a6177114 --- /dev/null +++ b/CRM/Upgrade/4.7.beta1.msg_template/message_templates/event_online_receipt_text.tpl @@ -0,0 +1,310 @@ +{contact.email_greeting}, + +{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} +{$event.confirm_email_text} + +{else} +Thank you for your participation. This letter is a confirmation that your registration has been received and your status has been updated to {if $participant_status}{$participant_status}{else}{if $isOnWaitlist}waitlisted{else}registered{/if}{/if}. + +{/if} + +{if $isOnWaitlist} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{ts}You have been added to the WAIT LIST for this event.{/ts} + +{if $isPrimary} +{ts}If space becomes available you will receive an email with a link to a web page where you can complete your registration.{/ts} +{/if} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{elseif $isRequireApproval} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{ts}Your registration has been submitted.{/ts} + +{if $isPrimary} +{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} + +{/if} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{elseif $is_pay_later && !$isAmountzero && !$isAdditionalParticipant} + +==========================================================={if $pricesetFieldsCount }===================={/if} + +{$pay_later_receipt} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{else} + +{ts}Please print this confirmation for your records.{/ts} +{/if} + + +==========================================================={if $pricesetFieldsCount }===================={/if} + +{ts}Event Information and Location{/ts} + +==========================================================={if $pricesetFieldsCount }===================={/if} + +{$event.event_title} +{$event.event_start_date|date_format:"%A"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:"%A"} {$event.event_end_date|crmDate}{/if}{/if} +{if $conference_sessions} + + +{ts}Your schedule:{/ts} +{assign var='group_by_day' value='NA'} +{foreach from=$conference_sessions item=session} +{if $session.start_date|date_format:"%Y/%m/%d" != $group_by_day|date_format:"%Y/%m/%d"} +{assign var='group_by_day' value=$session.start_date} + +{$group_by_day|date_format:"%m/%d/%Y"} + + +{/if} +{$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title} +{if $session.location} {$session.location}{/if} +{/foreach} +{/if} + +{if $event.participant_role neq 'Attendee' and $defaultRole} +{ts}Participant Role{/ts}: {$event.participant_role} +{/if} + +{if $isShowLocation} +{if $location.address.1.name} + +{$location.address.1.name} +{/if} +{if $location.address.1.street_address}{$location.address.1.street_address} +{/if} +{if $location.address.1.supplemental_address_1}{$location.address.1.supplemental_address_1} +{/if} +{if $location.address.1.supplemental_address_2}{$location.address.1.supplemental_address_2} +{/if} +{if $location.address.1.city}{$location.address.1.city}, {$location.address.1.state_province} {$location.address.1.postal_code}{if $location.address.1.postal_code_suffix} - {$location.address.1.postal_code_suffix}{/if} +{/if} + +{/if}{*End of isShowLocation condition*} + +{if $location.phone.1.phone || $location.email.1.email} + +{ts}Event Contacts:{/ts} +{foreach from=$location.phone item=phone} +{if $phone.phone} + +{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} {if $phone.phone_ext} {ts}ext.{/ts} {$phone.phone_ext}{/if} +{/foreach} +{foreach from=$location.email item=eventEmail} +{if $eventEmail.email} + +{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} +{/if} + +{if $event.is_public} +{capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture} +{ts}Download iCalendar File:{/ts} {$icalFeed} +{/if} + +{if $payer.name} +You were registered by: {$payer.name} +{/if} +{if $event.is_monetary} {* This section for Paid events only.*} + +==========================================================={if $pricesetFieldsCount }===================={/if} + +{$event.fee_label} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{if $lineItem}{foreach from=$lineItem item=value key=priceset} + +{if $value neq 'skip'} +{if $isPrimary} +{if $lineItem|@count GT 1} {* Header for multi participant registration cases. *} +{ts 1=$priceset+1}Participant %1{/ts} {$part.$priceset.info} + +{/if} +{/if} +-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if} + +{capture assign=ts_item}{ts}Item{/ts}{/capture} +{capture assign=ts_qty}{ts}Qty{/ts}{/capture} +{capture assign=ts_each}{ts}Each{/ts}{/capture} +{if $dataArray} +{capture assign=ts_subtotal}{ts}Subtotal{/ts}{/capture} +{capture assign=ts_taxRate}{ts}Tax Rate{/ts}{/capture} +{capture assign=ts_taxAmount}{ts}Tax Amount{/ts}{/capture} +{/if} +{capture assign=ts_total}{ts}Total{/ts}{/capture} +{if $pricesetFieldsCount }{capture assign=ts_participant_total}{ts}Total Participants{/ts}{/capture}{/if} +{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {if $dataArray} {$ts_subtotal|string_format:"%10s"} {$ts_taxRate|string_format:"%10s"} {$ts_taxAmount|string_format:"%10s"} {/if} {$ts_total|string_format:"%10s"} {$ts_participant_total|string_format:"%10s"} +-----------------------------------------------------------{if $pricesetFieldsCount }-----------------------------------------------------{/if} + +{foreach from=$value item=line} +{if $pricesetFieldsCount }{capture assign=ts_participant_count}{$line.participant_count}{/capture}{/if} +{capture assign=ts_item}{if $line.html_type eq 'Text'}{$line.label}{else}{$line.field_title} - {$line.label}{/if} {if $line.description} {$line.description}{/if}{/capture}{$ts_item|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney:$currency|string_format:"%10s"} {if $dataArray} {$line.unit_price*$line.qty|crmMoney:$currency|string_format:"%10s"} {if $line.tax_rate != "" || $line.tax_amount != ""} {$line.tax_rate|string_format:"%.2f"} % {$line.tax_amount|crmMoney:$currency|string_format:"%10s"} {else} {/if} {/if} {$line.line_total+$line.tax_amount|crmMoney:$currency|string_format:"%10s"}{$ts_participant_count|string_format:"%10s"} +{/foreach} +---------------------------------------------------------------------------------------------------------------- +{if $individual}{ts}Participant Total{/ts} {$individual.$priceset.totalAmtWithTax-$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%29s"} {$individual.$priceset.totalTaxAmt|crmMoney:$currency|string_format:"%33s"} {$individual.$priceset.totalAmtWithTax|crmMoney:$currency|string_format:"%12s"}{/if} +{/if} +{""|string_format:"%120s"} +{/foreach} +{""|string_format:"%120s"} + +{if $dataArray} +{ts}Amount before Tax{/ts}: {$totalAmount-$totalTaxAmount|crmMoney:$currency} + +{foreach from=$dataArray item=value key=priceset} +{if $priceset || $priceset == 0} +{$taxTerm} {$priceset|string_format:"%.2f"}%: {$value|crmMoney:$currency} +{else} +{ts}No{/ts} {$taxTerm}: {$value|crmMoney:$currency} +{/if} +{/foreach} +{/if} +{/if} + +{if $amounts && !$lineItem} +{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label} +{/foreach} +{/if} + +{if $totalTaxAmount} +{ts}Total Tax Amount{/ts}: {$totalTaxAmount|crmMoney:$currency} +{/if} +{if $isPrimary } + +{ts}Total Amount{/ts}: {$totalAmount|crmMoney:$currency} {if $hookDiscount.message}({$hookDiscount.message}){/if} + +{if $pricesetFieldsCount } + {assign var="count" value= 0} + {foreach from=$lineItem item=pcount} + {assign var="lineItemCount" value=0} + {if $pcount neq 'skip'} + {foreach from=$pcount item=p_count} + {assign var="lineItemCount" value=$lineItemCount+$p_count.participant_count} + {/foreach} + {if $lineItemCount < 1 } + {assign var="lineItemCount" value=1} + {/if} + {assign var="count" value=$count+$lineItemCount} + {/if} + {/foreach} + +{ts}Total Participants{/ts}: {$count} +{/if} + +{if $register_date} +{ts}Registration Date{/ts}: {$register_date|crmDate} +{/if} +{if $receive_date} +{ts}Transaction Date{/ts}: {$receive_date|crmDate} +{/if} +{if $contributionTypeName} +{ts}Financial Type{/ts}: {$contributionTypeName} +{/if} +{if $trxn_id} +{ts}Transaction #{/ts}: {$trxn_id} +{/if} +{if $paidBy} +{ts}Paid By{/ts}: {$paidBy} +{/if} +{if $checkNumber} +{ts}Check Number{/ts}: {$checkNumber} +{/if} +{if $contributeMode ne 'notify' and !$isAmountzero and (!$is_pay_later or $isBillingAddressRequiredForPayLater) and !$isOnWaitlist and !$isRequireApproval} + +==========================================================={if $pricesetFieldsCount }===================={/if} + +{ts}Billing Name and Address{/ts} + +==========================================================={if $pricesetFieldsCount }===================={/if} + +{$billingName} +{$address} +{/if} + +{if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{ts}Credit Card Information{/ts} + +==========================================================={if $pricesetFieldsCount }===================={/if} + +{$credit_card_type} +{$credit_card_number} +{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} +{/if} +{/if} +{/if} {* End of conditional section for Paid events *} + +{if $customPre} +{foreach from=$customPre item=customPr key=i} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{$customPre_grouptitle.$i} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{foreach from=$customPr item=customValue key=customName} +{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} + {$customName}: {$customValue} +{/if} +{/foreach} +{/foreach} +{/if} + +{if $customPost} +{foreach from=$customPost item=customPos key=j} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{$customPost_grouptitle.$j} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{foreach from=$customPos item=customValue key=customName} +{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} + {$customName}: {$customValue} +{/if} +{/foreach} +{/foreach} +{/if} +{if $customProfile} + +{foreach from=$customProfile.profile item=eachParticipant key=participantID} +==========================================================={if $pricesetFieldsCount }===================={/if} + +{ts 1=$participantID+2}Participant Information - Participant %1{/ts} + +==========================================================={if $pricesetFieldsCount }===================={/if} + +{foreach from=$eachParticipant item=eachProfile key=pid} +----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} + +{$customProfile.title.$pid} +----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} + +{foreach from=$eachProfile item=val key=field} +{foreach from=$val item=v key=f} +{$field}: {$v} +{/foreach} +{/foreach} +{/foreach} +{/foreach} +{/if} +{if $customGroup} +{foreach from=$customGroup item=value key=customName} +=========================================================={if $pricesetFieldsCount }===================={/if} + +{$customName} +=========================================================={if $pricesetFieldsCount }===================={/if} + +{foreach from=$value item=v key=n} +{$n}: {$v} +{/foreach} +{/foreach} +{/if} +{if $event.allow_selfcancelxfer } +{ts 1=$event.selfcancelxfer_time}You may transfer your registration to another participant or cancel your registration up to %1 hours before the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if} + {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} +{ts}Transfer or cancel your registration:{/ts} {$selfService} +{/if} diff --git a/CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_confirm_html.tpl b/CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_confirm_html.tpl new file mode 100644 index 0000000000..7585ee306f --- /dev/null +++ b/CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_confirm_html.tpl @@ -0,0 +1,201 @@ + + + + + + + + +{capture assign=headerStyle}colspan="2" style="text-align: left; padding: 4px; border-bottom: 1px solid #999; background-color: #eee;"{/capture} +{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} + +
+ + + + + + + + + + + + {if !$isAdditional and $participant.id} + + + + + + + {/if} + {if $event.allow_selfcancelxfer } + This event allows for self-cancel or transfer + {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participantID`&{contact.checksum}" h=0 a=1 fe=1}{/capture} + {ts}Self service cancel transfer{/ts} + {/if} + + + + + {if $event.allow_selfcancelxfer } + + + + {/if} + + + + +
+

{ts 1=$contact.display_name}Dear %1{/ts},

+
+ {ts}Confirm Your Registration{/ts} +
+ {capture assign=confirmUrl}{crmURL p='civicrm/event/confirm' q="reset=1&participantId=`$participant.id`&cs=`$checksumValue`" a=true h=0 fe=1}{/capture} + Go to a web page where you can confirm your registration online +
+ + + + + + + + {if $conference_sessions} + + + + + + + {/if} + + + + + + {if $isShowLocation} + + + + {/if} + + {if $event.location.phone.1.phone || $event.location.email.1.email} + + + + {foreach from=$event.location.phone item=phone} + {if $phone.phone} + + + + + {/if} + {/foreach} + {foreach from=$event.location.email item=eventEmail} + {if $eventEmail.email} + + + + + {/if} + {/foreach} + {/if} + + {if $event.is_public} + + + + {/if} + + {if $contact.email} + + + + + + + {/if} + + {if $register_date} + + + + + {/if} + +
+ {ts}Event Information and Location{/ts} +
+ {$event.event_title}
+ {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} +
+ {ts}Your schedule:{/ts} +
+ {assign var='group_by_day' value='NA'} + {foreach from=$conference_sessions item=session} + {if $session.start_date|date_format:"%Y/%m/%d" != $group_by_day|date_format:"%Y/%m/%d"} + {assign var='group_by_day' value=$session.start_date} + {$group_by_day|date_format:"%m/%d/%Y"}
+ {/if} + {$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title}
+ {if $session.location}    {$session.location}
{/if} + {/foreach} +
+ {ts}Participant Role{/ts}: + + {$participant.role} +
+ {if $event.location.address.1.name} + {$event.location.address.1.name}
+ {/if} + {if $event.location.address.1.street_address} + {$event.location.address.1.street_address}
+ {/if} + {if $event.location.address.1.supplemental_address_1} + {$event.location.address.1.supplemental_address_1}
+ {/if} + {if $event.location.address.1.supplemental_address_2} + {$event.location.address.1.supplemental_address_2}
+ {/if} + {if $event.location.address.1.city} + {$event.location.address.1.city} {$event.location.address.1.postal_code} + {if $event.location.address.1.postal_code_suffix} + - {$event.location.address.1.postal_code_suffix} + {/if} + {/if} +
+ {ts}Event Contacts:{/ts} +
+ {if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if} + + {$phone.phone} +
+ {ts}Email{/ts} + + {$eventEmail.email} +
+ {capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture} + {ts}Download iCalendar File{/ts} +
+ {ts}Registered Email{/ts} +
+ {$contact.email} +
+ {ts}Registration Date{/ts} + + {$participant.register_date|crmDate} +
+
+ {ts 1=$event.selfcancelxfer_time}You may transfer your registration to another participant or cancel your registration up to %1 hours before the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}
+ {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} + {ts}Click here to transfer or cancel your registration.{/ts} +
+

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

+
+
+ + + diff --git a/CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_confirm_text.tpl b/CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_confirm_text.tpl new file mode 100644 index 0000000000..cb4795b824 --- /dev/null +++ b/CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_confirm_text.tpl @@ -0,0 +1,93 @@ +{ts 1=$contact.display_name}Dear %1{/ts}, +{if !$isAdditional and $participant.id} + +=========================================================== +{ts}Confirm Your Registration{/ts} + +=========================================================== +{capture assign=confirmUrl}{crmURL p='civicrm/event/confirm' q="reset=1&participantId=`$participant.id`&cs=`$checksumValue`" a=true h=0 fe=1}{/capture} +Click this link to go to a web page where you can confirm your registration online: +{$confirmUrl} +{/if} +{if $event.allow_selfcancelxfer } +{ts 1=$event.selfcancelxfer_time}You may transfer your registration to another participant or cancel your registration up to %1 hours before the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if} + {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} +{ts}Transfer or cancel your registration:{/ts} {$selfService} +{/if} +=========================================================== +{ts}Event Information and Location{/ts} + +=========================================================== +{$event.event_title} +{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} +{if $conference_sessions} + + +{ts}Your schedule:{/ts} +{assign var='group_by_day' value='NA'} +{foreach from=$conference_sessions item=session} +{if $session.start_date|date_format:"%Y/%m/%d" != $group_by_day|date_format:"%Y/%m/%d"} +{assign var='group_by_day' value=$session.start_date} + +{$group_by_day|date_format:"%m/%d/%Y"} + + +{/if} +{$session.start_date|crmDate:0:1}{if $session.end_date}-{$session.end_date|crmDate:0:1}{/if} {$session.title} +{if $session.location} {$session.location}{/if} +{/foreach} +{/if} + + +{ts}Participant Role{/ts}: {$participant.role} + +{if $isShowLocation} +{if $event.location.address.1.name} + +{$event.location.address.1.name} +{/if} +{if $event.location.address.1.street_address}{$event.location.address.1.street_address} +{/if} +{if $event.location.address.1.supplemental_address_1}{$event.location.address.1.supplemental_address_1} +{/if} +{if $event.location.address.1.supplemental_address_2}{$event.location.address.1.supplemental_address_2} +{/if} +{if $event.location.address.1.city}{$event.location.address.1.city} {$event.location.address.1.postal_code}{if $event.location.address.1.postal_code_suffix} - {$event.location.address.1.postal_code_suffix}{/if} +{/if} + +{/if}{*End of isShowLocation condition*} + +{if $event.location.phone.1.phone || $event.location.email.1.email} + +{ts}Event Contacts:{/ts} +{foreach from=$event.location.phone item=phone} +{if $phone.phone} + +{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if}: {$phone.phone}{/if} +{/foreach} +{foreach from=$event.location.email item=eventEmail} +{if $eventEmail.email} + +{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} +{/if} + +{if $event.is_public} +{capture assign=icalFeed}{crmURL p='civicrm/event/ical' q="reset=1&id=`$event.id`" h=0 a=1 fe=1}{/capture} +{ts}Download iCalendar File:{/ts} {$icalFeed} +{/if} + +{if $contact.email} + +=========================================================== +{ts}Registered Email{/ts} + +=========================================================== +{$contact.email} +{/if} + +{if $register_date} +{ts}Registration Date{/ts}: {$participant.register_date|crmDate} +{/if} + +{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts} + diff --git a/CRM/Upgrade/Incremental/sql/4.7.beta1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.7.beta1.mysql.tpl index daa57c465e..372f7b90a7 100644 --- a/CRM/Upgrade/Incremental/sql/4.7.beta1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.7.beta1.mysql.tpl @@ -27,3 +27,5 @@ ALTER TABLE civicrm_participant INSERT INTO civicrm_participant_status_type(name, {localize field='label'}label{/localize}, class, is_reserved, is_active, is_counted, weight, visibility_id) VALUES ('Transferred', {localize}'{ts escape="sql"}Transferred{/ts}'{/localize}, 'Negative', 1, 1, 0, 16, 2); + +{include file='../CRM/Upgrade/4.7.beta1.msg_template/civicrm_msg_template.tpl'} diff --git a/templates/CRM/Event/Form/ManageEvent/Registration.hlp b/templates/CRM/Event/Form/ManageEvent/Registration.hlp index bfb72e9176..42e438bbbc 100644 --- a/templates/CRM/Event/Form/ManageEvent/Registration.hlp +++ b/templates/CRM/Event/Form/ManageEvent/Registration.hlp @@ -94,3 +94,18 @@ {htxt id="id-expiration_time"} {ts}Time limit in hours for confirming/finishing registration by participants with any of the pending statuses. Enter 0 (or leave empty) to disable this feature.{/ts} {/htxt} + +{htxt id="id-allow_selfcancelxfer-title"} + {ts}Allow Self-service Cancellation or Transfer?{/ts} +{/htxt} +{htxt id="id-allow_selfcancelxfer"} +

{ts}Check this box if you want to allow registered participants to either cancel their registration OR transfer it to another participant. If this feature is enabled, event confirmation emails will include a link to a Cancel or Transfer form.{/ts}

+

{ts}Automated refunds for cancellations are NOT currently supported. Participants who have paid for an event will be notified that cancellations are not refundable.{/ts}

+{/htxt} + +{htxt id="id-selfcancelxfer_time-title"} + {ts}Cancellation or Transfer Time Limit{/ts} +{/htxt} +{htxt id="id-selfcancelxfer_time"} + {ts}Number of hours prior to event start date to allow self-service cancellation or transfer. Enter 0 (or leave empty) to allow cancellation or transfer up until the event has started.{/ts} +{/htxt} \ No newline at end of file diff --git a/templates/CRM/Event/Form/ManageEvent/Registration.tpl b/templates/CRM/Event/Form/ManageEvent/Registration.tpl index b2921b4a3e..02164b343a 100644 --- a/templates/CRM/Event/Form/ManageEvent/Registration.tpl +++ b/templates/CRM/Event/Form/ManageEvent/Registration.tpl @@ -487,6 +487,23 @@ $(function($) { }); + var allow_selfCancel = $("#allow_selfcancelxfer"); + if ( !allow_selfCancel.prop('checked') ) { + $('#selfcancelxfer_time').hide(); + $('.crm-event-manage-registration-form-block-selfcancelxfer_time').hide(); + } + allow_selfCancel.change( function( ) { + if ( !$(this).prop('checked') ) { + $("#selfcancelxfer_time").val(''); + $('#selfcancelxfer_time').hide(); + $('.crm-event-manage-registration-form-block-selfcancelxfer_time').hide(); + } else { + $('#selfcancelxfer_time').show(); + $('.crm-event-manage-registration-form-block-selfcancelxfer_time').show(); + } + + }); + $('#registration_blocks').on('click', '.crm-button-add-profile', addBottomProfile); $('#registration_blocks').on('click', '.crm-button-rem-profile', removeBottomProfile); diff --git a/xml/templates/message_templates/event_online_receipt_html.tpl b/xml/templates/message_templates/event_online_receipt_html.tpl index 8e57e70afc..5f13bcc55e 100644 --- a/xml/templates/message_templates/event_online_receipt_html.tpl +++ b/xml/templates/message_templates/event_online_receipt_html.tpl @@ -508,9 +508,13 @@ {/foreach} {/if} {if $event.allow_selfcancelxfer } - This event allows for self-cancel or transfer - {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} - {ts}Self service cancel transfer{/ts} + + + {ts 1=$event.selfcancelxfer_time}You may transfer your registration to another participant or cancel your registration up to %1 hours before the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}
+ {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} + {ts}Click here to transfer or cancel your registration.{/ts} + + {/if} diff --git a/xml/templates/message_templates/event_online_receipt_text.tpl b/xml/templates/message_templates/event_online_receipt_text.tpl index b4647a08c6..85a6177114 100644 --- a/xml/templates/message_templates/event_online_receipt_text.tpl +++ b/xml/templates/message_templates/event_online_receipt_text.tpl @@ -304,7 +304,7 @@ You were registered by: {$payer.name} {/foreach} {/if} {if $event.allow_selfcancelxfer } -This event allows for self-cancel or transfer +{ts 1=$event.selfcancelxfer_time}You may transfer your registration to another participant or cancel your registration up to %1 hours before the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if} {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} - {ts}Self service cancel transfer:{/ts} {$selfService} +{ts}Transfer or cancel your registration:{/ts} {$selfService} {/if} diff --git a/xml/templates/message_templates/participant_confirm_html.tpl b/xml/templates/message_templates/participant_confirm_html.tpl index c7ae2b210c..7585ee306f 100644 --- a/xml/templates/message_templates/participant_confirm_html.tpl +++ b/xml/templates/message_templates/participant_confirm_html.tpl @@ -179,9 +179,17 @@ - + {if $event.allow_selfcancelxfer } + + + {ts 1=$event.selfcancelxfer_time}You may transfer your registration to another participant or cancel your registration up to %1 hours before the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if}
+ {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} + {ts}Click here to transfer or cancel your registration.{/ts} + + + {/if} - +

{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}

diff --git a/xml/templates/message_templates/participant_confirm_text.tpl b/xml/templates/message_templates/participant_confirm_text.tpl index 90d76f0f86..cb4795b824 100644 --- a/xml/templates/message_templates/participant_confirm_text.tpl +++ b/xml/templates/message_templates/participant_confirm_text.tpl @@ -10,9 +10,9 @@ Click this link to go to a web page where you can confirm your registration onli {$confirmUrl} {/if} {if $event.allow_selfcancelxfer } - This event allows for self-cancel or transfer - {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participantID`&{contact.checksum}" h=0 a=1 fe=1}{/capture} - {ts}Self service cancel transfer:{/ts} {$selfService} +{ts 1=$event.selfcancelxfer_time}You may transfer your registration to another participant or cancel your registration up to %1 hours before the event.{/ts} {if $totalAmount}{ts}Cancellations are not refundable.{/ts}{/if} + {capture assign=selfService}{crmURL p='civicrm/event/selfsvcupdate' q="reset=1&pid=`$participant.id`&{contact.checksum}" h=0 a=1 fe=1}{/capture} +{ts}Transfer or cancel your registration:{/ts} {$selfService} {/if} =========================================================== {ts}Event Information and Location{/ts} -- 2.25.1