copyright and version fixes
[civicrm-core.git] / templates / CRM / Contact / Form / Merge.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
232624b1 3 | CiviCRM version 4.4 |
6a488035
TO
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
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>
44 <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$other_cid"}">{$other_name}&nbsp;<em>{$other_contact_subtype}</em></a> ({ts}duplicate{/ts})</th>
45 <th>{ts}Mark All{/ts}<br />=={$form.toggleSelect.html} ==&gt;</th>
46 <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$main_cid"}">{$main_name}&nbsp;<em>{$main_contact_subtype}</em></a></th>
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>
52 {if !is_array($row.other)}
53 {$row.other}
54 {else}
55 {$row.other.fileName}
56 {/if}
57 </td>
58 <td style='white-space: nowrap'>{if $form.$field}=={$form.$field.html}==&gt;{/if}</td>
59 <td>
60 {if $row.title|substr:0:5 == "Email" OR
61 $row.title|substr:0:7 == "Address" OR
62 $row.title|substr:0:2 == "IM" OR
63 $row.title|substr:0:6 == "OpenID" OR
64 $row.title|substr:0:5 == "Phone"}
65
66 {assign var=position value=$field|strrpos:'_'}
67 {assign var=blockId value=$field|substr:$position+1}
68 {assign var=blockName value=$field|substr:14:$position-14}
69
70 {$form.location.$blockName.$blockId.locTypeId.html}&nbsp;
71 {if $blockName eq 'email' || $blockName eq 'phone' }
72 <span id="main_{$blockName}_{$blockId}_overwrite">{if $row.main}(overwrite){$form.location.$blockName.$blockId.operation.html}&nbsp;<br />{else}(add){/if}</span>
73 {literal}
74 <script type="text/javascript">
75 function mergeBlock(blockname, element, blockId) {
76 var allBlock = {/literal}{$mainLocBlock}{literal};
77 var block = eval( "allBlock." + 'main_'+ blockname + element.value);
78 if(blockname == 'email' || blockname == 'phone'){
79 var label = '(overwrite)'+ '<span id="main_blockname_blockId_overwrite">{/literal}{$form.location.$blockName.$blockId.operation.html}{literal}<br /></span>';
80 }
81 else {
82 label = '(overwrite)<br />';
83 }
84
85 if ( !block ) {
86 block = '';
87 label = '(add)';
88 }
89 cj( "#main_"+ blockname +"_" + blockId ).html( block );
90 cj( "#main_"+ blockname +"_" + blockId +"_overwrite" ).html( label );
91 }
92 </script>
93 {/literal}
94 {else}
95 <span id="main_{$blockName}_{$blockId}_overwrite">{if $row.main}(overwrite)<br />{else}(add){/if}</span>
96 {/if}
97
98 {/if}
99 {*NYSS 5546*}
100 <span id="main_{$blockName}_{$blockId}">
101 {if !is_array($row.main)}
102 {$row.main}
103 {else}
104 {$row.main.fileName}
105 {/if}
106 </span>
107 </td>
108 </tr>
109 {/foreach}
110
111 {foreach from=$rel_tables item=params key=paramName}
112 {if $paramName eq 'move_rel_table_users'}
113 <tr class="{cycle values="even-row,odd-row"}">
114 <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>
115 </tr>
116 {else}
117 <tr class="{cycle values="even-row,odd-row"}">
118 <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>
119 </tr>
120 {/if}
121 {/foreach}
122</table>
123<div class='form-item'>
124 <!--<p>{$form.moveBelongings.html} {$form.moveBelongings.label}</p>-->
125 <!--<p>{$form.deleteOther.html} {$form.deleteOther.label}</p>-->
126</div>
127<div class="message status">
128 <p><strong>{ts}WARNING: The duplicate contact record WILL BE DELETED after the merge is complete.{/ts}</strong></p>
129 {if $user}
130 <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.
131The 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).
132You 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>
133 {/if}
134 {if $other_contact_subtype}
135 <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>
136 {/if}
137</div>
138
139<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>
140</div>
141
142{literal}
143<script type="text/javascript">
144
145cj(document).ready(function(){
146 cj('table td input.form-checkbox').each(function() {
147 var ele = null;
148 var element = cj(this).attr('id').split('_',3);
149
150 switch ( element['1'] ) {
151 case 'addressee':
8539f25d 152 ele = '#' + element['0'] + '_' + element['1'];
6a488035
TO
153 break;
154
155 case 'email':
156 case 'postal':
8539f25d 157 ele = '#' + element['0'] + '_' + element['1'] + '_' + element['2'];
6a488035
TO
158 break;
159 }
160
161 if( ele ) {
8539f25d
CW
162 cj(this).on('click', function() {
163 var val = cj(this).prop('checked');
164 cj('input' + ele + ', input' + ele + '_custom').prop('checked', val);
6a488035
TO
165 });
166 }
167 });
168});
169
170</script>
171{/literal}
172
173{* process the dupe contacts *}
174{include file="CRM/common/dedupe.tpl"}