6 * cj('.my-link').crmRevisionLink({
7 * 'reportId': 123, // CRM_Report_Utils_Report::getInstanceIDForValue('logging/contact/summary'),
8 * 'tableName': 'my_table',
12 * Note: This file is used by CivHR
14 $.fn
.crmRevisionLink = function(options
) {
15 return this.each(function(){
16 var $dialog
= $('<div><div class="revision-content"></div></div>');
17 $('body').append($dialog
);
18 $(this).on("click", function() {
21 title
: ts("Revisions"),
25 overlay
: { opacity
: 0.5, background
: "black" },
27 var ajaxurl
= CRM
.url("civicrm/report/instance/" + options
.reportId
);
29 data
: "reset=1&snippet=4§ion=2&altered_contact_id_op=eq&altered_contact_id_value="+options
.contactId
+"&log_type_table_op=has&log_type_table_value=" + options
.tableName
,
31 success: function (data
) {
32 $dialog
.find(".revision-content").html(data
);
33 if (!$dialog
.find(".revision-content .report-layout").length
) {
34 $dialog
.find(".revision-content").html("Sorry, couldn't find any revisions.");
41 $(this).dialog("destroy");
48 }; // fn.crmRevisionLink