Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
39de6fd5 | 3 | | CiviCRM version 4.6 | |
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 | ||
fd66df85 | 31 | <div class="crm-submit-buttons"> |
fd66df85 | 32 | {include file="CRM/common/formButtons.tpl" location="top"} |
aeb97cc1 CW |
33 | {if $prev}<a href="{$prev}" class="crm-hover-button action-item"><span class="icon ui-icon-triangle-1-w"></span> {ts}Previous{/ts}</a>{/if} |
34 | {if $next}<a href="{$next}" class="crm-hover-button action-item">{ts}Next{/ts} <span class="icon ui-icon-triangle-1-e"></span></a>{/if} | |
fd66df85 | 35 | </div> |
6a488035 TO |
36 | |
37 | <div class="action-link"> | |
fd66df85 CW |
38 | <a href="{$flip}" class="action-item crm-hover-button"> |
39 | <span class="icon ui-icon-shuffle"></span> | |
40 | {ts}Flip between original and duplicate contacts.{/ts} | |
41 | </a> | |
6a488035 TO |
42 | </div> |
43 | ||
44 | <div class="action-link"> | |
aeb97cc1 | 45 | <a href="#" class="action-item crm-hover-button crm-notDuplicate" title={ts}Mark this pair as not a duplicate.{/ts} onClick="processDupes( {$main_cid}, {$other_cid}, 'dupe-nondupe', 'merge-contact', '{if $rgid}{crmURL p="civicrm/contact/dedupefind" q="reset=1&action=update&rgid=$rgid"}{/if}' );return false;"> |
fd66df85 CW |
46 | <span class="icon ui-icon-circle-close"></span> |
47 | {ts}Mark this pair as not a duplicate.{/ts} | |
48 | </a> | |
6a488035 TO |
49 | </div> |
50 | ||
a76cd114 | 51 | <table class="row-highlight"> |
6a488035 TO |
52 | <tr class="columnheader"> |
53 | <th> </th> | |
f1f27800 | 54 | <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$other_cid"}">{$other_name}</a> ({ts}duplicate{/ts})</th> |
6a488035 | 55 | <th>{ts}Mark All{/ts}<br />=={$form.toggleSelect.html} ==></th> |
f1f27800 | 56 | <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$main_cid"}">{$main_name}</a></th> |
6a488035 TO |
57 | </tr> |
58 | {foreach from=$rows item=row key=field} | |
59 | <tr class="{cycle values="odd-row,even-row"}"> | |
60 | <td>{$row.title}</td> | |
61 | <td> | |
f1f27800 DG |
62 | {if !is_array($row.other)} |
63 | {$row.other} | |
64 | {elseif $row.other.fileName} | |
65 | {$row.other.fileName} | |
66 | {else} | |
67 | {', '|implode:$row.other} | |
68 | {/if} | |
6a488035 | 69 | </td> |
a76cd114 | 70 | <td style='white-space: nowrap'>{if $form.$field}=={$form.$field.html|crmAddClass:"select-row"}==>{/if}</td> |
6a488035 TO |
71 | <td> |
72 | {if $row.title|substr:0:5 == "Email" OR | |
73 | $row.title|substr:0:7 == "Address" OR | |
74 | $row.title|substr:0:2 == "IM" OR | |
75 | $row.title|substr:0:6 == "OpenID" OR | |
76 | $row.title|substr:0:5 == "Phone"} | |
77 | ||
78 | {assign var=position value=$field|strrpos:'_'} | |
79 | {assign var=blockId value=$field|substr:$position+1} | |
80 | {assign var=blockName value=$field|substr:14:$position-14} | |
81 | ||
82 | {$form.location.$blockName.$blockId.locTypeId.html} | |
83 | {if $blockName eq 'email' || $blockName eq 'phone' } | |
84 | <span id="main_{$blockName}_{$blockId}_overwrite">{if $row.main}(overwrite){$form.location.$blockName.$blockId.operation.html} <br />{else}(add){/if}</span> | |
85 | {literal} | |
86 | <script type="text/javascript"> | |
87 | function mergeBlock(blockname, element, blockId) { | |
88 | var allBlock = {/literal}{$mainLocBlock}{literal}; | |
89 | var block = eval( "allBlock." + 'main_'+ blockname + element.value); | |
90 | if(blockname == 'email' || blockname == 'phone'){ | |
91 | var label = '(overwrite)'+ '<span id="main_blockname_blockId_overwrite">{/literal}{$form.location.$blockName.$blockId.operation.html}{literal}<br /></span>'; | |
92 | } | |
93 | else { | |
94 | label = '(overwrite)<br />'; | |
95 | } | |
96 | ||
97 | if ( !block ) { | |
98 | block = ''; | |
99 | label = '(add)'; | |
100 | } | |
101 | cj( "#main_"+ blockname +"_" + blockId ).html( block ); | |
102 | cj( "#main_"+ blockname +"_" + blockId +"_overwrite" ).html( label ); | |
103 | } | |
104 | </script> | |
105 | {/literal} | |
106 | {else} | |
107 | <span id="main_{$blockName}_{$blockId}_overwrite">{if $row.main}(overwrite)<br />{else}(add){/if}</span> | |
108 | {/if} | |
109 | ||
110 | {/if} | |
111 | {*NYSS 5546*} | |
112 | <span id="main_{$blockName}_{$blockId}"> | |
113 | {if !is_array($row.main)} | |
114 | {$row.main} | |
f1f27800 | 115 | {elseif $row.main.fileName} |
6a488035 | 116 | {$row.main.fileName} |
f1f27800 DG |
117 | {else} |
118 | {', '|implode:$row.main} | |
6a488035 TO |
119 | {/if} |
120 | </span> | |
121 | </td> | |
122 | </tr> | |
123 | {/foreach} | |
124 | ||
125 | {foreach from=$rel_tables item=params key=paramName} | |
126 | {if $paramName eq 'move_rel_table_users'} | |
127 | <tr class="{cycle values="even-row,odd-row"}"> | |
a76cd114 | 128 | <td><strong>{ts}Move related...{/ts}</strong></td><td>{if $otherUfId}<a target="_blank" href="{$params.other_url}">{$otherUfName}</a></td><td style='white-space: nowrap'>=={$form.$paramName.html|crmAddClass:"select-row"}==>{else}<td style='white-space: nowrap'></td>{/if}</td><td>{if $mainUfId}<a target="_blank" href="{$params.main_url}">{$mainUfName}</a>{/if}</td> |
6a488035 TO |
129 | </tr> |
130 | {else} | |
131 | <tr class="{cycle values="even-row,odd-row"}"> | |
a76cd114 | 132 | <td><strong>{ts}Move related...{/ts}</strong></td><td><a href="{$params.other_url}">{$params.title}</a></td><td style='white-space: nowrap'>=={$form.$paramName.html|crmAddClass:"select-row"}==></td><td><a href="{$params.main_url}">{$params.title}</a>{if $form.operation.$paramName.add.html} {$form.operation.$paramName.add.html}{/if}</td> |
6a488035 TO |
133 | </tr> |
134 | {/if} | |
135 | {/foreach} | |
136 | </table> | |
137 | <div class='form-item'> | |
138 | <!--<p>{$form.moveBelongings.html} {$form.moveBelongings.label}</p>--> | |
139 | <!--<p>{$form.deleteOther.html} {$form.deleteOther.label}</p>--> | |
140 | </div> | |
141 | <div class="message status"> | |
142 | <p><strong>{ts}WARNING: The duplicate contact record WILL BE DELETED after the merge is complete.{/ts}</strong></p> | |
143 | {if $user} | |
144 | <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. | |
145 | The 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). | |
146 | You 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> | |
147 | {/if} | |
6a488035 TO |
148 | </div> |
149 | ||
fd66df85 | 150 | <div class="crm-submit-buttons"> |
fd66df85 | 151 | {include file="CRM/common/formButtons.tpl" location="bottom"} |
6a488035 TO |
152 | </div> |
153 | ||
154 | {literal} | |
155 | <script type="text/javascript"> | |
156 | ||
ae8f569f CW |
157 | CRM.$(function($) { |
158 | $('table td input.form-checkbox').each(function() { | |
6a488035 | 159 | var ele = null; |
ae8f569f | 160 | var element = $(this).attr('id').split('_',3); |
6a488035 TO |
161 | |
162 | switch ( element['1'] ) { | |
163 | case 'addressee': | |
8539f25d | 164 | ele = '#' + element['0'] + '_' + element['1']; |
6a488035 TO |
165 | break; |
166 | ||
167 | case 'email': | |
168 | case 'postal': | |
8539f25d | 169 | ele = '#' + element['0'] + '_' + element['1'] + '_' + element['2']; |
6a488035 TO |
170 | break; |
171 | } | |
172 | ||
173 | if( ele ) { | |
ae8f569f CW |
174 | $(this).on('click', function() { |
175 | var val = $(this).prop('checked'); | |
176 | $('input' + ele + ', input' + ele + '_custom').prop('checked', val); | |
6a488035 TO |
177 | }); |
178 | } | |
179 | }); | |
ae8f569f | 180 | }); |
6a488035 TO |
181 | |
182 | </script> | |
183 | {/literal} | |
184 | ||
185 | {* process the dupe contacts *} | |
186 | {include file="CRM/common/dedupe.tpl"} |