Skip to content

Commit

Permalink
Merge pull request civicrm#12 from mathavanveda/dedupe-workflow-45-tr…
Browse files Browse the repository at this point in the history
…-highlight

display opnly selected contacts checkbox
  • Loading branch information
deepak-srivastava committed Apr 23, 2015
2 parents 8a9576a + c1f2f6f commit e2839fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Contact/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ static function getDedupes() {

$gid = isset($_REQUEST['gid']) ? CRM_Utils_Type::escape($_REQUEST['gid'], 'Integer') : 0;
$rgid = isset($_REQUEST['rgid']) ? CRM_Utils_Type::escape($_REQUEST['rgid'], 'Integer') : 0;
$selected = isset($_REQUEST['selected']) ? 1 : 0;
$selected = isset($_REQUEST['selected']) ? $_REQUEST['selected'] : 0;
if ($rowCount < 0) {
if ($rowCount == -1) {
$selected = 1;
Expand Down
13 changes: 13 additions & 0 deletions templates/CRM/Contact/Page/DedupeFind.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
<input type='checkbox' id ='threshold' class='toggle-vis' data-column-main="12" >
<label for="threshold">{ts}Threshold{/ts}&nbsp;</label>
</div><br/>
<div id="crm-dedupe-display-selected-div" style="float:right;">
<input type='checkbox' id ='crm-dedupe-display-selected' class='crm-dedupe-display-selected' name="display-selected">
<label for="display-selected">{ts}Show Only selected{/ts}&nbsp;</label>
</div>
<table id="dupePairs" class="nestedActivitySelector form-layout-compressed" cellspacing="0" width="100%">
<thead>
<tr class="columnheader">
Expand Down Expand Up @@ -181,6 +185,13 @@
CRM.$(function($) {
var sourceUrl = {/literal}'{$sourceUrl}'{literal};
var context = {/literal}'{$context}'{literal};
$('#crm-dedupe-display-selected').on('click', function(){
reloadUrl = sourceUrl;
if($(this).prop('checked')){
reloadUrl = sourceUrl+'&selected=1';
}
$('#dupePairs').DataTable().ajax.url(reloadUrl).load();
});
$('#dupePairs').dataTable({
//"scrollX": true, // doesn't work with hover popup for for icons
"lengthMenu": [[10, 25, 50, 100, 1000, 2000, -1, -2], [10, 25, 50, 100, 1000, 2000, "All Selected", "All"]],
Expand Down Expand Up @@ -226,6 +237,8 @@ CRM.$(function($) {
}
});

$('#crm-dedupe-display-selected-div').appendTo('#dupePairs_length');

// apply selected class on click of a row
$('#dupePairs tbody').on('click', 'tr', function() {
$(this).toggleClass('crm-row-selected');
Expand Down

0 comments on commit e2839fc

Please sign in to comment.