Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-07-14-13-42-39
[civicrm-core.git] / templates / CRM / Contact / Form / Merge.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
819d0d41 3 | CiviCRM version 4.5 |
6a488035 4 +--------------------------------------------------------------------+
819d0d41 5 | Copyright CiviCRM LLC (c) 2004-2014 |
6a488035
TO
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25*}
26<div class="crm-block crm-form-block crm-contact-merge-form-block">
27<div id="help">
28{ts}Click <strong>Merge</strong> to move data from the Duplicate Contact on the left into the Main Contact. In addition to the contact data (address, phone, email...), you may choose to move all or some of the related activity records (groups, contributions, memberships, etc.).{/ts} {help id="intro"}
29</div>
30
31<div class="crm-submit-buttons">{if $prev}<a href="{$prev}" class="button"><span>{ts}<< Prev{/ts}</span></a>{/if}{include file="CRM/common/formButtons.tpl" location="top"}{if $next}<a href="{$next}" class="button"><span>{ts}Next >>{/ts}</span></a>{/if}</div>
32
33<div class="action-link">
34 <a href="{$flip}">&raquo; {ts}Flip between original and duplicate contacts.{/ts}</a>
35</div>
36
37<div class="action-link">
00c461ec 38 <a id='notDuplicate' href="#" title={ts}Mark this pair as not a duplicate.{/ts} onClick="processDupes( {$main_cid}, {$other_cid}, 'dupe-nondupe', 'merge-contact', '{crmURL p="civicrm/contact/dedupefind" q="reset=1&action=update&rgid=$rgid"}' );return false;">&raquo; {ts}Mark this pair as not a duplicate.{/ts}</a>
6a488035
TO
39</div>
40
41<table>
42 <tr class="columnheader">
43 <th>&nbsp;</th>
f1f27800 44 <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$other_cid"}">{$other_name}</a> ({ts}duplicate{/ts})</th>
6a488035 45 <th>{ts}Mark All{/ts}<br />=={$form.toggleSelect.html} ==&gt;</th>
f1f27800 46 <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$main_cid"}">{$main_name}</a></th>
6a488035
TO
47 </tr>
48 {foreach from=$rows item=row key=field}
49 <tr class="{cycle values="odd-row,even-row"}">
50 <td>{$row.title}</td>
51 <td>
f1f27800
DG
52 {if !is_array($row.other)}
53 {$row.other}
54 {elseif $row.other.fileName}
55 {$row.other.fileName}
56 {else}
57 {', '|implode:$row.other}
58 {/if}
6a488035
TO
59 </td>
60 <td style='white-space: nowrap'>{if $form.$field}=={$form.$field.html}==&gt;{/if}</td>
61 <td>
62 {if $row.title|substr:0:5 == "Email" OR
63 $row.title|substr:0:7 == "Address" OR
64 $row.title|substr:0:2 == "IM" OR
65 $row.title|substr:0:6 == "OpenID" OR
66 $row.title|substr:0:5 == "Phone"}
67
68 {assign var=position value=$field|strrpos:'_'}
69 {assign var=blockId value=$field|substr:$position+1}
70 {assign var=blockName value=$field|substr:14:$position-14}
71
72 {$form.location.$blockName.$blockId.locTypeId.html}&nbsp;
73 {if $blockName eq 'email' || $blockName eq 'phone' }
74 <span id="main_{$blockName}_{$blockId}_overwrite">{if $row.main}(overwrite){$form.location.$blockName.$blockId.operation.html}&nbsp;<br />{else}(add){/if}</span>
75 {literal}
76 <script type="text/javascript">
77 function mergeBlock(blockname, element, blockId) {
78 var allBlock = {/literal}{$mainLocBlock}{literal};
79 var block = eval( "allBlock." + 'main_'+ blockname + element.value);
80 if(blockname == 'email' || blockname == 'phone'){
81 var label = '(overwrite)'+ '<span id="main_blockname_blockId_overwrite">{/literal}{$form.location.$blockName.$blockId.operation.html}{literal}<br /></span>';
82 }
83 else {
84 label = '(overwrite)<br />';
85 }
86
87 if ( !block ) {
88 block = '';
89 label = '(add)';
90 }
91 cj( "#main_"+ blockname +"_" + blockId ).html( block );
92 cj( "#main_"+ blockname +"_" + blockId +"_overwrite" ).html( label );
93 }
94 </script>
95 {/literal}
96 {else}
97 <span id="main_{$blockName}_{$blockId}_overwrite">{if $row.main}(overwrite)<br />{else}(add){/if}</span>
98 {/if}
99
100 {/if}
101 {*NYSS 5546*}
102 <span id="main_{$blockName}_{$blockId}">
103 {if !is_array($row.main)}
104 {$row.main}
f1f27800 105 {elseif $row.main.fileName}
6a488035 106 {$row.main.fileName}
f1f27800
DG
107 {else}
108 {', '|implode:$row.main}
6a488035
TO
109 {/if}
110 </span>
111 </td>
112 </tr>
113 {/foreach}
114
115 {foreach from=$rel_tables item=params key=paramName}
116 {if $paramName eq 'move_rel_table_users'}
117 <tr class="{cycle values="even-row,odd-row"}">
118 <th>{ts}Move related...{/ts}</th><td>{if $otherUfId}<a target="_blank" href="{$params.other_url}">{$otherUfName}</a></td><td style='white-space: nowrap'>=={$form.$paramName.html}==&gt;{else}<td style='white-space: nowrap'></td>{/if}</td><td>{if $mainUfId}<a target="_blank" href="{$params.main_url}">{$mainUfName}</a>{/if}</td>
119 </tr>
120 {else}
121 <tr class="{cycle values="even-row,odd-row"}">
122 <th>{ts}Move related...{/ts}</th><td><a href="{$params.other_url}">{$params.title}</a></td><td style='white-space: nowrap'>=={$form.$paramName.html}==&gt;</td><td><a href="{$params.main_url}">{$params.title}</a>{if $form.operation.$paramName.add.html}&nbsp;{$form.operation.$paramName.add.html}{/if}</td>
123 </tr>
124 {/if}
125 {/foreach}
126</table>
127<div class='form-item'>
128 <!--<p>{$form.moveBelongings.html} {$form.moveBelongings.label}</p>-->
129 <!--<p>{$form.deleteOther.html} {$form.deleteOther.label}</p>-->
130</div>
131<div class="message status">
132 <p><strong>{ts}WARNING: The duplicate contact record WILL BE DELETED after the merge is complete.{/ts}</strong></p>
133 {if $user}
134 <p><strong>{ts 1=$config->userFramework}There are %1 user accounts associated with both the original and duplicate contacts. Ensure that the Drupal User you want to retain is on the right - if necessary use the 'Flip between original and duplicate contacts.' option at top to swap the positions of the two records before doing the merge.
135The user record associated with the duplicate contact will not be deleted, but will be un-linked from the associated contact record (which will be deleted).
136You will need to manually delete that user (click on the link to open Drupal User account in new screen). You may need to give thought to how you handle any content or contents associated with that user.{/ts}</strong></p>
137 {/if}
138 {if $other_contact_subtype}
139 <p><strong>The duplicate contact (the one that will be deleted) is a <em>{$other_contact_subtype}</em>. Any data related to this will be lost forever (there is no undo) if you complete the merge.</strong></p>
140 {/if}
141</div>
142
143<div class="crm-submit-buttons">{if $prev}<a href="{$prev}" class="button"><span>{ts}<< Prev{/ts}</span></a>{/if}{include file="CRM/common/formButtons.tpl" location="bottom"}{if $next}<a href="{$next}" class="button"><span>{ts}Next >>{/ts}</span></a>{/if}</div>
144</div>
145
146{literal}
147<script type="text/javascript">
148
149cj(document).ready(function(){
150 cj('table td input.form-checkbox').each(function() {
151 var ele = null;
152 var element = cj(this).attr('id').split('_',3);
153
154 switch ( element['1'] ) {
155 case 'addressee':
8539f25d 156 ele = '#' + element['0'] + '_' + element['1'];
6a488035
TO
157 break;
158
159 case 'email':
160 case 'postal':
8539f25d 161 ele = '#' + element['0'] + '_' + element['1'] + '_' + element['2'];
6a488035
TO
162 break;
163 }
164
165 if( ele ) {
8539f25d
CW
166 cj(this).on('click', function() {
167 var val = cj(this).prop('checked');
168 cj('input' + ele + ', input' + ele + '_custom').prop('checked', val);
6a488035
TO
169 });
170 }
171 });
172});
173
174</script>
175{/literal}
176
177{* process the dupe contacts *}
178{include file="CRM/common/dedupe.tpl"}