Remove potentially misleading arrows on modified date
[civicrm-core.git] / templates / CRM / Contact / Form / Merge.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
2c4c49ca 3 | CiviCRM version 4.7 |
6a488035 4 +--------------------------------------------------------------------+
e7112fa7 5 | Copyright CiviCRM LLC (c) 2004-2015 |
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">
f6eedce7 27<div class="help">
6a488035
TO
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"}
f62db3ac
AH
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}
fd66df85 35</div>
6a488035
TO
36
37<div class="action-link">
fd66df85 38 <a href="{$flip}" class="action-item crm-hover-button">
f62db3ac 39 <i class="crm-i fa-random"></i>
fd66df85
CW
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;">
f62db3ac 46 <i class="crm-i fa-times-circle"></i>
fd66df85
CW
47 {ts}Mark this pair as not a duplicate.{/ts}
48 </a>
6a488035
TO
49</div>
50
08ef1f91
R
51<div class="action-link">
52 <a href="javascript:void(0);" class="action-item crm-hover-button toggle_equal_rows">
eb61dc07 53 <i class="crm-i fa-eye-slash"></i>
08ef1f91
R
54 {ts}Show/hide rows with the same data on each contact record.{/ts}
55 </a>
56</div>
57
a76cd114 58<table class="row-highlight">
6a488035
TO
59 <tr class="columnheader">
60 <th>&nbsp;</th>
f1f27800 61 <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$other_cid"}">{$other_name}</a> ({ts}duplicate{/ts})</th>
6a488035 62 <th>{ts}Mark All{/ts}<br />=={$form.toggleSelect.html} ==&gt;</th>
f1f27800 63 <th><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$main_cid"}">{$main_name}</a></th>
08ef1f91
R
64 <th width="300">Add/overwrite?</th>
65 </tr>
eb61dc07 66
08ef1f91 67 {crmAPI var='other_result' entity='Contact' action='get' return="modified_date" id=$other_cid}
eb61dc07
J
68
69 {crmAPI var='main_result' entity='Contact' action='get' return="modified_date" id=$main_cid}
70
08ef1f91
R
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>
76e0f310 74 <td></td>
08ef1f91
R
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>
6a488035 77 </tr>
eb61dc07 78
6a488035 79 {foreach from=$rows item=row key=field}
eb61dc07
J
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">
6a488035 83 <td>
08ef1f91 84 <strong>{$row.title}</strong>
6a488035 85 </td>
08ef1f91
R
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}
6a488035 92 <td>
08ef1f91
R
93 {$row.title}
94 </td>
eb61dc07
J
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
08ef1f91
R
101 <td style='white-space: nowrap'>
102 {if $form.$field}=={$form.$field.html|crmAddClass:"select-row"}==&gt;{/if}
103 </td>
eb61dc07
J
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}
08ef1f91 108
eb61dc07 109 {* For location blocks *}
08ef1f91
R
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
eb61dc07
J
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 />
08ef1f91 134 {else}
eb61dc07 135 (add)
6a488035 136 {/if}
08ef1f91 137 </span>
eb61dc07
J
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)}
08ef1f91 182 <span id="main_{$blockName}_{$blockId}_overwrite">
eb61dc07
J
183 {if $row.main}
184 (overwrite)<br />
08ef1f91 185 {else}
eb61dc07
J
186 (add)
187 {/if}
08ef1f91 188 </span>
6a488035 189 {/if}
eb61dc07
J
190 </td>
191
192 {/if}
08ef1f91 193
6a488035
TO
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"}">
a76cd114 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>
08ef1f91 201 <td>(migrate)</td>
6a488035
TO
202 </tr>
203 {else}
204 <tr class="{cycle values="even-row,odd-row"}">
a76cd114 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>
08ef1f91 206 <td>(migrate)</td>
6a488035
TO
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}
6a488035
TO
222</div>
223
fd66df85 224<div class="crm-submit-buttons">
fd66df85 225 {include file="CRM/common/formButtons.tpl" location="bottom"}
6a488035
TO
226</div>
227
228{literal}
229<script type="text/javascript">
230
ae8f569f 231 CRM.$(function($) {
eb61dc07 232
ae8f569f 233 $('table td input.form-checkbox').each(function() {
eb61dc07
J
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 }
6a488035 254 });
eb61dc07
J
255
256 // Show/hide matching data rows
257 $('.toggle_equal_rows').click(function() {
258 $('tr.equal-data').toggle();
259 });
260
08ef1f91 261 });
6a488035
TO
262
263</script>
264{/literal}
265
266{* process the dupe contacts *}
267{include file="CRM/common/dedupe.tpl"}