0010628: Calender print shows only time range 0-11 o'clock
authorCornelius Weiß <mail@corneliusweiss.de>
Tue, 18 Aug 2015 17:44:48 +0000 (19:44 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 27 Aug 2015 12:23:41 +0000 (14:23 +0200)
* print full day when not in calCrop is disabled

Change-Id: I2e9206c1c620c48d1a94db95c0d5331c8bbcbdc3
Reviewed-on: http://gerrit.tine20.com/customers/2117
Tested-by: Jenkins CI (http://ci.tine20.com/)
Tested-by: sstamer <s.stamer@metaways.de>
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Calendar/js/Printer/DaysView.js

index 0e2fa39..dddc3b7 100644 (file)
@@ -33,7 +33,15 @@ Tine.Calendar.Printer.DaysViewRenderer = Ext.extend(Tine.Calendar.Printer.BaseRe
     },
 
     onBeforePrint: function(document, view) {
+
         //if (this.printMode == 'sheet') {
+        //    // scroll to dayStart if crop is disabled
+        //    if (! view.cropDayTime) {
+        //        var scroller = document.getElementsByClassName('cal-daysviewpanel-scroller')[0],
+        //            dayStartPx = view.getTimeOffset(view.dayStart);
+        //
+        //        scroller.scrollTop = dayStartPx;
+        //    }
         //    // FF has scale to page option but scrambles everything after the first page
         //    // @TODO downscale to fit one page
         //
@@ -50,11 +58,15 @@ Tine.Calendar.Printer.DaysViewRenderer = Ext.extend(Tine.Calendar.Printer.BaseRe
         var node = view.el.dom.cloneNode(true),
             header = node.getElementsByClassName('cal-daysviewpanel-wholedayheader-scroller')[0],
             scroller = node.getElementsByClassName('cal-daysviewpanel-scroller')[0],
-            fullHeight = view.dayEndPx - view.getTimeOffset(view.dayStart) + 20;
-        
+            dayStartPx = view.getTimeOffset(view.dayStart),
+            fullHeight = view.getTimeOffset(view.startDate.add(Date.DAY, 1).add(Date.MINUTE, -1)),
+            cropHeight = view.dayEndPx - dayStartPx + 20,
+            scrollerHeight = view.cropDayTime ? cropHeight : fullHeight;
+
+
         // resize header/scroller to fullsize
         header.style.height = [header.firstChild.style.height, header.style.height].sort().pop();
-        scroller.style.height =  fullHeight + 'px';
+        scroller.style.height =  scrollerHeight + 'px';
         scroller.style.width = null;
 
         return this.generateTitle(view) + node.innerHTML;