Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-08-25-10-57-01
[civicrm-core.git] / templates / CRM / Contact / Form / Merge.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
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">
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', '{if $rgid}{crmURL p="civicrm/contact/dedupefind" q="reset=1&action=update&rgid=$rgid"}{/if}' );return false;">&raquo; {ts}Mark this pair as not a duplicate.{/ts}</a>
39 </div>
40
41 <table class="row-highlight">
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}</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}</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 {elseif $row.other.fileName}
55 {$row.other.fileName}
56 {else}
57 {', '|implode:$row.other}
58 {/if}
59 </td>
60 <td style='white-space: nowrap'>{if $form.$field}=={$form.$field.html|crmAddClass:"select-row"}==&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}
105 {elseif $row.main.fileName}
106 {$row.main.fileName}
107 {else}
108 {', '|implode:$row.main}
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 <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"}==&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 <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"}==&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.
135 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).
136 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>
137 {/if}
138 </div>
139
140 <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>
141 </div>
142
143 {literal}
144 <script type="text/javascript">
145
146 CRM.$(function($) {
147 $('table td input.form-checkbox').each(function() {
148 var ele = null;
149 var element = $(this).attr('id').split('_',3);
150
151 switch ( element['1'] ) {
152 case 'addressee':
153 ele = '#' + element['0'] + '_' + element['1'];
154 break;
155
156 case 'email':
157 case 'postal':
158 ele = '#' + element['0'] + '_' + element['1'] + '_' + element['2'];
159 break;
160 }
161
162 if( ele ) {
163 $(this).on('click', function() {
164 var val = $(this).prop('checked');
165 $('input' + ele + ', input' + ele + '_custom').prop('checked', val);
166 });
167 }
168 });
169 });
170
171 </script>
172 {/literal}
173
174 {* process the dupe contacts *}
175 {include file="CRM/common/dedupe.tpl"}