From fdc2e63a7fb961c26bab02e9347ce44d2bdfde66 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 4 Jul 2020 16:43:29 -0400 Subject: [PATCH] Bump minimum upgradable version to 4.4.7 --- CRM/Contact/BAO/Contact.php | 9 - CRM/Core/BAO/UFGroup.php | 5 - CRM/Core/DAO.php | 1 + .../civicrm_msg_template.tpl | 16 - .../event_offline_receipt_html.tpl | 456 ------ .../event_offline_receipt_text.tpl | 274 ---- .../event_online_receipt_html.tpl | 450 ------ .../event_online_receipt_text.tpl | 277 ---- .../civicrm_msg_template.tpl | 16 - .../contribution_offline_receipt_html.tpl | 261 ---- .../contribution_offline_receipt_text.tpl | 97 -- .../event_offline_receipt_html.tpl | 456 ------ .../event_offline_receipt_text.tpl | 274 ---- .../event_online_receipt_html.tpl | 450 ------ .../event_online_receipt_text.tpl | 277 ---- .../membership_offline_receipt_html.tpl | 240 --- .../membership_offline_receipt_text.tpl | 90 -- .../membership_online_receipt_html.tpl | 514 ------- .../membership_online_receipt_text.tpl | 221 --- .../civicrm_msg_template.tpl | 16 - .../event_online_receipt_html.tpl | 449 ------ .../event_online_receipt_text.tpl | 277 ---- .../message_templates/pcp_notify_html.tpl | 96 -- .../civicrm_msg_template.tpl | 16 - .../contribution_online_receipt_html.tpl | 394 ----- .../contribution_online_receipt_text.tpl | 179 --- .../membership_online_receipt_html.tpl | 514 ------- .../membership_online_receipt_text.tpl | 221 --- .../civicrm_msg_template.tpl | 16 - .../message_templates/pcp_notify_html.tpl | 96 -- .../message_templates/pcp_notify_text.tpl | 20 - .../civicrm_msg_template.tpl | 16 - .../contribution_online_receipt_html.tpl | 396 ----- .../contribution_online_receipt_text.tpl | 181 --- .../civicrm_msg_template.tpl | 16 - .../event_online_receipt_html.tpl | 450 ------ .../event_online_receipt_text.tpl | 277 ---- .../civicrm_msg_template.tpl | 16 - .../contribution_dupalert_html.tpl | 86 -- .../contribution_dupalert_text.tpl | 17 - .../event_online_receipt_html.tpl | 450 ------ .../event_online_receipt_text.tpl | 277 ---- CRM/Upgrade/Form.php | 2 +- CRM/Upgrade/Incremental/php/FourFour.php | 803 ---------- CRM/Upgrade/Incremental/php/FourThree.php | 1302 ----------------- CRM/Upgrade/Incremental/sql/4.3.0.mysql.tpl | 2 - CRM/Upgrade/Incremental/sql/4.3.1.mysql.tpl | 21 - CRM/Upgrade/Incremental/sql/4.3.2.mysql.tpl | 1 - CRM/Upgrade/Incremental/sql/4.3.3.mysql.tpl | 2 - CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl | 109 -- CRM/Upgrade/Incremental/sql/4.3.5.mysql.tpl | 11 - CRM/Upgrade/Incremental/sql/4.3.6.mysql.tpl | 96 -- CRM/Upgrade/Incremental/sql/4.3.7.mysql.tpl | 1 - CRM/Upgrade/Incremental/sql/4.3.8.mysql.tpl | 1 - CRM/Upgrade/Incremental/sql/4.3.9.mysql.tpl | 1 - .../Incremental/sql/4.3.alpha1.mysql.tpl | 876 ----------- .../Incremental/sql/4.3.alpha2.mysql.tpl | 40 - .../Incremental/sql/4.3.alpha3.mysql.tpl | 4 - .../Incremental/sql/4.3.beta1.mysql.tpl | 1 - .../Incremental/sql/4.3.beta2.mysql.tpl | 1 - .../Incremental/sql/4.3.beta3.mysql.tpl | 31 - .../Incremental/sql/4.3.beta4.mysql.tpl | 25 - .../Incremental/sql/4.3.beta5.mysql.tpl | 9 - CRM/Upgrade/Incremental/sql/4.4.0.mysql.tpl | 9 - CRM/Upgrade/Incremental/sql/4.4.1.mysql.tpl | 12 - CRM/Upgrade/Incremental/sql/4.4.2.mysql.tpl | 5 - CRM/Upgrade/Incremental/sql/4.4.3.mysql.tpl | 8 - CRM/Upgrade/Incremental/sql/4.4.4.mysql.tpl | 28 - CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl | 36 - CRM/Upgrade/Incremental/sql/4.4.6.mysql.tpl | 5 - .../Incremental/sql/4.4.alpha1.mysql.tpl | 161 -- .../Incremental/sql/4.4.beta1.mysql.tpl | 9 - 72 files changed, 2 insertions(+), 12470 deletions(-) delete mode 100644 CRM/Upgrade/4.3.5.msg_template/civicrm_msg_template.tpl delete mode 100644 CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/civicrm_msg_template.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/contribution_offline_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/contribution_offline_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_offline_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_offline_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_online_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_online_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_offline_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_offline_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_online_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_online_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.alpha3.msg_template/civicrm_msg_template.tpl delete mode 100644 CRM/Upgrade/4.3.alpha3.msg_template/message_templates/event_online_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.alpha3.msg_template/message_templates/event_online_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.alpha3.msg_template/message_templates/pcp_notify_html.tpl delete mode 100644 CRM/Upgrade/4.3.beta1.msg_template/civicrm_msg_template.tpl delete mode 100644 CRM/Upgrade/4.3.beta1.msg_template/message_templates/contribution_online_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.beta1.msg_template/message_templates/contribution_online_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.beta1.msg_template/message_templates/membership_online_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.beta1.msg_template/message_templates/membership_online_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl delete mode 100644 CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_html.tpl delete mode 100644 CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_text.tpl delete mode 100644 CRM/Upgrade/4.3.beta3.msg_template/civicrm_msg_template.tpl delete mode 100644 CRM/Upgrade/4.3.beta3.msg_template/message_templates/contribution_online_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.3.beta3.msg_template/message_templates/contribution_online_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.4.3.msg_template/civicrm_msg_template.tpl delete mode 100644 CRM/Upgrade/4.4.3.msg_template/message_templates/event_online_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.4.3.msg_template/message_templates/event_online_receipt_text.tpl delete mode 100644 CRM/Upgrade/4.4.alpha1.msg_template/civicrm_msg_template.tpl delete mode 100644 CRM/Upgrade/4.4.alpha1.msg_template/message_templates/contribution_dupalert_html.tpl delete mode 100644 CRM/Upgrade/4.4.alpha1.msg_template/message_templates/contribution_dupalert_text.tpl delete mode 100644 CRM/Upgrade/4.4.alpha1.msg_template/message_templates/event_online_receipt_html.tpl delete mode 100644 CRM/Upgrade/4.4.alpha1.msg_template/message_templates/event_online_receipt_text.tpl delete mode 100644 CRM/Upgrade/Incremental/php/FourFour.php delete mode 100644 CRM/Upgrade/Incremental/php/FourThree.php delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.0.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.1.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.2.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.3.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.5.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.6.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.7.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.8.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.9.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.alpha2.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.alpha3.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.beta1.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.beta2.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.beta3.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.beta4.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.3.beta5.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.4.0.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.4.1.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.4.2.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.4.3.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.4.4.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.4.6.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.4.alpha1.mysql.tpl delete mode 100644 CRM/Upgrade/Incremental/sql/4.4.beta1.mysql.tpl diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 2bb378d1d3..b540a8e4e1 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -3401,15 +3401,6 @@ LEFT JOIN civicrm_address ON ( civicrm_address.contact_id = civicrm_contact.id ) * @see CRM_Core_DAO::triggerRebuild */ public static function triggerInfo(&$info, $tableName = NULL) { - //during upgrade, first check for valid version and then create triggers - //i.e the columns created_date and modified_date are introduced in 4.3.alpha1 so dont create triggers for older version - if (CRM_Core_Config::isUpgradeMode()) { - $currentVer = CRM_Core_BAO_Domain::version(TRUE); - //if current version is less than 4.3.alpha1 dont create below triggers - if (version_compare($currentVer, '4.3.alpha1') < 0) { - return; - } - } // Modifications to these records should update the contact timestamps. \Civi\Core\SqlTrigger\TimestampTriggers::create('civicrm_contact', 'Contact') diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 5841ab0d72..c87c428f7f 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -1665,11 +1665,6 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) public static function getModuleUFGroup($moduleName = NULL, $count = 0, $skipPermission = TRUE, $op = CRM_Core_Permission::VIEW, $returnFields = NULL) { $selectFields = ['id', 'title', 'created_id', 'is_active', 'is_reserved', 'group_type']; - if (CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_uf_group', 'description')) { - // CRM-13555, since description field was added later (4.4), and to avoid any problems with upgrade - $selectFields[] = 'description'; - } - if (CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_uf_group', 'frontend_title')) { $selectFields[] = 'frontend_title'; } diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 42d07846aa..a58eaaccca 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -927,6 +927,7 @@ class CRM_Core_DAO extends DB_DataObject { * true if exists, else false */ public static function checkFieldExists($tableName, $columnName, $i18nRewrite = TRUE) { + CRM_Core_Error::deprecatedFunctionWarning('CRM_Core_BAO_SchemaHandler::checkIfFieldExists'); return CRM_Core_BAO_SchemaHandler::checkIfFieldExists($tableName, $columnName, $i18nRewrite); } diff --git a/CRM/Upgrade/4.3.5.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.3.5.msg_template/civicrm_msg_template.tpl deleted file mode 100644 index c63f9126de..0000000000 --- a/CRM/Upgrade/4.3.5.msg_template/civicrm_msg_template.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{php} - $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.3.5.msg_template/message_templates'; - $templates = array(); - 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=$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} diff --git a/CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_html.tpl b/CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_html.tpl deleted file mode 100644 index 6bfa5f5b78..0000000000 --- a/CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_html.tpl +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - -{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 $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} -

{$event.confirm_email_text|htmlize}

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

{$pay_later_receipt}

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

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

- {/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 $email} - - - - - - - {/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} - - {if $amount && !$lineItem} - {foreach from=$amount item=amnt key=level} - - - - {/foreach} - {/if} - {if $isPrimary} - - - - - {if $pricesetFieldsCount } - - - - - {/if} - {if $is_pay_later} - - - - {/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 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=value key=customName} - {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - - {if $customPost} - - - - {foreach from=$customPost item=value key=customName} - {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - - {if $customProfile} - {foreach from=$customProfile item=value key=customName} - - - - {foreach from=$value item=val key=field} - {if $field eq 'additionalCustomPre' or $field eq 'additionalCustomPost'} - - - - {foreach from=$val item=v key=f} - - - - - {/foreach} - {/if} - {/foreach} - {/foreach} - {/if} - - {if $customGroup} - {foreach from=$customGroup item=value key=customName} - - - - {foreach from=$value item=v key=n} - - - - - {/foreach} - {/foreach} - {/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}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.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} -
- {ts}Registered Email{/ts} -
- {$email} -
- {$event.fee_label} -
- {ts 1=$priceset+1}Participant %1{/ts} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - {if $pricesetFieldsCount }{/if} - - {foreach from=$value item=line} - - - - - - {if $pricesetFieldsCount } - - {/if} - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/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} - - {$line.line_total|crmMoney} - - {$line.participant_count} -
-
- {$amnt.amount|crmMoney} {$amnt.label} -
- {ts}Total Amount{/ts} - - {$totalAmount|crmMoney} {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} -
- {$pay_later_receipt} -
- {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} -
- {$customName} - - {$value} -
- {$customPost_grouptitle} -
- {$customName} - - {$value} -
- {ts 1=$customName+1}Participant Information - Participant %1{/ts} -
- {if $field eq 'additionalCustomPre'} - {$additionalCustomPre_grouptitle} - {else} - {$additionalCustomPost_grouptitle} - {/if} -
- {$f} - - {$v} -
- {$customName} -
- {$n} - - {$v} -
-
-
- - - diff --git a/CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_text.tpl b/CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_text.tpl deleted file mode 100644 index 603ad2de4c..0000000000 --- a/CRM/Upgrade/4.3.5.msg_template/message_templates/event_offline_receipt_text.tpl +++ /dev/null @@ -1,274 +0,0 @@ -{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} -{$event.confirm_email_text} -{/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} - -==========================================================={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|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 $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.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} - -{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 $email} - -==========================================================={if $pricesetFieldsCount }===================={/if} - -{ts}Registered Email{/ts} - -==========================================================={if $pricesetFieldsCount }===================={/if} - -{$email} -{/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} -{/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} -{capture assign=ts_total}{ts}Total{/ts}{/capture} -{capture assign=ts_participant_total}{if $pricesetFieldsCount }{ts}Total Participants{/ts}{/if}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {$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|string_format:"%10s"} {$line.line_total|crmMoney|string_format:"%10s"} {$ts_participant_count|string_format:"%10s"} -{/foreach} -{/if} -{/foreach} -{/if} -{if $amount && !$lineItem} -{foreach from=$amount item=amnt key=level}{$amnt.amount|crmMoney} {$amnt.label} -{/foreach} -{/if} -{if $isPrimary } - -{ts}Total Amount{/ts}: {$totalAmount|crmMoney} {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 $is_pay_later } - -==========================================================={if $pricesetFieldsCount }===================={/if} - -{$pay_later_receipt} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{/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 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} -=========================================================== -{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} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{$customPre_grouptitle} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{foreach from=$customPre item=value key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} -{$customName}: {$value} -{/if} -{/foreach} -{/if} - -{if $customPost} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{$customPost_grouptitle} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{foreach from=$customPost item=value key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} -{$customName}: {$value} -{/if} -{/foreach} -{/if} -{if $customProfile} - -{foreach from=$customProfile item=value key=customName} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{ts 1=$customName+1}Participant Information - Participant %1{/ts} - -==========================================================={if $pricesetFieldsCount }===================={/if} - -{foreach from=$value item=val key=field} -{if $field eq 'additionalCustomPre' or $field eq 'additionalCustomPost' } -{if $field eq 'additionalCustomPre' } -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} - -{$additionalCustomPre_grouptitle} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} - -{else} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} - -{$additionalCustomPost_grouptitle} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} - -{/if} -{foreach from=$val item=v key=f} -{$f}: {$v} -{/foreach} -{/if} -{/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} - - diff --git a/CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_html.tpl b/CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_html.tpl deleted file mode 100644 index 4e86fbfb2e..0000000000 --- a/CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_html.tpl +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - -{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} - -
- - - - - - - - - - - - - - -
-

Dear {contact.display_name},

- - {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 $isOnWaitlist}waitlisted{else}registered{/if} for the following:

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

{$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_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} - - {if $amounts && !$lineItem} - {foreach from=$amounts item=amnt key=level} - - - - {/foreach} - {/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 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} - -
- {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 $pricesetFieldsCount }{/if} - - {foreach from=$value item=line} - - - - - - {if $pricesetFieldsCount } {/if} - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/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.line_total|crmMoney:$currency} - {$line.participant_count}
-
- {$amnt.amount|crmMoney:$currency} {$amnt.label} -
- {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} -
-
-
- - - diff --git a/CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_text.tpl b/CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_text.tpl deleted file mode 100644 index db5bec9882..0000000000 --- a/CRM/Upgrade/4.3.5.msg_template/message_templates/event_online_receipt_text.tpl +++ /dev/null @@ -1,277 +0,0 @@ -Dear {contact.display_name}, - -{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} for the following: - -{/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} - -==========================================================={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} - -{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 $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} -{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"} {$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"} {$line.line_total|crmMoney:$currency|string_format:"%10s"}{$ts_participant_count|string_format:"%10s"} -{/foreach} -{/if} -{/foreach} -{/if} -{if $amounts && !$lineItem} -{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label} -{/foreach} -{/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 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} diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/civicrm_msg_template.tpl deleted file mode 100644 index ba58c2652f..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/civicrm_msg_template.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{php} - $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.3.alpha1.msg_template/message_templates'; - $templates = array(); - 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=$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} diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/contribution_offline_receipt_html.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/contribution_offline_receipt_html.tpl deleted file mode 100644 index d93593c337..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/contribution_offline_receipt_html.tpl +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - - - -{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 $formValues.receipt_text} -

{$formValues.receipt_text|htmlize}

- {else} -

{ts}Thank you for your support.{/ts}

- {/if} - -

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

- -
- - - - - - - - - - {if $lineItem and !$is_quick_config} - {foreach from=$lineItem item=value key=priceset} - - - - {/foreach} - {/if} - - - - - - - {if $receive_date} - - - - - {/if} - - {if $receipt_date} - - - - - {/if} - - {if $formValues.paidBy and !$formValues.hidden_CreditCard} - - - - - {if $formValues.check_number} - - - - - {/if} - {/if} - - {if $formValues.trxn_id} - - - - - {/if} - - {if $ccContribution} - - - - - - - - - - - - - {/if} - - {if $customGroup} - {foreach from=$customGroup item=value key=customName} - - - - {foreach from=$value item=v key=n} - - - - - {/foreach} - {/foreach} - {/if} - - {if $formValues.honor_first_name} - - - - - - - {/if} - - {if $formValues.product_name} - - - - - - - {if $formValues.product_option} - - - - - {/if} - {if $formValues.product_sku} - - - - - {/if} - {if $fulfilled_date} - - - - - {/if} - {/if} - -
- {ts}Contribution Information{/ts} -
- {ts}Financial Type{/ts} - - {$formValues.contributionType_name} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - - {foreach from=$value item=line} - - - - - - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Total{/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.line_total|crmMoney:$currency} -
-
- {ts}Total Amount{/ts} - - {$formValues.total_amount|crmMoney:$currency} -
- {ts}Received Date{/ts} - - {$receive_date|truncate:10:''|crmDate} -
- {ts}Receipt Date{/ts} - - {$receipt_date|truncate:10:''|crmDate} -
- {ts}Paid By{/ts} - - {$formValues.paidBy} -
- {ts}Check Number{/ts} - - {$formValues.check_number} -
- {ts}Transaction ID{/ts} - - {$formValues.trxn_id} -
- {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} -
- {$customName} -
- {$n} - - {$v} -
- {$formValues.honor_type} -
- {$formValues.honor_prefix} {$formValues.honor_first_name} {$formValues.honor_last_name}
- {if $formValues.honor_email} - {ts}Honoree Email{/ts}: {$formValues.honor_email} - {/if} -
- {ts}Premium Information{/ts} -
- {$formValues.product_name} -
- {ts}Option{/ts} - - {$formValues.product_option} -
- {ts}SKU{/ts} - - {$formValues.product_sku} -
- {ts}Sent{/ts} - - {$fulfilled_date|truncate:10:''|crmDate} -
-
-
- - - diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/contribution_offline_receipt_text.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/contribution_offline_receipt_text.tpl deleted file mode 100644 index 64a3db06c3..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/contribution_offline_receipt_text.tpl +++ /dev/null @@ -1,97 +0,0 @@ -{if $formValues.receipt_text} -{$formValues.receipt_text} -{else}{ts}Thank you for your support.{/ts}{/if} - -{ts}Please print this receipt for your records.{/ts} - - -=========================================================== -{ts}Contribution Information{/ts} - -=========================================================== -{ts}Financial Type{/ts}: {$formValues.contributionType_name} -{if $lineItem} -{foreach from=$lineItem item=value key=priceset} ---------------------------------------------------------- -{capture assign=ts_item}{ts}Item{/ts}{/capture} -{capture assign=ts_qty}{ts}Qty{/ts}{/capture} -{capture assign=ts_each}{ts}Each{/ts}{/capture} -{capture assign=ts_total}{ts}Total{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {$ts_total|string_format:"%10s"} ----------------------------------------------------------- -{foreach from=$value item=line} -{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"} {$line.line_total|crmMoney:$currency|string_format:"%10s"} -{/foreach} -{/foreach} -{/if} - -{ts}Total Amount{/ts}: {$formValues.total_amount|crmMoney:$currency} -{if $receive_date} -{ts}Received Date{/ts}: {$receive_date|truncate:10:''|crmDate} -{/if} -{if $receipt_date} -{ts}Receipt Date{/ts}: {$receipt_date|truncate:10:''|crmDate} -{/if} -{if $formValues.paidBy and !$formValues.hidden_CreditCard} -{ts}Paid By{/ts}: {$formValues.paidBy} -{if $formValues.check_number} -{ts}Check Number{/ts}: {$formValues.check_number} -{/if} -{/if} -{if $formValues.trxn_id} -{ts}Transaction ID{/ts}: {$formValues.trxn_id} -{/if} - -{if $ccContribution} -=========================================================== -{ts}Billing Name and Address{/ts} - -=========================================================== -{$billingName} -{$address} - -=========================================================== -{ts}Credit Card Information{/ts} - -=========================================================== -{$credit_card_type} -{$credit_card_number} -{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} -{/if} -{if $customGroup} -{foreach from=$customGroup item=value key=customName} -=========================================================== -{$customName} -=========================================================== -{foreach from=$value item=v key=n} -{$n}: {$v} -{/foreach} -{/foreach} -{/if} -{if $formValues.honor_first_name} - -=========================================================== -{$formValues.honor_type} -=========================================================== -{$formValues.honor_prefix} {$formValues.honor_first_name} {$formValues.honor_last_name} -{if $formValues.honor_email} -{ts}Honoree Email{/ts}: {$formValues.honor_email} -{/if} -{/if} - -{if $formValues.product_name} -=========================================================== -{ts}Premium Information{/ts} - -=========================================================== -{$formValues.product_name} -{if $formValues.product_option} -{ts}Option{/ts}: {$formValues.product_option} -{/if} -{if $formValues.product_sku} -{ts}SKU{/ts}: {$formValues.product_sku} -{/if} -{if $fulfilled_date} -{ts}Sent{/ts}: {$fulfilled_date|crmDate} -{/if} -{/if} diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_offline_receipt_html.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_offline_receipt_html.tpl deleted file mode 100644 index 38004aa3a0..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_offline_receipt_html.tpl +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - -{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 $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} -

{$event.confirm_email_text|htmlize}

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

{$pay_later_receipt}

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

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

- {/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 $email} - - - - - - - {/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} - - {if $amount && !$lineItem} - {foreach from=$amount item=amnt key=level} - - - - {/foreach} - {/if} - {if $isPrimary} - - - - - {if $pricesetFieldsCount } - - - - - {/if} - {if $is_pay_later} - - - - {/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 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=value key=customName} - {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - - {if $customPost} - - - - {foreach from=$customPost item=value key=customName} - {if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - - {if $customProfile} - {foreach from=$customProfile item=value key=customName} - - - - {foreach from=$value item=val key=field} - {if $field eq 'additionalCustomPre' or $field eq 'additionalCustomPost'} - - - - {foreach from=$val item=v key=f} - - - - - {/foreach} - {/if} - {/foreach} - {/foreach} - {/if} - - {if $customGroup} - {foreach from=$customGroup item=value key=customName} - - - - {foreach from=$value item=v key=n} - - - - - {/foreach} - {/foreach} - {/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}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.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} -
- {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} -
- {$email} -
- {$event.fee_label} -
- {ts 1=$priceset+1}Participant %1{/ts} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - {if $pricesetFieldsCount }{/if} - - {foreach from=$value item=line} - - - - - - {if $pricesetFieldsCount } - - {/if} - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/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} - - {$line.line_total|crmMoney} - - {$line.participant_count} -
-
- {$amnt.amount|crmMoney} {$amnt.label} -
- {ts}Total Amount{/ts} - - {$totalAmount|crmMoney} {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} -
- {$pay_later_receipt} -
- {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} -
- {$customName} - - {$value} -
- {$customPost_grouptitle} -
- {$customName} - - {$value} -
- {ts 1=$customName+1}Participant Information - Participant %1{/ts} -
- {if $field eq 'additionalCustomPre'} - {$additionalCustomPre_grouptitle} - {else} - {$additionalCustomPost_grouptitle} - {/if} -
- {$f} - - {$v} -
- {$customName} -
- {$n} - - {$v} -
-
-
- - - diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_offline_receipt_text.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_offline_receipt_text.tpl deleted file mode 100644 index 62fb64da11..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_offline_receipt_text.tpl +++ /dev/null @@ -1,274 +0,0 @@ -{if $event.confirm_email_text AND (not $isOnWaitlist AND not $isRequireApproval)} -{$event.confirm_email_text} -{/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} - -==========================================================={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|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 $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.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} -{/foreach} -{foreach from=$location.email item=eventEmail} -{if $eventEmail.email} - -{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} -{/if} - -{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 $email} - -==========================================================={if $pricesetFieldsCount }===================={/if} - -{ts}Registered Email{/ts} - -==========================================================={if $pricesetFieldsCount }===================={/if} - -{$email} -{/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} -{/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} -{capture assign=ts_total}{ts}Total{/ts}{/capture} -{capture assign=ts_participant_total}{if $pricesetFieldsCount }{ts}Total Participants{/ts}{/if}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {$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|string_format:"%10s"} {$line.line_total|crmMoney|string_format:"%10s"} {$ts_participant_count|string_format:"%10s"} -{/foreach} -{/if} -{/foreach} -{/if} -{if $amount && !$lineItem} -{foreach from=$amount item=amnt key=level}{$amnt.amount|crmMoney} {$amnt.label} -{/foreach} -{/if} -{if $isPrimary } - -{ts}Total Amount{/ts}: {$totalAmount|crmMoney} {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 $is_pay_later } - -==========================================================={if $pricesetFieldsCount }===================={/if} - -{$pay_later_receipt} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{/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 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} -=========================================================== -{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} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{$customPre_grouptitle} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{foreach from=$customPre item=value key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} -{$customName}: {$value} -{/if} -{/foreach} -{/if} - -{if $customPost} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{$customPost_grouptitle} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{foreach from=$customPost item=value key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} -{$customName}: {$value} -{/if} -{/foreach} -{/if} -{if $customProfile} - -{foreach from=$customProfile item=value key=customName} -==========================================================={if $pricesetFieldsCount }===================={/if} - -{ts 1=$customName+1}Participant Information - Participant %1{/ts} - -==========================================================={if $pricesetFieldsCount }===================={/if} - -{foreach from=$value item=val key=field} -{if $field eq 'additionalCustomPre' or $field eq 'additionalCustomPost' } -{if $field eq 'additionalCustomPre' } -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} - -{$additionalCustomPre_grouptitle} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} - -{else} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} - -{$additionalCustomPost_grouptitle} -----------------------------------------------------------{if $pricesetFieldsCount }--------------------{/if} - -{/if} -{foreach from=$val item=v key=f} -{$f}: {$v} -{/foreach} -{/if} -{/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} - - diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_online_receipt_html.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_online_receipt_html.tpl deleted file mode 100644 index 03e938a9df..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_online_receipt_html.tpl +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - -{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} - -
- - - - - - - - - - - - - - -
-

Dear {contact.display_name},

- - {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 $isOnWaitlist}waitlisted{else}registered{/if} for the following:

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

{$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_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} - - {if $amounts && !$lineItem} - {foreach from=$amounts item=amnt key=level} - - - - {/foreach} - {/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 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} - -
- {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} -
- {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 $pricesetFieldsCount }{/if} - - {foreach from=$value item=line} - - - - - - {if $pricesetFieldsCount } {/if} - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/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} - - {$line.line_total|crmMoney} - {$line.participant_count}
-
- {$amnt.amount|crmMoney} {$amnt.label} -
- {ts}Total Amount{/ts} - - {$totalAmount|crmMoney} {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} -
-
-
- - - diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_online_receipt_text.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_online_receipt_text.tpl deleted file mode 100644 index 5b24cb2c41..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/event_online_receipt_text.tpl +++ /dev/null @@ -1,277 +0,0 @@ -Dear {contact.display_name}, - -{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} for the following: - -{/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} - -==========================================================={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} -{/foreach} -{foreach from=$location.email item=eventEmail} -{if $eventEmail.email} - -{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} -{/if} - -{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 $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} -{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"} {$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|string_format:"%10s"} {$line.line_total|crmMoney|string_format:"%10s"}{$ts_participant_count|string_format:"%10s"} -{/foreach} -{/if} -{/foreach} -{/if} -{if $amounts && !$lineItem} -{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney} {$amnt.label} -{/foreach} -{/if} -{if $isPrimary } - -{ts}Total Amount{/ts}: {$totalAmount|crmMoney} {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 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} diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_offline_receipt_html.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_offline_receipt_html.tpl deleted file mode 100644 index e50e1f4446..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_offline_receipt_html.tpl +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - -{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 $isPrimary} - - - - {/if} - - {if $customValues} - - - - {/if} - -
- {if $formValues.receipt_text_signup} -

{$formValues.receipt_text_signup|htmlize}

- {elseif $formValues.receipt_text_renewal} -

{$formValues.receipt_text_renewal|htmlize}

- {else} -

{ts}Thank you for your support.{/ts}

- {/if} - {if ! $cancelled} -

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

- {/if} -
- - {if !$lineItem} - - - - - - - - {/if} - {if ! $cancelled} - {if !$lineItem} - - - - - - - - - {/if} - {if $formValues.total_amount} - - - - {if $formValues.contributionType_name} - - - - - {/if} - - {if $lineItem} - {foreach from=$lineItem item=value key=priceset} - - - - {/foreach} - {/if} - - - - - {if $receive_date} - - - - - {/if} - {if $formValues.paidBy} - - - - - {if $formValues.check_number} - - - - - {/if} - {/if} - {/if} - {/if} -
- {ts}Membership Information{/ts} -
- {ts}Membership Type{/ts} - - {$membership_name} -
- {ts}Membership Start Date{/ts} - - {$mem_start_date} -
- {ts}Membership End Date{/ts} - - {$mem_end_date} -
- {ts}Membership Fee{/ts} -
- {ts}Financial Type{/ts} - - {$formValues.contributionType_name} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - - {foreach from=$value item=line} - - - - - - - {/foreach} -
{ts}Item{/ts}{ts}Fee{/ts}{ts}Membership Start Date{/ts}{ts}Membership End Date{/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.line_total|crmMoney} - - {$line.start_date} - - {$line.end_date} -
-
- {ts}Amount{/ts} - - {$formValues.total_amount|crmMoney} -
- {ts}Received Date{/ts} - - {$receive_date|truncate:10:''|crmDate} -
- {ts}Paid By{/ts} - - {$formValues.paidBy} -
- {ts}Check Number{/ts} - - {$formValues.check_number} -
-
- - - {if $contributeMode ne 'notify' and !$isAmountzero and !$is_pay_later } - - - - - - - {/if} - - {if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later} - - - - - - - - - - - {/if} - -
- {ts}Billing Name and Address{/ts} -
- {$billingName}
- {$address} -
- {ts}Credit Card Information{/ts} -
- {$credit_card_type}
- {$credit_card_number} -
- {ts}Expires{/ts} - - {$credit_card_exp_date|truncate:7:''|crmDate} -
-
- - - - - {foreach from=$customValues item=value key=customName} - - - - - {/foreach} -
- {ts}Membership Options{/ts} -
- {$customName} - - {$value} -
-
-
- - - diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_offline_receipt_text.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_offline_receipt_text.tpl deleted file mode 100644 index 3f5203d7cd..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_offline_receipt_text.tpl +++ /dev/null @@ -1,90 +0,0 @@ -{if $formValues.receipt_text_signup} -{$formValues.receipt_text_signup} -{elseif $formValues.receipt_text_renewal} -{$formValues.receipt_text_renewal} -{else}{ts}Thank you for your support.{/ts}{/if} - -{if ! $cancelled}{ts}Please print this receipt for your records.{/ts} - - -{/if} -{if !$lineItem} -=========================================================== -{ts}Membership Information{/ts} - -=========================================================== -{ts}Membership Type{/ts}: {$membership_name} -{/if} -{if ! $cancelled} -{if !$lineItem} -{ts}Membership Start Date{/ts}: {$mem_start_date} -{ts}Membership End Date{/ts}: {$mem_end_date} -{/if} - -{if $formValues.total_amount} -=========================================================== -{ts}Membership Fee{/ts} - -=========================================================== -{if $formValues.contributionType_name} -{ts}Financial Type{/ts}: {$formValues.contributionType_name} -{/if} -{if $lineItem} -{foreach from=$lineItem item=value key=priceset} -{capture assign=ts_item}{ts}Item{/ts}{/capture} -{capture assign=ts_total}{ts}Fee{/ts}{/capture} -{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture} -{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} --------------------------------------------------------------------------------------------------- - -{foreach from=$value item=line} -{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.line_total|crmMoney|string_format:"%10s"} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} -{/foreach} -{/foreach} --------------------------------------------------------------------------------------------------- -{/if} -{ts}Amount{/ts}: {$formValues.total_amount|crmMoney} -{if $receive_date} -{ts}Received Date{/ts}: {$receive_date|truncate:10:''|crmDate} -{/if} -{if $formValues.paidBy} -{ts}Paid By{/ts}: {$formValues.paidBy} -{if $formValues.check_number} -{ts}Check Number{/ts}: {$formValues.check_number} -{/if} -{/if} -{/if} -{/if} - -{if $isPrimary } -{if $contributeMode ne 'notify' and !$isAmountzero and !$is_pay_later } - -=========================================================== -{ts}Billing Name and Address{/ts} - -=========================================================== -{$billingName} -{$address} -{/if} - -{if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later} -=========================================================== -{ts}Credit Card Information{/ts} - -=========================================================== -{$credit_card_type} -{$credit_card_number} -{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} -{/if} -{/if} - -{if $customValues} -=========================================================== -{ts}Membership Options{/ts} - -=========================================================== -{foreach from=$customValues item=value key=customName} - {$customName} : {$value} -{/foreach} -{/if} diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_online_receipt_html.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_online_receipt_html.tpl deleted file mode 100644 index c56152bbaa..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_online_receipt_html.tpl +++ /dev/null @@ -1,514 +0,0 @@ - - - - - - - - -{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 $receipt_text} -

{$receipt_text|htmlize}

- {/if} - - {if $is_pay_later} -

{$pay_later_receipt}

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

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

- {/if} - -
- - - {if $membership_assign && !$useForMember} - - - - - - - - {if $mem_start_date} - - - - - {/if} - {if $mem_end_date} - - - - - {/if} - {/if} - - - {if $amount} - - - - - {if !$useForMember and $membership_amount and $is_quick_config} - - - - - - {if $amount} - {if ! $is_separate_payment } - - - - - {else} - - - - - {/if} - {/if} - - - - - - {elseif !$useForMember && $lineItem and $priceSetID and !$is_quick_config} - - {foreach from=$lineItem item=value key=priceset} - - - - {/foreach} - - - - - - {else} - {if $useForMember && $lineItem and !$is_quick_config} - {foreach from=$lineItem item=value key=priceset} - - - - {/foreach} - {/if} - - - - - - {/if} - - - {elseif $membership_amount} - - - - - - - - - - - - {/if} - - {if $receive_date} - - - - - {/if} - - {if $is_monetary and $trxn_id} - - - - - {/if} - - {if $membership_trx_id} - - - - - {/if} - {if $is_recur} - {if $contributeMode eq 'notify' or $contributeMode eq 'directIPN'} - - - - - - - {/if} - {/if} - - {if $honor_block_is_active} - - - - - - - {if $honor_email} - - - - - {/if} - {/if} - - {if $pcpBlock} - - - - - - - - {if $pcp_roll_nickname} - - - - - {/if} - {if $pcp_personal_note} - - - - - {/if} - {/if} - - {if $onBehalfProfile} - - - - {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName} - - - - - {/foreach} - {/if} - - {if ! ($contributeMode eq 'notify' OR $contributeMode eq 'directIPN') and $is_monetary} - {if $is_pay_later} - - - - - - - {elseif $amount GT 0 OR $membership_amount GT 0} - - - - - - - {/if} - {/if} - - {if $contributeMode eq 'direct' AND !$is_pay_later AND ($amount GT 0 OR $membership_amount GT 0)} - - - - - - - {/if} - - {if $selectPremium} - - - - - - - {if $option} - - - - - {/if} - {if $sku} - - - - - {/if} - {if $start_date} - - - - - {/if} - {if $end_date} - - - - - {/if} - {if $contact_email OR $contact_phone} - - - - {/if} - {if $is_deductible AND $price} - - - - {/if} - {/if} - - {if $customPre} - - - - {foreach from=$customPre item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - - {if $customPost} - - - - {foreach from=$customPost item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - -
- {ts}Membership Information{/ts} -
- {ts}Membership Type{/ts} - - {$membership_name} -
- {ts}Membership Start Date{/ts} - - {$mem_start_date|crmDate} -
- {ts}Membership End Date{/ts} - - {$mem_end_date|crmDate} -
- {ts}Membership Fee{/ts} -
- {ts 1=$membership_name}%1 Membership{/ts} - - {$membership_amount|crmMoney} -
- {ts}Contribution Amount{/ts} - - {$amount|crmMoney} -
- {ts}Additional Contribution{/ts} - - {$amount|crmMoney} -
- {ts}Total{/ts} - - {$amount+$membership_amount|crmMoney} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - - {foreach from=$value item=line} - - - - - - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Total{/ts}
- {$line.description|truncate:30:"..."} - - {$line.qty} - - {$line.unit_price|crmMoney} - - {$line.line_total|crmMoney} -
-
- {ts}Total Amount{/ts} - - {$amount|crmMoney} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - - {foreach from=$value item=line} - - - - - - - {/foreach} -
{ts}Item{/ts}{ts}Fee{/ts}{ts}Membership Start Date{/ts}{ts}Membership End Date{/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.line_total|crmMoney} - - {$line.start_date} - - {$line.end_date} -
-
- {ts}Amount{/ts} - - {$amount|crmMoney} {if $amount_level} - {$amount_level}{/if} -
- {ts}Membership Fee{/ts} -
- {ts 1=$membership_name}%1 Membership{/ts} - - {$membership_amount|crmMoney} -
- {ts}Date{/ts} - - {$receive_date|crmDate} -
- {ts}Transaction #{/ts} - - {$trxn_id} -
- {ts}Membership Transaction #{/ts} - - {$membership_trx_id} -
- {ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by visiting this web page.{/ts} -
- {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts} -
- {$honor_type} -
- {$honor_prefix} {$honor_first_name} {$honor_last_name} -
- {ts}Honoree Email{/ts} - - {$honor_email} -
- {ts}Personal Campaign Page{/ts} -
- {ts}Display In Honor Roll{/ts} - - {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if} -
- {ts}Nickname{/ts} - - {$pcp_roll_nickname} -
- {ts}Personal Note{/ts} - - {$pcp_personal_note} -
- {$onBehalfProfile_grouptitle} -
- {$onBehalfName} - - {$onBehalfValue} -
- {ts}Registered Email{/ts} -
- {$email} -
- {ts}Billing Name and Address{/ts} -
- {$billingName}
- {$address|nl2br}
- {$email} -
- {ts}Credit Card Information{/ts} -
- {$credit_card_type}
- {$credit_card_number}
- {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}
-
- {ts}Premium Information{/ts} -
- {$product_name} -
- {ts}Option{/ts} - - {$option} -
- {ts}SKU{/ts} - - {$sku} -
- {ts}Start Date{/ts} - - {$start_date|crmDate} -
- {ts}End Date{/ts} - - {$end_date|crmDate} -
-

{ts}For information about this premium, contact:{/ts}

- {if $contact_email} -

{$contact_email}

- {/if} - {if $contact_phone} -

{$contact_phone}

- {/if} -
-

{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

-
- {$customPre_grouptitle} -
- {$customName} - - {$customValue} -
- {$customPost_grouptitle} -
- {$customName} - - {$customValue} -
-
- - - diff --git a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_online_receipt_text.tpl b/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_online_receipt_text.tpl deleted file mode 100644 index 957ac2fe23..0000000000 --- a/CRM/Upgrade/4.3.alpha1.msg_template/message_templates/membership_online_receipt_text.tpl +++ /dev/null @@ -1,221 +0,0 @@ -{if $receipt_text} -{$receipt_text} -{/if} -{if $is_pay_later} - -=========================================================== -{$pay_later_receipt} -=========================================================== -{else} - -{ts}Please print this receipt for your records.{/ts} -{/if} - -{if $membership_assign && !$useForMember} -=========================================================== -{ts}Membership Information{/ts} - -=========================================================== -{ts}Membership Type{/ts}: {$membership_name} -{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate} -{/if} -{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate} -{/if} - -{/if} -{if $amount} -=========================================================== -{ts}Membership Fee{/ts} - -=========================================================== -{if !$useForMember && $membership_amount && $is_quick_config} -{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney} -{if $amount} -{if ! $is_separate_payment } -{ts}Contribution Amount{/ts}: {$amount|crmMoney} -{else} -{ts}Additional Contribution{/ts}: {$amount|crmMoney} -{/if} -{/if} -------------------------------------------- -{ts}Total{/ts}: {$amount+$membership_amount|crmMoney} -{elseif !$useForMember && $lineItem and $priceSetID & !$is_quick_config} -{foreach from=$lineItem item=value key=priceset} ---------------------------------------------------------- -{capture assign=ts_item}{ts}Item{/ts}{/capture} -{capture assign=ts_qty}{ts}Qty{/ts}{/capture} -{capture assign=ts_each}{ts}Each{/ts}{/capture} -{capture assign=ts_total}{ts}Total{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {$ts_total|string_format:"%10s"} ----------------------------------------------------------- -{foreach from=$value item=line} -{$line.description|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney|string_format:"%10s"} {$line.line_total|crmMoney|string_format:"%10s"} -{/foreach} -{/foreach} - -{ts}Total Amount{/ts}: {$amount|crmMoney} -{else} -{if $useForMember && $lineItem && !$is_quick_config} -{foreach from=$lineItem item=value key=priceset} -{capture assign=ts_item}{ts}Item{/ts}{/capture} -{capture assign=ts_total}{ts}Fee{/ts}{/capture} -{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture} -{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} --------------------------------------------------------------------------------------------------- - -{foreach from=$value item=line} -{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.line_total|crmMoney|string_format:"%10s"} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} -{/foreach} -{/foreach} --------------------------------------------------------------------------------------------------- -{/if} -{ts}Amount{/ts}: {$amount|crmMoney} {if $amount_level } - {$amount_level} {/if} -{/if} -{elseif $membership_amount} -=========================================================== -{ts}Membership Fee{/ts} - -=========================================================== -{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney} -{/if} - -{if $receive_date} - -{ts}Date{/ts}: {$receive_date|crmDate} -{/if} -{if $is_monetary and $trxn_id} -{ts}Transaction #{/ts}: {$trxn_id} - -{/if} -{if $membership_trx_id} -{ts}Membership Transaction #{/ts}: {$membership_trx_id} - -{/if} -{if $is_recur} -{if $contributeMode eq 'notify' or $contributeMode eq 'directIPN'} -{ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by visiting this web page: %1.{/ts} - -{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts} -{/if} -{/if} - -{if $honor_block_is_active } -=========================================================== -{$honor_type} -=========================================================== -{$honor_prefix} {$honor_first_name} {$honor_last_name} -{if $honor_email} -{ts}Honoree Email{/ts}: {$honor_email} -{/if} - -{/if} -{if $pcpBlock} -=========================================================== -{ts}Personal Campaign Page{/ts} - -=========================================================== -{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if} - -{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if} - -{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if} - -{/if} -{if $onBehalfProfile} -=========================================================== -{ts}On Behalf Of{/ts} - -=========================================================== -{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName} -{$onBehalfName}: {$onBehalfValue} -{/foreach} -{/if} - -{if !( $contributeMode eq 'notify' OR $contributeMode eq 'directIPN' ) and $is_monetary} -{if $is_pay_later} -=========================================================== -{ts}Registered Email{/ts} - -=========================================================== -{$email} -{elseif $amount GT 0 OR $membership_amount GT 0 } -=========================================================== -{ts}Billing Name and Address{/ts} - -=========================================================== -{$billingName} -{$address} - -{$email} -{/if} {* End ! is_pay_later condition. *} -{/if} -{if $contributeMode eq 'direct' AND !$is_pay_later AND ( $amount GT 0 OR $membership_amount GT 0 ) } - -=========================================================== -{ts}Credit Card Information{/ts} - -=========================================================== -{$credit_card_type} -{$credit_card_number} -{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} -{/if} - -{if $selectPremium } -=========================================================== -{ts}Premium Information{/ts} - -=========================================================== -{$product_name} -{if $option} -{ts}Option{/ts}: {$option} -{/if} -{if $sku} -{ts}SKU{/ts}: {$sku} -{/if} -{if $start_date} -{ts}Start Date{/ts}: {$start_date|crmDate} -{/if} -{if $end_date} -{ts}End Date{/ts}: {$end_date|crmDate} -{/if} -{if $contact_email OR $contact_phone} - -{ts}For information about this premium, contact:{/ts} - -{if $contact_email} - {$contact_email} -{/if} -{if $contact_phone} - {$contact_phone} -{/if} -{/if} -{if $is_deductible AND $price} - -{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if} -{/if} - -{if $customPre} -=========================================================== -{$customPre_grouptitle} - -=========================================================== -{foreach from=$customPre item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - {$customName}: {$customValue} -{/if} -{/foreach} -{/if} - - -{if $customPost} -=========================================================== -{$customPost_grouptitle} - -=========================================================== -{foreach from=$customPost item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - {$customName}: {$customValue} -{/if} -{/foreach} -{/if} diff --git a/CRM/Upgrade/4.3.alpha3.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.3.alpha3.msg_template/civicrm_msg_template.tpl deleted file mode 100644 index 6924e8ba95..0000000000 --- a/CRM/Upgrade/4.3.alpha3.msg_template/civicrm_msg_template.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{php} - $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.3.alpha3.msg_template/message_templates'; - $templates = array(); - 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=$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} diff --git a/CRM/Upgrade/4.3.alpha3.msg_template/message_templates/event_online_receipt_html.tpl b/CRM/Upgrade/4.3.alpha3.msg_template/message_templates/event_online_receipt_html.tpl deleted file mode 100644 index 94d6b43177..0000000000 --- a/CRM/Upgrade/4.3.alpha3.msg_template/message_templates/event_online_receipt_html.tpl +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - - - -{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} - -
- - - - - - - - - - - - - - -
-

Dear {contact.display_name},

- - {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 $isOnWaitlist}waitlisted{else}registered{/if} for the following:

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

{$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_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} - - {if $amounts && !$lineItem} - {foreach from=$amounts item=amnt key=level} - - - - {/foreach} - {/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 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} - -
- {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} -
- {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 $pricesetFieldsCount }{/if} - - {foreach from=$value item=line} - - - - - - {if $pricesetFieldsCount } {/if} - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/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.line_total|crmMoney:$currency} - {$line.participant_count}
-
- {$amnt.amount|crmMoney:$currency} {$amnt.label} -
- {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} -
-
-
- - - diff --git a/CRM/Upgrade/4.3.alpha3.msg_template/message_templates/event_online_receipt_text.tpl b/CRM/Upgrade/4.3.alpha3.msg_template/message_templates/event_online_receipt_text.tpl deleted file mode 100644 index f7314e7567..0000000000 --- a/CRM/Upgrade/4.3.alpha3.msg_template/message_templates/event_online_receipt_text.tpl +++ /dev/null @@ -1,277 +0,0 @@ -Dear {contact.display_name}, - -{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} for the following: - -{/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} - -==========================================================={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} -{/foreach} -{foreach from=$location.email item=eventEmail} -{if $eventEmail.email} - -{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} -{/if} - -{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 $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} -{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"} {$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"} {$line.line_total|crmMoney:$currency|string_format:"%10s"}{$ts_participant_count|string_format:"%10s"} -{/foreach} -{/if} -{/foreach} -{/if} -{if $amounts && !$lineItem} -{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label} -{/foreach} -{/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 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} diff --git a/CRM/Upgrade/4.3.alpha3.msg_template/message_templates/pcp_notify_html.tpl b/CRM/Upgrade/4.3.alpha3.msg_template/message_templates/pcp_notify_html.tpl deleted file mode 100644 index 13a66bc875..0000000000 --- a/CRM/Upgrade/4.3.alpha3.msg_template/message_templates/pcp_notify_html.tpl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - -{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=pcpURL }{crmURL p="civicrm/contribute/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} - -
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- {ts}Personal Campaign Page Notification{/ts} -
- {ts}Action{/ts}: - - {if $mode EQ 'Update'} - {ts}Updated personal campaign page{/ts} - {else} - {ts}New personal campaign page{/ts} - {/if} -
- {ts}Personal Campaign Page Title{/ts} - - {$pcpTitle} -
- {ts}Current Status{/ts} - - {$pcpStatus} -
- {ts}View Page{/ts} -
- {ts}Supporter{/ts} - - {$supporterName} -
- {ts}Linked to Contribution Page{/ts} - - {$contribPageTitle} -
- {ts}Manage Personal Campaign Pages{/ts} -
-
-
- - - diff --git a/CRM/Upgrade/4.3.beta1.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.3.beta1.msg_template/civicrm_msg_template.tpl deleted file mode 100644 index bfb4353d18..0000000000 --- a/CRM/Upgrade/4.3.beta1.msg_template/civicrm_msg_template.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{php} - $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.3.beta1.msg_template/message_templates'; - $templates = array(); - 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=$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} diff --git a/CRM/Upgrade/4.3.beta1.msg_template/message_templates/contribution_online_receipt_html.tpl b/CRM/Upgrade/4.3.beta1.msg_template/message_templates/contribution_online_receipt_html.tpl deleted file mode 100644 index 464543bcb1..0000000000 --- a/CRM/Upgrade/4.3.beta1.msg_template/message_templates/contribution_online_receipt_html.tpl +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - - - -{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 $receipt_text} -

{$receipt_text|htmlize}

- {/if} - - {if $is_pay_later} -

{$pay_later_receipt}

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

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

- {/if} - -
- - - {if $amount} - - - - - - - {if $lineItem and $priceSetID and !$is_quick_config} - - {foreach from=$lineItem item=value key=priceset} - - - - {/foreach} - - - - - - {else} - - - - - - - {/if} - - {/if} - - - {if $receive_date} - - - - - {/if} - - {if $is_monetary and $trxn_id} - - - - - {/if} - - {if $is_recur} - {if $contributeMode eq 'notify' or $contributeMode eq 'directIPN'} - - - - - - - - - - {/if} - {/if} - - {if $honor_block_is_active} - - - - - - - {if $honor_email} - - - - - {/if} - {/if} - - {if $pcpBlock} - - - - - - - - {if $pcp_roll_nickname} - - - - - {/if} - {if $pcp_personal_note} - - - - - {/if} - {/if} - - {if $onBehalfProfile} - - - - {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName} - - - - - {/foreach} - {/if} - - {if $isShare} - - - - {/if} - - {if ! ($contributeMode eq 'notify' OR $contributeMode eq 'directIPN') and $is_monetary} - {if $is_pay_later} - - - - - - - {elseif $amount GT 0} - - - - - - - {/if} - {/if} - - {if $contributeMode eq 'direct' AND !$is_pay_later AND $amount GT 0} - - - - - - - {/if} - - {if $selectPremium} - - - - - - - {if $option} - - - - - {/if} - {if $sku} - - - - - {/if} - {if $start_date} - - - - - {/if} - {if $end_date} - - - - - {/if} - {if $contact_email OR $contact_phone} - - - - {/if} - {if $is_deductible AND $price} - - - - {/if} - {/if} - - {if $customPre} - - - - {foreach from=$customPre item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - - {if $customPost} - - - - {foreach from=$customPost item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - -
- {ts}Contribution Information{/ts} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - - {foreach from=$value item=line} - - - - - - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Total{/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.line_total|crmMoney:$currency} -
-
- {ts}Total Amount{/ts} - - {$amount|crmMoney:$currency} -
- {ts}Amount{/ts} - - {$amount|crmMoney:$currency} {if $amount_level} - {$amount_level}{/if} -
- {ts}Date{/ts} - - {$receive_date|crmDate} -
- {ts}Transaction #{/ts} - - {$trxn_id} -
- {ts 1=$cancelSubscriptionUrl}This is a recurring contribution. You can cancel future contributions by visiting this web page.{/ts} -
- {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by visiting this web page.{/ts} -
- {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by visiting this web page.{/ts} -
- {$honor_type} -
- {$honor_prefix} {$honor_first_name} {$honor_last_name} -
- {ts}Honoree Email{/ts} - - {$honor_email} -
- {ts}Personal Campaign Page{/ts} -
- {ts}Display In Honor Roll{/ts} - - {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if} -
- {ts}Nickname{/ts} - - {$pcp_roll_nickname} -
- {ts}Personal Note{/ts} - - {$pcp_personal_note} -
- {$onBehalfProfile_grouptitle} -
- {$onBehalfName} - - {$onBehalfValue} -
- {capture assign=contributionUrl}{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$contributionPageId`" a=true fe=1 h=1}{/capture} - {include file="CRM/common/SocialNetwork.tpl" emailMode=true url=$contributionUrl title=$title pageURL=$contributionUrl} -
- {ts}Registered Email{/ts} -
- {$email} -
- {ts}Billing Name and Address{/ts} -
- {$billingName}
- {$address|nl2br}
- {$email} -
- {ts}Credit Card Information{/ts} -
- {$credit_card_type}
- {$credit_card_number}
- {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}
-
- {ts}Premium Information{/ts} -
- {$product_name} -
- {ts}Option{/ts} - - {$option} -
- {ts}SKU{/ts} - - {$sku} -
- {ts}Start Date{/ts} - - {$start_date|crmDate} -
- {ts}End Date{/ts} - - {$end_date|crmDate} -
-

{ts}For information about this premium, contact:{/ts}

- {if $contact_email} -

{$contact_email}

- {/if} - {if $contact_phone} -

{$contact_phone}

- {/if} -
-

{ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

-
- {$customPre_grouptitle} -
- {$customName} - - {$customValue} -
- {$customPost_grouptitle} -
- {$customName} - - {$customValue} -
-
- - - diff --git a/CRM/Upgrade/4.3.beta1.msg_template/message_templates/contribution_online_receipt_text.tpl b/CRM/Upgrade/4.3.beta1.msg_template/message_templates/contribution_online_receipt_text.tpl deleted file mode 100644 index bcd6e97283..0000000000 --- a/CRM/Upgrade/4.3.beta1.msg_template/message_templates/contribution_online_receipt_text.tpl +++ /dev/null @@ -1,179 +0,0 @@ -{if $receipt_text} -{$receipt_text} -{/if} -{if $is_pay_later} - -=========================================================== -{$pay_later_receipt} -=========================================================== -{else} - -{ts}Please print this receipt for your records.{/ts} -{/if} - -{if $amount} -=========================================================== -{ts}Contribution Information{/ts} - -=========================================================== -{if $lineItem and $priceSetID and !$is_quick_config} -{foreach from=$lineItem item=value key=priceset} ---------------------------------------------------------- -{capture assign=ts_item}{ts}Item{/ts}{/capture} -{capture assign=ts_qty}{ts}Qty{/ts}{/capture} -{capture assign=ts_each}{ts}Each{/ts}{/capture} -{capture assign=ts_total}{ts}Total{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {$ts_total|string_format:"%10s"} ----------------------------------------------------------- -{foreach from=$value item=line} -{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"} {$line.line_total|crmMoney:$currency|string_format:"%10s"} -{/foreach} -{/foreach} - -{ts}Total Amount{/ts}: {$amount|crmMoney:$currency} -{else} -{ts}Amount{/ts}: {$amount|crmMoney:$currency} {if $amount_level } - {$amount_level} {/if} -{/if} -{/if} -{if $receive_date} - -{ts}Date{/ts}: {$receive_date|crmDate} -{/if} -{if $is_monetary and $trxn_id} -{ts}Transaction #{/ts}: {$trxn_id} -{/if} - -{if $is_recur and ($contributeMode eq 'notify' or $contributeMode eq 'directIPN')} -{ts}This is a recurring contribution. You can cancel future contributions at:{/ts} - -{$cancelSubscriptionUrl} - -{ts}You can update billing details for this recurring contribution at:{/ts} - -{$updateSubscriptionBillingUrl} - -{ts}You can update recurring contribution amount or change the number of installments for this recurring contribution at:{/ts} - -{$updateSubscriptionUrl} - -{/if} - -{if $honor_block_is_active } -=========================================================== -{$honor_type} -=========================================================== -{$honor_prefix} {$honor_first_name} {$honor_last_name} -{if $honor_email} -{ts}Honoree Email{/ts}: {$honor_email} -{/if} - -{/if} -{if $pcpBlock} -=========================================================== -{ts}Personal Campaign Page{/ts} - -=========================================================== -{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if} - -{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if} - -{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if} - -{/if} -{if $onBehalfProfile} -=========================================================== -{ts}On Behalf Of{/ts} - -=========================================================== -{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName} -{$onBehalfName}: {$onBehalfValue} -{/foreach} -{/if} - -{if !( $contributeMode eq 'notify' OR $contributeMode eq 'directIPN' ) and $is_monetary} -{if $is_pay_later} -=========================================================== -{ts}Registered Email{/ts} - -=========================================================== -{$email} -{elseif $amount GT 0} -=========================================================== -{ts}Billing Name and Address{/ts} - -=========================================================== -{$billingName} -{$address} - -{$email} -{/if} {* End ! is_pay_later condition. *} -{/if} -{if $contributeMode eq 'direct' AND !$is_pay_later AND $amount GT 0} - -=========================================================== -{ts}Credit Card Information{/ts} - -=========================================================== -{$credit_card_type} -{$credit_card_number} -{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} -{/if} - -{if $selectPremium } -=========================================================== -{ts}Premium Information{/ts} - -=========================================================== -{$product_name} -{if $option} -{ts}Option{/ts}: {$option} -{/if} -{if $sku} -{ts}SKU{/ts}: {$sku} -{/if} -{if $start_date} -{ts}Start Date{/ts}: {$start_date|crmDate} -{/if} -{if $end_date} -{ts}End Date{/ts}: {$end_date|crmDate} -{/if} -{if $contact_email OR $contact_phone} - -{ts}For information about this premium, contact:{/ts} - -{if $contact_email} - {$contact_email} -{/if} -{if $contact_phone} - {$contact_phone} -{/if} -{/if} -{if $is_deductible AND $price} - -{ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if} -{/if} - -{if $customPre} -=========================================================== -{$customPre_grouptitle} - -=========================================================== -{foreach from=$customPre item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - {$customName}: {$customValue} -{/if} -{/foreach} -{/if} - - -{if $customPost} -=========================================================== -{$customPost_grouptitle} - -=========================================================== -{foreach from=$customPost item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - {$customName}: {$customValue} -{/if} -{/foreach} -{/if} diff --git a/CRM/Upgrade/4.3.beta1.msg_template/message_templates/membership_online_receipt_html.tpl b/CRM/Upgrade/4.3.beta1.msg_template/message_templates/membership_online_receipt_html.tpl deleted file mode 100644 index c56152bbaa..0000000000 --- a/CRM/Upgrade/4.3.beta1.msg_template/message_templates/membership_online_receipt_html.tpl +++ /dev/null @@ -1,514 +0,0 @@ - - - - - - - - -{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 $receipt_text} -

{$receipt_text|htmlize}

- {/if} - - {if $is_pay_later} -

{$pay_later_receipt}

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

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

- {/if} - -
- - - {if $membership_assign && !$useForMember} - - - - - - - - {if $mem_start_date} - - - - - {/if} - {if $mem_end_date} - - - - - {/if} - {/if} - - - {if $amount} - - - - - {if !$useForMember and $membership_amount and $is_quick_config} - - - - - - {if $amount} - {if ! $is_separate_payment } - - - - - {else} - - - - - {/if} - {/if} - - - - - - {elseif !$useForMember && $lineItem and $priceSetID and !$is_quick_config} - - {foreach from=$lineItem item=value key=priceset} - - - - {/foreach} - - - - - - {else} - {if $useForMember && $lineItem and !$is_quick_config} - {foreach from=$lineItem item=value key=priceset} - - - - {/foreach} - {/if} - - - - - - {/if} - - - {elseif $membership_amount} - - - - - - - - - - - - {/if} - - {if $receive_date} - - - - - {/if} - - {if $is_monetary and $trxn_id} - - - - - {/if} - - {if $membership_trx_id} - - - - - {/if} - {if $is_recur} - {if $contributeMode eq 'notify' or $contributeMode eq 'directIPN'} - - - - - - - {/if} - {/if} - - {if $honor_block_is_active} - - - - - - - {if $honor_email} - - - - - {/if} - {/if} - - {if $pcpBlock} - - - - - - - - {if $pcp_roll_nickname} - - - - - {/if} - {if $pcp_personal_note} - - - - - {/if} - {/if} - - {if $onBehalfProfile} - - - - {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName} - - - - - {/foreach} - {/if} - - {if ! ($contributeMode eq 'notify' OR $contributeMode eq 'directIPN') and $is_monetary} - {if $is_pay_later} - - - - - - - {elseif $amount GT 0 OR $membership_amount GT 0} - - - - - - - {/if} - {/if} - - {if $contributeMode eq 'direct' AND !$is_pay_later AND ($amount GT 0 OR $membership_amount GT 0)} - - - - - - - {/if} - - {if $selectPremium} - - - - - - - {if $option} - - - - - {/if} - {if $sku} - - - - - {/if} - {if $start_date} - - - - - {/if} - {if $end_date} - - - - - {/if} - {if $contact_email OR $contact_phone} - - - - {/if} - {if $is_deductible AND $price} - - - - {/if} - {/if} - - {if $customPre} - - - - {foreach from=$customPre item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - - {if $customPost} - - - - {foreach from=$customPost item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - -
- {ts}Membership Information{/ts} -
- {ts}Membership Type{/ts} - - {$membership_name} -
- {ts}Membership Start Date{/ts} - - {$mem_start_date|crmDate} -
- {ts}Membership End Date{/ts} - - {$mem_end_date|crmDate} -
- {ts}Membership Fee{/ts} -
- {ts 1=$membership_name}%1 Membership{/ts} - - {$membership_amount|crmMoney} -
- {ts}Contribution Amount{/ts} - - {$amount|crmMoney} -
- {ts}Additional Contribution{/ts} - - {$amount|crmMoney} -
- {ts}Total{/ts} - - {$amount+$membership_amount|crmMoney} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - - {foreach from=$value item=line} - - - - - - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Total{/ts}
- {$line.description|truncate:30:"..."} - - {$line.qty} - - {$line.unit_price|crmMoney} - - {$line.line_total|crmMoney} -
-
- {ts}Total Amount{/ts} - - {$amount|crmMoney} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - - {foreach from=$value item=line} - - - - - - - {/foreach} -
{ts}Item{/ts}{ts}Fee{/ts}{ts}Membership Start Date{/ts}{ts}Membership End Date{/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.line_total|crmMoney} - - {$line.start_date} - - {$line.end_date} -
-
- {ts}Amount{/ts} - - {$amount|crmMoney} {if $amount_level} - {$amount_level}{/if} -
- {ts}Membership Fee{/ts} -
- {ts 1=$membership_name}%1 Membership{/ts} - - {$membership_amount|crmMoney} -
- {ts}Date{/ts} - - {$receive_date|crmDate} -
- {ts}Transaction #{/ts} - - {$trxn_id} -
- {ts}Membership Transaction #{/ts} - - {$membership_trx_id} -
- {ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by visiting this web page.{/ts} -
- {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts} -
- {$honor_type} -
- {$honor_prefix} {$honor_first_name} {$honor_last_name} -
- {ts}Honoree Email{/ts} - - {$honor_email} -
- {ts}Personal Campaign Page{/ts} -
- {ts}Display In Honor Roll{/ts} - - {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if} -
- {ts}Nickname{/ts} - - {$pcp_roll_nickname} -
- {ts}Personal Note{/ts} - - {$pcp_personal_note} -
- {$onBehalfProfile_grouptitle} -
- {$onBehalfName} - - {$onBehalfValue} -
- {ts}Registered Email{/ts} -
- {$email} -
- {ts}Billing Name and Address{/ts} -
- {$billingName}
- {$address|nl2br}
- {$email} -
- {ts}Credit Card Information{/ts} -
- {$credit_card_type}
- {$credit_card_number}
- {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}
-
- {ts}Premium Information{/ts} -
- {$product_name} -
- {ts}Option{/ts} - - {$option} -
- {ts}SKU{/ts} - - {$sku} -
- {ts}Start Date{/ts} - - {$start_date|crmDate} -
- {ts}End Date{/ts} - - {$end_date|crmDate} -
-

{ts}For information about this premium, contact:{/ts}

- {if $contact_email} -

{$contact_email}

- {/if} - {if $contact_phone} -

{$contact_phone}

- {/if} -
-

{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

-
- {$customPre_grouptitle} -
- {$customName} - - {$customValue} -
- {$customPost_grouptitle} -
- {$customName} - - {$customValue} -
-
- - - diff --git a/CRM/Upgrade/4.3.beta1.msg_template/message_templates/membership_online_receipt_text.tpl b/CRM/Upgrade/4.3.beta1.msg_template/message_templates/membership_online_receipt_text.tpl deleted file mode 100644 index 957ac2fe23..0000000000 --- a/CRM/Upgrade/4.3.beta1.msg_template/message_templates/membership_online_receipt_text.tpl +++ /dev/null @@ -1,221 +0,0 @@ -{if $receipt_text} -{$receipt_text} -{/if} -{if $is_pay_later} - -=========================================================== -{$pay_later_receipt} -=========================================================== -{else} - -{ts}Please print this receipt for your records.{/ts} -{/if} - -{if $membership_assign && !$useForMember} -=========================================================== -{ts}Membership Information{/ts} - -=========================================================== -{ts}Membership Type{/ts}: {$membership_name} -{if $mem_start_date}{ts}Membership Start Date{/ts}: {$mem_start_date|crmDate} -{/if} -{if $mem_end_date}{ts}Membership End Date{/ts}: {$mem_end_date|crmDate} -{/if} - -{/if} -{if $amount} -=========================================================== -{ts}Membership Fee{/ts} - -=========================================================== -{if !$useForMember && $membership_amount && $is_quick_config} -{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney} -{if $amount} -{if ! $is_separate_payment } -{ts}Contribution Amount{/ts}: {$amount|crmMoney} -{else} -{ts}Additional Contribution{/ts}: {$amount|crmMoney} -{/if} -{/if} -------------------------------------------- -{ts}Total{/ts}: {$amount+$membership_amount|crmMoney} -{elseif !$useForMember && $lineItem and $priceSetID & !$is_quick_config} -{foreach from=$lineItem item=value key=priceset} ---------------------------------------------------------- -{capture assign=ts_item}{ts}Item{/ts}{/capture} -{capture assign=ts_qty}{ts}Qty{/ts}{/capture} -{capture assign=ts_each}{ts}Each{/ts}{/capture} -{capture assign=ts_total}{ts}Total{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {$ts_total|string_format:"%10s"} ----------------------------------------------------------- -{foreach from=$value item=line} -{$line.description|truncate:30:"..."|string_format:"%-30s"} {$line.qty|string_format:"%5s"} {$line.unit_price|crmMoney|string_format:"%10s"} {$line.line_total|crmMoney|string_format:"%10s"} -{/foreach} -{/foreach} - -{ts}Total Amount{/ts}: {$amount|crmMoney} -{else} -{if $useForMember && $lineItem && !$is_quick_config} -{foreach from=$lineItem item=value key=priceset} -{capture assign=ts_item}{ts}Item{/ts}{/capture} -{capture assign=ts_total}{ts}Fee{/ts}{/capture} -{capture assign=ts_start_date}{ts}Membership Start Date{/ts}{/capture} -{capture assign=ts_end_date}{ts}Membership End Date{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_total|string_format:"%10s"} {$ts_start_date|string_format:"%20s"} {$ts_end_date|string_format:"%20s"} --------------------------------------------------------------------------------------------------- - -{foreach from=$value item=line} -{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.line_total|crmMoney|string_format:"%10s"} {$line.start_date|string_format:"%20s"} {$line.end_date|string_format:"%20s"} -{/foreach} -{/foreach} --------------------------------------------------------------------------------------------------- -{/if} -{ts}Amount{/ts}: {$amount|crmMoney} {if $amount_level } - {$amount_level} {/if} -{/if} -{elseif $membership_amount} -=========================================================== -{ts}Membership Fee{/ts} - -=========================================================== -{ts 1=$membership_name}%1 Membership{/ts}: {$membership_amount|crmMoney} -{/if} - -{if $receive_date} - -{ts}Date{/ts}: {$receive_date|crmDate} -{/if} -{if $is_monetary and $trxn_id} -{ts}Transaction #{/ts}: {$trxn_id} - -{/if} -{if $membership_trx_id} -{ts}Membership Transaction #{/ts}: {$membership_trx_id} - -{/if} -{if $is_recur} -{if $contributeMode eq 'notify' or $contributeMode eq 'directIPN'} -{ts 1=$cancelSubscriptionUrl}This membership will be renewed automatically. You can cancel the auto-renewal option by visiting this web page: %1.{/ts} - -{ts 1=$updateSubscriptionBillingUrl}You can update billing details for this automatically renewed membership by visiting this web page.{/ts} -{/if} -{/if} - -{if $honor_block_is_active } -=========================================================== -{$honor_type} -=========================================================== -{$honor_prefix} {$honor_first_name} {$honor_last_name} -{if $honor_email} -{ts}Honoree Email{/ts}: {$honor_email} -{/if} - -{/if} -{if $pcpBlock} -=========================================================== -{ts}Personal Campaign Page{/ts} - -=========================================================== -{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if} - -{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if} - -{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if} - -{/if} -{if $onBehalfProfile} -=========================================================== -{ts}On Behalf Of{/ts} - -=========================================================== -{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName} -{$onBehalfName}: {$onBehalfValue} -{/foreach} -{/if} - -{if !( $contributeMode eq 'notify' OR $contributeMode eq 'directIPN' ) and $is_monetary} -{if $is_pay_later} -=========================================================== -{ts}Registered Email{/ts} - -=========================================================== -{$email} -{elseif $amount GT 0 OR $membership_amount GT 0 } -=========================================================== -{ts}Billing Name and Address{/ts} - -=========================================================== -{$billingName} -{$address} - -{$email} -{/if} {* End ! is_pay_later condition. *} -{/if} -{if $contributeMode eq 'direct' AND !$is_pay_later AND ( $amount GT 0 OR $membership_amount GT 0 ) } - -=========================================================== -{ts}Credit Card Information{/ts} - -=========================================================== -{$credit_card_type} -{$credit_card_number} -{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} -{/if} - -{if $selectPremium } -=========================================================== -{ts}Premium Information{/ts} - -=========================================================== -{$product_name} -{if $option} -{ts}Option{/ts}: {$option} -{/if} -{if $sku} -{ts}SKU{/ts}: {$sku} -{/if} -{if $start_date} -{ts}Start Date{/ts}: {$start_date|crmDate} -{/if} -{if $end_date} -{ts}End Date{/ts}: {$end_date|crmDate} -{/if} -{if $contact_email OR $contact_phone} - -{ts}For information about this premium, contact:{/ts} - -{if $contact_email} - {$contact_email} -{/if} -{if $contact_phone} - {$contact_phone} -{/if} -{/if} -{if $is_deductible AND $price} - -{ts 1=$price|crmMoney}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if} -{/if} - -{if $customPre} -=========================================================== -{$customPre_grouptitle} - -=========================================================== -{foreach from=$customPre item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - {$customName}: {$customValue} -{/if} -{/foreach} -{/if} - - -{if $customPost} -=========================================================== -{$customPost_grouptitle} - -=========================================================== -{foreach from=$customPost item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - {$customName}: {$customValue} -{/if} -{/foreach} -{/if} diff --git a/CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl deleted file mode 100644 index 581377590c..0000000000 --- a/CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{php} - $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.3.beta2.msg_template/message_templates'; - $templates = array(); - 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=$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} diff --git a/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_html.tpl b/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_html.tpl deleted file mode 100644 index 6e8e8b230d..0000000000 --- a/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_html.tpl +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - -{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=pcpURL }{crmURL p="civicrm/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} - -
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- {ts}Personal Campaign Page Notification{/ts} -
- {ts}Action{/ts}: - - {if $mode EQ 'Update'} - {ts}Updated personal campaign page{/ts} - {else} - {ts}New personal campaign page{/ts} - {/if} -
- {ts}Personal Campaign Page Title{/ts} - - {$pcpTitle} -
- {ts}Current Status{/ts} - - {$pcpStatus} -
- {ts}View Page{/ts} -
- {ts}Supporter{/ts} - - {$supporterName} -
- {ts}Linked to Contribution Page{/ts} - - {$contribPageTitle} -
- {ts}Manage Personal Campaign Pages{/ts} -
-
-
- - - diff --git a/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_text.tpl b/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_text.tpl deleted file mode 100644 index 52f9761e58..0000000000 --- a/CRM/Upgrade/4.3.beta2.msg_template/message_templates/pcp_notify_text.tpl +++ /dev/null @@ -1,20 +0,0 @@ -=========================================================== -{ts}Personal Campaign Page Notification{/ts} - -=========================================================== -{ts}Action{/ts}: {if $mode EQ 'Update'}{ts}Updated personal campaign page{/ts}{else}{ts}New personal campaign page{/ts}{/if} -{ts}Personal Campaign Page Title{/ts}: {$pcpTitle} -{ts}Current Status{/ts}: {$pcpStatus} -{capture assign=pcpURL}{crmURL p="civicrm/pcp/info" q="reset=1&id=`$pcpId`" h=0 a=1}{/capture} -{ts}View Page{/ts}: ->> {$pcpURL} - -{ts}Supporter{/ts}: {$supporterName} ->> {$supporterUrl} - -{ts}Linked to Contribution Page{/ts}: {$contribPageTitle} ->> {$contribPageUrl} - -{ts}Manage Personal Campaign Pages{/ts}: ->> {$managePCPUrl} - diff --git a/CRM/Upgrade/4.3.beta3.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.3.beta3.msg_template/civicrm_msg_template.tpl deleted file mode 100644 index f9a58e0ebd..0000000000 --- a/CRM/Upgrade/4.3.beta3.msg_template/civicrm_msg_template.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{php} - $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.3.beta3.msg_template/message_templates'; - $templates = array(); - 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=$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} diff --git a/CRM/Upgrade/4.3.beta3.msg_template/message_templates/contribution_online_receipt_html.tpl b/CRM/Upgrade/4.3.beta3.msg_template/message_templates/contribution_online_receipt_html.tpl deleted file mode 100644 index 48bde393ba..0000000000 --- a/CRM/Upgrade/4.3.beta3.msg_template/message_templates/contribution_online_receipt_html.tpl +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - - -{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 $receipt_text} -

{$receipt_text|htmlize}

- {/if} - - {if $is_pay_later} -

{$pay_later_receipt}

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

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

- {/if} - -
- - - {if $amount} - - - - - - - {if $lineItem and $priceSetID and !$is_quick_config} - - {foreach from=$lineItem item=value key=priceset} - - - - {/foreach} - - - - - - {else} - - - - - - - {/if} - - {/if} - - - {if $receive_date} - - - - - {/if} - - {if $is_monetary and $trxn_id} - - - - - {/if} - - {if $is_recur} - {if $contributeMode eq 'notify' or $contributeMode eq 'directIPN'} - - - {if $updateSubscriptionBillingUrl} - - - - {/if} - - - - - {/if} - {/if} - - {if $honor_block_is_active} - - - - - - - {if $honor_email} - - - - - {/if} - {/if} - - {if $pcpBlock} - - - - - - - - {if $pcp_roll_nickname} - - - - - {/if} - {if $pcp_personal_note} - - - - - {/if} - {/if} - - {if $onBehalfProfile} - - - - {foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName} - - - - - {/foreach} - {/if} - - {if $isShare} - - - - {/if} - - {if ! ($contributeMode eq 'notify' OR $contributeMode eq 'directIPN') and $is_monetary} - {if $is_pay_later} - - - - - - - {elseif $amount GT 0} - - - - - - - {/if} - {/if} - - {if $contributeMode eq 'direct' AND !$is_pay_later AND $amount GT 0} - - - - - - - {/if} - - {if $selectPremium} - - - - - - - {if $option} - - - - - {/if} - {if $sku} - - - - - {/if} - {if $start_date} - - - - - {/if} - {if $end_date} - - - - - {/if} - {if $contact_email OR $contact_phone} - - - - {/if} - {if $is_deductible AND $price} - - - - {/if} - {/if} - - {if $customPre} - - - - {foreach from=$customPre item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - - {if $customPost} - - - - {foreach from=$customPost item=customValue key=customName} - {if ($trackingFields and ! in_array($customName, $trackingFields)) or ! $trackingFields} - - - - - {/if} - {/foreach} - {/if} - -
- {ts}Contribution Information{/ts} -
- {* FIXME: style this table so that it looks like the text version (justification, etc.) *} - - - - - - - {foreach from=$value item=line} - - - - - - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/ts}{ts}Total{/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.line_total|crmMoney:$currency} -
-
- {ts}Total Amount{/ts} - - {$amount|crmMoney:$currency} -
- {ts}Amount{/ts} - - {$amount|crmMoney:$currency} {if $amount_level} - {$amount_level}{/if} -
- {ts}Date{/ts} - - {$receive_date|crmDate} -
- {ts}Transaction #{/ts} - - {$trxn_id} -
- {ts 1=$cancelSubscriptionUrl}This is a recurring contribution. You can cancel future contributions by visiting this web page.{/ts} -
- {ts 1=$updateSubscriptionBillingUrl}You can update billing details for this recurring contribution by visiting this web page.{/ts} -
- {ts 1=$updateSubscriptionUrl}You can update recurring contribution amount or change the number of installments for this recurring contribution by visiting this web page.{/ts} -
- {$honor_type} -
- {$honor_prefix} {$honor_first_name} {$honor_last_name} -
- {ts}Honoree Email{/ts} - - {$honor_email} -
- {ts}Personal Campaign Page{/ts} -
- {ts}Display In Honor Roll{/ts} - - {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if} -
- {ts}Nickname{/ts} - - {$pcp_roll_nickname} -
- {ts}Personal Note{/ts} - - {$pcp_personal_note} -
- {$onBehalfProfile_grouptitle} -
- {$onBehalfName} - - {$onBehalfValue} -
- {capture assign=contributionUrl}{crmURL p='civicrm/contribute/transact' q="reset=1&id=`$contributionPageId`" a=true fe=1 h=1}{/capture} - {include file="CRM/common/SocialNetwork.tpl" emailMode=true url=$contributionUrl title=$title pageURL=$contributionUrl} -
- {ts}Registered Email{/ts} -
- {$email} -
- {ts}Billing Name and Address{/ts} -
- {$billingName}
- {$address|nl2br}
- {$email} -
- {ts}Credit Card Information{/ts} -
- {$credit_card_type}
- {$credit_card_number}
- {ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate}
-
- {ts}Premium Information{/ts} -
- {$product_name} -
- {ts}Option{/ts} - - {$option} -
- {ts}SKU{/ts} - - {$sku} -
- {ts}Start Date{/ts} - - {$start_date|crmDate} -
- {ts}End Date{/ts} - - {$end_date|crmDate} -
-

{ts}For information about this premium, contact:{/ts}

- {if $contact_email} -

{$contact_email}

- {/if} - {if $contact_phone} -

{$contact_phone}

- {/if} -
-

{ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}

-
- {$customPre_grouptitle} -
- {$customName} - - {$customValue} -
- {$customPost_grouptitle} -
- {$customName} - - {$customValue} -
-
- - - diff --git a/CRM/Upgrade/4.3.beta3.msg_template/message_templates/contribution_online_receipt_text.tpl b/CRM/Upgrade/4.3.beta3.msg_template/message_templates/contribution_online_receipt_text.tpl deleted file mode 100644 index ae4f6a5d4c..0000000000 --- a/CRM/Upgrade/4.3.beta3.msg_template/message_templates/contribution_online_receipt_text.tpl +++ /dev/null @@ -1,181 +0,0 @@ -{if $receipt_text} -{$receipt_text} -{/if} -{if $is_pay_later} - -=========================================================== -{$pay_later_receipt} -=========================================================== -{else} - -{ts}Please print this receipt for your records.{/ts} -{/if} - -{if $amount} -=========================================================== -{ts}Contribution Information{/ts} - -=========================================================== -{if $lineItem and $priceSetID and !$is_quick_config} -{foreach from=$lineItem item=value key=priceset} ---------------------------------------------------------- -{capture assign=ts_item}{ts}Item{/ts}{/capture} -{capture assign=ts_qty}{ts}Qty{/ts}{/capture} -{capture assign=ts_each}{ts}Each{/ts}{/capture} -{capture assign=ts_total}{ts}Total{/ts}{/capture} -{$ts_item|string_format:"%-30s"} {$ts_qty|string_format:"%5s"} {$ts_each|string_format:"%10s"} {$ts_total|string_format:"%10s"} ----------------------------------------------------------- -{foreach from=$value item=line} -{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"} {$line.line_total|crmMoney:$currency|string_format:"%10s"} -{/foreach} -{/foreach} - -{ts}Total Amount{/ts}: {$amount|crmMoney:$currency} -{else} -{ts}Amount{/ts}: {$amount|crmMoney:$currency} {if $amount_level } - {$amount_level} {/if} -{/if} -{/if} -{if $receive_date} - -{ts}Date{/ts}: {$receive_date|crmDate} -{/if} -{if $is_monetary and $trxn_id} -{ts}Transaction #{/ts}: {$trxn_id} -{/if} - -{if $is_recur and ($contributeMode eq 'notify' or $contributeMode eq 'directIPN')} -{ts}This is a recurring contribution. You can cancel future contributions at:{/ts} - -{$cancelSubscriptionUrl} - -{if $updateSubscriptionBillingUrl} -{ts}You can update billing details for this recurring contribution at:{/ts} - -{$updateSubscriptionBillingUrl} - -{/if} -{ts}You can update recurring contribution amount or change the number of installments for this recurring contribution at:{/ts} - -{$updateSubscriptionUrl} - -{/if} - -{if $honor_block_is_active } -=========================================================== -{$honor_type} -=========================================================== -{$honor_prefix} {$honor_first_name} {$honor_last_name} -{if $honor_email} -{ts}Honoree Email{/ts}: {$honor_email} -{/if} - -{/if} -{if $pcpBlock} -=========================================================== -{ts}Personal Campaign Page{/ts} - -=========================================================== -{ts}Display In Honor Roll{/ts}: {if $pcp_display_in_roll}{ts}Yes{/ts}{else}{ts}No{/ts}{/if} - -{if $pcp_roll_nickname}{ts}Nickname{/ts}: {$pcp_roll_nickname}{/if} - -{if $pcp_personal_note}{ts}Personal Note{/ts}: {$pcp_personal_note}{/if} - -{/if} -{if $onBehalfProfile} -=========================================================== -{ts}On Behalf Of{/ts} - -=========================================================== -{foreach from=$onBehalfProfile item=onBehalfValue key=onBehalfName} -{$onBehalfName}: {$onBehalfValue} -{/foreach} -{/if} - -{if !( $contributeMode eq 'notify' OR $contributeMode eq 'directIPN' ) and $is_monetary} -{if $is_pay_later} -=========================================================== -{ts}Registered Email{/ts} - -=========================================================== -{$email} -{elseif $amount GT 0} -=========================================================== -{ts}Billing Name and Address{/ts} - -=========================================================== -{$billingName} -{$address} - -{$email} -{/if} {* End ! is_pay_later condition. *} -{/if} -{if $contributeMode eq 'direct' AND !$is_pay_later AND $amount GT 0} - -=========================================================== -{ts}Credit Card Information{/ts} - -=========================================================== -{$credit_card_type} -{$credit_card_number} -{ts}Expires{/ts}: {$credit_card_exp_date|truncate:7:''|crmDate} -{/if} - -{if $selectPremium } -=========================================================== -{ts}Premium Information{/ts} - -=========================================================== -{$product_name} -{if $option} -{ts}Option{/ts}: {$option} -{/if} -{if $sku} -{ts}SKU{/ts}: {$sku} -{/if} -{if $start_date} -{ts}Start Date{/ts}: {$start_date|crmDate} -{/if} -{if $end_date} -{ts}End Date{/ts}: {$end_date|crmDate} -{/if} -{if $contact_email OR $contact_phone} - -{ts}For information about this premium, contact:{/ts} - -{if $contact_email} - {$contact_email} -{/if} -{if $contact_phone} - {$contact_phone} -{/if} -{/if} -{if $is_deductible AND $price} - -{ts 1=$price|crmMoney:$currency}The value of this premium is %1. This may affect the amount of the tax deduction you can claim. Consult your tax advisor for more information.{/ts}{/if} -{/if} - -{if $customPre} -=========================================================== -{$customPre_grouptitle} - -=========================================================== -{foreach from=$customPre item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - {$customName}: {$customValue} -{/if} -{/foreach} -{/if} - - -{if $customPost} -=========================================================== -{$customPost_grouptitle} - -=========================================================== -{foreach from=$customPost item=customValue key=customName} -{if ( $trackingFields and ! in_array( $customName, $trackingFields ) ) or ! $trackingFields} - {$customName}: {$customValue} -{/if} -{/foreach} -{/if} diff --git a/CRM/Upgrade/4.4.3.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.4.3.msg_template/civicrm_msg_template.tpl deleted file mode 100644 index 521836c98d..0000000000 --- a/CRM/Upgrade/4.4.3.msg_template/civicrm_msg_template.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{php} - $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.4.3.msg_template/message_templates'; - $templates = array(); - 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=$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} diff --git a/CRM/Upgrade/4.4.3.msg_template/message_templates/event_online_receipt_html.tpl b/CRM/Upgrade/4.4.3.msg_template/message_templates/event_online_receipt_html.tpl deleted file mode 100644 index ca4c608d8a..0000000000 --- a/CRM/Upgrade/4.4.3.msg_template/message_templates/event_online_receipt_html.tpl +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - -{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} - -
- - - - - - - - - - - - - - -
-

Dear {contact.display_name},

- - {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_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} - - {if $amounts && !$lineItem} - {foreach from=$amounts item=amnt key=level} - - - - {/foreach} - {/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 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} - -
- {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 $pricesetFieldsCount }{/if} - - {foreach from=$value item=line} - - - - - - {if $pricesetFieldsCount } {/if} - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/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.line_total|crmMoney:$currency} - {$line.participant_count}
-
- {$amnt.amount|crmMoney:$currency} {$amnt.label} -
- {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} -
-
-
- - - diff --git a/CRM/Upgrade/4.4.3.msg_template/message_templates/event_online_receipt_text.tpl b/CRM/Upgrade/4.4.3.msg_template/message_templates/event_online_receipt_text.tpl deleted file mode 100644 index ba339e7b85..0000000000 --- a/CRM/Upgrade/4.4.3.msg_template/message_templates/event_online_receipt_text.tpl +++ /dev/null @@ -1,277 +0,0 @@ -Dear {contact.display_name}, - -{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} - -{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 $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} -{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"} {$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"} {$line.line_total|crmMoney:$currency|string_format:"%10s"}{$ts_participant_count|string_format:"%10s"} -{/foreach} -{/if} -{/foreach} -{/if} -{if $amounts && !$lineItem} -{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label} -{/foreach} -{/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 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} diff --git a/CRM/Upgrade/4.4.alpha1.msg_template/civicrm_msg_template.tpl b/CRM/Upgrade/4.4.alpha1.msg_template/civicrm_msg_template.tpl deleted file mode 100644 index f93d38b7e6..0000000000 --- a/CRM/Upgrade/4.4.alpha1.msg_template/civicrm_msg_template.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{php} - $dir = SMARTY_DIR . '/../../CRM/Upgrade/4.4.alpha1.msg_template/message_templates'; - $templates = array(); - 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=$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} diff --git a/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/contribution_dupalert_html.tpl b/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/contribution_dupalert_html.tpl deleted file mode 100644 index 0f782a9c98..0000000000 --- a/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/contribution_dupalert_html.tpl +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - -{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 $receiptMessage} - - - - {/if} -
-

{ts}A contribution / membership signup was made on behalf of the organization listed below.{/ts}

-

{ts}The information provided matched multiple existing database records based on the configured Duplicate Matching Rules for your site.{/ts}

-
- - - - - - - - - - - - - -
- {ts}Organization Name{/ts} - - {$onBehalfName} -
- {ts}Organization Email{/ts} - - {$onBehalfEmail} -
- {ts}Organization Contact ID{/ts} - - {$onBehalfID} -
-
-

{ts}If you think this may be a duplicate contact which should be merged with an existing record - Go to "Contacts >> Find and Merge Duplicate Contacts". Use the strict rule for Organizations to find the potential duplicates and merge them if appropriate.{/ts}

-
- - - - - - - -
- {ts}Copy of Contribution Receipt{/ts} -
- {* FIXME: the below is most probably not HTML-ised *} - {$receiptMessage} -
-
-
- - - diff --git a/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/contribution_dupalert_text.tpl b/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/contribution_dupalert_text.tpl deleted file mode 100644 index 28b2a37f22..0000000000 --- a/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/contribution_dupalert_text.tpl +++ /dev/null @@ -1,17 +0,0 @@ -{ts}A contribution / membership signup was made on behalf of the organization listed below.{/ts} -{ts}The information provided matched multiple existing database records based on the configured Duplicate Matching Rules for your site.{/ts} - -{ts}Organization Name{/ts}: {$onBehalfName} -{ts}Organization Email{/ts}: {$onBehalfEmail} -{ts}Organization Contact ID{/ts}: {$onBehalfID} - -{ts}If you think this may be a duplicate contact which should be merged with an existing record - Go to "Contacts >> Find and Merge Duplicate Contacts". Use the strict rule for Organizations to find the potential duplicates and merge them if appropriate.{/ts} - -{if $receiptMessage} -########################################################### -{ts}Copy of Contribution Receipt{/ts} - -########################################################### -{$receiptMessage} - -{/if} diff --git a/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/event_online_receipt_html.tpl b/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/event_online_receipt_html.tpl deleted file mode 100644 index 2c9da1a36c..0000000000 --- a/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/event_online_receipt_html.tpl +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - -{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} - -
- - - - - - - - - - - - - - -
-

Dear {contact.display_name},

- - {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 $isOnWaitlist}waitlisted{else}registered{/if} for the following:

- - {/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_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} - - {if $amounts && !$lineItem} - {foreach from=$amounts item=amnt key=level} - - - - {/foreach} - {/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 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} - -
- {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} -
- {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 $pricesetFieldsCount }{/if} - - {foreach from=$value item=line} - - - - - - {if $pricesetFieldsCount } {/if} - - {/foreach} -
{ts}Item{/ts}{ts}Qty{/ts}{ts}Each{/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.line_total|crmMoney:$currency} - {$line.participant_count}
-
- {$amnt.amount|crmMoney:$currency} {$amnt.label} -
- {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} -
-
-
- - - diff --git a/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/event_online_receipt_text.tpl b/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/event_online_receipt_text.tpl deleted file mode 100644 index ce7b1714dc..0000000000 --- a/CRM/Upgrade/4.4.alpha1.msg_template/message_templates/event_online_receipt_text.tpl +++ /dev/null @@ -1,277 +0,0 @@ -Dear {contact.display_name}, - -{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} for the following: - -{/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} -{/foreach} -{foreach from=$location.email item=eventEmail} -{if $eventEmail.email} - -{ts}Email{/ts}: {$eventEmail.email}{/if}{/foreach} -{/if} - -{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 $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} -{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"} {$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"} {$line.line_total|crmMoney:$currency|string_format:"%10s"}{$ts_participant_count|string_format:"%10s"} -{/foreach} -{/if} -{/foreach} -{/if} -{if $amounts && !$lineItem} -{foreach from=$amounts item=amnt key=level}{$amnt.amount|crmMoney:$currency} {$amnt.label} -{/foreach} -{/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 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} diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index bd7c86b686..f08257affb 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -25,7 +25,7 @@ class CRM_Upgrade_Form extends CRM_Core_Form { /** * Minimum previous CiviCRM version we can directly upgrade from */ - const MINIMUM_UPGRADABLE_VERSION = '4.2.9'; + const MINIMUM_UPGRADABLE_VERSION = '4.4.7'; /** * @var \CRM_Core_Config diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php deleted file mode 100644 index d4d83ee49d..0000000000 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ /dev/null @@ -1,803 +0,0 @@ - 0) { - $preUpgradeMessage .= '
' . ts("WARNING: There are %1 word-replacement entries which will not be valid in v4.4+ (eg with over 255 characters). They will be dropped during upgrade. For details, consult the CiviCRM log.", [ - 1 => $oversizedEntries, - ]); - } - } - } - - /** - * Compute any messages which should be displayed after upgrade. - * - * @param string $postUpgradeMessage - * alterable. - * @param string $rev - * an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs. - */ - public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { - if ($rev == '4.4.1') { - $config = CRM_Core_Config::singleton(); - if (!empty($config->useIDS)) { - $postUpgradeMessage .= '
' . ts("The setting to skip IDS check has been removed. Your site has this configured in civicrm.settings.php but it will no longer work. Instead, use the new permission 'skip IDS check' to bypass the IDS system."); - } - } - if ($rev == '4.4.3') { - $postUpgradeMessage .= '

' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality: If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).'); - } - if ($rev == '4.4.3') { - $query = "SELECT cft.id financial_trxn -FROM civicrm_financial_trxn cft -LEFT JOIN civicrm_entity_financial_trxn ceft ON ceft.financial_trxn_id = cft.id -LEFT JOIN civicrm_contribution cc ON ceft.entity_id = cc.id -WHERE ceft.entity_table = 'civicrm_contribution' AND cft.payment_instrument_id IS NULL;"; - $dao = CRM_Core_DAO::executeQuery($query); - if ($dao->N) { - $postUpgradeMessage .= '

' . ts('Your database contains %1 financial transaction records with no payment instrument (Paid By is empty). If you use the Accounting Batches feature this may result in unbalanced transactions. If you do not use this feature, you can ignore the condition (although you will be required to select a Paid By value for new transactions). You can review steps to correct transactions with missing payment instruments on the wiki.', [ - 1 => $dao->N, - 2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Transactions+Missing+a+Payment+Instrument+-+4.4.3+Upgrades', - ]) . ''; - } - } - if ($rev == '4.4.6') { - $postUpgradeMessage .= '

' . ts('Your contact image urls have been upgraded. If your contact image urls did not follow the standard format for image Urls they have not been upgraded. Please check the log to see image urls that were not upgraded.'); - } - } - - /** - * Upgrade 4.4.alpha1. - * - * @param string $rev - * - * @return bool - */ - public function upgrade_4_4_alpha1($rev) { - // task to process sql - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.4.alpha1']), 'runSql', $rev); - - // Consolidate activity contacts CRM-12274. - $this->addTask('Consolidate activity contacts', 'activityContacts'); - - return TRUE; - } - - /** - * @param $rev - */ - public function upgrade_4_4_beta1($rev) { - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.4.beta1']), 'runSql', $rev); - - // add new 'data' column in civicrm_batch - $query = 'ALTER TABLE civicrm_batch ADD data LONGTEXT NULL COMMENT "cache entered data"'; - CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - - // check if batch entry data exists in civicrm_cache table - $query = 'SELECT path, data FROM civicrm_cache WHERE group_name = "batch entry"'; - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - // get batch id $batchId[2] - $batchId = explode('-', $dao->path); - $data = unserialize($dao->data); - - // move the data to civicrm_batch table - CRM_Core_DAO::setFieldValue('CRM_Batch_DAO_Batch', $batchId[2], 'data', json_encode(['values' => $data])); - } - - // delete entries from civicrm_cache table - $query = 'DELETE FROM civicrm_cache WHERE group_name = "batch entry"'; - CRM_Core_DAO::executeQuery($query); - - $this->addTask('Migrate custom word-replacements', 'wordReplacements'); - } - - /** - * @param $rev - */ - public function upgrade_4_4_1($rev) { - $config = CRM_Core_Config::singleton(); - // CRM-13327 upgrade handling for the newly added name badges - $ogID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'name_badge', 'id', 'name'); - $nameBadges = array_flip(array_values(CRM_Core_BAO_OptionValue::getOptionValuesAssocArrayFromName('name_badge'))); - unset($nameBadges['Avery 5395']); - if (!empty($nameBadges)) { - $dimension = '{"paper-size":"a4","orientation":"portrait","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":4,"metric":"mm","lMargin":6,"tMargin":19,"SpaceX":0,"SpaceY":0,"width":100,"height":65,"lPadding":0,"tPadding":0}'; - $query = "UPDATE civicrm_option_value - SET value = '{$dimension}' - WHERE option_group_id = %1 AND name = 'Fattorini Name Badge 100x65'"; - - CRM_Core_DAO::executeQuery($query, [1 => [$ogID, 'Integer']]); - } - else { - $dimensions = [ - 1 => '{"paper-size":"a4","orientation":"landscape","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":1,"metric":"mm","lMargin":25,"tMargin":27,"SpaceX":0,"SpaceY":35,"width":106,"height":150,"lPadding":5,"tPadding":5}', - 2 => '{"paper-size":"a4","orientation":"portrait","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":4,"metric":"mm","lMargin":6,"tMargin":19,"SpaceX":0,"SpaceY":0,"width":100,"height":65,"lPadding":0,"tPadding":0}', - 3 => '{"paper-size":"a4","orientation":"portrait","font-name":"times","font-size":6,"font-style":"","NX":2,"NY":2,"metric":"mm","lMargin":10,"tMargin":28,"SpaceX":0,"SpaceY":0,"width":96,"height":121,"lPadding":5,"tPadding":5}', - ]; - $insertStatements = [ - 1 => "($ogID, %1, '{$dimensions[1]}', %1, NULL, 0, NULL, 2, NULL, 0, 0, 1, NULL, NULL)", - 2 => "($ogID, %2, '{$dimensions[2]}', %2, NULL, 0, NULL, 3, NULL, 0, 0, 1, NULL, NULL)", - 3 => "($ogID, %3, '{$dimensions[3]}', %3, NULL, 0, NULL, 4, NULL, 0, 0, 1, NULL, NULL)", - ]; - - $queryParams = [ - 1 => ['A6 Badge Portrait 150x106', 'String'], - 2 => ['Fattorini Name Badge 100x65', 'String'], - 3 => ['Hanging Badge 3-3/4" x 4-3"/4', 'String'], - ]; - - foreach ($insertStatements as $values) { - $query = 'INSERT INTO civicrm_option_value (`option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) VALUES' . $values; - CRM_Core_DAO::executeQuery($query, $queryParams); - } - } - - // CRM-12578 - Prior to this version a CSS file under drupal would disable core css - if (!empty($config->customCSSURL) && strpos($config->userFramework, 'Drupal') === 0) { - // The new setting doesn't exist yet - need to create it first - $sql = ' - INSERT INTO civicrm_setting (group_name, name , value , domain_id , is_domain , created_date) - VALUES (%1, %2, %3, %4, %5, now())'; - CRM_Core_DAO::executeQuery($sql, [ - 1 => [CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'String'], - 2 => ['disable_core_css', 'String'], - 3 => [serialize(1), 'String'], - 4 => [CRM_Core_Config::domainID(), 'Positive'], - 5 => [1, 'Int'], - ]); - Civi::service('settings_manager')->flush(); - } - - // CRM-13701 - Fix $config->timeInputFormat - $sql = " - SELECT time_format - FROM civicrm_preferences_date - WHERE time_format IS NOT NULL - AND time_format <> '' - LIMIT 1 - "; - $timeInputFormat = CRM_Core_DAO::singleValueQuery($sql); - if ($timeInputFormat && $timeInputFormat != $config->timeInputFormat) { - $params = ['timeInputFormat' => $timeInputFormat]; - CRM_Core_BAO_ConfigSetting::add($params); - } - - // CRM-13698 - add 'Available' and 'No-show' activity statuses - $insertStatus = []; - $nsinc = $avinc = $inc = 0; - if (!CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'status_id', 'Available')) { - $insertStatus[] = "(%1, 'Available', %2, 'Available', NULL, 0, NULL, %3, 0, 0, 1, NULL, NULL)"; - $avinc = $inc = 1; - } - if (!CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'status_id', 'No_show')) { - $insertStatus[] = "(%1, 'No-show', %4, 'No_show', NULL, 0, NULL, %5, 0, 0, 1, NULL, NULL)"; - $nsinc = $inc + 1; - } - if (!empty($insertStatus)) { - $acOptionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'activity_status', 'id', 'name'); - $maxVal = CRM_Core_DAO::singleValueQuery("SELECT MAX(ROUND(op.value)) FROM civicrm_option_value op WHERE op.option_group_id = $acOptionGroupID"); - $maxWeight = CRM_Core_DAO::singleValueQuery("SELECT MAX(weight) FROM civicrm_option_value WHERE option_group_id = $acOptionGroupID"); - - $p[1] = [$acOptionGroupID, 'Integer']; - if ($avinc) { - $p[2] = [$avinc + $maxVal, 'Integer']; - $p[3] = [$avinc + $maxWeight, 'Integer']; - } - if ($nsinc) { - $p[4] = [$nsinc + $maxVal, 'Integer']; - $p[5] = [$nsinc + $maxWeight, 'Integer']; - } - $insertStatus = implode(',', $insertStatus); - - $sql = " -INSERT INTO - civicrm_option_value (`option_group_id`, label, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) -VALUES {$insertStatus}"; - CRM_Core_DAO::executeQuery($sql, $p); - } - - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.4.1']), 'runSql', $rev); - $this->addTask('Patch word-replacement schema', 'wordReplacements_patch', $rev); - } - - /** - * @param $rev - * - * @return bool - */ - public function upgrade_4_4_4($rev) { - $fkConstraint = []; - if (!CRM_Core_DAO::checkFKConstraintInFormat('civicrm_activity_contact', 'activity_id')) { - $fkConstraint[] = "ADD CONSTRAINT `FK_civicrm_activity_contact_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE"; - } - if (!CRM_Core_DAO::checkFKConstraintInFormat('civicrm_activity_contact', 'contact_id')) { - $fkConstraint[] = "ADD CONSTRAINT `FK_civicrm_activity_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE; -"; - } - - if (!empty($fkConstraint)) { - $fkConstraint = implode(',', $fkConstraint); - $sql = "ALTER TABLE `civicrm_activity_contact` -{$fkConstraint} -"; - // CRM-14036 : delete entries of un-mapped contacts - CRM_Core_DAO::executeQuery("DELETE ac FROM civicrm_activity_contact ac -LEFT JOIN civicrm_contact c -ON c.id = ac.contact_id -WHERE c.id IS NULL; -"); - // delete entries of un-mapped activities - CRM_Core_DAO::executeQuery("DELETE ac FROM civicrm_activity_contact ac -LEFT JOIN civicrm_activity a -ON a.id = ac.activity_id -WHERE a.id IS NULL; -"); - - CRM_Core_DAO::executeQuery("SET FOREIGN_KEY_CHECKS=0;"); - CRM_Core_DAO::executeQuery($sql); - CRM_Core_DAO::executeQuery("SET FOREIGN_KEY_CHECKS=1;"); - } - - // task to process sql - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.4.4']), 'runSql', $rev); - - // CRM-13892 : add `name` column to dashboard schema - $query = " -ALTER TABLE civicrm_dashboard - ADD name varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Internal name of dashlet.' AFTER domain_id "; - CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - - $dashboard = new CRM_Core_DAO_Dashboard(); - $dashboard->find(); - while ($dashboard->fetch()) { - $urlElements = explode('/', $dashboard->url); - if ($urlElements[1] == 'dashlet') { - $url = explode('&', $urlElements[2]); - $name = $url[0]; - } - elseif ($urlElements[1] == 'report') { - $url = explode('&', $urlElements[3]); - $name = 'report/' . $url[0]; - } - $values .= " - WHEN {$dashboard->id} THEN '{$name}' - "; - } - - $query = " - UPDATE civicrm_dashboard - SET name = CASE id - {$values} - END; - "; - CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - - // CRM-13998 : missing alter statements for civicrm_report_instance - $this->addTask(ts('Confirm civicrm_report_instance sql table for upgrades'), 'updateReportInstanceTable'); - - return TRUE; - } - - /** - * @param $rev - */ - public function upgrade_4_4_6($rev) { - $sql = "SELECT count(*) AS count FROM INFORMATION_SCHEMA.STATISTICS where " . - "TABLE_SCHEMA = database() AND INDEX_NAME = 'index_image_url' AND TABLE_NAME = 'civicrm_contact';"; - $dao = CRM_Core_DAO::executeQuery($sql); - $dao->fetch(); - if ($dao->count < 1) { - $sql = "CREATE INDEX index_image_url ON civicrm_contact (image_url);"; - $dao = CRM_Core_DAO::executeQuery($sql); - } - $minId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_contact WHERE image_URL IS NOT NULL'); - $maxId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(max(id),0) FROM civicrm_contact WHERE image_URL IS NOT NULL'); - for ($startId = $minId; $startId <= $maxId; $startId += self::BATCH_SIZE) { - $endId = $startId + self::BATCH_SIZE - 1; - $title = "Upgrade image_urls ($startId => $endId)"; - $this->addTask($title, 'upgradeImageUrls', $startId, $endId); - } - } - - /** - * Upgrade script for 4.4.7. - * - * @param string $rev - * @param string $originalVer - * @param string $latestVer - */ - public function upgrade_4_4_7($rev, $originalVer, $latestVer) { - // For WordPress/Joomla(?), cleanup broken image_URL from 4.4.6 upgrades - https://issues.civicrm.org/jira/browse/CRM-14971 - // URL formula from 4.4.6 upgrade - $exBackendUrl = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=XXX', TRUE); - $exFrontendUrl = CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=XXX', TRUE, NULL, TRUE, TRUE); - if ($originalVer == '4.4.6' && $exBackendUrl != $exFrontendUrl) { - $minId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_contact WHERE image_URL IS NOT NULL'); - $maxId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(max(id),0) FROM civicrm_contact WHERE image_URL IS NOT NULL'); - for ($startId = $minId; $startId <= $maxId; $startId += self::BATCH_SIZE) { - $endId = $startId + self::BATCH_SIZE - 1; - $title = "Upgrade image_urls ($startId => $endId)"; - $this->addTask($title, 'cleanupBackendImageUrls', $startId, $endId); - } - } - $this->addTask(ts('Update saved search information'), 'changeSavedSearch'); - } - - /** - * Upgrade image URLs. - * - * @param \CRM_Queue_TaskContext $ctx - * @param $startId - * @param $endId - * - * @return bool - */ - public static function upgradeImageUrls(CRM_Queue_TaskContext $ctx, $startId, $endId) { - $dao = self::findContactImageUrls($startId, $endId); - $failures = []; - $config = CRM_Core_Config::singleton(); - while ($dao->fetch()) { - $imageURL = $dao->image_url; - $baseurl = CIVICRM_UF_BASEURL; - //CRM-15897 - gross hack for joomla to remove the administrator/ - if ($config->userFramework == 'Joomla') { - $baseurl = str_replace("/administrator/", "/", $baseurl); - } - $baselen = strlen($baseurl); - if (substr($imageURL, 0, $baselen) == $baseurl) { - $photo = basename($dao->image_url); - $fullpath = $config->customFileUploadDir . $photo; - if (file_exists($fullpath)) { - // For anyone who upgraded 4.4.6 release (eg 4.4.0=>4.4.6), the $newImageUrl incorrectly used backend URLs. - // For anyone who skipped 4.4.6 (eg 4.4.0=>4.4.7), the $newImageUrl correctly uses frontend URLs - self::setContactImageUrl($dao->id, - CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=' . $photo, TRUE, NULL, TRUE, TRUE)); - } - else { - $failures[$dao->id] = $dao->image_url; - } - } - else { - $failures[$dao->id] = $dao->image_url; - } - } - CRM_Core_Error::debug_var('imageUrlsNotUpgraded', $failures); - return TRUE; - } - - /** - * Change saved search. - * - * @param \CRM_Queue_TaskContext $ctx - * - * @return bool - */ - public static function changeSavedSearch(CRM_Queue_TaskContext $ctx) { - $membershipStatuses = array_flip(CRM_Member_PseudoConstant::membershipStatus()); - - $dao = new CRM_Contact_DAO_SavedSearch(); - $dao->find(); - while ($dao->fetch()) { - $formValues = NULL; - if (!empty($dao->form_values)) { - $formValues = unserialize($dao->form_values); - } - if (!empty($formValues['mapper'])) { - foreach ($formValues['mapper'] as $key => $value) { - foreach ($value as $k => $v) { - if ($v[0] == 'Membership' && in_array($v[1], ['membership_status', 'membership_status_id'])) { - $value = $formValues['value'][$key][$k]; - $op = $formValues['operator'][$key][$k]; - if ($op == 'IN') { - $value = trim($value); - $value = str_replace('(', '', $value); - $value = str_replace(')', '', $value); - - $v = explode(',', $value); - $value = []; - foreach ($v as $k1 => $v2) { - if (is_numeric($v2)) { - break 2; - } - $value[$k1] = $membershipStatuses[$v2]; - } - $formValues['value'][$key][$k] = "(" . implode(',', $value) . ")"; - } - elseif (in_array($op, ['=', '!='])) { - if (is_numeric($value)) { - break; - } - $formValues['value'][$key][$k] = $membershipStatuses[$value]; - } - } - } - } - $dao->form_values = serialize($formValues); - $dao->save(); - } - } - - return TRUE; - } - - /** - * For WordPress/Joomla(?) sites which upgraded to 4.4.6, find back-end image_URLs - * (e.g. "http://example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/contact/imagefile&photo=123.jpg") - * and convert them to front-end URLs - * (e.g. "http://example.com/?page=CiviCRM&q=civicrm/contact/imagefile&photo=123.jpg"). - * - * @param CRM_Queue_TaskContext $ctx - * @param int $startId - * @param int $endId - * @return bool - */ - public static function cleanupBackendImageUrls(CRM_Queue_TaskContext $ctx, $startId, $endId) { - $dao = self::findContactImageUrls($startId, $endId); - while ($dao->fetch()) { - $imageUrl = str_replace('&', '&', $dao->image_url); - if (preg_match(":civicrm/contact/imagefile.*photo=:", $imageUrl)) { - // looks like one of ours - $imageUrlParts = parse_url($imageUrl); - parse_str($imageUrlParts['query'], $imageUrlQuery); - self::setContactImageUrl($dao->id, - CRM_Utils_System::url('civicrm/contact/imagefile', 'photo=' . $imageUrlQuery['photo'], TRUE, NULL, TRUE, TRUE)); - } - } - return TRUE; - } - - /** - * @param int $startId - * @param int $endId - * @return CRM_Core_DAO - * columns include "id" and "image_URL" - */ - public static function findContactImageUrls($startId, $endId) { - $sql = " -SELECT id, image_url -FROM civicrm_contact -WHERE 1 -AND id BETWEEN %1 AND %2 -AND image_URL IS NOT NULL -"; - - $params = [ - 1 => [$startId, 'Integer'], - 2 => [$endId, 'Integer'], - ]; - $dao = CRM_Core_DAO::executeQuery($sql, $params, TRUE, NULL, FALSE, FALSE); - return $dao; - } - - /** - * @param int $cid - * @param string $newImageUrl - */ - public static function setContactImageUrl($cid, $newImageUrl) { - $sql = 'UPDATE civicrm_contact SET image_url=%1 WHERE id=%2'; - $params = [ - 1 => [$newImageUrl, 'String'], - 2 => [$cid, 'Integer'], - ]; - $updatedao = CRM_Core_DAO::executeQuery($sql, $params); - } - - /** - * Update activity contacts CRM-12274 - * - * @param CRM_Queue_TaskContext $ctx - * - * @return bool - * TRUE for success - */ - public static function activityContacts(CRM_Queue_TaskContext $ctx) { - $upgrade = new CRM_Upgrade_Form(); - - $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate'); - $ovValue[] = $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); - $ovValue[] = $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); - $ovValue[] = $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts); - - $optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'activity_contacts', 'id', 'name'); - if (!empty($ovValue)) { - $ovValues = implode(', ', $ovValue); - $query = " -UPDATE civicrm_option_value -SET is_reserved = 1 -WHERE option_group_id = {$optionGroupID} AND value IN ($ovValues)"; - - $dao = CRM_Core_DAO::executeQuery($query); - } - - if (!$assigneeID) { - $assigneeID = 1; - $value[] = "({$optionGroupID}, 'Activity Assignees', 1, 'Activity Assignees', 1, 1, 1)"; - } - if (!$sourceID) { - $sourceID = 2; - $value[] = "({$optionGroupID}, 'Activity Source', 2, 'Activity Source', 2, 1, 1)"; - } - if (!$targetID) { - $targetID = 3; - $value[] = "({$optionGroupID}, 'Activity Targets', 3, 'Activity Targets', 3, 1, 1)"; - } - - if (!$assigneeID || !$sourceID || !$targetID) { - $insert = " -INSERT INTO civicrm_option_value -(option_group_id, label, value, name, weight, is_reserved, is_active) -VALUES - -"; - $values = implode(', ', $value); - $query = $insert . $values; - $dao = CRM_Core_DAO::executeQuery($query); - } - - // sometimes an user does not make a clean backup and the above table - // already exists, so lets delete this table - CRM-13665 - $query = "DROP TABLE IF EXISTS civicrm_activity_contact"; - $dao = CRM_Core_DAO::executeQuery($query); - - $query = " -CREATE TABLE IF NOT EXISTS civicrm_activity_contact ( - id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Activity contact id', - activity_id int(10) unsigned NOT NULL COMMENT 'Foreign key to the activity for this record.', - contact_id int(10) unsigned NOT NULL COMMENT 'Foreign key to the contact for this record.', - record_type_id int(10) unsigned DEFAULT NULL COMMENT 'The record type id for this row', - PRIMARY KEY (id), - UNIQUE KEY UI_activity_contact (contact_id,activity_id,record_type_id), - KEY FK_civicrm_activity_contact_activity_id (activity_id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -"; - - $dao = CRM_Core_DAO::executeQuery($query); - - $query = " -INSERT INTO civicrm_activity_contact (activity_id, contact_id, record_type_id) -SELECT activity_id, target_contact_id, {$targetID} as record_type_id -FROM civicrm_activity_target"; - - $dao = CRM_Core_DAO::executeQuery($query); - - $query = " -INSERT INTO civicrm_activity_contact (activity_id, contact_id, record_type_id) -SELECT activity_id, assignee_contact_id, {$assigneeID} as record_type_id -FROM civicrm_activity_assignment"; - $dao = CRM_Core_DAO::executeQuery($query); - - $query = " - INSERT INTO civicrm_activity_contact (activity_id, contact_id, record_type_id) -SELECT id, source_contact_id, {$sourceID} as record_type_id -FROM civicrm_activity -WHERE source_contact_id IS NOT NULL"; - - $dao = CRM_Core_DAO::executeQuery($query); - - $query = "DROP TABLE civicrm_activity_target"; - $dao = CRM_Core_DAO::executeQuery($query); - - $query = "DROP TABLE civicrm_activity_assignment"; - $dao = CRM_Core_DAO::executeQuery($query); - - $query = "ALTER TABLE civicrm_activity - DROP FOREIGN KEY FK_civicrm_activity_source_contact_id"; - - $dao = CRM_Core_DAO::executeQuery($query); - - $query = "ALTER TABLE civicrm_activity DROP COLUMN source_contact_id"; - $dao = CRM_Core_DAO::executeQuery($query); - - return TRUE; - } - - /** - * Migrate word-replacements from $config to civicrm_word_replacement - * - * @param CRM_Queue_TaskContext $ctx - * - * @return bool - * TRUE for success - * @see http://issues.civicrm.org/jira/browse/CRM-13187 - */ - public static function wordReplacements(CRM_Queue_TaskContext $ctx) { - $query = " -CREATE TABLE IF NOT EXISTS `civicrm_word_replacement` ( - `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Word replacement ID', - `find_word` varchar(255) COLLATE utf8_bin COMMENT 'Word which need to be replaced', - `replace_word` varchar(255) COLLATE utf8_bin COMMENT 'Word which will replace the word in find', - `is_active` tinyint COMMENT 'Is this entry active?', - `match_type` enum('wildcardMatch', 'exactMatch') DEFAULT 'wildcardMatch', - `domain_id` int unsigned COMMENT 'FK to Domain ID. This is for Domain specific word replacement', - PRIMARY KEY ( `id` ), - UNIQUE INDEX `UI_domain_find` (domain_id, find_word), - CONSTRAINT FK_civicrm_word_replacement_domain_id FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain`(`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ; - "; - $dao = CRM_Core_DAO::executeQuery($query); - - self::rebuildWordReplacementTable(); - return TRUE; - } - - /** - * Fix misconfigured constraints created in 4.4.0. To distinguish the good - * and bad configurations, we change the constraint name from "UI_find" - * (the original name in 4.4.0) to "UI_domain_find" (the new name in - * 4.4.1). - * - * @param CRM_Queue_TaskContext $ctx - * @param $rev - * - * @return bool - * TRUE for success - * @see http://issues.civicrm.org/jira/browse/CRM-13655 - */ - public static function wordReplacements_patch(CRM_Queue_TaskContext $ctx, $rev) { - if (CRM_Core_DAO::checkConstraintExists('civicrm_word_replacement', 'UI_find')) { - CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_word_replacement DROP FOREIGN KEY FK_civicrm_word_replacement_domain_id;"); - CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_word_replacement DROP KEY FK_civicrm_word_replacement_domain_id;"); - CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_word_replacement DROP KEY UI_find;"); - CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_word_replacement MODIFY COLUMN `find_word` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT 'Word which need to be replaced';"); - CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_word_replacement MODIFY COLUMN `replace_word` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT 'Word which will replace the word in find';"); - CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_word_replacement ADD CONSTRAINT UI_domain_find UNIQUE KEY `UI_domain_find` (`domain_id`,`find_word`);"); - CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_word_replacement ADD CONSTRAINT FK_civicrm_word_replacement_domain_id FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`);"); - } - return TRUE; - } - - /** - * Get all the word-replacements stored in config-arrays - * and convert them to params for the WordReplacement.create API. - * - * Note: This function is duplicated in CRM_Core_BAO_WordReplacement and - * CRM_Upgrade_Incremental_php_FourFour to ensure that the incremental upgrade - * step behaves consistently even as the BAO evolves in future versions. - * However, if there's a bug in here prior to 4.4.0, we should apply the - * bugfix in both places. - * - * @param bool $rebuildEach - * Whether to perform rebuild after each individual API call. - * @return array - * Each item is $params for WordReplacement.create - * @see CRM_Core_BAO_WordReplacement::convertConfigArraysToAPIParams - */ - public static function getConfigArraysAsAPIParams($rebuildEach) { - $wordReplacementCreateParams = []; - // get all domains - $result = civicrm_api3('domain', 'get', [ - 'return' => ['locale_custom_strings'], - ]); - if (!empty($result["values"])) { - foreach ($result["values"] as $value) { - $params = []; - $params["domain_id"] = $value["id"]; - $params["options"] = ['wp-rebuild' => $rebuildEach]; - // unserialize word match string - $localeCustomArray = []; - if (!empty($value["locale_custom_strings"])) { - $localeCustomArray = unserialize($value["locale_custom_strings"]); - } - if (!empty($localeCustomArray)) { - $wordMatchArray = []; - // Traverse Language array - foreach ($localeCustomArray as $localCustomData) { - // Traverse status array "enabled" "disabled" - foreach ($localCustomData as $status => $matchTypes) { - $params["is_active"] = $status == "enabled"; - // Traverse Match Type array "wildcardMatch" "exactMatch" - foreach ($matchTypes as $matchType => $words) { - $params["match_type"] = $matchType; - foreach ($words as $word => $replace) { - $params["find_word"] = $word; - $params["replace_word"] = $replace; - $wordReplacementCreateParams[] = $params; - } - } - } - } - } - } - } - return $wordReplacementCreateParams; - } - - /** - * Get all the word-replacements stored in config-arrays - * and write them out as records in civicrm_word_replacement. - * - * Note: This function is duplicated in CRM_Core_BAO_WordReplacement and - * CRM_Upgrade_Incremental_php_FourFour to ensure that the incremental upgrade - * step behaves consistently even as the BAO evolves in future versions. - * However, if there's a bug in here prior to 4.4.0, we should apply the - * bugfix in both places. - */ - public static function rebuildWordReplacementTable() { - civicrm_api3('word_replacement', 'replace', [ - 'options' => ['match' => ['domain_id', 'find_word']], - 'values' => array_filter(self::getConfigArraysAsAPIParams(FALSE), [__CLASS__, 'isValidWordReplacement']), - ]); - CRM_Core_BAO_WordReplacement::rebuild(); - } - - /** - * CRM-13998 missing alter statements for civicrm_report_instance - */ - public function updateReportInstanceTable() { - - // add civicrm_report_instance.name - - $sql = "SELECT count(*) FROM information_schema.columns " - . "WHERE table_schema = database() AND table_name = 'civicrm_report_instance' AND COLUMN_NAME = 'name' "; - - $res = CRM_Core_DAO::singleValueQuery($sql); - - if ($res <= 0) { - $sql = "ALTER TABLE civicrm_report_instance ADD `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'when combined with report_id/template uniquely identifies the instance'"; - $res = CRM_Core_DAO::executeQuery($sql); - } - - // add civicrm_report_instance args - - $sql = "SELECT count(*) FROM information_schema.columns WHERE table_schema = database() AND table_name = 'civicrm_report_instance' AND COLUMN_NAME = 'args' "; - - $res = CRM_Core_DAO::singleValueQuery($sql); - - if ($res <= 0) { - $sql = "ALTER TABLE civicrm_report_instance ADD `args` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'arguments that are passed in the url when invoking the instance'"; - - $res = CRM_Core_DAO::executeQuery($sql); - } - - return TRUE; - } - - /** - * @param array $params - * @return bool - * TRUE if $params is valid - */ - public static function isValidWordReplacement($params) { - $result = strlen($params['find_word']) <= self::MAX_WORD_REPLACEMENT_SIZE && strlen($params['replace_word']) <= self::MAX_WORD_REPLACEMENT_SIZE; - if (!$result) { - CRM_Core_Error::debug_var('invalidWordReplacement', $params); - } - return $result; - } - -} diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php deleted file mode 100644 index 4d603e8297..0000000000 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ /dev/null @@ -1,1302 +0,0 @@ - 0) { - $error = ts("There is a data integrity issue with this CiviCRM database. It contains %1 contribution records which are linked to contact records that have been deleted. You will need to correct this manually before you can run the upgrade. Use the following MySQL query to identify the problem records: %2 These records will need to be deleted or linked to an existing contact record.", [ - 1 => $count, - 2 => 'SELECT ct.* FROM civicrm_contribution ct LEFT JOIN civicrm_contact c ON ct.contact_id = c.id WHERE c.id IS NULL;', - ]); - throw new CRM_Core_Exception($error); - return FALSE; - } - } - if ($rev == '4.3.beta4' && CRM_Utils_Constant::value('CIVICRM_UF', FALSE) == 'Drupal6') { - // CRM-11823 - Make sure the D6 HTML HEAD technique will work on - // upgrade pages ... except when we're in Drush. - if (!function_exists('drush_main')) { - // force-load theme registry - theme('item_list', []); - $theme_registry = theme_get_registry(); - if (!isset($theme_registry['page']['preprocess functions']) || FALSE === array_search('civicrm_preprocess_page_inject', $theme_registry['page']['preprocess functions'])) { - throw new CRM_Core_Exception('Please reset the Drupal cache (Administer => Site Configuration => Performance => Clear cached data))'); - } - } - } - - if ($rev == '4.3.6') { - $constraintArray = [ - 'civicrm_contact' => 'contact_id', - 'civicrm_payment_processor' => 'payment_processor_id', - ]; - - if (version_compare('4.1alpha1', $currentVer) <= 0) { - $constraintArray['civicrm_campaign'] = 'campaign_id'; - } - - if (version_compare('4.3alpha1', $currentVer) <= 0) { - $constraintArray['civicrm_financial_type'] = 'financial_type_id'; - } - - foreach ($constraintArray as $key => $value) { - $query = "SELECT contri_recur.id FROM civicrm_contribution_recur contri_recur LEFT JOIN {$key} ON contri_recur.{$value} = {$key}.id -WHERE {$key}.id IS NULL"; - if ($value != 'contact_id') { - $query .= " AND contri_recur.{$value} IS NOT NULL "; - } - $dao = CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - if ($dao->N) { - $invalidDataMessage = 'Oops, it looks like you have orphaned recurring contribution records in your database. Before this upgrade can complete they will need to be fixed or deleted. You can review steps to correct this situation on the documentation wiki.'; - throw new CRM_Core_Exception($invalidDataMessage); - return FALSE; - } - } - } - } - - /** - * Compute any messages which should be displayed after upgrade. - * - * @param string $postUpgradeMessage - * alterable. - * @param string $rev - * an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs. - * @return void - */ - public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) { - if ($rev == '4.3.alpha1') { - // check if CiviMember component is enabled - $config = CRM_Core_Config::singleton(); - if (in_array('CiviMember', $config->enableComponents)) { - $postUpgradeMessage .= '
' . ts('Membership renewal reminders must now be configured using the Schedule Reminders feature, which supports multiple renewal reminders (Administer > Communications > Schedule Reminders). The Update Membership Statuses scheduled job will no longer send membershp renewal reminders. You can use your existing renewal reminder message template(s) with the Schedule Reminders feature.'); - $postUpgradeMessage .= '
' . ts('The Set Membership Reminder Dates scheduled job has been deleted since membership reminder dates stored in the membership table are no longer in use.'); - } - - //CRM-11636 - //here we do the financial type check and migration - $isDefaultsModified = self::_checkAndMigrateDefaultFinancialTypes(); - if ($isDefaultsModified) { - $postUpgradeMessage .= '
' . ts('Please review all price set financial type assignments.'); - } - list($context, $orgName) = self::createDomainContacts(); - if ($context == 'added') { - $postUpgradeMessage .= '
' . ts("A new organization contact has been added as the default domain contact using the information from your Organization Address and Contact Info settings: '%1'.", [1 => $orgName]); - } - elseif ($context == 'merged') { - $postUpgradeMessage .= '
' . ts("The existing organization contact record for '%1' has been marked as the default domain contact, and has been updated with information from your Organization Address and Contact Info settings.", [1 => $orgName]); - } - - $providerExists = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_sms_provider LIMIT 1"); - if ($providerExists) { - $postUpgradeMessage .= '
' . ts('SMS providers were found to setup. Please note Clickatell / Twilio are now shipped as extensions and will require installing them to continue working. Extension could be downloaded and installed from github.', [1 => 'https://github.com/civicrm/civicrm-core/tree/master/tools/extensions']); - } - } - - if ($rev == '4.3.alpha2') { - $sql = " -SELECT title, id -FROM civicrm_action_schedule -WHERE entity_value = '' OR entity_value IS NULL -"; - - $dao = CRM_Core_DAO::executeQuery($sql); - $reminder = []; - $list = ''; - while ($dao->fetch()) { - $reminder[$dao->id] = $dao->title; - $list .= "
  • {$dao->title}
  • "; - } - if (!empty($reminder)) { - $list = "
    "; - $postUpgradeMessage .= '
    ' . ts("Scheduled Reminders must be linked to one or more 'entities' (Events, Event Templates, Activity Types, Membership Types). The following reminders are not configured properly and will not be run. Please review them and update or delete them: %1", [1 => $list]); - } - } - if ($rev == '4.3.beta2') { - $postUpgradeMessage .= '
    ' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality: If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).'); - } - - if ($rev == '4.3.beta5') { - $postUpgradeMessage .= '
    ' . ts("If you are interested in trying out the new Accounting Integration features, please review user permissions and assign the new 'manual batch' permissions as appropriate."); - - // CRM-12155 - $query = " -SELECT ceft.id FROM `civicrm_financial_trxn` cft -LEFT JOIN civicrm_entity_financial_trxn ceft - ON ceft.financial_trxn_id = cft.id AND ceft.entity_table = 'civicrm_contribution' -LEFT JOIN civicrm_contribution cc - ON cc.id = ceft.entity_id AND ceft.entity_table = 'civicrm_contribution' -WHERE cc.id IS NULL -"; - - $dao = CRM_Core_DAO::executeQuery($query); - $isOrphanData = TRUE; - if (!$dao->N) { - $query = " -SELECT cli.id FROM civicrm_line_item cli -LEFT JOIN civicrm_contribution cc ON cli.entity_id = cc.id AND cli.entity_table = 'civicrm_contribution' -LEFT JOIN civicrm_participant cp ON cli.entity_id = cp.id AND cli.entity_table = 'civicrm_participant' -WHERE CASE WHEN cli.entity_table = 'civicrm_contribution' - THEN cc.id IS NULL - ELSE cp.id IS NULL -END -"; - $dao = CRM_Core_DAO::executeQuery($query); - if (!$dao->N) { - $revPattern = '/^((\d{1,2})\.\d{1,2})\.(\d{1,2}|\w{4,7})?$/i'; - preg_match($revPattern, $currentVer, $version); - if ($version[1] >= 4.3) { - $query = " -SELECT cfi.id -FROM civicrm_financial_item cfi -LEFT JOIN civicrm_entity_financial_trxn ceft ON ceft.entity_table = 'civicrm_financial_item' and cfi.id = ceft.entity_id -WHERE ceft.entity_id IS NULL; -"; - $dao = CRM_Core_DAO::executeQuery($query); - if (!$dao->N) { - $isOrphanData = FALSE; - } - } - else { - $isOrphanData = FALSE; - } - } - } - - if ($isOrphanData) { - $postUpgradeMessage .= "
    " . ts('Your database contains extraneous financial records related to deleted contacts and contributions. These records should not affect the site and will not appear in reports, search results or exports. However you may wish to clean them up. Refer to this wiki page for details. - ', [1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Clean+up+extraneous+financial+data+-+4.3+upgrades']) . ""; - } - } - if ($rev == '4.3.4') { - $postUpgradeMessage .= '
    ' . ts('System Administrator Alert: If you are running scheduled jobs using CLI.php, you will need to reconfigure cron tasks to include a password. Scheduled jobs will no longer run if the password is not provided (learn more).', - [1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs']); - } - if ($rev == '4.3.5') { - $postUpgradeMessage .= '
    ' . ts('Default versions of the following System Workflow Message Templates have been modified to handle new functionality: If you have modified these templates, please review the new default versions and implement updates as needed to your copies (Administer > Communications > Message Templates > System Workflow Messages).'); - } - if ($rev == '4.3.6') { - $flag = CRM_Core_DAO::singleValueQuery('SELECT count(ccp.id) FROM civicrm_contribution_product ccp -INNER JOIN civicrm_product cp ON ccp.product_id = cp.id -WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); - if ($flag) { - $postUpgradeMessage .= '
    ' . ts('Your database contains one or more premiums which have a cost but are not linked to a financial type. If you are exporting transations to an accounting package, this will result in unbalanced transactions. You can review steps to correct this situation on the wiki.', - [1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Issues+Caused+by+Missing+Cost+of+Goods+Account+-+4.3+Upgrades']); - } - } - } - - /** - * @param $rev - * - * @return bool - */ - public function upgrade_4_3_alpha1($rev) { - self::task_4_3_alpha1_checkDBConstraints(); - - // add indexes for civicrm_entity_financial_trxn - // CRM-12141 - $this->addTask('Check/Add indexes for civicrm_entity_financial_trxn', 'task_4_3_x_checkIndexes', $rev); - // task to process sql - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.alpha1']), 'runSql', $rev); - - //CRM-11636 - $this->addTask('Populate financial type values for price records', 'assignFinancialTypeToPriceRecords'); - //CRM-11514 create financial records for contributions - $this->addTask('Create financial records for contributions', 'createFinancialRecords'); - - $minId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_contact'); - $maxId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(max(id),0) FROM civicrm_contact'); - for ($startId = $minId; $startId <= $maxId; $startId += self::BATCH_SIZE) { - $endId = $startId + self::BATCH_SIZE - 1; - $title = "Upgrade timestamps ($startId => $endId)"; - $this->addTask($title, 'convertTimestamps', $startId, $endId); - } - - // CRM-10893 - // fix WP access control - $config = CRM_Core_Config::singleton(); - if ($config->userFramework == 'WordPress') { - civicrm_wp_set_capabilities(); - } - - // Update phones CRM-11292. - $this->addTask('Upgrade Phone Numbers', 'phoneNumeric'); - - return TRUE; - } - - /** - * @param $rev - */ - public function upgrade_4_3_alpha2($rev) { - //CRM-11847 - $isColumnPresent = CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_dedupe_rule_group', 'is_default'); - if ($isColumnPresent) { - CRM_Core_DAO::executeQuery('ALTER TABLE civicrm_dedupe_rule_group DROP COLUMN is_default'); - } - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.alpha2']), 'runSql', $rev); - } - - /** - * @param $rev - */ - public function upgrade_4_3_alpha3($rev) { - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.alpha3']), 'runSql', $rev); - } - - /** - * @param $rev - */ - public function upgrade_4_3_beta2($rev) { - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.beta2']), 'runSql', $rev); - - // CRM-12002 - if ( - CRM_Core_DAO::checkTableExists('log_civicrm_line_item') && - CRM_Core_BAO_SchemaHandler::checkIfFieldExists('log_civicrm_line_item', 'label') - ) { - CRM_Core_DAO::executeQuery('ALTER TABLE `log_civicrm_line_item` CHANGE `label` `label` VARCHAR(255) NULL DEFAULT NULL'); - } - } - - /** - * @param $rev - */ - public function upgrade_4_3_beta3($rev) { - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.beta3']), 'runSql', $rev); - // CRM-12065 - $query = "SELECT id, form_values FROM civicrm_report_instance WHERE form_values LIKE '%contribution_type%'"; - $this->addTask('Replace contribution_type to financial_type in table civicrm_report_instance', 'replaceContributionTypeId', $query, 'reportInstance'); - $query = "SELECT * FROM civicrm_saved_search WHERE form_values LIKE '%contribution_type%'"; - $this->addTask('Replace contribution_type to financial_type in table civicrm_saved_search', 'replaceContributionTypeId', $query, 'savedSearch'); - } - - /** - * @param $rev - */ - public function upgrade_4_3_beta4($rev) { - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.beta4']), 'runSql', $rev); - // add indexes for civicrm_entity_financial_trxn - // CRM-12141 - $this->addTask('Check/Add indexes for civicrm_entity_financial_trxn', 'task_4_3_x_checkIndexes', $rev); - } - - /** - * @param $rev - */ - public function upgrade_4_3_beta5($rev) { - // CRM-12205 - if ( - CRM_Core_DAO::checkTableExists('log_civicrm_financial_trxn') && - CRM_Core_BAO_SchemaHandler::checkIfFieldExists('log_civicrm_financial_trxn', 'trxn_id') - ) { - CRM_Core_DAO::executeQuery('ALTER TABLE `log_civicrm_financial_trxn` CHANGE `trxn_id` `trxn_id` VARCHAR(255) NULL DEFAULT NULL'); - } - // CRM-12142 - some sites didn't get this column added yet, and sites which installed 4.3 from scratch will already have it - // CRM-12367 - add this column to single lingual sites only - $upgrade = new CRM_Upgrade_Form(); - if (!$upgrade->multilingual && - !CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_premiums', 'premiums_nothankyou_label') - ) { - $query = " -ALTER TABLE civicrm_premiums -ADD COLUMN premiums_nothankyou_label varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL - COMMENT 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)' -"; - CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - } - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.beta5']), 'runSql', $rev); - } - - /** - * @param $rev - */ - public function upgrade_4_3_4($rev) { - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.4']), 'runSql', $rev); - } - - /** - * @param $rev - */ - public function upgrade_4_3_5($rev) { - // CRM-12156 - $config = CRM_Core_Config::singleton(); - $dbname = DB::parseDSN($config->dsn); - $sql = "SELECT DELETE_RULE -FROM information_schema.REFERENTIAL_CONSTRAINTS -WHERE CONSTRAINT_NAME = 'FK_civicrm_financial_item_contact_id' -AND CONSTRAINT_SCHEMA = %1"; - $params = [1 => [$dbname['database'], 'String']]; - $onDelete = CRM_Core_DAO::singleValueQuery($sql, $params, TRUE, FALSE); - - if ($onDelete != 'CASCADE') { - $query = "ALTER TABLE `civicrm_financial_item` -DROP FOREIGN KEY FK_civicrm_financial_item_contact_id, -DROP INDEX FK_civicrm_financial_item_contact_id;"; - CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - $query = " -ALTER TABLE `civicrm_financial_item` -ADD CONSTRAINT `FK_civicrm_financial_item_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE; -"; - CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - } - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.5']), 'runSql', $rev); - } - - /** - * @param $rev - */ - public function upgrade_4_3_6($rev) { - //CRM-13094 - $this->addTask(ts('Add missing constraints'), 'addMissingConstraints', $rev); - //CRM-13088 - $this->addTask('Add ON DELETE Options for constraints', 'task_4_3_x_checkConstraints', $rev); - $this->addTask(ts('Upgrade DB to %1: SQL', [1 => '4.3.6']), 'runSql', $rev); - // CRM-12844 - // update line_item, financial_trxn and financial_item table for recurring contributions - $this->addTask('Update financial_account_id in financial_trxn table', 'updateFinancialTrxnData', $rev); - $this->addTask('Update Line Item Data', 'updateLineItemData', $rev); - } - - /** - * CRM-11636 - * @return bool - */ - public function assignFinancialTypeToPriceRecords() { - $upgrade = new CRM_Upgrade_Form(); - //here we update price set entries - $sqlFinancialIds = " -SELECT id, LCASE(name) name -FROM civicrm_financial_type -WHERE name IN ('Donation', 'Event Fee', 'Member Dues'); -"; - $daoFinancialIds = CRM_Core_DAO::executeQuery($sqlFinancialIds); - while ($daoFinancialIds->fetch()) { - $financialIds[$daoFinancialIds->name] = $daoFinancialIds->id; - } - $sqlPriceSetUpdate = " -UPDATE civicrm_price_set ps -SET ps.financial_type_id = - CASE - WHEN ps.extends LIKE '%1%' THEN {$financialIds['event fee']} - WHEN ps.extends LIKE '2' THEN {$financialIds['donation']} - WHEN ps.extends LIKE '3' THEN {$financialIds['member dues']} - END -WHERE financial_type_id IS NULL -"; - CRM_Core_DAO::executeQuery($sqlPriceSetUpdate); - - //here we update price field value rows - $sqlPriceFieldValueUpdate = " -UPDATE civicrm_price_field_value pfv -LEFT JOIN civicrm_membership_type mt ON (pfv.membership_type_id = mt.id) -INNER JOIN civicrm_price_field pf ON (pfv.price_field_id = pf.id) -INNER JOIN civicrm_price_set ps ON (pf.price_set_id = ps.id) - SET pfv.financial_type_id = - CASE - WHEN pfv.membership_type_id IS NOT NULL THEN mt.financial_type_id - WHEN pfv.membership_type_id IS NULL THEN ps.financial_type_id - END -"; - CRM_Core_DAO::executeQuery($sqlPriceFieldValueUpdate); - - return TRUE; - } - - /** - * @return bool - */ - public static function _checkAndMigrateDefaultFinancialTypes() { - $modifiedDefaults = FALSE; - //insert types if not exists - $sqlFetchTypes = " -SELECT id, name -FROM civicrm_contribution_type -WHERE name IN ('Donation', 'Event Fee', 'Member Dues') AND is_active =1 -"; - $daoFetchTypes = CRM_Core_DAO::executeQuery($sqlFetchTypes); - - if ($daoFetchTypes->N < 3) { - $modifiedDefaults = TRUE; - $insertStatments = [ - 'Donation' => "('Donation', 0, 1, 1)", - 'Member' => "('Member Dues', 0, 1, 1)", - 'Event Fee' => "('Event Fee', 0, 1, 0)", - ]; - foreach ($insertStatments as $values) { - $query = " -INSERT INTO civicrm_contribution_type (name, is_reserved, is_active, is_deductible) -VALUES $values -ON DUPLICATE KEY UPDATE is_active = 1 -"; - CRM_Core_DAO::executeQuery($query); - } - } - return $modifiedDefaults; - } - - /** - * @return bool - */ - public function createFinancialRecords() { - $upgrade = new CRM_Upgrade_Form(); - - // update civicrm_entity_financial_trxn.amount = civicrm_financial_trxn.total_amount - $query = " -UPDATE civicrm_entity_financial_trxn ceft -LEFT JOIN civicrm_financial_trxn cft ON cft.id = ceft.financial_trxn_id -SET ceft.amount = total_amount -WHERE cft.net_amount IS NOT NULL -AND ceft.entity_table = 'civicrm_contribution' -"; - CRM_Core_DAO::executeQuery($query); - - $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); - $completedStatus = array_search('Completed', $contributionStatus); - $pendingStatus = array_search('Pending', $contributionStatus); - $cancelledStatus = array_search('Cancelled', $contributionStatus); - $queryParams = [ - 1 => [$completedStatus, 'Integer'], - 2 => [$pendingStatus, 'Integer'], - 3 => [$cancelledStatus, 'Integer'], - ]; - - $accountType = key(CRM_Core_PseudoConstant::accountOptionValues('financial_account_type', NULL, " AND v.name = 'Asset' ")); - $query = " -SELECT id -FROM civicrm_financial_account -WHERE is_default = 1 -AND financial_account_type_id = {$accountType} -"; - $financialAccountId = CRM_Core_DAO::singleValueQuery($query); - - $accountRelationsips = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', - 'account_relationship', CRM_Core_DAO::$_nullArray, 'validate'); - - $accountsReceivableAccount = array_search('Accounts Receivable Account is', $accountRelationsips); - $incomeAccountIs = array_search('Income Account is', $accountRelationsips); - $assetAccountIs = array_search('Asset Account is', $accountRelationsips); - $expenseAccountIs = array_search('Expense Account is', $accountRelationsips); - - $financialItemStatus = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialItem', 'status_id', - CRM_Core_DAO::$_nullArray, 'validate'); - $unpaidStatus = array_search('Unpaid', $financialItemStatus); - $paidStatus = array_search('Paid', $financialItemStatus); - - $validCurrencyCodes = CRM_Core_PseudoConstant::currencyCode(); - $validCurrencyCodes = implode("','", $validCurrencyCodes); - $config = CRM_Core_Config::singleton(); - $defaultCurrency = $config->defaultCurrency; - $now = date('YmdHis'); - - //adding financial_trxn records and entity_financial_trxn records related to contribution - //Add temp column for easy entry in entity_financial_trxn - $sql = "ALTER TABLE civicrm_financial_trxn ADD COLUMN contribution_id INT DEFAULT NULL"; - CRM_Core_DAO::executeQuery($sql); - - //pending pay later status handling - $sql = " -INSERT INTO civicrm_financial_trxn - (contribution_id, payment_instrument_id, currency, total_amount, net_amount, fee_amount, trxn_id, status_id, - check_number, to_financial_account_id, from_financial_account_id, trxn_date) -SELECT con.id as contribution_id, con.payment_instrument_id, - IF(con.currency IN ('{$validCurrencyCodes}'), con.currency, '{$defaultCurrency}') as currency, - con.total_amount, con.net_amount, con.fee_amount, con.trxn_id, con.contribution_status_id, - con.check_number, efa.financial_account_id as to_financial_account_id, NULL as from_financial_account_id, - REPLACE(REPLACE(REPLACE( - CASE - WHEN con.receive_date IS NOT NULL THEN - con.receive_date - WHEN con.receipt_date IS NOT NULL THEN - con.receipt_date - ELSE - {$now} - END - , '-', ''), ':', ''), ' ', '') as trxn_date -FROM civicrm_contribution con - LEFT JOIN civicrm_entity_financial_account efa - ON (con.financial_type_id = efa.entity_id AND efa.entity_table = 'civicrm_financial_type' - AND efa.account_relationship = {$accountsReceivableAccount}) -WHERE con.is_pay_later = 1 -AND con.contribution_status_id = {$pendingStatus} -"; - CRM_Core_DAO::executeQuery($sql); - - //create a temp table to hold financial account id related to payment instruments - $tempTable1 = CRM_Utils_SQL_TempTable::build()->setCategory('upgrade43')->setDurable(); - - $sql = " -SELECT ceft.financial_account_id financial_account_id, cov.value as instrument_id -FROM civicrm_entity_financial_account ceft -INNER JOIN civicrm_option_value cov ON cov.id = ceft.entity_id AND ceft.entity_table = 'civicrm_option_value' -INNER JOIN civicrm_option_group cog ON cog.id = cov.option_group_id -WHERE cog.name = 'payment_instrument' -"; - $tempTable1->createWithQuery($sql); - $tempTableName1 = $tempTable1->getName(); - - //CRM-12141 - $sql = "ALTER TABLE {$tempTableName1} ADD INDEX index_instrument_id (instrument_id(200));"; - CRM_Core_DAO::executeQuery($sql); - - //create temp table to process completed / cancelled contribution - $tempTable2 = CRM_Utils_SQL_TempTable::build()->setCategory('upgrade43')->setDurable(); - $tempTableName2 = $tempTable2->getName(); - $sql = " -SELECT con.id as contribution_id, con.payment_instrument_id, - IF(con.currency IN ('{$validCurrencyCodes}'), con.currency, '{$defaultCurrency}') as currency, - con.total_amount, con.net_amount, con.fee_amount, con.trxn_id, con.contribution_status_id, - con.check_number, NULL as from_financial_account_id, - REPLACE(REPLACE(REPLACE( - CASE - WHEN con.receive_date IS NOT NULL THEN - con.receive_date - WHEN con.receipt_date IS NOT NULL THEN - con.receipt_date - ELSE - {$now} - END - , '-', ''), ':', ''), ' ', '') as trxn_date, - CASE - WHEN con.payment_instrument_id IS NULL THEN - {$financialAccountId} - WHEN con.payment_instrument_id IS NOT NULL THEN - tpi.financial_account_id - END as to_financial_account_id, - IF(eft.financial_trxn_id IS NULL, 'insert', eft.financial_trxn_id) as action -FROM civicrm_contribution con -LEFT JOIN civicrm_entity_financial_trxn eft - ON (eft.entity_table = 'civicrm_contribution' AND eft.entity_id = con.id) -LEFT JOIN {$tempTableName1} tpi - ON con.payment_instrument_id = tpi.instrument_id -WHERE con.contribution_status_id IN ({$completedStatus}, {$cancelledStatus}) -"; - $tempTable2->createWithQuery($sql); - - // CRM-12141 - $sql = "ALTER TABLE {$tempTableName2} ADD INDEX index_action (action);"; - CRM_Core_DAO::executeQuery($sql); - - //handling for completed contribution and cancelled contribution - //insertion of new records - $sql = " -INSERT INTO civicrm_financial_trxn - (contribution_id, payment_instrument_id, currency, total_amount, net_amount, fee_amount, trxn_id, status_id, check_number, - to_financial_account_id, from_financial_account_id, trxn_date) -SELECT tempI.contribution_id, tempI.payment_instrument_id, tempI.currency, tempI.total_amount, tempI.net_amount, - tempI.fee_amount, tempI.trxn_id, tempI.contribution_status_id, tempI.check_number, - tempI.to_financial_account_id, tempI.from_financial_account_id, tempI.trxn_date -FROM {$tempTableName2} tempI -WHERE tempI.action = 'insert' -"; - CRM_Core_DAO::executeQuery($sql); - - //update of existing records - $sql = " -UPDATE civicrm_financial_trxn ft - INNER JOIN {$tempTableName2} tempU - ON (tempU.action != 'insert' AND ft.id = tempU.action) -SET ft.from_financial_account_id = NULL, - ft.to_financial_account_id = tempU.to_financial_account_id, - ft.status_id = tempU.contribution_status_id, - ft.payment_instrument_id = tempU.payment_instrument_id, - ft.check_number = tempU.check_number, - ft.contribution_id = tempU.contribution_id;"; - CRM_Core_DAO::executeQuery($sql); - - //insert the -ve transaction rows for cancelled contributions - $sql = " -INSERT INTO civicrm_financial_trxn - (contribution_id, payment_instrument_id, currency, total_amount, net_amount, fee_amount, trxn_id, status_id, - check_number, to_financial_account_id, from_financial_account_id, trxn_date) -SELECT ft.contribution_id, ft.payment_instrument_id, ft.currency, -ft.total_amount, ft.net_amount, ft.fee_amount, ft.trxn_id, - ft.status_id, ft.check_number, ft.to_financial_account_id, ft.from_financial_account_id, ft.trxn_date -FROM civicrm_financial_trxn ft -WHERE ft.status_id = {$cancelledStatus};"; - CRM_Core_DAO::executeQuery($sql); - - //inserting entity financial trxn entries if its not present in entity_financial_trxn for completed and pending contribution statuses - //this also handles +ve and -ve both transaction entries for a cancelled contribution - $sql = " -INSERT INTO civicrm_entity_financial_trxn (entity_table, entity_id, financial_trxn_id, amount) -SELECT 'civicrm_contribution', ft.contribution_id, ft.id, ft.total_amount as amount -FROM civicrm_financial_trxn ft -WHERE contribution_id IS NOT NULL AND - ft.id NOT IN (SELECT financial_trxn_id - FROM civicrm_entity_financial_trxn - WHERE entity_table = 'civicrm_contribution' - AND entity_id = ft.contribution_id)"; - CRM_Core_DAO::executeQuery($sql); - //end of adding financial_trxn records and entity_financial_trxn records related to contribution - - //update all linked line_item rows - // set line_item.financial_type_id = contribution.financial_type_id if contribution page id is null and not participant line item - // set line_item.financial_type_id = price_field_value.financial_type_id if contribution page id is set and not participant line item - // set line_item.financial_type_id = event.financial_type_id if its participant line item and line_item.price_field_value_id is null - // set line_item.financial_type_id = price_field_value.financial_type_id if its participant line item and line_item.price_field_value_id is set - $updateLineItemSql = " -UPDATE civicrm_line_item li - LEFT JOIN civicrm_contribution con - ON (li.entity_id = con.id AND li.entity_table = 'civicrm_contribution') - LEFT JOIN civicrm_price_field_value cpfv - ON li.price_field_value_id = cpfv.id - LEFT JOIN civicrm_participant cp - ON (li.entity_id = cp.id AND li.entity_table = 'civicrm_participant') - LEFT JOIN civicrm_event ce - ON ce.id = cp.event_id -SET li.financial_type_id = CASE - WHEN (con.contribution_page_id IS NULL || li.price_field_value_id IS NULL) AND cp.id IS NULL THEN - con.financial_type_id - WHEN (con.contribution_page_id IS NOT NULL AND cp.id IS NULL) || (cp.id IS NOT NULL AND li.price_field_value_id IS NOT NULL) THEN - cpfv.financial_type_id - WHEN cp.id IS NOT NULL AND li.price_field_value_id IS NULL THEN - ce.financial_type_id - END"; - CRM_Core_DAO::executeQuery($updateLineItemSql, $queryParams); - - //add the financial_item entries - //add a temp column so that inserting entity_financial_trxn entries gets easy - $sql = "ALTER TABLE civicrm_financial_item ADD COLUMN f_trxn_id INT DEFAULT NULL"; - CRM_Core_DAO::executeQuery($sql); - - //add financial_item entries for contribution completed / pending pay later / cancelled - $contributionlineItemSql = " -INSERT INTO civicrm_financial_item - (transaction_date, contact_id, amount, currency, entity_table, entity_id, description, status_id, financial_account_id, f_trxn_id) - -SELECT REPLACE(REPLACE(REPLACE(ft.trxn_date, '-', ''), ':', ''), ' ', ''), con.contact_id, - IF(ft.total_amount < 0 AND con.contribution_status_id = %3, -li.line_total, li.line_total) as line_total, con.currency, 'civicrm_line_item', - li.id as line_item_id, li.label as line_item_label, - IF(con.contribution_status_id = {$pendingStatus}, {$unpaidStatus}, {$paidStatus}) as status_id, efa.financial_account_id as financial_account_id, - ft.id as f_trxn_id -FROM civicrm_line_item li - INNER JOIN civicrm_contribution con - ON (li.entity_id = con.id AND li.entity_table = 'civicrm_contribution') - INNER JOIN civicrm_financial_trxn ft - ON (con.id = ft.contribution_id) - LEFT JOIN civicrm_entity_financial_account efa - ON (li.financial_type_id = efa.entity_id AND efa.entity_table = 'civicrm_financial_type' - AND efa.account_relationship = {$incomeAccountIs}) -WHERE con.contribution_status_id IN (%1, %3) OR (con.is_pay_later = 1 AND con.contribution_status_id = %2)"; - CRM_Core_DAO::executeQuery($contributionlineItemSql, $queryParams); - - //add financial_item entries for event - $participantLineItemSql = " -INSERT INTO civicrm_financial_item - (transaction_date, contact_id, amount, currency, entity_table, entity_id, description, status_id, financial_account_id, f_trxn_id) - -SELECT REPLACE(REPLACE(REPLACE(ft.trxn_date, '-', ''), ':', ''), ' ', ''), con.contact_id, - IF(ft.total_amount < 0 AND con.contribution_status_id = %3, -li.line_total, li.line_total) as line_total, - con.currency, 'civicrm_line_item', li.id as line_item_id, li.label as line_item_label, - IF(con.contribution_status_id = {$pendingStatus}, {$unpaidStatus}, {$paidStatus}) as status_id, - efa.financial_account_id as financial_account_id, ft.id as f_trxn_id -FROM civicrm_line_item li - INNER JOIN civicrm_participant par - ON (li.entity_id = par.id AND li.entity_table = 'civicrm_participant') - INNER JOIN civicrm_participant_payment pp - ON (pp.participant_id = par.id) - INNER JOIN civicrm_contribution con - ON (pp.contribution_id = con.id) - INNER JOIN civicrm_financial_trxn ft - ON (con.id = ft.contribution_id) - LEFT JOIN civicrm_entity_financial_account efa - ON (li.financial_type_id = efa.entity_id AND - efa.entity_table = 'civicrm_financial_type' AND efa.account_relationship = {$incomeAccountIs}) -WHERE con.contribution_status_id IN (%1, %3) OR (con.is_pay_later = 1 AND con.contribution_status_id = %2)"; - CRM_Core_DAO::executeQuery($participantLineItemSql, $queryParams); - - //fee handling for contributions - //insert fee entries in financial_trxn for contributions - $sql = "ALTER TABLE civicrm_financial_trxn ADD COLUMN is_fee TINYINT DEFAULT NULL"; - CRM_Core_DAO::executeQuery($sql); - - $sql = " -INSERT INTO civicrm_financial_trxn - (contribution_id, payment_instrument_id, currency, total_amount, net_amount, fee_amount, trxn_id, status_id, check_number, - to_financial_account_id, from_financial_account_id, trxn_date, payment_processor_id, is_fee) - -SELECT DISTINCT con.id, ft.payment_instrument_id, ft.currency, ft.fee_amount, NULL, NULL, ft.trxn_id, %1 as status_id, - ft.check_number, efaFT.financial_account_id as to_financial_account_id, CASE - WHEN efaPP.financial_account_id IS NOT NULL THEN - efaPP.financial_account_id - WHEN tpi.financial_account_id IS NOT NULL THEN - tpi.financial_account_id - ELSE - {$financialAccountId} - END as from_financial_account_id, ft.trxn_date, ft.payment_processor_id, 1 as is_fee -FROM civicrm_contribution con - INNER JOIN civicrm_financial_trxn ft - ON (ft.contribution_id = con.id) - LEFT JOIN civicrm_entity_financial_account efaFT - ON (con.financial_type_id = efaFT.entity_id AND efaFT.entity_table = 'civicrm_financial_type' - AND efaFT.account_relationship = {$expenseAccountIs}) - LEFT JOIN civicrm_entity_financial_account efaPP - ON (ft.payment_processor_id = efaPP.entity_id AND efaPP.entity_table = 'civicrm_payment_processor' - AND efaPP.account_relationship = {$assetAccountIs}) - LEFT JOIN {$tempTableName1} tpi - ON ft.payment_instrument_id = tpi.instrument_id -WHERE ft.fee_amount IS NOT NULL AND ft.fee_amount != 0 AND (con.contribution_status_id IN (%1, %3) OR (con.contribution_status_id =%2 AND con.is_pay_later = 1))"; - CRM_Core_DAO::executeQuery($sql, $queryParams); - - //link financial_trxn to contribution - $sql = " -INSERT INTO civicrm_entity_financial_trxn - (entity_table, entity_id, financial_trxn_id, amount) -SELECT 'civicrm_contribution', ft.contribution_id, ft.id, ft.total_amount -FROM civicrm_financial_trxn ft -WHERE ft.is_fee = 1"; - CRM_Core_DAO::executeQuery($sql); - - //add fee related entries to financial item table - $domainId = CRM_Core_Config::domainID(); - $domainContactId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', $domainId, 'contact_id'); - $sql = " -INSERT INTO civicrm_financial_item - (transaction_date, contact_id, amount, currency, entity_table, entity_id, description, status_id, financial_account_id, f_trxn_id) -SELECT ft.trxn_date, {$domainContactId} as contact_id, ft.total_amount, ft.currency, 'civicrm_financial_trxn', ft.id, - 'Fee', {$paidStatus} as status_id, ft.to_financial_account_id as financial_account_id, ft.id as f_trxn_id -FROM civicrm_financial_trxn ft -WHERE ft.is_fee = 1;"; - CRM_Core_DAO::executeQuery($sql); - - //add entries to entity_financial_trxn table - $sql = " -INSERT INTO civicrm_entity_financial_trxn (entity_table, entity_id, financial_trxn_id, amount) -SELECT 'civicrm_financial_item' as entity_table, fi.id as entity_id, fi.f_trxn_id as financial_trxn_id, fi.amount -FROM civicrm_financial_item fi"; - CRM_Core_DAO::executeQuery($sql); - - //drop the temparory columns - $sql = "ALTER TABLE civicrm_financial_trxn - DROP COLUMN contribution_id, - DROP COLUMN is_fee;"; - CRM_Core_DAO::executeQuery($sql); - - $sql = "ALTER TABLE civicrm_financial_item DROP f_trxn_id"; - CRM_Core_DAO::executeQuery($sql); - - return TRUE; - } - - /** - * @return array - */ - public function createDomainContacts() { - $domainParams = $context = []; - $query = " -ALTER TABLE civicrm_domain ADD contact_id INT( 10 ) UNSIGNED NULL DEFAULT NULL COMMENT 'FK to Contact ID. This is specifically not an FK to avoid circular constraints', - ADD CONSTRAINT FK_civicrm_domain_contact_id FOREIGN KEY (contact_id) REFERENCES civicrm_contact(id);"; - CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - - $query = ' -SELECT cd.id, cd.name, ce.email FROM civicrm_domain cd -LEFT JOIN civicrm_loc_block clb ON clb.id = cd. loc_block_id -LEFT JOIN civicrm_email ce ON ce.id = clb.email_id ; -'; - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $query = " -SELECT cc.id FROM civicrm_contact cc -LEFT JOIN civicrm_email ce ON ce.contact_id = cc.id -WHERE cc.contact_type = 'Organization' AND cc.organization_name = %1 -"; - $params = [1 => [$dao->name, 'String']]; - if ($dao->email) { - $query .= " AND ce.email = %2 "; - $params[2] = [$dao->email, 'String']; - } - $contactID = CRM_Core_DAO::singleValueQuery($query, $params); - $context[1] = $dao->name; - if (empty($contactID)) { - $params = [ - 'sort_name' => $dao->name, - 'display_name' => $dao->name, - 'legal_name' => $dao->name, - 'organization_name' => $dao->name, - 'contact_type' => 'Organization', - ]; - $contact = CRM_Contact_BAO_Contact::add($params); - $contactID = $contact->id; - $context[0] = 'added'; - } - else { - $context[0] = 'merged'; - } - $domainParams['contact_id'] = $contactID; - CRM_Core_BAO_Domain::edit($domainParams, $dao->id); - } - return $context; - } - - public function task_4_3_alpha1_checkDBConstraints() { - //checking whether the foreign key exists before dropping it CRM-11260 - $config = CRM_Core_Config::singleton(); - $dbUf = DB::parseDSN($config->dsn); - $tables = [ - 'autorenewal_msg_id' => [ - 'tableName' => 'civicrm_membership_type', - 'fkey' => 'FK_civicrm_membership_autorenewal_msg_id', - ], - 'to_account_id' => [ - 'tableName' => 'civicrm_financial_trxn', - 'constraintName' => 'civicrm_financial_trxn_ibfk_2', - ], - 'from_account_id' => [ - 'tableName' => 'civicrm_financial_trxn', - 'constraintName' => 'civicrm_financial_trxn_ibfk_1', - ], - 'contribution_type_id' => [ - 'tableName' => 'civicrm_contribution_recur', - 'fkey' => 'FK_civicrm_contribution_recur_contribution_type_id', - ], - ]; - $query = " -SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS -WHERE table_name = 'civicrm_contribution_recur' -AND constraint_name = 'FK_civicrm_contribution_recur_contribution_type_id' -AND TABLE_SCHEMA = %1 -"; - $params = [1 => [$dbUf['database'], 'String']]; - $dao = CRM_Core_DAO::executeQuery($query, $params, TRUE, NULL, FALSE, FALSE); - foreach ($tables as $columnName => $value) { - if ($value['tableName'] == 'civicrm_membership_type' || $value['tableName'] == 'civicrm_contribution_recur') { - $foreignKeyExists = CRM_Core_DAO::checkConstraintExists($value['tableName'], $value['fkey']); - $fKey = $value['fkey']; - } - else { - $foreignKeyExists = CRM_Core_DAO::checkFKConstraintInFormat($value['tableName'], $columnName); - $fKey = "`FK_{$value['tableName']}_{$columnName}`"; - } - if ($foreignKeyExists || $value['tableName'] == 'civicrm_financial_trxn') { - if ($value['tableName'] != 'civicrm_contribution_recur' || ($value['tableName'] == 'civicrm_contribution_recur' && $dao->N)) { - $constraintName = $foreignKeyExists ? $fKey : $value['constraintName']; - $query = "ALTER TABLE {$value['tableName']} DROP FOREIGN KEY {$constraintName}"; - CRM_Core_DAO::executeQuery($query, $params, TRUE, NULL, FALSE, FALSE); - } - $query = "ALTER TABLE {$value['tableName']} DROP INDEX {$fKey}"; - CRM_Core_DAO::executeQuery($query, $params, TRUE, NULL, FALSE, FALSE); - } - } - // check if column contact_id is present or not in civicrm_financial_account - $fieldExists = CRM_Core_BAO_SchemaHandler::checkIfFieldExists('civicrm_financial_account', 'contact_id', FALSE); - if (!$fieldExists) { - $query = " -ALTER TABLE civicrm_financial_account - ADD contact_id int(10) unsigned DEFAULT NULL COMMENT 'Version identifier of financial_type' AFTER name, - ADD CONSTRAINT FK_civicrm_financial_account_contact_id FOREIGN KEY (contact_id) REFERENCES civicrm_contact(id); -"; - CRM_Core_DAO::executeQuery($query, $params, TRUE, NULL, FALSE, FALSE); - } - } - - /** - * Read creation and modification times from civicrm_log; add them to civicrm_contact. - * - * @param \CRM_Queue_TaskContext $ctx - * @param int $startId - * @param int $endId - * - * @return bool - */ - public function convertTimestamps(CRM_Queue_TaskContext $ctx, $startId, $endId) { - $sql = " - SELECT entity_id, min(modified_date) AS created, max(modified_date) AS modified - FROM civicrm_log - WHERE entity_table = 'civicrm_contact' - AND entity_id BETWEEN %1 AND %2 - GROUP BY entity_id - "; - $params = [ - 1 => [$startId, 'Integer'], - 2 => [$endId, 'Integer'], - ]; - $dao = CRM_Core_DAO::executeQuery($sql, $params); - while ($dao->fetch()) { - // FIXME civicrm_log.modified_date is DATETIME; civicrm_contact.modified_date is TIMESTAMP - CRM_Core_DAO::executeQuery( - 'UPDATE civicrm_contact SET created_date = FROM_UNIXTIME(UNIX_TIMESTAMP(%1)), modified_date = FROM_UNIXTIME(UNIX_TIMESTAMP(%2)) WHERE id = %3', - [ - 1 => [$dao->created, 'String'], - 2 => [$dao->modified, 'String'], - 3 => [$dao->entity_id, 'Integer'], - ] - ); - } - - return TRUE; - } - - /** - * Change index and add missing constraints for civicrm_contribution_recur. - * - * @param \CRM_Queue_TaskContext $ctx - * - * @return bool - */ - public function addMissingConstraints(CRM_Queue_TaskContext $ctx) { - $query = "SHOW KEYS FROM `civicrm_contribution_recur` WHERE key_name = 'UI_contrib_payment_instrument_id'"; - $dao = CRM_Core_DAO::executeQuery($query); - if ($dao->N) { - CRM_Core_DAO::executeQuery('ALTER TABLE civicrm_contribution_recur DROP INDEX UI_contrib_payment_instrument_id'); - CRM_Core_DAO::executeQuery('ALTER TABLE civicrm_contribution_recur ADD INDEX UI_contribution_recur_payment_instrument_id (payment_instrument_id)'); - } - $constraintArray = [ - 'contact_id' => " ADD CONSTRAINT `FK_civicrm_contribution_recur_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE ", - 'payment_processor_id' => " ADD CONSTRAINT `FK_civicrm_contribution_recur_payment_processor_id` FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor` (`id`) ON DELETE SET NULL ", - 'financial_type_id' => " ADD CONSTRAINT `FK_civicrm_contribution_recur_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`) ON DELETE SET NULL ", - 'campaign_id' => " ADD CONSTRAINT `FK_civicrm_contribution_recur_campaign_id` FOREIGN KEY (`campaign_id`) REFERENCES `civicrm_campaign` (`id`) ON DELETE SET NULL ", - ]; - $constraint = []; - foreach ($constraintArray as $constraintKey => $value) { - $foreignKeyExists = CRM_Core_DAO::checkFKConstraintInFormat('civicrm_contribution_recur', $constraintKey); - if (!$foreignKeyExists) { - $constraint[] = $value; - } - } - if (!empty($constraint)) { - $query = "ALTER TABLE civicrm_contribution_recur " . implode(' , ', $constraint); - CRM_Core_DAO::executeQuery($query); - } - return TRUE; - } - - /** - * Update financial_account_id for bad data in financial_trxn table. - * CRM-12844 - * - * @param \CRM_Queue_TaskContext $ctx - * - * @return bool - */ - public function updateFinancialTrxnData(CRM_Queue_TaskContext $ctx) { - $upgrade = new CRM_Upgrade_Form(); - $sql = "SELECT cc.id contribution_id, cc.contribution_recur_id, cft.payment_processor_id, -cft.id financial_trxn_id, cfi.entity_table, cft.from_financial_account_id, cft.to_financial_account_id - -FROM `civicrm_contribution` cc -LEFT JOIN civicrm_entity_financial_trxn ceft ON ceft.entity_id = cc.id -LEFT JOIN civicrm_financial_trxn cft ON cft.id = ceft.financial_trxn_id -LEFT JOIN civicrm_entity_financial_trxn ceft1 ON ceft1.financial_trxn_id = ceft.financial_trxn_id -LEFT JOIN civicrm_financial_item cfi ON cfi.id = ceft1.entity_id -WHERE ceft.entity_table = 'civicrm_contribution' AND cc.contribution_recur_id IS NOT NULL -AND ceft1.entity_table = 'civicrm_financial_item' AND cft.id IS NOT NULL AND cft.payment_instrument_id = %1 - -ORDER BY cft.id "; - $paymentInstrument = CRM_Contribute_PseudoConstant::paymentInstrument('name'); - $param = [1 => [array_search('Credit Card', $paymentInstrument), 'Integer']]; - $dao = CRM_Core_DAO::executeQuery($sql, $param); - $financialTrxn = []; - $subsequentPayments = []; - while ($dao->fetch()) { - if (!array_key_exists($dao->contribution_recur_id, $financialTrxn)) { - $financialTrxn[$dao->contribution_recur_id] = [ - 'from_financial_account_id' => $dao->to_financial_account_id, - 'payment_processor_id' => $dao->payment_processor_id, - $dao->contribution_id => 1, - ]; - if (!is_null($dao->from_financial_account_id)) { - $sql = 'UPDATE civicrm_financial_trxn SET from_financial_account_id = NULL WHERE id = %1'; - $params = [1 => [$dao->financial_trxn_id, 'Integer']]; - CRM_Core_DAO::executeQuery($sql, $params); - } - } - elseif (!array_key_exists($dao->contribution_id, $financialTrxn[$dao->contribution_recur_id])) { - if (($dao->entity_table == 'civicrm_line_item' && $dao->to_financial_account_id == $financialTrxn[$dao->contribution_recur_id]['from_financial_account_id']) - || ($dao->entity_table == 'civicrm_financial_trxn' && $dao->from_financial_account_id == $financialTrxn[$dao->contribution_recur_id]['from_financial_account_id']) - ) { - continue; - } - $subsequentPayments[$dao->contribution_recur_id][$dao->entity_table][] = $dao->financial_trxn_id; - } - } - foreach ($subsequentPayments as $key => $value) { - foreach ($value as $table => $val) { - if ($table == 'civicrm_financial_trxn') { - $field = 'from_financial_account_id'; - } - else { - $field = 'to_financial_account_id'; - } - $sql = "UPDATE civicrm_financial_trxn SET $field = " . $financialTrxn[$dao->contribution_recur_id]['from_financial_account_id'] . ', -payment_processor_id = ' . $financialTrxn[$dao->contribution_recur_id]['payment_processor_id'] . ' WHERE -id IN (' . implode(',', $val) . ')'; - CRM_Core_DAO::executeQuery($sql); - } - } - return TRUE; - } - - /** - * Update financial_account_id for bad data in financial_trxn table. - * CRM-12844 - * - * @param \CRM_Queue_TaskContext $ctx - * - * @return bool - */ - public function updateLineItemData(CRM_Queue_TaskContext $ctx) { - $sql = "SELECT cc.id contribution_id, cc.contribution_recur_id, -cc.financial_type_id contribution_financial_type, -cli.financial_type_id line_financial_type_id, -cli.price_field_id, cli.price_field_value_id, cli.label, cli.id line_item_id, -cfi.financial_account_id -FROM `civicrm_line_item` cli -LEFT JOIN civicrm_contribution cc ON cc.id = cli.entity_id -LEFT JOIN civicrm_financial_item cfi ON cfi.entity_id = cli.id -LEFT JOIN civicrm_price_field cpf ON cpf.id = cli.price_field_id -LEFT JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id -LEFT JOIN civicrm_price_field_value cpfv ON cpfv.id = cli.price_field_value_id -WHERE cfi.entity_table = 'civicrm_line_item' -AND cli.entity_table = 'civicrm_contribution' -AND cps.is_quick_config = 1 AND cc.contribution_recur_id IS NOT NULL -ORDER BY cli.id"; - $dao = CRM_Core_DAO::executeQuery($sql); - $financialTrxn = $subsequentPayments = []; - while ($dao->fetch()) { - if (!array_key_exists($dao->contribution_recur_id, $financialTrxn)) { - $financialTrxn[$dao->contribution_recur_id] = [ - 'price_field_id' => $dao->price_field_id, - 'price_field_value_id' => $dao->price_field_value_id, - 'label' => strval($dao->label), - 'financial_account_id' => $dao->financial_account_id, - $dao->contribution_id => 1, - ]; - } - else { - if ($dao->price_field_value_id == $financialTrxn[$dao->contribution_recur_id]['price_field_value_id']) { - continue; - } - $subsequentPayments[$dao->contribution_recur_id][] = $dao->line_item_id; - } - } - foreach ($subsequentPayments as $key => $value) { - $sql = "UPDATE civicrm_line_item cli -LEFT JOIN civicrm_financial_item cfi ON cli.id = cfi.entity_id -SET -cli.label = %1, -cli.price_field_id = %2, -cli.price_field_value_id = %3, -cfi.financial_account_id = %4, -cfi.description = %5, -cli.financial_type_id = %6 -WHERE cfi.entity_table = 'civicrm_line_item' -AND cli.entity_table = 'civicrm_contribution' AND cli.id IN (" . implode(',', $value) . ');'; - $params = [ - 1 => [$financialTrxn[$key]['label'], 'String'], - 2 => [$financialTrxn[$key]['price_field_id'], 'Integer'], - 3 => [$financialTrxn[$key]['price_field_value_id'], 'Integer'], - 4 => [$financialTrxn[$key]['financial_account_id'], 'Integer'], - 5 => [$financialTrxn[$key]['label'], 'String'], - 6 => [$dao->contribution_financial_type, 'Integer'], - ]; - CRM_Core_DAO::executeQuery($sql, $params); - } - return TRUE; - } - - /** - * Replace contribution_type to financial_type in table. - * - * Civicrm_saved_search and Structure civicrm_report_instance - * - * @param \CRM_Queue_TaskContext $ctx - * @param string $query - * @param string $table - * - * @return bool - */ - public function replaceContributionTypeId(CRM_Queue_TaskContext $ctx, $query, $table) { - $dao = CRM_Core_DAO::executeQuery($query); - while ($dao->fetch()) { - $formValues = unserialize($dao->form_values); - foreach (['contribution_type_id_op', 'contribution_type_id_value', 'contribution_type_id'] as $value) { - if (array_key_exists($value, $formValues)) { - $key = preg_replace('/contribution/', 'financial', $value); - $formValues[$key] = $formValues[$value]; - unset($formValues[$value]); - } - } - if ($table != 'savedSearch') { - foreach (['fields', 'group_bys'] as $value) { - if (array_key_exists($value, $formValues)) { - if (array_key_exists('contribution_type_id', $formValues[$value])) { - $formValues[$value]['financial_type_id'] = $formValues[$value]['contribution_type_id']; - unset($formValues[$value]['contribution_type_id']); - } - elseif (array_key_exists('contribution_type', $formValues[$value])) { - $formValues[$value]['financial_type'] = $formValues[$value]['contribution_type']; - unset($formValues[$value]['contribution_type']); - } - } - } - if (array_key_exists('order_bys', $formValues)) { - foreach ($formValues['order_bys'] as $key => $values) { - if (preg_grep('/contribution_type/', $values)) { - $formValues['order_bys'][$key]['column'] = preg_replace('/contribution_type/', 'financial_type', $values['column']); - } - } - } - } - - if ($table == 'savedSearch') { - $saveDao = new CRM_Contact_DAO_SavedSearch(); - } - else { - $saveDao = new CRM_Report_DAO_ReportInstance(); - } - $saveDao->id = $dao->id; - - if ($table == 'savedSearch') { - if (array_key_exists('mapper', $formValues)) { - foreach ($formValues['mapper'] as $key => $values) { - foreach ($values as $k => $v) { - if (preg_grep('/contribution_/', $v)) { - $formValues['mapper'][$key][$k] = preg_replace('/contribution_type/', 'financial_type', $v); - } - } - } - } - } - $saveDao->form_values = serialize($formValues); - - $saveDao->save(); - } - return TRUE; - } - - /** - * Add ON DELETE options for constraint if not present. - * CRM-13088 && CRM-12156 - * - * @param CRM_Queue_TaskContext $ctx - * - * @return bool - * TRUE for success - */ - public function task_4_3_x_checkConstraints(CRM_Queue_TaskContext $ctx) { - CRM_Core_DAO::executeQuery('ALTER TABLE `civicrm_financial_account` CHANGE `contact_id` `contact_id` INT( 10 ) UNSIGNED NULL DEFAULT NULL'); - $config = CRM_Core_Config::singleton(); - $dbname = DB::parseDSN($config->dsn); - $constraintArray = [ - "'FK_civicrm_financial_account_contact_id'", - "'FK_civicrm_financial_item_contact_id'", - "'FK_civicrm_contribution_recur_financial_type_id'", - "'FK_civicrm_line_item_financial_type_id'", - "'FK_civicrm_product_financial_type_id'", - "'FK_civicrm_premiums_product_financial_type_id'", - "'FK_civicrm_price_field_value_financial_type_id'", - "'FK_civicrm_contribution_product_financial_type_id'", - "'FK_civicrm_price_set_financial_type_id'", - "'FK_civicrm_grant_financial_type_id'", - ]; - - $sql = "SELECT DELETE_RULE, TABLE_NAME, CONSTRAINT_NAME -FROM information_schema.REFERENTIAL_CONSTRAINTS -WHERE CONSTRAINT_NAME IN (" . implode(',', $constraintArray) . ") -AND CONSTRAINT_SCHEMA = %1"; - $params = [1 => [$dbname['database'], 'String']]; - $onDelete = CRM_Core_DAO::executeQuery($sql, $params, TRUE, FALSE); - while ($onDelete->fetch()) { - if (($onDelete->TABLE_NAME != 'civicrm_financial_item' && $onDelete->DELETE_RULE != 'SET NULL') || - ($onDelete->TABLE_NAME == 'civicrm_financial_item' && $onDelete->DELETE_RULE != 'CASCADE') - ) { - $tableName = 'civicrm_financial_type'; - $onDeleteOption = ' SET NULL '; - $columnName = 'financial_type_id'; - if (preg_match('/contact_id/', $onDelete->CONSTRAINT_NAME)) { - $tableName = 'civicrm_contact'; - $columnName = 'contact_id'; - if ($onDelete->TABLE_NAME == 'civicrm_financial_item') { - $onDeleteOption = 'CASCADE'; - } - } - } - else { - continue; - } - $query = "ALTER TABLE {$onDelete->TABLE_NAME} - DROP FOREIGN KEY {$onDelete->CONSTRAINT_NAME}, - DROP INDEX {$onDelete->CONSTRAINT_NAME};"; - CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - $query = " ALTER TABLE {$onDelete->TABLE_NAME} - ADD CONSTRAINT {$onDelete->CONSTRAINT_NAME} FOREIGN KEY (`" . $columnName . "`) REFERENCES {$tableName} (`id`) ON DELETE {$onDeleteOption}; - "; - CRM_Core_DAO::executeQuery($query, [], TRUE, NULL, FALSE, FALSE); - } - return TRUE; - } - - /** - * Check/Add INDEX CRM-12141 - * - * @param CRM_Queue_TaskContext $ctx - * - * @return bool - * TRUE for success - */ - public function task_4_3_x_checkIndexes(CRM_Queue_TaskContext $ctx) { - $query = " -SHOW KEYS -FROM civicrm_entity_financial_trxn -WHERE key_name IN ('UI_entity_financial_trxn_entity_table', 'UI_entity_financial_trxn_entity_id') -"; - $dao = CRM_Core_DAO::executeQuery($query); - if (!$dao->N) { - $query = " -ALTER TABLE civicrm_entity_financial_trxn -ADD INDEX UI_entity_financial_trxn_entity_table (entity_table), -ADD INDEX UI_entity_financial_trxn_entity_id (entity_id); -"; - CRM_Core_DAO::executeQuery($query); - } - return TRUE; - } - - /** - * Update phones CRM-11292 - * - * @param CRM_Queue_TaskContext $ctx - * - * @return bool - * TRUE for success - */ - public static function phoneNumeric(CRM_Queue_TaskContext $ctx) { - CRM_Core_DAO::executeQuery(CRM_Contact_BAO_Contact::DROP_STRIP_FUNCTION_43); - CRM_Core_DAO::executeQuery(CRM_Contact_BAO_Contact::CREATE_STRIP_FUNCTION_43); - CRM_Core_DAO::executeQuery("UPDATE civicrm_phone SET phone_numeric = civicrm_strip_non_numeric(phone)"); - return TRUE; - } - -} diff --git a/CRM/Upgrade/Incremental/sql/4.3.0.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.0.mysql.tpl deleted file mode 100644 index 5283039600..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.0.mysql.tpl +++ /dev/null @@ -1,2 +0,0 @@ --- CRM-12290 -UPDATE civicrm_currency SET symbol = 'N$' WHERE name = 'NAD'; diff --git a/CRM/Upgrade/Incremental/sql/4.3.1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.1.mysql.tpl deleted file mode 100644 index b8bbcad971..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.1.mysql.tpl +++ /dev/null @@ -1,21 +0,0 @@ --- CRM-12351 -UPDATE civicrm_dedupe_rule_group SET title = name WHERE title IS NULL; - --- CRM-12373 - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Dns'; -INSERT INTO civicrm_mailing_bounce_pattern (bounce_type_id, pattern) - VALUES - (@bounceTypeID, 'Host or domain name not found'); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Host'; -INSERT INTO civicrm_mailing_bounce_pattern (bounce_type_id, pattern) - VALUES - (@bounceTypeID, 'lost connection'), - (@bounceTypeID, 'conversation with [^ ]* timed out while'); - -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Relay'; -INSERT INTO civicrm_mailing_bounce_pattern (bounce_type_id, pattern) - VALUES - (@bounceTypeID, 'No route to host'), - (@bounceTypeID, 'Network is unreachable'); diff --git a/CRM/Upgrade/Incremental/sql/4.3.2.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.2.mysql.tpl deleted file mode 100644 index ea0b70fa50..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.2.mysql.tpl +++ /dev/null @@ -1 +0,0 @@ -{* placeholder file for upgrade*} diff --git a/CRM/Upgrade/Incremental/sql/4.3.3.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.3.mysql.tpl deleted file mode 100644 index 4753fab7f1..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.3.mysql.tpl +++ /dev/null @@ -1,2 +0,0 @@ --- CRM-12501 -ALTER TABLE civicrm_financial_account CHANGE `tax_rate` `tax_rate` DECIMAL( 10, 8 ) NULL DEFAULT NULL COMMENT 'The percentage of the total_amount that is due for this tax.'; diff --git a/CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl deleted file mode 100644 index 4da5c51ee8..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.4.mysql.tpl +++ /dev/null @@ -1,109 +0,0 @@ -{* file to handle db changes in 4.3.4 during upgrade*} - --- CRM-12466 -INSERT INTO -civicrm_option_group (name, {localize field='title'}title{/localize}, is_reserved, is_active) -VALUES -('contact_smart_group_display', {localize}'{ts escape="sql"}Contact Smart Group View Options{/ts}'{/localize}, 1, 1); - -SELECT @option_group_id_csgOpt := max(id) FROM civicrm_option_group WHERE name = 'contact_smart_group_display'; - -INSERT INTO -civicrm_option_value (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, -`is_default`, `weight`) -VALUES -(@option_group_id_csgOpt, {localize}'Show Smart Groups on Demand'{/localize}, 1, 'showondemand', NULL, 0, 0, 1), -(@option_group_id_csgOpt, {localize}'Always Show Smart Groups'{/localize}, 2, 'alwaysshow', NULL, 0, 0, 2), -(@option_group_id_csgOpt, {localize}'Hide Smart Groups'{/localize}, 3, 'hide' , NULL, 0, 0, 3); - - -INSERT INTO civicrm_setting -(domain_id, contact_id, is_domain, group_name, name, value) -VALUES -({$domainID}, NULL, 1, 'CiviCRM Preferences', 'contact_smart_group_display', '{serialize}1{/serialize}'); - --- CRM-12665 remove options groups -DELETE cov, cog FROM civicrm_option_group cog -INNER JOIN civicrm_option_value cov ON cov.option_group_id = cog.id -WHERE cog.name IN ('grant_program_status', 'allocation_algorithm'); - --- CRM-12470 -UPDATE civicrm_financial_account -SET is_default = 1 -WHERE name IN ('Premiums', 'Banking Fees', 'Accounts Payable', 'Donation'); - -SELECT @option_group_id_arel := max(id) from civicrm_option_group where name = 'account_relationship'; -SELECT @option_group_id_fat := max(id) from civicrm_option_group where name = 'financial_account_type'; -SELECT @domainContactId := contact_id from civicrm_domain where id = {$domainID}; - --- for Accounts Receivable Account is -SELECT @option_value_rel_id_ar := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Accounts Receivable Account is'; -SELECT @arAccount := id FROM civicrm_financial_account WHERE name = 'accounts receivable'; -SELECT @arAccountEntity := financial_account_id FROM civicrm_entity_financial_account - WHERE account_relationship = @option_value_rel_id_ar AND entity_table = 'civicrm_financial_type' LIMIT 1; - -INSERT INTO civicrm_entity_financial_account(entity_table, entity_id, account_relationship, financial_account_id) -SELECT 'civicrm_financial_type', cft.id, @option_value_rel_id_ar, IFNULL(@arAccount, @arAccountEntity) -FROM civicrm_financial_type cft -LEFT JOIN civicrm_entity_financial_account ceft -ON ceft.entity_id = cft.id AND ceft.account_relationship = @option_value_rel_id_ar AND ceft.entity_table = 'civicrm_financial_type' -WHERE ceft.entity_id IS NULL; - --- for income account is -SELECT @option_value_rel_id := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Income Account is'; -SELECT @opval := value FROM civicrm_option_value WHERE name = 'Revenue' and option_group_id = @option_group_id_fat; - --- create FA if not exists with same name as financial type -INSERT INTO civicrm_financial_account (name, contact_id, financial_account_type_id, description, account_type_code, is_active) -SELECT cft.name, @domainContactId, @opval, cft.name as description, 'INC', 1 -FROM civicrm_financial_type cft -LEFT JOIN civicrm_entity_financial_account ceft -ON ceft.entity_id = cft.id AND ceft.account_relationship = @option_value_rel_id AND ceft.entity_table = 'civicrm_financial_type' -LEFT JOIN civicrm_financial_account ca ON ca.name = cft.name -WHERE ceft.entity_id IS NULL AND ca.id IS NULL; - -INSERT INTO civicrm_entity_financial_account(entity_table, entity_id, account_relationship, financial_account_id) -SELECT 'civicrm_financial_type', cft.id, @option_value_rel_id, ca.id -FROM civicrm_financial_type cft -LEFT JOIN civicrm_entity_financial_account ceft -ON ceft.entity_id = cft.id AND ceft.account_relationship = @option_value_rel_id AND ceft.entity_table = 'civicrm_financial_type' -LEFT JOIN civicrm_financial_account ca ON ca.name = cft.name -WHERE ceft.entity_id IS NULL; - --- for cost of sales -SELECT @option_value_rel_id_cg := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Cost of Sales Account is'; -SELECT @opCost := value FROM civicrm_option_value WHERE name = 'Cost of Sales' and option_group_id = @option_group_id_fat; -SELECT @financialAccountId := id FROM civicrm_financial_account WHERE is_default = 1 and financial_account_type_id = @opCost; - --- CRM-13231 -INSERT IGNORE INTO civicrm_financial_account (id, name, contact_id, financial_account_type_id, description, account_type_code, accounting_code, is_active, is_default) -VALUES (@financialAccountId, 'Premiums', @domainContactId, @opCost, 'Account to record cost of premiums provided to payors', 'COGS', '5100', 1, 1); - -SELECT @financialAccountId := id FROM civicrm_financial_account WHERE is_default = 1 and financial_account_type_id = @opCost; - -INSERT INTO civicrm_entity_financial_account(entity_table, entity_id, account_relationship, financial_account_id) -SELECT 'civicrm_financial_type', cft.id, @option_value_rel_id_cg, @financialAccountId -FROM civicrm_financial_type cft -LEFT JOIN civicrm_entity_financial_account ceft -ON ceft.entity_id = cft.id AND ceft.account_relationship = @option_value_rel_id_cg AND ceft.entity_table = 'civicrm_financial_type' -WHERE ceft.entity_id IS NULL; - --- for Expense Account is -SELECT @option_value_rel_id_exp := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Expense Account is'; -SELECT @opexp := value FROM civicrm_option_value WHERE name = 'Expenses' and option_group_id = @option_group_id_fat; -SET @financialAccountId := ''; -SELECT @financialAccountId := id FROM civicrm_financial_account WHERE is_default = 1 and financial_account_type_id = @opexp; - --- CRM-13231 -INSERT IGNORE INTO civicrm_financial_account (id, name, contact_id, financial_account_type_id, description, account_type_code, accounting_code, is_active, is_default) -VALUES (@financialAccountId, 'Banking Fees', @domainContactId, @opexp, 'Payment processor fees and manually recorded banking fees', 'EXP', '5200', 1, 1); - -SELECT @financialAccountId := id FROM civicrm_financial_account WHERE is_default = 1 and financial_account_type_id = @opexp; - - -INSERT INTO civicrm_entity_financial_account(entity_table, entity_id, account_relationship, financial_account_id) -SELECT 'civicrm_financial_type', cft.id, @option_value_rel_id_exp, @financialAccountId -FROM civicrm_financial_type cft -LEFT JOIN civicrm_entity_financial_account ceft -ON ceft.entity_id = cft.id AND ceft.account_relationship = @option_value_rel_id_exp AND ceft.entity_table = 'civicrm_financial_type' -WHERE ceft.entity_id IS NULL; diff --git a/CRM/Upgrade/Incremental/sql/4.3.5.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.5.mysql.tpl deleted file mode 100644 index bac8a19058..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.5.mysql.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{* file to handle db changes in 4.3.5 during upgrade*} -{include file='../CRM/Upgrade/4.3.5.msg_template/civicrm_msg_template.tpl'} --- CRM-12799 -DROP TABLE IF EXISTS civicrm_payment; - --- CRM-12929 - -INSERT INTO civicrm_setting -(domain_id, contact_id, is_domain, group_name, name, value) -VALUES -({$domainID}, NULL, 1, 'CiviCRM Preferences', 'allowPermDeleteFinancial', '{serialize}0{/serialize}'); diff --git a/CRM/Upgrade/Incremental/sql/4.3.6.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.6.mysql.tpl deleted file mode 100644 index e693e84752..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.6.mysql.tpl +++ /dev/null @@ -1,96 +0,0 @@ -{* file to handle db changes in 4.3.6 during upgrade *} --- CRM-13060 -UPDATE civicrm_price_set_entity cpse -LEFT JOIN civicrm_price_set cps ON cps.id = cpse.price_set_id -LEFT JOIN civicrm_price_field cpf ON cps.id = cpf.price_set_id -LEFT JOIN civicrm_price_field_value cpfv ON cpf.id = cpfv.price_field_id -LEFT JOIN civicrm_event ce ON cpse.entity_id = ce.id AND cpse.entity_table = 'civicrm_event' -LEFT JOIN civicrm_contribution_page ccg ON cpse.entity_id = ccg.id AND cpse.entity_table = 'civicrm_contribution_page' -SET cpfv.financial_type_id = CASE - WHEN ce.id IS NOT NULL - THEN ce.financial_type_id - WHEN ccg.id IS NOT NULL - THEN ccg.financial_type_id -END, -cps.financial_type_id = CASE - WHEN ce.id IS NOT NULL - THEN ce.financial_type_id - WHEN ccg.id IS NOT NULL - THEN ccg.financial_type_id -END -WHERE cps.is_quick_config = 1; - --- CRM-12844 --- DELETE bad data -DELETE cli FROM `civicrm_contribution` cc -LEFT JOIN civicrm_line_item cli ON cli.entity_id = cc.id -LEFT JOIN civicrm_financial_item cfi ON cfi.entity_id = cli.id AND cfi.entity_table = 'civicrm_line_item' -LEFT JOIN civicrm_price_field cpf ON cpf.id = cli.price_field_id -LEFT JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id -WHERE cc.contribution_recur_id IS NOT NULL -AND cli.entity_table = 'civicrm_contribution' AND cfi.id IS NULL -AND cps.is_quick_config = 1; - --- Set from_financial_account_id to null -UPDATE `civicrm_contribution` cc -LEFT JOIN civicrm_entity_financial_trxn ceft ON ceft.entity_id = cc.id -LEFT JOIN civicrm_financial_trxn cft ON cft.id = ceft.financial_trxn_id -LEFT JOIN civicrm_entity_financial_trxn ceft1 ON ceft1.financial_trxn_id = ceft.financial_trxn_id -LEFT JOIN civicrm_financial_item cfi ON cfi.id = ceft1.entity_id -LEFT JOIN civicrm_entity_financial_account cefa ON cefa.entity_id = cft.payment_processor_id -SET cft.from_financial_account_id = NULL -WHERE ceft.entity_table = 'civicrm_contribution' AND cc.contribution_recur_id IS NOT NULL -AND ceft1.entity_table = 'civicrm_financial_item' AND cft.id IS NOT NULL AND cft.payment_instrument_id = 1 AND cfi.entity_table = 'civicrm_line_item' AND cft.from_financial_account_id IS NOT NULL -AND cefa.entity_table = 'civicrm_payment_processor' AND cefa.financial_account_id = cft.to_financial_account_id; - --- CRM-13096 -DROP TABLE IF EXISTS civicrm_official_receipt; - --- CRM-13231 -SELECT @option_group_id_arel := max(id) from civicrm_option_group where name = 'account_relationship'; -SELECT @option_group_id_fat := max(id) from civicrm_option_group where name = 'financial_account_type'; -SELECT @opexp := value FROM civicrm_option_value WHERE name = 'Expenses' and option_group_id = @option_group_id_fat; -SELECT @financialAccountId := id FROM civicrm_financial_account WHERE is_default = 1 and financial_account_type_id = @opexp; -SELECT @domainContactId := contact_id from civicrm_domain where id = {$domainID}; - -SELECT @option_value_rel_id_exp := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Expense Account is'; - -INSERT IGNORE INTO civicrm_financial_account (id, name, contact_id, financial_account_type_id, description, account_type_code, accounting_code, is_active, is_default) -VALUES (@financialAccountId, 'Banking Fees', @domainContactId, @opexp, 'Payment processor fees and manually recorded banking fees', 'EXP', '5200', 1, 1); - -SELECT @financialAccountId := id FROM civicrm_financial_account WHERE is_default = 1 and financial_account_type_id = @opexp; - -INSERT INTO civicrm_entity_financial_account(entity_table, entity_id, account_relationship, financial_account_id) -SELECT 'civicrm_financial_type', cft.id, @option_value_rel_id_exp, @financialAccountId -FROM civicrm_financial_type cft -LEFT JOIN civicrm_entity_financial_account ceft -ON ceft.entity_id = cft.id AND ceft.account_relationship = @option_value_rel_id_exp AND ceft.entity_table = 'civicrm_financial_type' -WHERE ceft.entity_id IS NULL; - -UPDATE civicrm_financial_trxn cft -INNER JOIN civicrm_entity_financial_trxn ceft ON ceft.financial_trxn_id = cft .id -INNER JOIN civicrm_entity_financial_trxn ceft1 ON ceft1.financial_trxn_id = cft .id -INNER JOIN civicrm_financial_item cfi ON cfi.id = ceft1.entity_id -INNER JOIN civicrm_contribution cc ON cc.id = ceft.entity_id -INNER JOIN civicrm_entity_financial_account cefa ON cefa.entity_id = cc.financial_type_id -SET cft.to_financial_account_id = cefa.financial_account_id -WHERE ceft.entity_table = 'civicrm_contribution' AND ceft1.entity_table = 'civicrm_financial_item' AND cfi.entity_table = 'civicrm_financial_trxn' AND cft.to_financial_account_id IS NULL AND cefa.entity_table = 'civicrm_financial_type' AND cefa.account_relationship = @option_value_rel_id_exp; - --- Add COGS account relationship -SELECT @option_value_rel_id_cg := value FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Cost of Sales Account is'; -SELECT @opCost := value FROM civicrm_option_value WHERE name = 'Cost of Sales' and option_group_id = @option_group_id_fat; -SET @financialAccountId := ''; -SELECT @financialAccountId := id FROM civicrm_financial_account WHERE is_default = 1 and financial_account_type_id = @opCost; - --- CRM-13231 -INSERT IGNORE INTO civicrm_financial_account (id, name, contact_id, financial_account_type_id, description, account_type_code, accounting_code, is_active, is_default) -VALUES (@financialAccountId, 'Premiums', @domainContactId, @opCost, 'Account to record cost of premiums provided to payors', 'COGS', '5100', 1, 1); - -SELECT @financialAccountId := id FROM civicrm_financial_account WHERE is_default = 1 and financial_account_type_id = @opCost; - -INSERT INTO civicrm_entity_financial_account(entity_table, entity_id, account_relationship, financial_account_id) -SELECT 'civicrm_financial_type', cft.id, @option_value_rel_id_cg, @financialAccountId -FROM civicrm_financial_type cft -LEFT JOIN civicrm_entity_financial_account ceft -ON ceft.entity_id = cft.id AND ceft.account_relationship = @option_value_rel_id_cg AND ceft.entity_table = 'civicrm_financial_type' -WHERE ceft.entity_id IS NULL; diff --git a/CRM/Upgrade/Incremental/sql/4.3.7.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.7.mysql.tpl deleted file mode 100644 index 4892128d49..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.7.mysql.tpl +++ /dev/null @@ -1 +0,0 @@ -{* file to handle db changes in 4.3.7 during upgrade *} diff --git a/CRM/Upgrade/Incremental/sql/4.3.8.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.8.mysql.tpl deleted file mode 100644 index c37ba06ff7..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.8.mysql.tpl +++ /dev/null @@ -1 +0,0 @@ -{* file to handle db changes in 4.3.8 during upgrade *} diff --git a/CRM/Upgrade/Incremental/sql/4.3.9.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.9.mysql.tpl deleted file mode 100644 index 39dec10fb2..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.9.mysql.tpl +++ /dev/null @@ -1 +0,0 @@ -{* file to handle db changes in 4.3.9 during upgrade *} diff --git a/CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl deleted file mode 100644 index 5fe6f42fc2..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.alpha1.mysql.tpl +++ /dev/null @@ -1,876 +0,0 @@ -{include file='../CRM/Upgrade/4.3.alpha1.msg_template/civicrm_msg_template.tpl'} - --- CRM-10999 -ALTER TABLE `civicrm_premiums` -ADD COLUMN `premiums_nothankyou_position` int(10) unsigned DEFAULT '1'; - --- CRM-11514 if contribution type name is null, assign it a name -UPDATE civicrm_contribution_type -SET name = CONCAT('Unknown_', id) -WHERE name IS NULL OR TRIM(name) = ''; - --- CRM-8507 -ALTER TABLE civicrm_custom_field - ADD UNIQUE INDEX `UI_name_custom_group_id` (`name`, `custom_group_id`); - ---CRM-10473 Added Missing Provinces of Ningxia Autonomous Region of China -INSERT INTO `civicrm_state_province`(`country_id`, `abbreviation`, `name`) VALUES -(1045, 'YN', 'Yinchuan'), -(1045, 'SZ', 'Shizuishan'), -(1045, 'WZ', 'Wuzhong'), -(1045, 'GY', 'Guyuan'), -(1045, 'ZW', 'Zhongwei'); - --- CRM-10553 -ALTER TABLE civicrm_contact - ADD COLUMN `created_date` timestamp NULL DEFAULT NULL - COMMENT 'When was the contact was created.'; -ALTER TABLE civicrm_contact - ADD COLUMN `modified_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP - COMMENT 'When was the contact (or closely related entity) was created or modified or deleted.'; - --- CRM-10296 -DELETE FROM civicrm_job WHERE `api_action` = 'process_membership_reminder_date'; -ALTER TABLE civicrm_membership DROP COLUMN reminder_date; -ALTER TABLE civicrm_membership_log DROP COLUMN renewal_reminder_date; -ALTER TABLE civicrm_membership_type - DROP COLUMN renewal_reminder_day, - DROP FOREIGN KEY FK_civicrm_membership_type_renewal_msg_id, - DROP INDEX FK_civicrm_membership_type_renewal_msg_id, - DROP COLUMN renewal_msg_id, - DROP COLUMN autorenewal_msg_id; - --- CRM-10738 -ALTER TABLE civicrm_msg_template - CHANGE msg_text msg_text LONGTEXT NULL COMMENT 'Text formatted message', - CHANGE msg_html msg_html LONGTEXT NULL COMMENT 'HTML formatted message'; - --- CRM-10860 -ALTER TABLE civicrm_contribution_page ADD COLUMN is_recur_installments tinyint(4) DEFAULT '0'; -UPDATE civicrm_contribution_page SET is_recur_installments='1'; - --- CRM-10863 -SELECT @country_id := id from civicrm_country where name = 'Luxembourg' AND iso_code = 'LU'; -INSERT IGNORE INTO `civicrm_state_province`(`country_id`, `abbreviation`, `name`) VALUES -(@country_id, 'L', 'Luxembourg'); - --- CRM-10899 and CRM-10999 -{if $multilingual} - {foreach from=$locales item=locale} - UPDATE civicrm_option_group SET title_{$locale} = '{ts escape="sql"}Currencies Enabled{/ts}' WHERE name = "currencies_enabled"; - ALTER TABLE `civicrm_premiums` - ADD COLUMN premiums_nothankyou_label_{$locale} varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)'; - {/foreach} -{else} - UPDATE civicrm_option_group SET title = '{ts escape="sql"}Currencies Enabled{/ts}' WHERE name = "currencies_enabled"; -{/if} - --- CRM-11047 -ALTER TABLE civicrm_job DROP COLUMN api_prefix; - --- CRM-11068, CRM-10678, CRM-11759 -ALTER TABLE civicrm_group - ADD refresh_date datetime default NULL COMMENT 'Date and time when we need to refresh the cache next.' AFTER `cache_date`, - ADD COLUMN `created_id` INT(10) unsigned DEFAULT NULL COMMENT 'FK to contact table, creator of the group.'; - --- CRM-11759 -ALTER TABLE civicrm_group - ADD CONSTRAINT `FK_civicrm_group_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE SET NULL; - -INSERT INTO `civicrm_job` - ( domain_id, run_frequency, last_run, name, description, api_entity, api_action, parameters, is_active ) -VALUES - ( {$domainID}, 'Always' , NULL, '{ts escape="sql" skip="true"}Rebuild Smart Group Cache{/ts}', '{ts escape="sql" skip="true"}Rebuilds the smart group cache.{/ts}', 'job', 'group_rebuild', '{ts escape="sql" skip="true"}limit=Number optional-Limit the number of smart groups rebuild{/ts}', 0), - ( {$domainID}, 'Daily' , NULL, '{ts escape="sql" skip="true"}Validate Email Address from Mailings.{/ts}', '{ts escape="sql" skip="true"}Updates the reset_date on an email address to indicate that there was a valid delivery to this email address.{/ts}', 'mailing', 'update_email_resetdate', '{ts escape="sql" skip="true"}minDays, maxDays=Consider mailings that have completed between minDays and maxDays{/ts}', 0); - --- CRM-11117 -INSERT IGNORE INTO `civicrm_setting` (`group_name`, `name`, `value`, `domain_id`, `is_domain`) VALUES ('CiviCRM Preferences', 'activity_assignee_notification_ics', 's:1:"0";', {$domainID}, '1'); - --- CRM-10885 -ALTER TABLE civicrm_dedupe_rule_group - ADD used enum('Unsupervised','Supervised','General') COLLATE utf8_unicode_ci NOT NULL COMMENT 'Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)' AFTER threshold; - -UPDATE civicrm_dedupe_rule_group - SET used = 'General' WHERE is_default = 0; - -UPDATE civicrm_dedupe_rule_group - SET used = CASE level - WHEN 'Fuzzy' THEN 'Supervised' - WHEN 'Strict' THEN 'Unsupervised' - END -WHERE is_default = 1; - -UPDATE civicrm_dedupe_rule_group - SET name = CONCAT_WS('', `contact_type`, `used`) -WHERE is_default = 1 OR is_reserved = 1; - -UPDATE civicrm_dedupe_rule_group - SET title = 'Name and Email' -WHERE contact_type IN ('Organization', 'Household') AND used IN ('Unsupervised', 'Supervised'); - -UPDATE civicrm_dedupe_rule_group - SET title = CASE used - WHEN 'Supervised' THEN 'Name and Email (reserved)' - WHEN 'Unsupervised' THEN 'Email (reserved)' - WHEN 'General' THEN 'Name and Address (reserved)' - END -WHERE contact_type = 'Individual' AND is_reserved = 1; - -ALTER TABLE civicrm_dedupe_rule_group DROP COLUMN level; - --- CRM-10771 -ALTER TABLE civicrm_uf_field - ADD `is_multi_summary` tinyint(4) DEFAULT '0' COMMENT 'Include in multi-record listing?'; - --- CRM-1115 --- note that country names are not translated in the DB -SELECT @region_id := max(id) from civicrm_worldregion where name = "Europe and Central Asia"; -INSERT IGNORE INTO civicrm_country (name,iso_code,region_id,is_province_abbreviated) VALUES("Kosovo", "XK", @region_id, 0); - -UPDATE civicrm_country SET name = 'Libya' WHERE name LIKE 'Libyan%'; -UPDATE civicrm_country SET name = 'Congo, Republic of the' WHERE name = 'Congo'; - --- CRM-10621 Add component report links to reports menu for upgrade -SELECT @reportlastID := MAX(id) FROM civicrm_navigation where name = 'Reports' AND domain_id = {$domainID}; -SELECT @max_weight := MAX(ROUND(weight)) from civicrm_navigation WHERE parent_id = @reportlastID; - -INSERT INTO civicrm_navigation - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/report/list&compid=99&reset=1', '{ts escape="sql" skip="true"}Contact Reports{/ts}', 'Contact Reports', 'administer CiviCRM', '', @reportlastID, '1', 0, (SELECT @max_weight := @max_weight+1) ); -INSERT INTO civicrm_navigation - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/report/list&compid=2&reset=1', '{ts escape="sql" skip="true"}Contribution Reports{/ts}', 'Contribution Reports', 'access CiviContribute', '', @reportlastID, '1', 0, (SELECT @max_weight := @max_weight+1) ); -INSERT INTO civicrm_navigation - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/report/list&compid=6&reset=1', '{ts escape="sql" skip="true"}Pledge Reports{/ts}', 'Pledge Reports', 'access CiviPledge', '', @reportlastID, '1', 0, (SELECT @max_weight := @max_weight+1) ); -INSERT INTO civicrm_navigation - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/report/list&compid=1&reset=1', '{ts escape="sql" skip="true"}Event Reports{/ts}', 'Event Reports', 'access CiviEvent', '', @reportlastID, '1', 0, (SELECT @max_weight := @max_weight+1)); -INSERT INTO civicrm_navigation - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/report/list&compid=4&reset=1', '{ts escape="sql" skip="true"}Mailing Reports{/ts}', 'Mailing Reports', 'access CiviMail', '', @reportlastID, '1', 0, (SELECT @max_weight := @max_weight+1)); -INSERT INTO civicrm_navigation - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/report/list&compid=3&reset=1', '{ts escape="sql" skip="true"}Membership Reports{/ts}', 'Membership Reports', 'access CiviMember', '', @reportlastID, '1', 0, (SELECT @max_weight := @max_weight+1)); -INSERT INTO civicrm_navigation - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/report/list&compid=9&reset=1', '{ts escape="sql" skip="true"}Campaign Reports{/ts}', 'Campaign Reports', 'interview campaign contacts,release campaign contacts,reserve campaign contacts,manage campaign,administer CiviCampaign,gotv campaign contacts', 'OR', @reportlastID, '1', 0, (SELECT @max_weight := @max_weight+1)); -INSERT INTO civicrm_navigation - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/report/list&compid=7&reset=1', '{ts escape="sql" skip="true"}Case Reports{/ts}', 'Case Reports', 'access my cases and activities,access all cases and activities,administer CiviCase', 'OR', @reportlastID, '1', 0, (SELECT @max_weight := @max_weight+1) ); -INSERT INTO civicrm_navigation - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/report/list&compid=5&reset=1', '{ts escape="sql" skip="true"}Grant Reports{/ts}', 'Grant Reports', 'access CiviGrant', '', @reportlastID, '1', 0, (SELECT @max_weight := @max_weight+1) ); - --- CRM-11148 Multiple terms membership signup and renewal via price set -ALTER TABLE `civicrm_price_field_value` ADD COLUMN `membership_num_terms` INT(10) NULL DEFAULT NULL COMMENT 'Maximum number of related memberships.' AFTER `membership_type_id`; - --- CRM-11070 -SELECT @option_group_id_tuf := max(id) from civicrm_option_group where name = 'tag_used_for'; -SELECT @weight := MAX(weight) FROM civicrm_option_value WHERE option_group_id = @option_group_id_tuf; - -INSERT INTO -`civicrm_option_value` (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`) -VALUES -(@option_group_id_tuf, {localize}'Attachments'{/localize}, 'civicrm_file', 'Attachments', NULL, 0, 0, @weight = @weight + 1); - -ALTER TABLE civicrm_extension MODIFY COLUMN type ENUM( 'payment', 'search', 'report', 'module','sms') CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ; - --- CRM-9914 -SELECT @option_group_id_sms_provider_name := max(id) from civicrm_option_group where name = 'sms_provider_name'; -DELETE FROM civicrm_option_value WHERE option_group_id = @option_group_id_sms_provider_name AND name = 'Clickatell'; - --- CRM-11292 -ALTER TABLE `civicrm_phone` -ADD `phone_numeric` varchar(32) -COMMENT 'Phone number stripped of all whitespace, letters, and punctuation.' -AFTER `phone_ext`, -ADD INDEX phone_numeric_index(`phone_numeric`); - - --- civiaccounts upgrade - --- ADD fields w.r.t 10.6 mwb -ALTER TABLE `civicrm_financial_account` -CHANGE `account_type_id` financial_account_type_id int(10) unsigned NOT NULL DEFAULT '3' COMMENT 'Version identifier of financial_type', -ADD `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Financial Type Description.', -ADD `parent_id` int(10) unsigned DEFAULT NULL COMMENT 'Parent ID in account hierarchy', -ADD `is_header_account` tinyint(4) DEFAULT NULL COMMENT 'Is this a header account which does not allow transactions to be posted against it directly, but only to its sub-accounts?', -ADD `accounting_code` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Optional value for mapping monies owed and received to accounting system codes.', -ADD `account_type_code` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Optional value for mapping account types to accounting system account categories (QuickBooks Account Type Codes for example).', -ADD `is_deductible` tinyint(4) DEFAULT '1' COMMENT 'Is this account tax-deductible?', -ADD `is_tax` tinyint(4) DEFAULT '0' COMMENT 'Is this account for taxes?', -ADD `tax_rate` decimal(9,8) DEFAULT '0.00' COMMENT 'The percentage of the total_amount that is due for this tax.', -ADD `is_reserved` tinyint(4) DEFAULT NULL COMMENT 'Is this a predefined system object?', -ADD `is_active` tinyint(4) DEFAULT NULL COMMENT 'Is this property active?', -ADD `is_default` tinyint(4) DEFAULT NULL COMMENT 'Is this account the default one (or default tax one) for its financial_account_type?', -ADD CONSTRAINT `UI_name` UNIQUE INDEX (`name`), -ADD CONSTRAINT `FK_civicrm_financial_account_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `civicrm_financial_account`(id); - --- CRM-8425 --- Rename table civicrm_contribution_type to civicrm_financial_type -RENAME TABLE `civicrm_contribution_type` TO `civicrm_financial_type`; - -ALTER TABLE `civicrm_financial_type` -CHANGE `name` `name` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Financial Type Name.', -ADD CONSTRAINT `UI_id` UNIQUE INDEX(id), -DROP INDEX UI_name; - -CREATE TABLE IF NOT EXISTS `civicrm_entity_financial_account` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', - `entity_table` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Links to an entity_table like civicrm_financial_type', - `entity_id` int(10) unsigned NOT NULL COMMENT 'Links to an id in the entity_table, such as vid in civicrm_financial_type', - `account_relationship` int(10) unsigned NOT NULL COMMENT 'FK to a new civicrm_option_value (account_relationship)', - `financial_account_id` int(10) unsigned NOT NULL COMMENT 'FK to the financial_account_id', - PRIMARY KEY (`id`), -KEY `FK_civicrm_entity_financial_account_financial_account_id` (`financial_account_id`) -)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - --- Constraints for table `civicrm_entity_financial_account` - ALTER TABLE `civicrm_entity_financial_account` - ADD CONSTRAINT `FK_civicrm_entity_financial_account_financial_account_id` FOREIGN KEY (`financial_account_id`) REFERENCES `civicrm_financial_account` (`id`); - --- CRM-9730 Table structure for table `civicrm_financial_item` --- - -CREATE TABLE IF NOT EXISTS `civicrm_financial_item` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Date and time the item was created', - `transaction_date` datetime NOT NULL COMMENT 'Date and time of the source transaction', - `contact_id` int(10) unsigned NOT NULL COMMENT 'FK to Contact ID of contact the item is from', - `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Human readable description of this item, to ease display without lookup of source item.', - `amount` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT 'Total amount of this item', - `currency` varchar(3) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Currency for the amount', - `financial_account_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to civicrm_financial_account', - `status_id` int(10) unsigned DEFAULT NULL COMMENT 'Payment status: test, paid, part_paid, unpaid (if empty assume unpaid)', - `entity_table` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The table providing the source of this item such as civicrm_line_item', - `entity_id` int(10) unsigned DEFAULT NULL COMMENT 'The specific source item that is responsible for the creation of this financial_item', - PRIMARY KEY (`id`), - UNIQUE KEY `UI_id` (`id`), - KEY `IX_created_date` (`created_date`), - KEY `IX_transaction_date` (`transaction_date`), - KEY `IX_entity` (`entity_table`,`entity_id`), - KEY `FK_civicrm_financial_item_contact_id` (`contact_id`), - KEY `FK_civicrm_financial_item_financial_account_id` (`financial_account_id`) -)ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - -ALTER TABLE `civicrm_batch` -ADD `payment_instrument_id` int(10) unsigned DEFAULT NULL COMMENT 'fk to Payment Instrument options in civicrm_option_values', -ADD `exported_date` datetime DEFAULT NULL; - -ALTER TABLE `civicrm_financial_item` - ADD CONSTRAINT `FK_civicrm_financial_item_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`), - ADD CONSTRAINT `FK_civicrm_financial_item_financial_account_id` FOREIGN KEY (`financial_account_id`) REFERENCES `civicrm_financial_account` (`id`); - -ALTER TABLE `civicrm_entity_financial_trxn` -DROP currency; - --- CRM-12312 -UPDATE civicrm_event SET contribution_type_id = NULL WHERE contribution_type_id = 0; - --- CRM-9189 and CRM-8425 change fk's to financial_account.id in our branch that will need to be changed to an fk to financial_type.id - -ALTER TABLE `civicrm_pledge` -DROP FOREIGN KEY FK_civicrm_pledge_contribution_type_id, -DROP INDEX FK_civicrm_pledge_contribution_type_id; - -ALTER TABLE `civicrm_pledge` -CHANGE `contribution_type_id` `financial_type_id` int unsigned COMMENT 'FK to Financial Type'; - -ALTER TABLE `civicrm_pledge` -ADD CONSTRAINT FK_civicrm_pledge_financial_type_id FOREIGN KEY (`financial_type_id`) REFERENCES civicrm_financial_type (id); - -ALTER TABLE `civicrm_membership_type` -DROP FOREIGN KEY FK_civicrm_membership_type_contribution_type_id, -DROP INDEX FK_civicrm_membership_type_contribution_type_id; - -ALTER TABLE `civicrm_membership_type` -CHANGE `contribution_type_id` `financial_type_id` int unsigned NOT NULL COMMENT 'If membership is paid by a contribution - what financial type should be used. FK to civicrm_financial_type.id'; - -ALTER TABLE `civicrm_membership_type` -ADD CONSTRAINT FK_civicrm_membership_type_financial_type_id FOREIGN KEY (`financial_type_id`) REFERENCES civicrm_financial_type (id); - -ALTER TABLE `civicrm_price_set` -DROP FOREIGN KEY FK_civicrm_price_set_contribution_type_id, -DROP INDEX FK_civicrm_price_set_contribution_type_id; - -ALTER TABLE `civicrm_price_set` -CHANGE `contribution_type_id` `financial_type_id` int unsigned COMMENT 'If membership is paid by a contribution - what financial type should be used. FK to civicrm_financial_type.id'; - -ALTER TABLE `civicrm_price_set` -ADD CONSTRAINT FK_civicrm_price_set_financial_type_id FOREIGN KEY (`financial_type_id`) REFERENCES civicrm_financial_type (id); - -ALTER TABLE `civicrm_event` -CHANGE `contribution_type_id` `financial_type_id` int unsigned COMMENT 'Financial type assigned to paid event registrations for this event. Required if is_monetary is true.'; - -ALTER TABLE `civicrm_contribution` -DROP FOREIGN KEY FK_civicrm_contribution_contribution_type_id, -DROP INDEX FK_civicrm_contribution_contribution_type_id; - -ALTER TABLE `civicrm_contribution` -CHANGE `contribution_type_id` `financial_type_id` int unsigned COMMENT 'FK to Financial Type for (total_amount - non_deductible_amount).'; - -ALTER TABLE `civicrm_contribution` -ADD CONSTRAINT FK_civicrm_contribution_financial_type_id FOREIGN KEY (`financial_type_id`) REFERENCES civicrm_financial_type (id); - -ALTER TABLE `civicrm_contribution_page` -DROP FOREIGN KEY FK_civicrm_contribution_page_contribution_type_id, -DROP INDEX FK_civicrm_contribution_page_contribution_type_id; - -ALTER TABLE `civicrm_contribution_page` -CHANGE `contribution_type_id` `financial_type_id` int unsigned DEFAULT NULL COMMENT 'default financial type assigned to contributions submitted via this page, e.g. Contribution, Campaign Contribution', -ADD `is_partial_payment` tinyint(4) DEFAULT '0' COMMENT 'is partial payment enabled for this event', -ADD `min_initial_amount` decimal(20,2) DEFAULT NULL COMMENT 'Minimum initial amount for partial payment'; - -{if $multilingual} - {foreach from=$locales item=loc} - ALTER TABLE `civicrm_contribution_page` - ADD `initial_amount_label_{$loc}` varchar(255) COLLATE utf8_unicode_ci COMMENT 'Initial amount label for partial payment', - ADD `initial_amount_help_text_{$loc}` text COLLATE utf8_unicode_ci COMMENT 'Initial amount help text for partial payment'; - {/foreach} -{else} - ALTER TABLE `civicrm_contribution_page` - ADD `initial_amount_label` varchar(255) COLLATE utf8_unicode_ci COMMENT 'Initial amount label for partial payment', - ADD `initial_amount_help_text` text COLLATE utf8_unicode_ci COMMENT 'Initial amount help text for partial payment'; -{/if} - -ALTER TABLE `civicrm_contribution_page` -ADD CONSTRAINT FK_civicrm_contribution_page_financial_type_id FOREIGN KEY (`financial_type_id`) REFERENCES civicrm_financial_type (id); - -ALTER TABLE `civicrm_contribution_recur` -CHANGE `contribution_type_id` `financial_type_id` int unsigned COMMENT 'FK to Financial Type'; - -ALTER TABLE `civicrm_contribution_recur` -ADD CONSTRAINT FK_civicrm_contribution_recur_financial_type_id FOREIGN KEY (`financial_type_id`) REFERENCES civicrm_financial_type (id); - --- CRM-9083 -ALTER TABLE `civicrm_financial_trxn` CHANGE `to_account_id` `to_financial_account_id` int unsigned COMMENT 'FK to financial_financial_account table.', -CHANGE `from_account_id` `from_financial_account_id` int unsigned COMMENT 'FK to financial_account table.', -ADD `status_id` int(10) unsigned DEFAULT NULL, -CHANGE `trxn_id` trxn_id varchar(255) COMMENT 'unique processor transaction id, bank id + trans id,... depending on payment_method', -CHANGE `trxn_date` trxn_date datetime DEFAULT NULL, -ADD `payment_instrument_id` int unsigned DEFAULT NULL COMMENT 'FK to payment_instrument option group values', -ADD `check_number` VARCHAR( 255 ) NULL DEFAULT NULL, -ADD INDEX `UI_ftrxn_check_number` (`check_number`), -ADD INDEX `UI_ftrxn_payment_instrument_id` (`payment_instrument_id`); - -ALTER TABLE `civicrm_financial_trxn` -ADD CONSTRAINT FK_civicrm_financial_trxn_to_financial_account_id FOREIGN KEY (`to_financial_account_id`) REFERENCES civicrm_financial_account (id), -ADD CONSTRAINT FK_civicrm_financial_trxn_from_financial_account_id FOREIGN KEY (`from_financial_account_id`) REFERENCES civicrm_financial_account (id); - -ALTER TABLE `civicrm_financial_trxn` ADD `payment_processor_id` int unsigned COMMENT 'Payment Processor for this contribution Page'; - --- Fill in the payment_processor_id based on a lookup using the payment_processor field -UPDATE `civicrm_payment_processor` cppt, `civicrm_financial_trxn` cft -SET cft.`payment_processor_id` = cppt.`id` -WHERE cft.`payment_processor` = cppt.`payment_processor_type` and `is_test` = 0; - --- remove payment_processor field -ALTER TABLE `civicrm_financial_trxn` DROP `payment_processor`; - -ALTER TABLE `civicrm_financial_trxn` - ADD CONSTRAINT `FK_civicrm_financial_trxn_payment_processor_id` FOREIGN KEY (`payment_processor_id`) REFERENCES `civicrm_payment_processor` (`id`) ON DELETE SET NULL; - --- Drop index for civicrm_financial_trxn.trxn_id and set default to null -ALTER TABLE `civicrm_financial_trxn` CHANGE `trxn_id` `trxn_id` varchar( 255 ) DEFAULT NULL ; -ALTER TABLE `civicrm_financial_trxn` DROP INDEX UI_ft_trxn_id; - --- remove trxn_type field -ALTER TABLE `civicrm_financial_trxn` DROP `trxn_type`; - --- CRM-9731 - -ALTER TABLE `civicrm_payment_processor` ADD `payment_processor_type_id` int(10) unsigned NULL AFTER `description`, -ADD CONSTRAINT `FK_civicrm_payment_processor_payment_processor_type_id` FOREIGN KEY (`payment_processor_type_id`) REFERENCES `civicrm_payment_processor_type` (`id`); - -UPDATE `civicrm_payment_processor` , `civicrm_payment_processor_type` -SET payment_processor_type_id = `civicrm_payment_processor_type`.id -WHERE payment_processor_type = `civicrm_payment_processor_type`.name; - -ALTER TABLE `civicrm_payment_processor` DROP `payment_processor_type`; - --- CRM-9730 -ALTER TABLE `civicrm_price_field_value` ADD `deductible_amount` DECIMAL( 20, 2 ) NOT NULL DEFAULT '0.00' COMMENT 'Tax-deductible portion of the amount'; - -ALTER TABLE `civicrm_line_item` ADD `deductible_amount` DECIMAL( 20, 2 ) NOT NULL DEFAULT '0.00' COMMENT 'Tax-deductible portion of the amount'; - -ALTER TABLE `civicrm_price_field_value` ADD -`financial_type_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to Financial Type.', - ADD CONSTRAINT `FK_civicrm_price_field_value_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`); - -ALTER TABLE `civicrm_line_item` ADD -`financial_type_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to Financial Type.', - ADD CONSTRAINT `FK_civicrm_line_item_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`); - -ALTER TABLE `civicrm_grant` ADD -`financial_type_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to Financial Type.', - ADD CONSTRAINT `FK_civicrm_grant_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`); - -ALTER TABLE `civicrm_product` ADD -`financial_type_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to Financial Type.', -ADD CONSTRAINT `FK_civicrm_product_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`); - -ALTER TABLE `civicrm_premiums_product` ADD -`financial_type_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to Financial Type.', -ADD CONSTRAINT `FK_civicrm_premiums_product_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`); - -ALTER TABLE `civicrm_contribution_product` ADD -`financial_type_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to Financial Type.', -ADD CONSTRAINT `FK_civicrm_contribution_product_financial_type_id` FOREIGN KEY (`financial_type_id`) REFERENCES `civicrm_financial_type` (`id`); - --- CRM-11122 -ALTER TABLE `civicrm_discount` -DROP FOREIGN KEY FK_civicrm_discount_option_group_id, -DROP INDEX FK_civicrm_discount_option_group_id; - -ALTER TABLE `civicrm_discount` CHANGE `option_group_id` `price_set_id` INT( 10 ) UNSIGNED NOT NULL COMMENT 'FK to civicrm_price_set'; - -ALTER TABLE `civicrm_discount` - ADD CONSTRAINT `FK_civicrm_discount_price_set_id` FOREIGN KEY (`price_set_id`) REFERENCES `civicrm_price_set` (`id`) ON DELETE CASCADE; - --- CRM-8425 - -UPDATE civicrm_navigation SET `label` = 'Financial Types', `name` = 'Financial Types', `url` = 'civicrm/admin/financial/financialType?reset=1' WHERE `name` = 'Contribution Types'; - --- CRM-9199 --- Insert menu item at Administer > CiviContribute, below the section break below Premiums (Thank-you Gifts), just below Financial Account. - -SELECT @parent_id := id from `civicrm_navigation` where name = 'CiviContribute' AND domain_id = {$domainID}; -SELECT @add_weight_id := weight from `civicrm_navigation` where `name` = 'Financial Types' and `parent_id` = @parent_id; - -UPDATE `civicrm_navigation` -SET `weight` = `weight`+1 -WHERE `parent_id` = @parent_id -AND `weight` > @add_weight_id; - -INSERT INTO `civicrm_navigation` - ( domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ( {$domainID}, 'civicrm/admin/financial/financialAccount&reset=1', '{ts escape="sql" skip="true"}Financial Account{/ts}', 'Financial Account', 'access CiviContribute,administer CiviCRM', 'AND', @parent_id, '1', NULL, @add_weight_id + 1 ); - --- CRM-10944 -SELECT @contributionlastID := max(id) from civicrm_navigation where name = 'Contributions' AND domain_id = {$domainID}; - -SELECT @pledgeWeight := weight from civicrm_navigation where name = 'Pledges' and parent_id = @contributionlastID; - -UPDATE `civicrm_navigation` -SET `weight` = `weight`+1 -WHERE `parent_id` = @contributionlastID -AND `weight` > @pledgeWeight; - -INSERT INTO civicrm_navigation - (domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight) -VALUES - ({$domainID}, NULL, '{ts escape="sql" skip="true"}Accounting Batches{/ts}', 'Accounting Batches', 'access CiviContribute', '', @contributionlastID, '1', 1, @pledgeWeight+1); -SET @financialTransactionID:=LAST_INSERT_ID(); - -INSERT INTO civicrm_navigation - (domain_id, url, label, name, permission, permission_operator, parent_id, is_active, has_separator, weight ) -VALUES - ({$domainID}, 'civicrm/financial/batch&reset=1&action=add', '{ts escape="sql" skip="true"}New Batch{/ts}', 'New Batch', 'access CiviContribute', 'AND', @financialTransactionID, '1', NULL, 1), - ({$domainID}, 'civicrm/financial/financialbatches?reset=1&batchStatus=1', '{ts escape="sql" skip="true"}Open Batches{/ts}', 'Open Batches', 'access CiviContribute', 'AND', @financialTransactionID, '1', NULL, 2), - ({$domainID}, 'civicrm/financial/financialbatches?reset=1&batchStatus=2', '{ts escape="sql" skip="true"}Closed Batches{/ts}', 'Closed Batches', 'access CiviContribute', 'AND', @financialTransactionID, '1', NULL, 3), - ({$domainID}, 'civicrm/financial/financialbatches?reset=1&batchStatus=5', '{ts escape="sql" skip="true"}Exported Batches{/ts}', 'Exported Batches', 'access CiviContribute', 'AND', @financialTransactionID, '1', NULL, 4); - --- Insert an entry for financial_account_type in civicrm_option_group and for the the following financial account types in civicrm_option_value as per CRM-8425 -INSERT INTO - `civicrm_option_group` (`name`, {localize field='title'}title{/localize}, `is_reserved`, `is_active`) -VALUES - ('financial_account_type', {localize}'{ts escape="sql"}Financial Account Type{/ts}'{/localize}, 1, 1), - ('account_relationship', {localize}'{ts escape="sql"}Account Relationship{/ts}'{/localize}, 1, 1), - ('financial_item_status', {localize}'{ts escape="sql"}Financial Item Status{/ts}'{/localize}, 1, 1), - ('batch_mode', {localize}'{ts escape="sql"}Batch Mode{/ts}'{/localize}, 1, 1); - -SELECT @option_group_id_fat := max(id) from civicrm_option_group where name = 'financial_account_type'; -SELECT @option_group_id_arel := max(id) from civicrm_option_group where name = 'account_relationship'; -SELECT @option_group_id_financial_item_status := max(id) from civicrm_option_group where name = 'financial_item_status'; - -INSERT INTO - `civicrm_option_value` (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, {localize field='description'}`description`{/localize}, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) -VALUES - (@option_group_id_fat, {localize}'{ts escape="sql"}Asset{/ts}'{/localize}, 1, 'Asset', NULL, 0, 0, 1, {localize}'Things you own'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_fat, {localize}'{ts escape="sql"}Liability{/ts}'{/localize}, 2, 'Liability', NULL, 0, 0, 2, {localize}'Things you own, like a grant still to be disbursed'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_fat, {localize}'{ts escape="sql"}Revenue{/ts}'{/localize}, 3, 'Revenue', NULL, 0, 1, 3, {localize}'Income from contributions and sales of tickets and memberships'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_fat, {localize}'{ts escape="sql"}Cost of Sales{/ts}'{/localize}, 4, 'Cost of Sales', NULL, 0, 0, 4, {localize}'Costs incurred to get revenue, e.g. premiums for donations, dinner for a fundraising dinner ticket'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_fat, {localize}'{ts escape="sql"}Expenses{/ts}'{/localize}, 5, 'Expenses', NULL, 0, 0, 5, {localize}'Things that are paid for that are consumable, e.g. grants disbursed'{/localize}, 0, 1, 1, 2, NULL), - --- Financial account relationship - (@option_group_id_arel, {localize}'{ts escape="sql"}Income Account is{/ts}'{/localize}, 1, 'Income Account is', NULL, 0, 1, 1, {localize}'Income Account is'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_arel, {localize}'{ts escape="sql"}Credit/Contra Account is{/ts}'{/localize}, 2, 'Credit/Contra Account is', NULL, 0, 0, 2, {localize}'Credit/Contra Account is'{/localize}, 0, 1, 0, 2, NULL), - (@option_group_id_arel, {localize}'{ts escape="sql"}Accounts Receivable Account is{/ts}'{/localize}, 3, 'Accounts Receivable Account is', NULL, 0, 0, 3, {localize}'Accounts Receivable Account is'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_arel, {localize}'{ts escape="sql"}Credit Liability Account is{/ts}'{/localize}, 4, 'Credit Liability Account is', NULL, 0, 0, 4, {localize}'Credit Liability Account is'{/localize}, 0, 1, 0, 2, NULL), - (@option_group_id_arel, {localize}'{ts escape="sql"}Expense Account is{/ts}'{/localize}, 5, 'Expense Account is', NULL, 0, 0, 5, {localize}'Expense Account is'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_arel, {localize}'{ts escape="sql"}Asset Account is{/ts}'{/localize}, 6, 'Asset Account is', NULL, 0, 0, 6, {localize}'Asset Account is'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_arel, {localize}'{ts escape="sql"}Cost of Sales Account is{/ts}'{/localize}, 7, 'Cost of Sales Account is', NULL, 0, 0, 7, {localize}'Cost of Sales Account is'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_arel, {localize}'{ts escape="sql"}Premiums Inventory Account is{/ts}'{/localize}, 8, 'Premiums Inventory Account is', NULL, 0, 0, 8, {localize}'Premiums Inventory Account is'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_arel, {localize}'{ts escape="sql"}Discounts Account is{/ts}'{/localize}, 9, 'Discounts Account is', NULL, 0, 0, 9, {localize}'Discounts Account is'{/localize}, 0, 1, 1, 2, NULL), - --- Financial Item Status - (@option_group_id_financial_item_status, {localize}'{ts escape="sql"}Paid{/ts}'{/localize}, 1, 'Paid', NULL, 0, 0, 1, {localize}'Paid'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_financial_item_status, {localize}'{ts escape="sql"}Partially paid{/ts}'{/localize}, 2, 'Partially paid', NULL, 0, 0, 2, {localize}'Partially paid'{/localize}, 0, 1, 1, 2, NULL), - (@option_group_id_financial_item_status, {localize}'{ts escape="sql"}Unpaid{/ts}'{/localize}, 3, 'Unpaid', NULL, 0, 0, 1, {localize}'Unpaid'{/localize}, 0, 1, 1, 2, NULL); - --- Data migration from civicrm_contibution_type to civicrm_financial_account, civicrm_financial_type, civicrm_entity_financial_account -SELECT @opval := value FROM civicrm_option_value WHERE name = 'Revenue' and option_group_id = @option_group_id_fat; -SELECT @domainContactId := contact_id from civicrm_domain where id = {$domainID}; - -INSERT INTO `civicrm_financial_account` - (`id`, `name`, `description`, `is_deductible`, `is_reserved`, `is_active`, `financial_account_type_id`, `contact_id`, accounting_code) - SELECT id, name, CONCAT('Default account for ', name), is_deductible, is_reserved, is_active, @opval, @domainContactId, accounting_code - FROM `civicrm_financial_type`; - --- CRM-9306 and CRM-11657 -UPDATE `civicrm_financial_account` SET `is_default` = 0, `account_type_code` = 'INC'; - -SELECT @option_value_rel_id := value FROM `civicrm_option_value` WHERE `option_group_id` = @option_group_id_arel AND `name` = 'Income Account is'; -SELECT @opexp := value FROM civicrm_option_value WHERE name = 'Expenses' and option_group_id = @option_group_id_fat; -SELECT @opAsset := value FROM civicrm_option_value WHERE name = 'Asset' and option_group_id = @option_group_id_fat; -SELECT @opLiability := value FROM civicrm_option_value WHERE name = 'Liability' and option_group_id = @option_group_id_fat; -SELECT @opCost := value FROM civicrm_option_value WHERE name = 'Cost of Sales' and option_group_id = @option_group_id_fat; - --- CRM-11522 drop accounting_code after coping its values into financial_account -ALTER TABLE civicrm_financial_type DROP accounting_code; - -INSERT INTO - `civicrm_financial_account` (`name`, `contact_id`, `financial_account_type_id`, `description`, `accounting_code`, `account_type_code`, `is_reserved`, `is_active`, `is_deductible`, `is_default`) -VALUES - ('Banking Fees' , @domainContactId, @opexp, 'Payment processor fees and manually recorded banking fees', '5200', 'EXP', 0, 1, 0, 0), - ('Deposit Bank Account' , @domainContactId, @opAsset, 'All manually recorded cash and cheques go to this account', '1100', 'BANK', 0, 1, 0, 1), - ('Accounts Receivable' , @domainContactId, @opAsset, 'Amounts to be received later (eg pay later event revenues)', '1200', 'AR', 0, 1, 0, 0), - ('Accounts Payable' , @domainContactId, @opLiability, 'Amounts to be paid out such as grants and refunds', '2200', 'AP', 0, 1, 0, 0), - ('Premiums' , @domainContactId, @opCost, 'Account to record cost of premiums provided to payors', '5100', 'COGS', 0, 1, 0, 0), - ('Premiums Inventory' , @domainContactId, @opAsset, 'Account representing value of premiums inventory', '1375', 'OCASSET', 0, 1, 0, 0), - ('Discounts' , @domainContactId, @opval, 'Contra-revenue account for amounts discounted from sales', '4900', 'INC', 0, 1, 0, 0), - ('Payment Processor Account', @domainContactId, @opAsset, 'Account to record payments into a payment processor merchant account', '1150', 'BANK', 0, 1, 0, 0); - --- CRM-10926 -SELECT @option_value_rel_id_exp := value FROM `civicrm_option_value` WHERE `option_group_id` = @option_group_id_arel AND `name` = 'Expense Account is'; -SELECT @option_value_rel_id_ar := value FROM `civicrm_option_value` WHERE `option_group_id` = @option_group_id_arel AND `name` = 'Accounts Receivable Account is'; -SELECT @option_value_rel_id_as := value FROM `civicrm_option_value` WHERE `option_group_id` = @option_group_id_arel AND `name` = 'Asset Account is'; - -SELECT @financial_account_id_bf := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Banking Fees'; -SELECT @financial_account_id_ap := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Accounts Receivable'; - -INSERT INTO `civicrm_entity_financial_account` - ( entity_table, entity_id, account_relationship, financial_account_id ) -SELECT 'civicrm_financial_type', ft.id, @option_value_rel_id, fa.id -FROM `civicrm_financial_type` as ft LEFT JOIN `civicrm_financial_account` as fa ON ft.id = fa.id; - --- Banking Fees -INSERT INTO `civicrm_entity_financial_account` - ( entity_table, entity_id, account_relationship, financial_account_id ) -SELECT 'civicrm_financial_type', ft.id, @option_value_rel_id_exp, @financial_account_id_bf -FROM `civicrm_financial_type` as ft; - --- Accounts Receivable -INSERT INTO `civicrm_entity_financial_account` - ( entity_table, entity_id, account_relationship, financial_account_id ) -SELECT 'civicrm_financial_type', ft.id, @option_value_rel_id_ar, @financial_account_id_ap -FROM `civicrm_financial_type` as ft; - --- CRM-11516 -SELECT @financial_account_id_ar := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Deposit Bank Account'; -SELECT @financial_account_id_pp := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Payment Processor Account'; - -INSERT INTO civicrm_entity_financial_account (entity_table, entity_id, account_relationship, financial_account_id) -SELECT 'civicrm_option_value', cov.id, @option_value_rel_id_as, @financial_account_id_ar FROM `civicrm_option_group` cog -LEFT JOIN civicrm_option_value cov ON cog.id = cov.option_group_id -WHERE cog.name = 'payment_instrument' AND cov.name NOT IN ('Credit Card', 'Debit Card'); - -INSERT INTO civicrm_entity_financial_account (entity_table, entity_id, account_relationship, financial_account_id) -SELECT 'civicrm_option_value', cov.id, @option_value_rel_id_as, @financial_account_id_pp FROM `civicrm_option_group` cog -LEFT JOIN civicrm_option_value cov ON cog.id = cov.option_group_id -WHERE cog.name = 'payment_instrument' AND cov.name IN ('Credit Card', 'Debit Card'); - - --- CRM-11515 -SELECT @financial_account_id_ppa := max(id) FROM `civicrm_financial_account` WHERE `name` = 'Payment Processor Account'; - -INSERT INTO civicrm_entity_financial_account (`entity_table`, `entity_id`, `account_relationship`, `financial_account_id`) -SELECT 'civicrm_payment_processor', id, @option_value_rel_id_as, @financial_account_id_ppa FROM `civicrm_payment_processor`; - --- CRM-9923 and CRM-11037 -SELECT @option_group_id_batch_status := max(id) from civicrm_option_group where name = 'batch_status'; - -SELECT @weight := MAX(ROUND(value)) FROM civicrm_option_value WHERE option_group_id = @option_group_id_batch_status; - -INSERT INTO - `civicrm_option_value` (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`) -VALUES - (@option_group_id_batch_status, {localize}'Data Entry'{/localize}, @weight + 1, 'Data Entry', NULL, 0, 0, @weight + 1), - (@option_group_id_batch_status, {localize}'Reopened'{/localize}, @weight + 2, 'Reopened', NULL, 0, 0, @weight + 2), - (@option_group_id_batch_status, {localize}'Exported'{/localize}, @weight + 3, 'Exported' , NULL, 0, 0, @weight + 3); - --- Insert Batch Modes. -SELECT @option_group_id_batch_modes := max(id) from civicrm_option_group where name = 'batch_mode'; - -INSERT INTO - `civicrm_option_value` (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`) -VALUES - (@option_group_id_batch_modes, {localize}'Manual Batch'{/localize}, 1, 'Manual Batch', NULL, 0, 0, 1), - (@option_group_id_batch_modes, {localize}'Automatic Batch'{/localize}, 2, 'Automatic Batch' , NULL, 0, 0, 2); - --- End of civiaccounts upgrade - --- CRM-10933 -ALTER TABLE `civicrm_report_instance` -ADD COLUMN `drilldown_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to instance ID drilldown to', -ADD CONSTRAINT `FK_civicrm_report_instance_drilldown_id` FOREIGN KEY (`drilldown_id`) REFERENCES `civicrm_report_instance` (`id`) ON DELETE SET NULL; - --- CRM-10012 -ALTER TABLE `civicrm_membership_type` -ADD COLUMN `max_related` INT(10) unsigned DEFAULT NULL COMMENT 'Maximum number of related memberships.' AFTER `relationship_direction`; -ALTER TABLE `civicrm_membership` -ADD COLUMN `max_related` INT(10) unsigned DEFAULT NULL COMMENT 'Maximum number of related memberships (membership_type override).' AFTER `owner_membership_id`; -ALTER TABLE `civicrm_membership_log` -ADD COLUMN `max_related` INT(10) unsigned DEFAULT NULL COMMENT 'Maximum number of related memberships.' AFTER `membership_type_id`; - --- CRM-11358 -DELETE FROM civicrm_dashboard_contact WHERE contact_id NOT IN (SELECT id FROM civicrm_contact); -INSERT INTO `civicrm_dashboard` -(`domain_id`, {localize field='label'}`label`{/localize}, `url`, `permission`, `permission_operator`, `column_no`, `is_minimized`, `is_active`, `weight`, `fullscreen_url`, `is_fullscreen`, `is_reserved`) -SELECT id, {localize}'{ts escape="sql"}CiviCRM News{/ts}'{/localize}, 'civicrm/dashlet/blog&reset=1&snippet=5', 'access CiviCRM', NULL, 0, 0, 1, 0, 'civicrm/dashlet/blog&reset=1&snippet=5&context=dashletFullscreen', 1, 1 -FROM `civicrm_domain`; - -INSERT INTO `civicrm_dashboard_contact` (dashboard_id, contact_id, column_no, is_active) -SELECT (SELECT MAX(id) FROM `civicrm_dashboard`), contact_id, 1, IF (SUM(is_active) > 0, 0, 1) -FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id; - --- CRM-11387 -ALTER TABLE `civicrm_event` - ADD `is_partial_payment` tinyint(4) DEFAULT '0' COMMENT 'is partial payment enabled for this event', - ADD `min_initial_amount` decimal(20,2) DEFAULT NULL COMMENT 'Minimum initial amount for partial payment'; - -{if $multilingual} - {foreach from=$locales item=loc} - ALTER TABLE `civicrm_event` - ADD `initial_amount_label_{$loc}` varchar(255) COLLATE utf8_unicode_ci COMMENT 'Initial amount label for partial payment', - ADD `initial_amount_help_text_{$loc}` text COLLATE utf8_unicode_ci COMMENT 'Initial amount help text for partial payment'; - {/foreach} -{else} - ALTER TABLE `civicrm_event` - ADD `initial_amount_label` varchar(255) COLLATE utf8_unicode_ci COMMENT 'Initial amount label for partial payment', - ADD `initial_amount_help_text` text COLLATE utf8_unicode_ci COMMENT 'Initial amount help text for partial payment'; -{/if} - --- CRM-11347 -UPDATE `civicrm_option_value` SET is_reserved = 0 -WHERE name = 'Urgent' AND option_group_id = (SELECT id FROM `civicrm_option_group` WHERE name = 'case_status'); - --- CRM-11400 -UPDATE `civicrm_state_province` SET name = 'Distrito Federal' WHERE name = 'Diatrito Federal'; - --- CRM-9379 and CRM-11539 -SELECT @option_group_id_act := MAX(id) FROM civicrm_option_group WHERE name = 'activity_type'; -SELECT @max_val := MAX(ROUND(op.value)) FROM civicrm_option_value op WHERE op.option_group_id = @option_group_id_act; -SELECT @max_wt := MAX(weight) FROM civicrm_option_value WHERE option_group_id = @option_group_id_act; -SELECT @CompId := MAX(id) FROM civicrm_component where name = 'CiviContribute'; - -INSERT INTO civicrm_option_value - (option_group_id, {localize field='label'}label{/localize}, value, name, weight, {localize field='description'}description{/localize}, is_active, is_reserved, component_id, filter) -VALUES - (@option_group_id_act, {localize field='label'}'Export Accounting Batch'{/localize}, @max_val+1, 'Export Accounting Batch', @max_wt+1, {localize field='description'}'Export Accounting Batch'{/localize}, 1, 1, @CompId, 1), - (@option_group_id_act, {localize field='label'}'Create Batch'{/localize}, @max_val+2, 'Create Batch', @max_wt+2, {localize field='description'}'Create Batch'{/localize}, 1, 1, @CompId, 1), - (@option_group_id_act, {localize field='label'}'Edit Batch'{/localize}, @max_val+3, 'Edit Batch', @max_wt+3, {localize field='description'}'Edit Batch'{/localize}, 1, 1, @CompId, 1); - --- CRM-11341 -INSERT INTO - `civicrm_job` (domain_id, run_frequency, last_run, name, description, api_entity, api_action, parameters, is_active) -SELECT - id, 'Daily' , NULL, '{ts escape="sql" skip="true"}Disable expired relationships{/ts}', '{ts escape="sql" skip="true"}Disables relationships that have expired (ie. those relationships whose end date is in the past).{/ts}', 'job', 'disable_expired_relationships', NULL, 0 -FROM `civicrm_domain`; - --- CRM-11367 -SELECT @country_id := max(id) from civicrm_country where name = 'Latvia'; - -DELETE FROM civicrm_state_province WHERE name IN ('Ventspils Apripkis', 'Aizkraukles Apripkis', 'Alkanes Apripkis', 'Balvu Apripkis', 'Bauskas Apripkis', 'Cesu Aprikis', 'Daugavpile Apripkis', 'Dobeles Apripkis', 'Gulbenes Aprlpkis', 'Jelgavas Apripkis', 'Jekabpils Apripkis', 'Kraslavas Apripkis', 'Kuldlgas Apripkis', 'Limbazu Apripkis', 'Liepajas Apripkis', 'Ludzas Apripkis', 'Madonas Apripkis', 'Ogres Apripkis', 'Preilu Apripkis', 'Rezaknes Apripkis', 'Rigas Apripkis', 'Saldus Apripkis', 'Talsu Apripkis', 'Tukuma Apriplcis', 'Valkas Apripkis', 'Valmieras Apripkis'); - -INSERT IGNORE INTO civicrm_state_province (country_id, abbreviation, name) VALUES -(@country_id, '002', 'Aizkraukles novads'), -(@country_id, '038', 'Jaunjelgavas novads'), -(@country_id, '072', 'Pļaviņu novads'), -(@country_id, '046', 'Kokneses novads'), -(@country_id, '065', 'Neretas novads'), -(@country_id, '092', 'SkrÄ«veru novads'), -(@country_id, '007', 'AlÅ«ksnes novads'), -(@country_id, '009', 'Apes novads'), -(@country_id, '015', 'Balvu novads'), -(@country_id, '108', 'Viļakas novads'), -(@country_id, '014', 'Baltinavas novads'), -(@country_id, '082', 'RugÄ�ju novads'), -(@country_id, '016', 'Bauskas novads'), -(@country_id, '034', 'Iecavas novads'), -(@country_id, '083', 'RundÄ�les novads'), -(@country_id, '105', 'Vecumnieku novads'), -(@country_id, '022', 'CÄ“su novads'), -(@country_id, '055', 'LÄ«gatnes novads'), -(@country_id, '008', 'Amatas novads'), -(@country_id, '039', 'Jaunpiebalgas novads'), -(@country_id, '075', 'Priekuļu novads'), -(@country_id, '070', 'PÄ�rgaujas novads'), -(@country_id, '076', 'Raunas novads'), -(@country_id, '104', 'Vecpiebalgas novads'), -(@country_id, '025', 'Daugavpils novads'), -(@country_id, '036', 'IlÅ«kstes novads'), -(@country_id, '026', 'Dobeles novads'), -(@country_id, '010', 'Auces novads'), -(@country_id, '098', 'TÄ“rvetes novads'), -(@country_id, '033', 'Gulbenes novads'), -(@country_id, '041', 'Jelgavas novads'), -(@country_id, '069', 'Ozolnieku novads'), -(@country_id, '042', 'JÄ“kabpils novads'), -(@country_id, '004', 'AknÄ«stes novads'), -(@country_id, '107', 'ViesÄ«tes novads'), -(@country_id, '049', 'Krustpils novads'), -(@country_id, '085', 'Salas novads'), -(@country_id, '047', 'KrÄ�slavas novads'), -(@country_id, '024', 'Dagdas novads'), -(@country_id, '001', 'Aglonas novads'), -(@country_id, '050', 'KuldÄ«gas novads'), -(@country_id, '093', 'Skrundas novads'), -(@country_id, '006', 'Alsungas novads'), -(@country_id, '003', 'Aizputes novads'), -(@country_id, '028', 'Durbes novads'), -(@country_id, '032', 'Grobiņas novads'), -(@country_id, '071', 'PÄ�vilostas novads'), -(@country_id, '074', 'Priekules novads'), -(@country_id, '066', 'NÄ«cas novads'), -(@country_id, '081', 'Rucavas novads'), -(@country_id, '100', 'Vaiņodes novads'), -(@country_id, '054', 'Limbažu novads'), -(@country_id, '005', 'Alojas novads'), -(@country_id, '086', 'SalacgrÄ«vas novads'), -(@country_id, '058', 'Ludzas novads'), -(@country_id, '044', 'KÄ�rsavas novads'), -(@country_id, '110', 'Zilupes novads'), -(@country_id, '023', 'Ciblas novads'), -(@country_id, '059', 'Madonas novads'), -(@country_id, '021', 'Cesvaines novads'), -(@country_id, '057', 'LubÄ�nas novads'), -(@country_id, '102', 'VarakļÄ�nu novads'), -(@country_id, '030', 'Ä’rgļu novads'), -(@country_id, '067', 'Ogres novads'), -(@country_id, '035', 'IkÅ¡Ä·iles novads'), -(@country_id, '051', 'Ķeguma novads'), -(@country_id, '053', 'LielvÄ�rdes novads'), -(@country_id, '073', 'Preiļu novads'), -(@country_id, '056', 'LÄ«vÄ�nu novads'), -(@country_id, '078', 'Riebiņu novads'), -(@country_id, '103', 'VÄ�rkavas novads'), -(@country_id, '077', 'RÄ“zeknes novads'), -(@country_id, '109', 'ViļÄ�nu novads'), -(@country_id, '013', 'Baldones novads'), -(@country_id, '052', 'Ķekavas novads'), -(@country_id, '068', 'Olaines novads'), -(@country_id, '087', 'Salaspils novads'), -(@country_id, '089', 'Saulkrastu novads'), -(@country_id, '091', 'Siguldas novads'), -(@country_id, '037', 'InÄ�ukalna novads'), -(@country_id, '011', 'Ä€dažu novads'), -(@country_id, '012', 'BabÄ«tes novads'), -(@country_id, '020', 'Carnikavas novads'), -(@country_id, '031', 'Garkalnes novads'), -(@country_id, '048', 'Krimuldas novads'), -(@country_id, '061', 'MÄ�lpils novads'), -(@country_id, '062', 'MÄ�rupes novads'), -(@country_id, '080', 'Ropažu novads'), -(@country_id, '090', 'SÄ“jas novads'), -(@country_id, '095', 'Stopiņu novads'), -(@country_id, '088', 'Saldus novads'), -(@country_id, '018', 'BrocÄ“nu novads'), -(@country_id, '097', 'Talsu novads'), -(@country_id, '027', 'Dundagas novads'), -(@country_id, '063', 'MÄ“rsraga novads'), -(@country_id, '079', 'Rojas novads'), -(@country_id, '099', 'Tukuma novads'), -(@country_id, '043', 'Kandavas novads'), -(@country_id, '029', 'Engures novads'), -(@country_id, '040', 'Jaunpils novads'), -(@country_id, '101', 'Valkas novads'), -(@country_id, '094', 'Smiltenes novads'), -(@country_id, '096', 'StrenÄ�u novads'), -(@country_id, '045', 'KocÄ“nu novads'), -(@country_id, '060', 'Mazsalacas novads'), -(@country_id, '084', 'RÅ«jienas novads'), -(@country_id, '017', 'BeverÄ«nas novads'), -(@country_id, '019', 'Burtnieku novads'), -(@country_id, '064', 'NaukÅ¡Ä“nu novads'), -(@country_id, '106', 'Ventspils novads'), -(@country_id, 'JKB', 'JÄ“kabpils'), -(@country_id, 'VMR', 'Valmiera'); - --- CRM-11507 -ALTER TABLE `civicrm_batch` CHANGE `type_id` `type_id` INT( 10 ) UNSIGNED NULL COMMENT 'fk to Batch Type options in civicrm_option_values'; -UPDATE `civicrm_batch` SET `mode_id` = '1'; - --- add Refunded in contribution status -SELECT @option_group_id_cs := MAX(id) FROM civicrm_option_group WHERE name = 'contribution_status'; - -SELECT @max_weight := MAX(weight) FROM civicrm_option_value WHERE option_group_id = @option_group_id_cs; - -INSERT INTO - `civicrm_option_value` (`option_group_id`, {localize field='label'}label{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) -VALUES - (@option_group_id_cs, {localize}'{ts escape="sql"}Refunded{/ts}'{/localize}, @max_weight + 1, 'Refunded', NULL, 0, NULL, @max_weight + 1, 0, 1, 1, NULL, NULL); - --- Payprocs from extensions may have long titles -ALTER TABLE civicrm_payment_processor_type MODIFY COLUMN title varchar(127); - --- CRM-11665 -ALTER TABLE `civicrm_address` - ADD COLUMN manual_geo_code tinyint(4) DEFAULT '0' COMMENT 'Is this a manually entered geo code.'; - --- CRM-11761 -UPDATE `civicrm_setting` SET `group_name` = 'Personal Preferences' WHERE `group_name` = 'Navigation Menu'; - --- CRM-11779 - -INSERT INTO civicrm_action_mapping ( entity, entity_value, entity_value_label, entity_status, entity_status_label, entity_date_start, entity_date_end, entity_recipient ) -VALUES -( 'civicrm_participant', 'event_template', 'Event Template', 'civicrm_participant_status_type', 'Participant Status', 'event_start_date', 'event_end_date', 'event_contacts'); - --- CRM-11802 Fix ON DELETE CASCADE constraint for line_item.price_field_id -ALTER TABLE `civicrm_line_item` - DROP FOREIGN KEY `FK_civicrm_line_item_price_field_id`, - CHANGE `price_field_id` `price_field_id` INT( 10 ) UNSIGNED DEFAULT NULL; - -ALTER TABLE `civicrm_line_item` - ADD CONSTRAINT `FK_civicrm_line_item_price_field_id` FOREIGN KEY (`price_field_id`) REFERENCES `civicrm_price_field`(id) ON DELETE SET NULL; - --- CRM-11821 --- update all location info of domain --- like address, email, phone etc. -UPDATE civicrm_domain cd -LEFT JOIN civicrm_loc_block clb ON cd.loc_block_id = clb.id -LEFT JOIN civicrm_address ca ON clb.address_id = ca.id -LEFT JOIN civicrm_phone cp ON cp.id = clb.phone_id -LEFT JOIN civicrm_email ce ON ce.id = clb.email_id -SET -ca.contact_id = cd.contact_id, cp.contact_id = cd.contact_id, ce.contact_id = cd.contact_id; - --- Delete rows from civicrm_loc_block used for civicrm_domain -DELETE clb.* FROM civicrm_domain cd -LEFT JOIN civicrm_loc_block clb ON clb.id = cd.loc_block_id; - --- Delete loc_block_id from civicrm_domain -ALTER TABLE `civicrm_domain` DROP loc_block_id; - --- CRM11818 --- pledge payments should not be cancelled if the contribution was --- compledged but the pledge is cancelled -UPDATE -civicrm_pledge_payment pp -INNER JOIN civicrm_contribution c ON -c.id = pp.contribution_id AND pp.status_id =3 -AND contribution_status_id = 1 -SET pp.status_id = contribution_status_id - diff --git a/CRM/Upgrade/Incremental/sql/4.3.alpha2.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.alpha2.mysql.tpl deleted file mode 100644 index 72c703f35f..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.alpha2.mysql.tpl +++ /dev/null @@ -1,40 +0,0 @@ --- CRM-11847 -UPDATE `civicrm_dedupe_rule_group` - SET name = 'IndividualGeneral' - WHERE name = 'IndividualComplete'; - --- CRM-11791 -INSERT IGNORE INTO `civicrm_relationship_type` ( name_a_b,label_a_b, name_b_a,label_b_a, description, contact_type_a, contact_type_b, is_reserved ) - VALUES - ( 'Partner of', '{ts escape="sql"}Partner of{/ts}', 'Partner of', '{ts escape="sql"}Partner of{/ts}', '{ts escape="sql"}Partner relationship.{/ts}', 'Individual', 'Individual', 0 ); - --- CRM-11886 -UPDATE `civicrm_navigation` - SET permission = 'view own manual batches,view all manual batches' - WHERE - name = 'Open Batches' OR - name = 'Closed Batches' OR - name = 'Exported Batches' OR - name = 'Accounting Batches'; - -UPDATE `civicrm_navigation` - SET permission = 'create manual batch' - WHERE - name = 'Accounting Batches'; - --- CRM-11891 -SELECT @contributionlastID := max(id) from civicrm_navigation where name = 'Contributions' AND domain_id = {$domainID}; -SELECT @importWeight := weight from civicrm_navigation where name = 'Import Contributions' and parent_id = @contributionlastID; - --- since 'Bulk Data Entry' was renamed to 'Batch Data Entry' -UPDATE `civicrm_navigation` SET label = '{ts escape="sql"}Batch Data Entry{/ts}', name = 'Batch Data Entry' -WHERE url = 'civicrm/batch&reset=1'; - -UPDATE `civicrm_navigation` - SET `weight` = `weight`+2 - WHERE `parent_id` = @contributionlastID - AND (`weight` > @importWeight OR `name` = 'Accounting Batches'); - -UPDATE `civicrm_navigation` - SET `weight` = @importWeight+1 - WHERE `name` = 'Batch Data Entry'; diff --git a/CRM/Upgrade/Incremental/sql/4.3.alpha3.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.alpha3.mysql.tpl deleted file mode 100644 index 17d54c7f1d..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.alpha3.mysql.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{include file='../CRM/Upgrade/4.3.alpha3.msg_template/civicrm_msg_template.tpl'} --- CRM-11906 - -ALTER TABLE `civicrm_batch` CHANGE `item_count` `item_count` INT( 10 ) UNSIGNED NULL DEFAULT NULL COMMENT 'Number of items in a batch.'; diff --git a/CRM/Upgrade/Incremental/sql/4.3.beta1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.beta1.mysql.tpl deleted file mode 100644 index 752533be8a..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.beta1.mysql.tpl +++ /dev/null @@ -1 +0,0 @@ -{include file='../CRM/Upgrade/4.3.beta1.msg_template/civicrm_msg_template.tpl'} diff --git a/CRM/Upgrade/Incremental/sql/4.3.beta2.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.beta2.mysql.tpl deleted file mode 100644 index 1f2e830087..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.beta2.mysql.tpl +++ /dev/null @@ -1 +0,0 @@ -{include file='../CRM/Upgrade/4.3.beta2.msg_template/civicrm_msg_template.tpl'} diff --git a/CRM/Upgrade/Incremental/sql/4.3.beta3.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.beta3.mysql.tpl deleted file mode 100644 index 0bf6fd7eb6..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.beta3.mysql.tpl +++ /dev/null @@ -1,31 +0,0 @@ -{include file='../CRM/Upgrade/4.3.beta3.msg_template/civicrm_msg_template.tpl'} --- CRM-12077 -DELETE cog, cov FROM `civicrm_option_group` cog -LEFT JOIN civicrm_option_value cov ON cov.option_group_id = cog.id -WHERE cog.name = 'account_type'; - -{if $multilingual} - UPDATE civicrm_uf_field - SET field_name = 'financial_type' - WHERE field_name LIKE 'contribution_type'; - {foreach from=$locales item=locale} - UPDATE civicrm_uf_field - SET label_{$locale} = 'Financial Type' - WHERE field_name = 'financial_type' AND label_{$locale} = 'Contribution Type'; - {/foreach} - -{else} - UPDATE civicrm_uf_field - SET field_name = 'financial_type', - label = CASE - WHEN label = 'Contribution Type' - THEN 'Financial Type' - ELSE label - END - WHERE field_name = 'contribution_type'; -{/if} - --- CRM-12065 -UPDATE `civicrm_mapping_field` -SET name = replace(name, 'contribution_type', 'financial_type') -where name LIKE '%contribution_type%'; diff --git a/CRM/Upgrade/Incremental/sql/4.3.beta4.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.beta4.mysql.tpl deleted file mode 100644 index 471686ad22..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.beta4.mysql.tpl +++ /dev/null @@ -1,25 +0,0 @@ --- CRM-12151 -ALTER TABLE civicrm_option_value - DROP INDEX index_option_group_id_value, - ADD INDEX index_option_group_id_value (value(128), option_group_id), - DROP INDEX index_option_group_id_name, - ADD INDEX index_option_group_id_name (option_group_id, name(128)); - --- CRM-12127 -UPDATE civicrm_membership_type cmt -LEFT JOIN civicrm_price_field_value cpfv ON cpfv.membership_type_id = cmt.id -LEFT JOIN civicrm_price_field cpf ON cpf.id = cpfv.price_field_id -LEFT JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id -SET -cpfv.financial_type_id = cmt.financial_type_id, -{if !$multilingual} - cpfv.label = cmt.name, - cpfv.description = cmt.description, -{else} - {foreach from=$locales item=locale} - cpfv.label_{$locale} = cmt.name_{$locale}, - cpfv.description_{$locale} = cmt.description_{$locale}, - {/foreach} -{/if} -cpfv.amount = IFNULL(cmt.minimum_fee, 0.00) -WHERE cps.is_quick_config = 1 AND cpfv.membership_type_id IS NOT NULL; diff --git a/CRM/Upgrade/Incremental/sql/4.3.beta5.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.3.beta5.mysql.tpl deleted file mode 100644 index 2f2b4e8d3b..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.3.beta5.mysql.tpl +++ /dev/null @@ -1,9 +0,0 @@ --- CRM-12142 --- Populate default text for premiums_nothankyou_label -UPDATE `civicrm_premiums` SET {localize field="premiums_nothankyou_label"}premiums_nothankyou_label = '{ts escape="sql"}No thank-you{/ts}'{/localize}; - --- CRM-12233 Fix price field label for quick config membership signup field -UPDATE `civicrm_price_field` cpf -LEFT JOIN `civicrm_price_set` cps ON cps.id = cpf.price_set_id -SET {localize field="label"}cpf.label = '{ts escape="sql"}Membership{/ts}'{/localize} -WHERE cps.is_quick_config = 1 AND cpf.name = 'membership_amount'; diff --git a/CRM/Upgrade/Incremental/sql/4.4.0.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.0.mysql.tpl deleted file mode 100644 index 1b102146df..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.4.0.mysql.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{* file to handle db changes in 4.4.0 during upgrade *} --- CRM-13571 -UPDATE civicrm_state_province SET name = 'Møre og Romsdal' WHERE name = 'Møre ag Romsdal'; - --- CRM-13604 -UPDATE civicrm_state_province SET name = 'Alta Verapaz' WHERE name = 'Alta Verapez'; -UPDATE civicrm_state_province SET name = 'Baja Verapaz' WHERE name = 'Baja Verapez'; -UPDATE civicrm_state_province SET name = 'Retalhuleu' WHERE name = 'Reta.thuleu'; -UPDATE civicrm_state_province SET name = 'Sololá' WHERE name = 'Solol6'; diff --git a/CRM/Upgrade/Incremental/sql/4.4.1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.1.mysql.tpl deleted file mode 100644 index b200c27352..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.4.1.mysql.tpl +++ /dev/null @@ -1,12 +0,0 @@ -{* file to handle db changes in 4.4.1 during upgrade *} --- CRM-13327 -SELECT @option_group_id_name_badge := max(id) from civicrm_option_group where name = 'name_badge'; -UPDATE civicrm_option_value -SET value = '{literal}{"name":"Avery 5395","paper-size":"a4","metric":"mm","lMargin":15,"tMargin":26,"NX":2,"NY":4,"SpaceX":10,"SpaceY":5,"width":83,"height":57,"font-size":12,"orientation":"portrait","font-name":"helvetica","font-style":"","lPadding":3,"tPadding":3}{/literal}' -WHERE option_group_id = @option_group_id_name_badge AND name = 'Avery 5395'; - --- CRM-13669 -{literal} -UPDATE civicrm_option_value SET name = 'Dear {contact.household_name}' -WHERE name = 'Dear {contact.househols_name}'; -{/literal} diff --git a/CRM/Upgrade/Incremental/sql/4.4.2.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.2.mysql.tpl deleted file mode 100644 index 6cf155aa5f..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.4.2.mysql.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{* file to handle db changes in 4.4.2 during upgrade *} --- CRM-13758 -UPDATE civicrm_uf_field SET field_name = 'gender_id' WHERE field_name = 'gender'; -UPDATE civicrm_uf_field SET field_name = 'prefix_id' WHERE field_name = 'individual_prefix'; -UPDATE civicrm_uf_field SET field_name = 'suffix_id' WHERE field_name = 'individual_suffix'; diff --git a/CRM/Upgrade/Incremental/sql/4.4.3.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.3.mysql.tpl deleted file mode 100644 index 6d2787d441..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.4.3.mysql.tpl +++ /dev/null @@ -1,8 +0,0 @@ -{* file to handle db changes in 4.4.3 during upgrade *} -{include file='../CRM/Upgrade/4.4.3.msg_template/civicrm_msg_template.tpl'} - --- CRM-13420 -UPDATE civicrm_option_value -INNER JOIN civicrm_option_group ON civicrm_option_value.option_group_id = civicrm_option_group.id -SET civicrm_option_value.is_default = 1 -WHERE civicrm_option_group.name = 'payment_instrument' AND civicrm_option_value.name = 'Check'; diff --git a/CRM/Upgrade/Incremental/sql/4.4.4.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.4.mysql.tpl deleted file mode 100644 index 3244650630..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.4.4.mysql.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{* file to handle db changes in 4.4.4 during upgrade *} - -{* update comment for civicrm_report_instance.grouprole *} -ALTER TABLE civicrm_report_instance MODIFY grouprole varchar(1024) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'role required to be able to run this instance'; - -{* CRM-14117 *} -UPDATE civicrm_navigation SET url = 'http://civicrm.org/what/whatiscivicrm' WHERE name = 'About'; - --- CRM-13968 -SELECT @inprogressstatus := value FROM civicrm_option_value cov -LEFT JOIN civicrm_option_group cg ON cov.option_group_id = cg.id -WHERE cg.name = 'contribution_status' AND cov.name = 'In Progress'; - -SELECT @financialstatus := value FROM civicrm_option_value cov -LEFT JOIN civicrm_option_group cg ON cov.option_group_id = cg.id -WHERE cg.name = 'financial_item_status' AND cov.name = 'Unpaid'; - -SELECT @accountrecievable := id FROM `civicrm_financial_account` WHERE `name` LIKE 'Accounts Receivable'; - -UPDATE civicrm_financial_trxn cft -LEFT JOIN civicrm_entity_financial_trxn ceft ON ceft.financial_trxn_id = cft.id -LEFT JOIN civicrm_entity_financial_trxn ceft_financial_item ON ceft_financial_item.financial_trxn_id = cft.id -LEFT JOIN civicrm_financial_item cfi ON cfi.id = ceft_financial_item.entity_id -SET to_financial_account_id = @accountrecievable, cfi.status_id = @financialstatus -WHERE ceft.entity_table = 'civicrm_contribution' AND ceft_financial_item.entity_table = 'civicrm_financial_item' AND cft.status_id = @inprogressstatus AND cfi.status_id IS NULL; - -{* CRM-14167 *} -ALTER TABLE civicrm_activity_contact ADD INDEX index_record_type ( activity_id, record_type_id ); diff --git a/CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl deleted file mode 100644 index 99441185a8..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.4.5.mysql.tpl +++ /dev/null @@ -1,36 +0,0 @@ -{* file to handle db changes in 4.4.5 during upgrade *} --- CRM-14191 -SELECT @option_group_id_batch_status := max(id) from civicrm_option_group where name = 'batch_status'; -SELECT @weight := MAX(ROUND(value)) FROM civicrm_option_value WHERE option_group_id = @option_group_id_batch_status; - -UPDATE civicrm_option_value -SET value = (Select @weight := @weight +1), -weight = @weight -WHERE option_group_id = @option_group_id_batch_status AND name IN ('Data Entry', 'Reopened', 'Exported') AND value = 0 ORDER BY id; - -SELECT @option_group_id_batch_modes := max(id) from civicrm_option_group where name = 'batch_mode'; -SELECT @weights := MAX(ROUND(value)) FROM civicrm_option_value WHERE option_group_id = @option_group_id_batch_modes; - -UPDATE civicrm_option_value -SET value = (Select @weights := @weights +1), -weight = @weights -WHERE option_group_id = @option_group_id_batch_modes AND name IN ('Manual Batch', 'Automatic Batch') AND value = 0; - -SELECT @manual_mode_id := MAX(value) FROM civicrm_option_value WHERE option_group_id = @option_group_id_batch_modes AND name = 'Manual Batch'; -UPDATE civicrm_batch SET mode_id = @manual_mode_id WHERE (mode_id IS NULL OR mode_id = 0) AND type_id IS NULL; - -SELECT @data_entry_status_id := MAX(value) FROM civicrm_option_value WHERE option_group_id = @option_group_id_batch_status AND name = 'Data Entry'; -UPDATE civicrm_batch SET status_id = @data_entry_status_id WHERE status_id = 3 AND type_id IS NOT NULL; - -SELECT @exported_status_id := MAX(value) FROM civicrm_option_value WHERE option_group_id = @option_group_id_batch_status AND name = 'Exported'; -UPDATE civicrm_navigation SET url = CONCAT('civicrm/financial/financialbatches?reset=1&batchStatus=', @exported_status_id) WHERE name = 'Exported Batches'; - --- update status_id to Exported -SELECT @export_activity_type := max(value) FROM civicrm_option_value cov -INNER JOIN civicrm_option_group cog ON cog.id = cov.option_group_id -WHERE cog.name = 'activity_type' AND cov.name = 'Export Accounting Batch'; - -UPDATE civicrm_batch cb -INNER JOIN civicrm_activity ca ON ca.source_record_id = cb.id -SET cb.status_id = @exported_status_id -WHERE cb.status_id = 0 AND ca.activity_type_id = @export_activity_type; diff --git a/CRM/Upgrade/Incremental/sql/4.4.6.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.6.mysql.tpl deleted file mode 100644 index 82916b9041..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.4.6.mysql.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{* CRM-16846 - This file is never run, but it doesn't matter because the below query is undone by another alteration to the same column in 4.5.alpha1 *} - --- CRM-14903 -ALTER TABLE `civicrm_mapping_field` -CHANGE COLUMN `operator` `operator` ENUM('=','!=','>','<','>=','<=','IN','NOT IN','LIKE','NOT LIKE','IS NULL','IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY', 'RLIKE'); diff --git a/CRM/Upgrade/Incremental/sql/4.4.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.alpha1.mysql.tpl deleted file mode 100644 index c3c3c63f3d..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.4.alpha1.mysql.tpl +++ /dev/null @@ -1,161 +0,0 @@ -{include file='../CRM/Upgrade/4.4.alpha1.msg_template/civicrm_msg_template.tpl'} - --- CRM-12357 -SELECT @option_group_id_cvOpt := max(id) FROM civicrm_option_group WHERE name = 'contact_view_options'; -SELECT @max_val := MAX(ROUND(op.value)) FROM civicrm_option_value op WHERE op.option_group_id = @option_group_id_cvOpt; -SELECT @max_wt := MAX(ROUND(val.weight)) FROM civicrm_option_value val WHERE val.option_group_id = @option_group_id_cvOpt; - -INSERT INTO - `civicrm_option_value` (`option_group_id`, {localize field='label'}`label`{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) -VALUES - (@option_group_id_cvOpt, {localize}'{ts escape="sql"}Mailings{/ts}'{/localize}, @max_val+1, 'CiviMail', NULL, 0, NULL, @max_wt+1, 0, 0, 1, NULL, NULL); - -INSERT INTO civicrm_setting - (domain_id, contact_id, is_domain, group_name, name, value) -VALUES - ({$domainID}, NULL, 1, 'Mailing Preferences', 'write_activity_record', '{serialize}1{/serialize}'); - --- CRM-12580 -ALTER TABLE civicrm_contact ADD INDEX index_is_deleted_sort_name(is_deleted, sort_name, id); -ALTER TABLE civicrm_contact DROP INDEX index_is_deleted; - --- CRM-12495 -DROP TABLE IF EXISTS `civicrm_task_status`; -DROP TABLE IF EXISTS `civicrm_task`; -DROP TABLE IF EXISTS `civicrm_project`; - --- CRM-12425 -SELECT @bounceTypeID := max(id) FROM civicrm_mailing_bounce_type WHERE name = 'Spam'; -INSERT INTO civicrm_mailing_bounce_pattern (bounce_type_id, pattern) -VALUES (@bounceTypeID, 'X-HmXmrOriginalRecipient'); - --- CRM-12716 -UPDATE civicrm_custom_field SET text_length = NULL WHERE html_type = 'TextArea' AND text_length = 255; - --- CRM-12288 - -SELECT @option_group_id_activity_type := max(id) from civicrm_option_group where name = 'activity_type'; -SELECT @max_val := MAX(ROUND(op.value)) FROM civicrm_option_value op WHERE op.option_group_id = @option_group_id_activity_type; -SELECT @max_wt := max(weight) from civicrm_option_value where option_group_id=@option_group_id_activity_type; - -INSERT INTO civicrm_option_value - (option_group_id, {localize field='label'}label{/localize}, {localize field='description'}description{/localize}, value, name, weight, filter, component_id) -VALUES - (@option_group_id_activity_type, {localize}'Inbound SMS'{/localize},{localize}'Inbound SMS'{/localize}, (SELECT @max_val := @max_val+1), 'Inbound SMS', (SELECT @max_wt := @max_wt+1), 1, NULL), - (@option_group_id_activity_type, {localize}'SMS delivery'{/localize},{localize}'SMS delivery'{/localize}, (SELECT @max_val := @max_val+1), 'SMS delivery', (SELECT @max_wt := @max_wt+1), 1, NULL); - --- CRM-13015 replaced if $multilingual w/ localize method -UPDATE `civicrm_option_value` SET {localize field="label"}label = '{ts escape="sql"}Outbound SMS{/ts}'{/localize} - WHERE name = 'SMS' and option_group_id = @option_group_id_activity_type; - --- CRM-12689 -ALTER TABLE civicrm_action_schedule - ADD COLUMN limit_to tinyint(4) DEFAULT '1' COMMENT 'Is this the recipient criteria limited to OR in addition to?' AFTER recipient; - --- CRM-12653 -SELECT @uf_group_contribution_batch_entry := max(id) FROM civicrm_uf_group WHERE name = 'contribution_batch_entry'; -SELECT @uf_group_membership_batch_entry := max(id) FROM civicrm_uf_group WHERE name = 'membership_batch_entry'; - -INSERT INTO civicrm_uf_field - ( uf_group_id, field_name, is_required, is_reserved, weight, visibility, in_selector, is_searchable, location_type_id, {localize field='label'}label{/localize}, field_type) -VALUES - ( @uf_group_contribution_batch_entry, 'soft_credit', 0, 0, 10, 'User and User Admin Only', 0, 0, NULL, {localize}'Soft Credit'{/localize}, 'Contribution'), - ( @uf_group_membership_batch_entry, 'soft_credit', 0, 0, 13, 'User and User Admin Only', 0, 0, NULL, {localize}'Soft Credit'{/localize}, 'Membership'); - --- CRM-12809 -ALTER TABLE `civicrm_custom_group` - ADD COLUMN `is_reserved` tinyint(4) DEFAULT '0' COMMENT 'Is this a reserved Custom Group?'; - ---CRM-12986 fix event_id & contact_id to NOT NULL fields on participant table -SET foreign_key_checks = 0; -ALTER TABLE `civicrm_participant` - CHANGE COLUMN `event_id` `event_id` INT(10) UNSIGNED NOT NULL, - CHANGE COLUMN `contact_id` `contact_id` INT(10) UNSIGNED NOT NULL; -SET foreign_key_checks = 1; - --- CRM-12964 civicrm_print_label table creation -CREATE TABLE IF NOT EXISTS `civicrm_print_label` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'User title for for this label layout', - `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'variable name/programmatic handle for this field.', - `description` text COLLATE utf8_unicode_ci COMMENT 'Description of this label layout', - `label_format_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'This refers to name column of civicrm_option_value row in name_badge option group', - `label_type_id` int(10) unsigned DEFAULT NULL COMMENT 'Implicit FK to civicrm_option_value row in NEW label_type option group', - `data` longtext COLLATE utf8_unicode_ci COMMENT 'contains json encode configurations options', - `is_default` tinyint(4) DEFAULT '1' COMMENT 'Is this default?', - `is_active` tinyint(4) DEFAULT '1' COMMENT 'Is this option active?', - `is_reserved` tinyint(4) DEFAULT '1' COMMENT 'Is this reserved label?', - `created_id` int(10) unsigned DEFAULT NULL COMMENT 'FK to civicrm_contact, who created this label layout', - PRIMARY KEY (`id`), - KEY `FK_civicrm_print_label_created_id` (`created_id`), - CONSTRAINT `FK_civicrm_print_label_created_id` FOREIGN KEY (`created_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE SET NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1; - --- CRM-12964 adding meta-data -INSERT INTO - `civicrm_option_group` (`name`, {localize field='title'}`title`{/localize}, `is_reserved`, `is_active`) -VALUES - ('label_type', {localize}'{ts escape="sql"}Label Type{/ts}'{/localize}, 1, 1), - ('name_badge', {localize}'{ts escape="sql"}Name Badge Format{/ts}'{/localize}, 1, 1); - -SELECT @option_group_id_label_type := max(id) from civicrm_option_group where name = 'label_type'; -SELECT @option_group_id_name_badge := max(id) from civicrm_option_group where name = 'name_badge'; - -INSERT INTO - `civicrm_option_value` (`option_group_id`, {localize field='label'}`label`{/localize}, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) -VALUES - (@option_group_id_label_type, {localize}'{ts escape="sql"}Event Badge{/ts}'{/localize}, 1, 'Event Badge', NULL, 0, NULL, 1, 0, 0, 1, NULL, NULL), - (@option_group_id_name_badge, {localize}'{ts escape="sql"}Avery 5395{/ts}'{/localize}, '{literal}{"name":"Avery 5395","paper-size":"a4","metric":"mm","lMargin":13.5,"tMargin":3,"NX":2,"NY":4,"SpaceX":15,"SpaceY":8.5,"width":85.7,"height":59.2,"font-size":12,"orientation":"portrait","font-name":"helvetica","font-style":"","lPadding":0,"tPadding":0}{/literal}', 'Avery 5395', NULL, 0, NULL, 1, 0, 0, 1, NULL, NULL); - --- CRM-12964 adding navigation -UPDATE civicrm_navigation - SET url = 'civicrm/admin/badgelayout&reset=1', - name = 'Event Name Badge Layouts', - label= '{ts escape="sql" skip="true"}Event Name Badge Layouts{/ts}' - WHERE name = 'Event Badge Formats'; - ---CRM-12539 change 'Greater London' to 'London' -UPDATE `civicrm_state_province` SET `name` = 'London' WHERE `name` = 'Greater London'; - -UPDATE `civicrm_premiums` SET {localize field="premiums_nothankyou_label"}premiums_nothankyou_label = '{ts escape="sql"}No thank-you{/ts}'{/localize}; - --- CRM-13015 Change address option labels from Additional Address to Supplemental Address -SELECT @option_group_id_addroptions := max(id) from civicrm_option_group where name = 'address_options'; - -UPDATE civicrm_option_value - SET {localize field="label"}label = '{ts escape="sql"}Supplemental Address 1{/ts}'{/localize} - WHERE name = 'supplemental_address_1' AND option_group_id = @option_group_id_addroptions; - -UPDATE civicrm_option_value - SET {localize field="label"}label = '{ts escape="sql"}Supplemental Address 2{/ts}'{/localize} - WHERE name = 'supplemental_address_2' AND option_group_id = @option_group_id_addroptions; - --- CRM-12717 -UPDATE `civicrm_navigation` SET label = '{ts escape="sql"}Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.){/ts}', name = 'Misc (Undelete, PDFs, Limits, Logging, Captcha, etc.)' -WHERE url = 'civicrm/admin/setting/misc&reset=1'; - --- CRM-13112 -ALTER TABLE civicrm_survey - ADD is_share TINYINT( 4 ) NULL DEFAULT '1' COMMENT 'Can people share the petition through social media?'; - --- CRM-12439 -{if $multilingual} - ALTER TABLE `civicrm_uf_group` - ADD `description` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'Optional verbose description of the profile.' AFTER `group_type`; -{else} - ALTER TABLE `civicrm_uf_group` - ADD `description` TEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT 'Optional verbose description of the profile.' AFTER `title`; -{/if} - ---CRM-13142 -UPDATE - civicrm_uf_field uf - INNER JOIN - civicrm_uf_group ug ON uf.uf_group_id = ug.id AND ug.is_reserved = 1 AND name = 'membership_batch_entry' -SET uf.is_reserved = 0 -WHERE uf.field_name IN ('join_date', 'membership_start_date', 'membership_end_date'); - ---CRM-13155 - Add searching for recurring contribution data to search has been successfully created. -ALTER TABLE `civicrm_contribution_recur` - CHANGE COLUMN `next_sched_contribution` `next_sched_contribution_date` DATETIME NULL DEFAULT NULL COMMENT 'At Groundspring this was used by the cron job which triggered payments. If we\'re not doing that but we know about payments, it might still be useful to store for display to org andor contributors.' AFTER `cycle_day`; - diff --git a/CRM/Upgrade/Incremental/sql/4.4.beta1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.4.beta1.mysql.tpl deleted file mode 100644 index ede9a6e3f8..0000000000 --- a/CRM/Upgrade/Incremental/sql/4.4.beta1.mysql.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{* file to handle db changes in 4.4.beta1 during upgrade *} --- CRM-13314 Added States for Uruguay -INSERT IGNORE INTO civicrm_state_province (id, country_id, abbreviation, name) VALUES -(NULL, 1229, "FL", "Florida"), -(NULL, 1229, "RN", "Rio Negro"), -(NULL, 1229, "SJ", "San Jose"); - -ALTER TABLE civicrm_email -MODIFY email VARCHAR(254); -- 2.25.1