template für reports als ajaxblock
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 13 Mar 2012 18:59:40 +0000 (19:59 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 18 Apr 2012 12:45:48 +0000 (14:45 +0200)
templates/webpages/ic/sales_price_information.html [new file with mode: 0644]

diff --git a/templates/webpages/ic/sales_price_information.html b/templates/webpages/ic/sales_price_information.html
new file mode 100644 (file)
index 0000000..d7b92bd
--- /dev/null
@@ -0,0 +1,29 @@
+<div id='sales_price_information_sales_order'></div>
+<div id='sales_price_information_sales_quotation'></div>
+
+<script type='text/javascript'>
+  function get_report(target, source, data){
+    $.ajax({
+      url:        source,
+//      beforeSend: function () { $(target).html('<img src="image/spinner.gif">') },
+      success:    function (rsp) {
+        $(target).html(rsp);
+        $(target).find('.paginate').find('a').click(function(event){ redirect_event(event, target) });
+        $(target).find('a.report-generator-header-link').click(function(event){ redirect_event(event, target) });
+      },
+      data:       data,
+    });
+  };
+
+  function redirect_event(event, target){
+    event.preventDefault();
+    get_report(target, event.target + '', {});
+  }
+
+  $(document).ready(function(){
+    get_report('#sales_price_information_sales_order', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_order' });
+    get_report('#sales_price_information_sales_quotation', 'controller.pl', { action: 'SellPriceInformation/list', 'filter.part.id': [% id %], 'filter.order.type': 'sales_quotation' });
+  });
+
+
+</script>