PriceRule: Kontextinformation in Waren
[kivitendo-erp.git] / templates / webpages / ic / form_footer.html
index 1be0eec..32c19a7 100644 (file)
     <td><hr size="3" noshade></td>
   </tr>
  </table>
-
- <br style="clear: left" />
 </div>
 
+[%- IF LANGUAGES.size %]
+ [% PROCESS 'ic/tabs/_edit_translations.html' %]
+[%- END %]
+
 [%- IF id %]
-<div id="sales_price_information" class="tabcontent">
+<div id="sales_price_information">
   [% PROCESS ic/sales_price_information.html id=id %]
 </div>
 [%- END %]
 
 [%- IF CUSTOM_VARIABLES.size %]
-<div id="custom_variables" class="tabcontent">
+<div id="custom_variables">
 
  <p>[% 'Unchecked custom variables will not appear in orders and invoices.' | $T8 %]</p>
 
    [%- FOREACH var = CUSTOM_VARIABLES %]
    <tr>
     <td align="right" valign="top">[% var.VALID_BOX %]</td>
-    <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
+    [%- IF !var.partsgroup_filtered %]
+      <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
+    [%- END %]
     <td valign="top">[% var.HTML_CODE %]</td>
    </tr>
    [%- END %]
   </table>
  </p>
-
- <br style="clear: left" />
 </div>
 [%- END %]
 
 </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 %]">
 <input type="hidden" name="price_rows" value="[% HTML.escape(price_rows) %]">
 <input class="submit" type="submit" name="action" value="[% 'Save' | $T8 %]">
@@ -79,6 +90,8 @@
     [%- END %]
   [%- END %]
 
+[%- END %]
+
   [%- IF id != "" %]
 <input type="button" class="submit" onclick="set_history_window([% id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
   [%- END %]
 </form>
 
 <script type="text/javascript" src="js/wz_tooltip.js"></script>
-<script type="text/javascript">
-<!--
-    var maintab = new ddtabcontent("maintab");
-    maintab.setpersist(true);
-    maintab.setselectedClassTarget("link"); //"link" or "linkparent"
-    maintab.init();
-  -->
+[%- 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>
-
-</body>
+[%- END %]