Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7297 from jitendrapurohit/selfservice
CRM-16761 -- Self service view, update and cancel for CiviEvent
- Loading branch information
Showing
10 changed files
with
310 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 56 additions & 1 deletion
57
CRM/Upgrade/4.7.beta1.msg_template/civicrm_msg_template.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
{* TO DO: Add upgrade logic to update event_online msg templates and insert participant_transferred and cancelled msg templates. *} | ||
{php} | ||
$dir = SMARTY_DIR . '/../../CRM/Upgrade/4.7.beta1.msg_template/message_templates'; | ||
$templates = array(); | ||
$ovNames = array( | ||
'event' => array( | ||
'participant_transferred' => ts('Events - Registration Transferred Notice', array('escape' => 'sql')), | ||
), | ||
); | ||
|
||
$this->assign('ovNames', $ovNames); | ||
$this->assign('dir', $dir); | ||
|
||
foreach (preg_grep('/\.tpl$/', scandir($dir)) as $filename) { | ||
$parts = explode('_', basename($filename, '.tpl')); | ||
$templates[] = array('type' => array_pop($parts), 'name' => implode('_', $parts), 'filename' => "$dir/$filename"); | ||
} | ||
$this->assign('templates', $templates); | ||
{/php} | ||
{foreach from=$ovNames key=name item=ignore} | ||
SELECT @tpl_ogid_{$name} := MAX(id) FROM civicrm_option_group WHERE name = 'msg_tpl_workflow_{$name}'; | ||
SELECT @max_val := MAX(ROUND(op.value)) FROM civicrm_option_value op WHERE op.option_group_id = @tpl_ogid_{$name}; | ||
SELECT @max_wt := max(weight) from civicrm_option_value where option_group_id=@tpl_ogid_{$name}; | ||
{/foreach} | ||
|
||
INSERT INTO civicrm_option_value | ||
(option_group_id, name, {localize field='label'}label{/localize}, value, weight) VALUES | ||
{foreach from=$ovNames key=gName item=ovs name=for_groups} | ||
{foreach from=$ovs key=vName item=label name=for_values} | ||
(@tpl_ogid_{$gName}, '{$vName}', {localize}'{$label}'{/localize}, (SELECT @max_val := @max_val+1), (SELECT @max_wt := @max_wt+1)) {if $smarty.foreach.for_groups.last and $smarty.foreach.for_values.last};{else},{/if} | ||
{/foreach} | ||
{/foreach} | ||
|
||
{foreach from=$ovNames key=gName item=ovs} | ||
{foreach from=$ovs key=vName item=label} | ||
SELECT @tpl_ovid_{$vName} := MAX(id) FROM civicrm_option_value WHERE option_group_id = @tpl_ogid_{$gName} AND name = '{$vName}'; | ||
{/foreach} | ||
{/foreach} | ||
|
||
INSERT INTO civicrm_msg_template | ||
(msg_title, msg_subject, msg_text, msg_html, workflow_id, is_default, is_reserved) VALUES | ||
{foreach from=$ovNames key=gName item=ovs name=for_groups} | ||
{foreach from=$ovs key=vName item=title name=for_values} | ||
{fetch assign=subject file="`$smarty.const.SMARTY_DIR`/../../CRM/Upgrade/4.7.beta1.msg_template/message_templates/`$vName`_subject.tpl"} | ||
{fetch assign=text file="`$smarty.const.SMARTY_DIR`/../../CRM/Upgrade/4.7.beta1.msg_template/message_templates/`$vName`_text.tpl"} | ||
{fetch assign=html file="`$smarty.const.SMARTY_DIR`/../../CRM/Upgrade/4.7.beta1.msg_template/message_templates/`$vName`_html.tpl"} | ||
('{$title}', '{$subject|escape:"quotes"}', '{$text|escape:"quotes"}', '{$html|escape:"quotes"}', @tpl_ovid_{$vName}, 1, 0), | ||
('{$title}', '{$subject|escape:"quotes"}', '{$text|escape:"quotes"}', '{$html|escape:"quotes"}', @tpl_ovid_{$vName}, 0, 1) {if $smarty.foreach.for_groups.last and $smarty.foreach.for_values.last};{else},{/if} | ||
{/foreach} | ||
{/foreach} | ||
|
||
{foreach from=$templates item=tpl} | ||
{fetch assign=content file=$tpl.filename} | ||
SELECT @workflow_id := MAX(id) FROM civicrm_option_value WHERE name = '{$tpl.name}'; | ||
SELECT @content := msg_{$tpl.type} FROM civicrm_msg_template WHERE workflow_id = @workflow_id AND is_reserved = 1 LIMIT 1; | ||
UPDATE civicrm_msg_template SET msg_{$tpl.type} = '{$content|escape:"quotes"}' WHERE workflow_id = @workflow_id AND (is_reserved = 1 OR (is_default = 1 AND msg_{$tpl.type} = @content)); | ||
{/foreach} |
146 changes: 146 additions & 0 deletions
146
CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_transferred_html.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title></title> | ||
</head> | ||
<body> | ||
|
||
{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} | ||
|
||
<center> | ||
<table width="620" border="0" cellpadding="0" cellspacing="0" id="crm-event_receipt" style="font-family: Arial, Verdana, sans-serif; text-align: left;"> | ||
|
||
<!-- BEGIN HEADER --> | ||
<!-- You can add table row(s) here with logo or other header elements --> | ||
<!-- END HEADER --> | ||
|
||
<!-- BEGIN CONTENT --> | ||
|
||
<tr> | ||
<td> | ||
<p>{ts 1=$contact.display_name}Dear %1{/ts},</p> | ||
<p>{ts 1=$to_participant}Your Event Registration has been Transferred to %1.{/ts}</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<table style="border: 1px solid #999; margin: 1em 0em 1em; border-collapse: collapse; width:100%;"> | ||
<tr> | ||
<th {$headerStyle}> | ||
{ts}Event Information and Location{/ts} | ||
</th> | ||
</tr> | ||
<tr> | ||
<td colspan="2" {$valueStyle}> | ||
{$event.event_title}<br /> | ||
{$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} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td {$labelStyle}> | ||
{ts}Participant Role{/ts}: | ||
</td> | ||
<td {$valueStyle}> | ||
{$participant.role} | ||
</td> | ||
</tr> | ||
|
||
{if $isShowLocation} | ||
<tr> | ||
<td colspan="2" {$valueStyle}> | ||
{if $event.location.address.1.name} | ||
{$event.location.address.1.name}<br /> | ||
{/if} | ||
{if $event.location.address.1.street_address} | ||
{$event.location.address.1.street_address}<br /> | ||
{/if} | ||
{if $event.location.address.1.supplemental_address_1} | ||
{$event.location.address.1.supplemental_address_1}<br /> | ||
{/if} | ||
{if $event.location.address.1.supplemental_address_2} | ||
{$event.location.address.1.supplemental_address_2}<br /> | ||
{/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} | ||
</td> | ||
</tr> | ||
{/if} | ||
|
||
{if $event.location.phone.1.phone || $event.location.email.1.email} | ||
<tr> | ||
<td colspan="2" {$labelStyle}> | ||
{ts}Event Contacts:{/ts} | ||
</td> | ||
</tr> | ||
{foreach from=$event.location.phone item=phone} | ||
{if $phone.phone} | ||
<tr> | ||
<td {$labelStyle}> | ||
{if $phone.phone_type}{$phone.phone_type_display}{else}{ts}Phone{/ts}{/if} | ||
</td> | ||
<td {$valueStyle}> | ||
{$phone.phone} | ||
</td> | ||
</tr> | ||
{/if} | ||
{/foreach} | ||
{foreach from=$event.location.email item=eventEmail} | ||
{if $eventEmail.email} | ||
<tr> | ||
<td {$labelStyle}> | ||
{ts}Email{/ts} | ||
</td> | ||
<td {$valueStyle}> | ||
{$eventEmail.email} | ||
</td> | ||
</tr> | ||
{/if} | ||
{/foreach} | ||
{/if} | ||
|
||
{if $contact.email} | ||
<tr> | ||
<th {$headerStyle}> | ||
{ts}Registered Email{/ts} | ||
</th> | ||
</tr> | ||
<tr> | ||
<td colspan="2" {$valueStyle}> | ||
{$contact.email} | ||
</td> | ||
</tr> | ||
{/if} | ||
|
||
{if $register_date} | ||
<tr> | ||
<td {$labelStyle}> | ||
{ts}Registration Date{/ts} | ||
</td> | ||
<td {$valueStyle}> | ||
{$participant.register_date|crmDate} | ||
</td> | ||
</tr> | ||
{/if} | ||
|
||
</table> | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
<p>{ts 1=$domain.phone 2=$domain.email}Please contact us at %1 or send email to %2 if you have questions.{/ts}</p> | ||
</td> | ||
</tr> | ||
|
||
</table> | ||
</center> | ||
|
||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
CRM/Upgrade/4.7.beta1.msg_template/message_templates/participant_transferred_subject.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ts 1=$event.event_title}Event Registration Transferred for %1{/ts} |
Oops, something went wrong.