0012126: Use canvas print only for sheet print
authorsstamer <s.stamer@metaways.de>
Wed, 17 Aug 2016 09:52:27 +0000 (11:52 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 19 Aug 2016 07:37:11 +0000 (09:37 +0200)
https://forge.tine20.org/view.php?id=12126

Change-Id: Ia4c0cca4bde02aa9d78d6b67356b9324eb5744a1
Reviewed-on: http://gerrit.tine20.com/customers/3466
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/js/CalendarPanelSplitPlugin.js
tine20/Calendar/js/Printer/DaysView.js
tine20/Calendar/js/Printer/MonthView.js
tine20/Tinebase/js/ux/Printer/renderers/Base.js

index a390968..637689f 100644 (file)
@@ -490,6 +490,10 @@ Tine.Calendar.Printer.SplitViewRenderer = Ext.extend(Tine.Calendar.Printer.BaseR
         this.viewArray = [];
 
         this.paperHeight = viewRenderer.paperHeight;
+        // Splitview creates a new renderer so we need to set this again
+        // This is a hack! This is ugly but we have no better idea...fix it.
+        this.useHtml2Canvas = this.printMode == 'sheet' && splitView.calPanel.view.cls != "cal-monthview";
+        
         
         splitView.attendeeViews.each(function(v, i) {
             var renderer = new v.printRenderer({printMode: this.printMode});
index 6af1e34..ad06d23 100644 (file)
@@ -35,6 +35,8 @@ Tine.Calendar.Printer.DaysViewRenderer = Ext.extend(Tine.Calendar.Printer.BaseRe
 
     onBeforePrint: function(document, view) {
         if (this.printMode == 'sheet') {
+            this.useHtml2Canvas = true;
+
             if (view.cropDayTime) {
                 var node = document.getElementById(this.panelId),
                     cropper = node.getElementsByClassName('cal-daysviewpanel-cropper')[0],
index 6ec8d46..eb2e6c5 100644 (file)
@@ -1,6 +1,5 @@
 Tine.Calendar.Printer.MonthViewRenderer = Ext.extend(Tine.Calendar.Printer.BaseRenderer, {
     paperHeight: 155,
-    useHtml2Canvas: false,
 
     generateBody: function(view) {
         var daysHtml = this.splitDays(view.store, view.dateMesh[0], view.dateMesh.length),
index 029a89b..f47d439 100644 (file)
@@ -13,7 +13,7 @@ Ext.ux.Printer.BaseRenderer = Ext.extend(Object, {
   /**
    * @cfg {Boll} useHtml2Canvas
    */
-  useHtml2Canvas: true,
+  useHtml2Canvas: false,
   
   debug: false,