1 {* common dupe contacts processing *}
2 <div id='processDupes' class="success-status" style="display:none;"></div>
4 <script type='text/javascript'>
6 cj( '#processDupes' ).hide( );
8 function processDupes( cid, oid, oper, context, reloadURL ) {
9 //currently we are doing in a single way.
10 //later we might want two way operations.
12 if ( !cid || !oid || !oper ) return;
14 var title = {/literal}'{ts escape="js"}Mark as Dedupe Exception{/ts}'{literal};
15 var msg = {/literal}'{ts escape="js"}Are you sure you want to mark this pair of contacts as NOT duplicates?{/ts}'{literal};
16 if ( oper == 'nondupe-dupe' ) {
17 var title = {/literal}'{ts escape="js"}Remove Dedupe Exception{/ts}'{literal};
18 var msg = {/literal}'{ts escape="js"}Are you sure you want to remove this dedupe exception.{/ts}'{literal};
21 cj("#processDupes").show( );
22 cj("#processDupes").dialog({
32 cj( '#processDupes' ).show( ).html( msg );
36 "Cancel": function() {
37 cj(this).dialog("close");
40 saveProcessDupes( cid, oid, oper, context );
41 cj(this).dialog( 'close' );
42 if ( context == 'merge-contact' && reloadURL ) {
43 // redirect after a small delay
44 setTimeout("window.location.href = '" + reloadURL + "'", 500);
52 function saveProcessDupes( cid, oid, oper, context ) {
53 //currently we are doing in a single way.
54 //later we might want two way operations.
56 if ( !cid || !oid || !oper ) return;
58 var statusMsg = {/literal}'{ts escape="js"}Marked as non duplicates.{/ts}'{literal};
59 if ( oper == 'nondupe-dupe' ) {
60 var statusMsg = {/literal}'{ts escape="js"}Marked as duplicates.{/ts}'{literal};
63 var url = {/literal}"{crmURL p='civicrm/ajax/rest' q='className=CRM_Contact_Page_AJAX&fnName=processDupes' h=0 }"{literal};
64 //post the data to process dupes.
66 {cid: cid, oid: oid, op: oper},
68 if ( result.status == oper ) {
70 if ( oper == 'dupe-nondupe' &&
71 context == 'dupe-listing' ) {
73 } else if ( oper == 'nondupe-dupe' ) {
74 cj( "#dupeRow_" + cid + '_' + oid ).hide( );