CRM-12910 - logButton.tpl - Use more JS variables instead of Smarty variables
authorTim Otten <totten@civicrm.org>
Tue, 6 Aug 2013 23:30:54 +0000 (16:30 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 6 Aug 2013 23:30:54 +0000 (16:30 -0700)
----------------------------------------
* CRM-12910: Display revision history for each item under "Job"
  http://issues.civicrm.org/jira/browse/CRM-12910

templates/CRM/common/logButton.tpl

index 27515dc161857498815b4ee83f9afebb89de542a..61e6be5bca66e07fc3ca756e2a7786f1b55685e3 100644 (file)
@@ -46,6 +46,9 @@
 
 (function($, CRM) {
   var cssDialogSelector = ".dialog-{/literal}{$snippet.css_class}{literal}";
+  var contactId = {/literal}{$snippet.contact_id}{literal};
+  var tableName = "{/literal}{$snippet.table_name}{literal}";
+  var reportId = {/literal}{$snippet.instance_id}{literal};
   $(document).on("click", ".{/literal}{$snippet.css_class}{literal}", function() {
     $(cssDialogSelector).show( );
     $(cssDialogSelector).dialog({
@@ -55,9 +58,9 @@
       bgiframe: true,
       overlay: { opacity: 0.5, background: "black" },
       open:function() {
-        var ajaxurl = CRM.url("civicrm/report/instance/{/literal}{$snippet.instance_id}{literal}");
+        var ajaxurl = CRM.url("civicrm/report/instance/" + reportId);
         cj.ajax({
-          data: "reset=1&snippet=4&section=2&altered_contact_id_op=eq&altered_contact_id_value={/literal}{$snippet.contact_id}{literal}&log_type_table_op=has&log_type_table_value={/literal}{$snippet.table_name}{literal}",
+          data: "reset=1&snippet=4&section=2&altered_contact_id_op=eq&altered_contact_id_value="+contactId+"&log_type_table_op=has&log_type_table_value=" + tableName,
           url:  ajaxurl,
           success: function (data) {
             $(cssDialogSelector + " .revision-content").html(data);