PriceRule: Kontextinformation in Waren
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 7 Oct 2014 15:10:02 +0000 (17:10 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 18 Dec 2014 15:18:51 +0000 (16:18 +0100)
templates/webpages/ic/form_footer.html
templates/webpages/ic/form_header.html

index 9440b67..32c19a7 100644 (file)
 
 </div>
 
+[%- IF id %]
+<div id='price_rules'>
+  <div id='price_rules_customer_report'></div>
+  <div id='price_rules_vendor_report'></div>
+</div>
+[%- END %]
+
 [%- IF show_edit_buttons %]
 
 <input class="submit" type="submit" name="action" value="[% 'Update' | $T8 %]">
 </form>
 
 <script type="text/javascript" src="js/wz_tooltip.js"></script>
+[%- IF id %]
+<script type='text/javascript'>
+  var inline_report = function(target, source, data){
+    $.ajax({
+      url:        source,
+      success:    function (rsp) {
+        $(target).html(rsp);
+        $(target).find('.paginate').find('a').click(function(event){ ns.redirect_event(event, target) });
+        $(target).find('a.report-generator-header-link').click(function(event){ ns.redirect_event(event, target) });
+      },
+      data:       data,
+    });
+  };
+  var redirect_event = function(event, target){
+    event.preventDefault();
+    ns.inline_report(target, event.target + '', {});
+  };
+  $(function() {
+    window.setTimeout(function(){
+      inline_report('#price_rules_customer_report', 'controller.pl', { action: 'PriceRule/list', 'filter.item_type_matches[].part': [% id %], 'filter.type': 'customer', inline: 1 });
+      inline_report('#price_rules_vendor_report', 'controller.pl', { action: 'PriceRule/list', 'filter.item_type_matches[].part': [% id %], 'filter.type': 'vendor', inline: 1 });
+    }, 200);
+  });
+</script>
+[%- END %]
index 7b8455d..6b69894 100644 (file)
@@ -33,6 +33,9 @@
     [%- IF CUSTOM_VARIABLES.size %]
     <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
     [%- END %]
+    [%- IF id  %]
+    <li><a href="#price_rules">[% 'Price Rules' | $T8 %]</a></li>
+    [% END %]
    </ul>
 
   <div id="master_data">