Re-add in the remove Exception function
[civicrm-core.git] / templates / CRM / Contact / Page / DedupeException.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2019 |
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 {include file="CRM/common/dedupe.tpl"}
27 <div class="crm-accordion-header">
28 {ts}Filter Contacts{/ts}
29 </div>
30 <div class="crm-accordion-body">
31 <form method="get">
32 <table class="no-border form-layout-compressed" id="searchOptions" style="width:100%;">
33 <tr>
34 <td class="crm-contact-form-block-contact1">
35 <label for="search-contact1">{ts}Contact Name{/ts}</label><br />
36 <input class="crm-form-text" type="text" size="50" placeholder="Search Contacts" value="{$searchcontact1}" id="search-contact1" search-column="0" />
37 </td>
38 <td class="crm-contact-form-block-search">
39 <label>&nbsp;</label><br />
40 <button type="submit" class="button crm-button filtercontacts"><span><i class="crm-i fa-search"></i> Find Contacts</span></button>
41 </td>
42 </tr>
43 </table>
44 </form>
45 </div>
46
47
48 <div class="crm-content-block crm-block">
49 {include file="CRM/common/pager.tpl" location="top"}
50 {include file='CRM/common/jsortable.tpl'}
51
52 <div id="claim_level-wrapper" class="dataTables_wrapper">
53 <table id="claim_level-table" class="display">
54 <thead>
55 <tr>
56 <th>{ts}Contact 1{/ts}</th>
57 <th>{ts}Contact 2 (Duplicate){/ts}</th>
58 <th data-orderable="false"></th>
59 </tr>
60 </thead>
61 <tbody>
62 {assign var="rowClass" value="odd-row"}
63 {assign var="rowCount" value=0}
64
65 {foreach from=$exceptions key=errorId item=exception}
66 {assign var="rowCount" value=$rowCount+1}
67
68 <tr id="row{$rowCount}" class="{cycle values="odd,even"}">
69
70 <td>
71 {assign var="contact1name" value="contact_id1.display_name"}
72 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$exception.contact_id1`"}" target="_blank">{ $exception.$contact1name }</a>
73 </td>
74 <td>
75 {assign var="contact2name" value="contact_id2.display_name"}
76 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$exception.contact_id2`"}" target="_blank">{ $exception.$contact2name }</a>
77 </td>
78 <td>
79 <a id='duplicateContacts' href="#" title={ts}Remove Exception{/ts} onClick="processDupes( {$exception.contact_id1}, {$exception.contact_id2}, 'nondupe-dupe', 'dedupe-exception' );return false;">&raquo; {ts}Remove Exception{/ts}</a>
80 </td>
81 </tr>
82
83 {if $rowClass eq "odd-row"}
84 {assign var="rowClass" value="even-row"}
85 {else}
86 {assign var="rowClass" value="odd-row"}
87 {/if}
88
89 {/foreach}
90 </tbody>
91 </table>
92 </div>
93 {include file="CRM/common/pager.tpl" location="bottom"}
94 </div>
95
96
97
98 <div class="clear"><br /></div>
99 <div class="action-link">
100 {crmButton p="civicrm/contact/deduperules" q="reset=1" icon="times"}{ts}Done{/ts}{/crmButton}
101 </div>
102
103 {* process the dupe contacts *}
104 {literal}
105 <script type="text/javascript">
106 CRM.$(function($) {
107
108 {/literal}
109 var $form = $({if empty($form.formClass)}'#crm-main-content-wrapper'{else}'form.{$form.formClass}'{/if});
110 var currentLocation = {$pager->_response.currentLocation|json_encode};
111 {literal}
112
113 var refreshing = false;
114 var timer = null;
115
116 // apply the search
117 $('.filtercontacts').on( 'click', function (e) {
118 e.preventDefault();
119 clearTimeout(timer);
120 timer = setTimeout(updateTable, 500)
121 });
122
123 function updateTable() {
124
125 var contact1term = $('#search-contact1').val();
126
127 currentLocation = currentLocation.replace(/crmPID=\d+/, 'crmPID=' + 0);
128
129 if (currentLocation.indexOf('crmContact1Q') !== -1) {
130 currentLocation = currentLocation.replace(/crmContact1Q=\w*/, 'crmContact1Q=' + contact1term);
131 }
132 else {
133 currentLocation += '&crmContact1Q='+contact1term;
134 }
135
136 refresh(currentLocation);
137 }
138
139 function refresh(url) {
140 if (!refreshing) {
141 refreshing = true;
142 var options = url ? {url: url} : {};
143 $form.off('.crm-pager').closest('.crm-ajax-container, #crm-main-content-wrapper').crmSnippet(options).crmSnippet('refresh');
144 }
145 }
146
147
148 });
149 </script>
150 {/literal}