CRM-14486 add empowered by CiviCRM as public footer
[civicrm-core.git] / templates / CRM / common / logButton.tpl
index 5c9568ae737e358e0afbeab5eba25c4d1f81c647..5f4af02177d4c0c69437c9a9f703a845b3054a1d 100644 (file)
@@ -1,8 +1,8 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
 *}
 
 <a class="css_right {$snippet.css_class}" href="#" title="{ts}View Revisions{/ts}">View Revisions</a>
-<div class="dialog-{$snippet.css_class}">
-  <div class="revision-content"></div>
-</div>
 
 {literal}
 <script type="text/javascript">
-
 (function($, CRM) {
-  $.fn.crmRevisionLink = function(options) {
-    return this.each(function(){
-      $(this).on("click", function() {
-        $(options.cssDialogSelector).show( );
-        $(options.cssDialogSelector).dialog({
-          title: "{/literal}{ts}Revisions{/ts}{literal}",
-          modal: true,
-          width: "680px",
-          bgiframe: true,
-          overlay: { opacity: 0.5, background: "black" },
-          open:function() {
-            var ajaxurl = CRM.url("civicrm/report/instance/" + options.reportId);
-            cj.ajax({
-              data: "reset=1&snippet=4&section=2&altered_contact_id_op=eq&altered_contact_id_value="+options.contactId+"&log_type_table_op=has&log_type_table_value=" + options.tableName,
-              url:  ajaxurl,
-              success: function (data) {
-                $(options.cssDialogSelector + " .revision-content").html(data);
-                if (!$(options.cssDialogSelector + " .revision-content .report-layout").length) {
-                  $(options.cssDialogSelector + " .revision-content").html("Sorry, couldn't find any revisions.");
-                }
-              }
-            });
-          },
-          buttons: {
-            "Done": function() {
-              $(this).dialog("destroy");
-            }
-          }
-        });
-      });
-    }); // this.each
-  }; // fn.crmRevisionLink
-
-  $(".{/literal}{$snippet.css_class}{literal}").crmRevisionLink({
-    cssDialogSelector: ".dialog-{/literal}{$snippet.css_class}{literal}",
-    contactId: {/literal}{$snippet.contact_id}{literal},
-    tableName: "{/literal}{$snippet.table_name}{literal}",
-    reportId: {/literal}{$snippet.instance_id}{literal}
-  });
+  if ($(".{/literal}{$snippet.css_class}{literal}").length) {
+    $(".{/literal}{$snippet.css_class}{literal}").crmRevisionLink({
+      contactId: {/literal}{$snippet.contact_id}{literal},
+      tableName: "{/literal}{$snippet.table_name}{literal}",
+      reportId: {/literal}{$snippet.instance_id}{literal}
+    });
+  }
 })(cj, CRM);
 </script>
 {/literal}