Remove potentially misleading arrows on modified date
[civicrm-core.git] / templates / CRM / Contact / Form / Merge.tpl
... / ...
CommitLineData
1{*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.7 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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 class="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">
32 {include file="CRM/common/formButtons.tpl" location="top"}
33 {if $prev}<a href="{$prev}" class="crm-hover-button action-item"><i class="crm-i fa-chevron-left"></i> {ts}Previous{/ts}</a>{/if}
34 {if $next}<a href="{$next}" class="crm-hover-button action-item">{ts}Next{/ts} <i class="crm-i fa-chevron-right"></i></a>{/if}
35</div>
36
37<div class="action-link">
38 <a href="{$flip}" class="action-item crm-hover-button">
39 <i class="crm-i fa-random"></i>
40 {ts}Flip between original and duplicate contacts.{/ts}
41 </a>
42</div>
43
44<div class="action-link">
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;">
46 <i class="crm-i fa-times-circle"></i>
47 {ts}Mark this pair as not a duplicate.{/ts}
48 </a>
49</div>
50
51<div class="action-link">
52 <a href="javascript:void(0);" class="action-item crm-hover-button toggle_equal_rows">
53 <i class="crm-i fa-eye-slash"></i>
54 {ts}Show/hide rows with the same data on each contact record.{/ts}
55 </a>
56</div>
57
58<table class="row-highlight">
59 <tr class="columnheader">
60 <th>&nbsp;</th>
61 <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$other_cid"}">{$other_name}</a> ({ts}duplicate{/ts})</th>
62 <th>{ts}Mark All{/ts}<br />=={$form.toggleSelect.html} ==&gt;</th>
63 <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$main_cid"}">{$main_name}</a></th>
64 <th width="300">Add/overwrite?</th>
65 </tr>
66
67 {crmAPI var='other_result' entity='Contact' action='get' return="modified_date" id=$other_cid}
68
69 {crmAPI var='main_result' entity='Contact' action='get' return="modified_date" id=$main_cid}
70
71 <tr style="background-color: #FFFFCC !important; border-bottom:1px solid #ccc !important;">
72 <td>Last modified</td>
73 <td>{$other_result.values.0.modified_date|date_format:"%d/%m/%y %H:%M:%S"} {if $other_result.values.0.modified_date gt $main_result.values.0.modified_date} (Most recent) {/if}</td>
74 <td></td>
75 <td>{$main_result.values.0.modified_date|date_format:"%d/%m/%y %H:%M:%S"} {if $main_result.values.0.modified_date gt $other_result.values.0.modified_date} (Most recent) {/if}</td>
76 <td></td>
77 </tr>
78
79 {foreach from=$rows item=row key=field}
80
81 {if !isset($row.main) && !isset($row.other)}
82 <tr style="background-color: #fff !important; border-bottom:1px solid #ccc !important;" class="no-data">
83 <td>
84 <strong>{$row.title}</strong>
85 </td>
86 {else}
87 {if $row.main eq $row.other}
88 <tr style="background-color: #EFFFE7 !important; border-bottom:1px solid #ccc !important;" class="equal-data {cycle values="odd-row,even-row"}">
89 {else}
90 <tr style="background-color: #FFECEC !important; border-bottom:1px solid #ccc !important;" class="diff-data {cycle values="odd-row,even-row"}">
91 {/if}
92 <td>
93 {$row.title}
94 </td>
95 {/if}
96
97 <td>
98 {if $row.title|substr:0:7 == "Address"}<span id="other_{$blockName}_{$blockId}" style="white-space:pre">{else}<span id="other_{$blockName}_{$blockId}">{/if}{if !is_array($row.other)}{$row.other}{elseif $row.other.fileName}{$row.other.fileName}{else}{', '|implode:$row.other}{/if}</span>
99 </td>
100
101 <td style='white-space: nowrap'>
102 {if $form.$field}=={$form.$field.html|crmAddClass:"select-row"}==&gt;{/if}
103 </td>
104
105 {assign var=position value=$field|strrpos:'_'}
106 {assign var=blockId value=$field|substr:$position+1}
107 {assign var=blockName value=$field|substr:14:$position-14}
108
109 {* For location blocks *}
110 {if $row.title|substr:0:5 == "Email" OR
111 $row.title|substr:0:7 == "Address" OR
112 $row.title|substr:0:2 == "IM" OR
113 $row.title|substr:0:7 == "Website" OR
114 $row.title|substr:0:5 == "Phone"}
115
116 <td>
117 {if $row.title|substr:0:7 == "Address"}<span id="main_{$blockName}_{$blockId}" style="white-space:pre">{else}<span id="main_{$blockName}_{$blockId}">{/if}{if !is_array($row.main)}{$row.main}{elseif $row.main.fileName}{$row.main.fileName}{else}{', '|implode:$row.main}{/if}</span>
118 </td>
119
120 <td>
121 {if $blockName eq 'email' || $blockName eq 'phone' || $blockName eq 'address' || $blockName eq 'im' }
122 {$form.location.$blockName.$blockId.locTypeId.html}&nbsp;
123 {/if}
124
125 {* Display other_type_id for websites, ims and phones *}
126 {if $blockName eq 'website' || $blockName eq 'im' || $blockName eq 'phone' }
127 {$form.type.$blockName.$blockId.typeTypeId.html}&nbsp;
128 {/if}
129
130 {if $blockName eq 'email' || $blockName eq 'phone' || $blockName eq 'website' || $blockName eq 'im' }
131 <span id="main_{$blockName}_{$blockId}_overwrite">
132 {if $row.main}
133 (overwrite){$form.location.$blockName.$blockId.html}&nbsp;<br />
134 {else}
135 (add)
136 {/if}
137 </span>
138 {/if}
139
140 {literal}
141 <script type="text/javascript">
142 function mergeBlock(blockname, element, blockId) {
143 var allBlock = {/literal}{$mainLocBlock}{literal};
144 var block = eval( "allBlock." + 'main_'+ blockname + element.value);
145 var label = '';
146 if (blockname == 'email' || blockname == 'phone') {
147 label = '(overwrite)'+ '<span id="main_blockname_blockId_overwrite">{/literal}{$form.location.$blockName.$blockId.operation.html}{literal}<br /></span>';
148 }
149 else {
150 label = '(overwrite)<br />';
151 }
152
153 if (!block) {
154 block = '';
155 label = '(add)';
156 }
157 cj( "#main_"+ blockname +"_" + blockId ).html( block );
158 cj( "#main_"+ blockname +"_" + blockId +"_overwrite" ).html( label );
159 }
160 </script>
161 {/literal}
162
163 </td>
164
165 {* For non-location blocks *}
166 {else}
167
168 <td>
169 <span id="main_{$blockName}_{$blockId}">
170 {if !is_array($row.main)}
171 {$row.main}
172 {elseif $row.main.fileName}
173 {$row.main.fileName}
174 {else}
175 {', '|implode:$row.main}
176 {/if}
177 </span>
178 </td>
179
180 <td>
181 {if isset($row.main) || isset($row.other)}
182 <span id="main_{$blockName}_{$blockId}_overwrite">
183 {if $row.main}
184 (overwrite)<br />
185 {else}
186 (add)
187 {/if}
188 </span>
189 {/if}
190 </td>
191
192 {/if}
193
194 </tr>
195 {/foreach}
196
197 {foreach from=$rel_tables item=params key=paramName}
198 {if $paramName eq 'move_rel_table_users'}
199 <tr class="{cycle values="even-row,odd-row"}">
200 <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>
201 <td>(migrate)</td>
202 </tr>
203 {else}
204 <tr class="{cycle values="even-row,odd-row"}">
205 <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>
206 <td>(migrate)</td>
207 </tr>
208 {/if}
209 {/foreach}
210</table>
211<div class='form-item'>
212 <!--<p>{$form.moveBelongings.html} {$form.moveBelongings.label}</p>-->
213 <!--<p>{$form.deleteOther.html} {$form.deleteOther.label}</p>-->
214</div>
215<div class="message status">
216 <p><strong>{ts}WARNING: The duplicate contact record WILL BE DELETED after the merge is complete.{/ts}</strong></p>
217 {if $user}
218 <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.
219The 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).
220You 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>
221 {/if}
222</div>
223
224<div class="crm-submit-buttons">
225 {include file="CRM/common/formButtons.tpl" location="bottom"}
226</div>
227
228{literal}
229<script type="text/javascript">
230
231 CRM.$(function($) {
232
233 $('table td input.form-checkbox').each(function() {
234 var ele = null;
235 var element = $(this).attr('id').split('_',3);
236
237 switch ( element['1'] ) {
238 case 'addressee':
239 ele = '#' + element['0'] + '_' + element['1'];
240 break;
241
242 case 'email':
243 case 'postal':
244 ele = '#' + element['0'] + '_' + element['1'] + '_' + element['2'];
245 break;
246 }
247
248 if( ele ) {
249 $(this).on('click', function() {
250 var val = $(this).prop('checked');
251 $('input' + ele + ', input' + ele + '_custom').prop('checked', val);
252 });
253 }
254 });
255
256 // Show/hide matching data rows
257 $('.toggle_equal_rows').click(function() {
258 $('tr.equal-data').toggle();
259 });
260
261 });
262
263</script>
264{/literal}
265
266{* process the dupe contacts *}
267{include file="CRM/common/dedupe.tpl"}