adopt printing to splitViews
authorCornelius Weiß <mail@corneliusweiss.de>
Thu, 14 Aug 2014 13:45:44 +0000 (15:45 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 25 Feb 2015 16:15:19 +0000 (17:15 +0100)
Change-Id: Icb14e853107a3d6351389647a733132f3f81242d
Reviewed-on: http://gerrit.tine20.com/customers/990

tine20/Calendar/js/CalendarPanelSplitPlugin.js

index 14a6fd6..66b3ded 100644 (file)
@@ -288,8 +288,8 @@ Tine.Calendar.CalendarPanelSplitPlugin.prototype = {
         return this.activeAttendeeView;
     },
     
-    onPrint: function() {
-        var renderer = new Tine.Calendar.Printer.SplitViewRenderer();
+    onPrint: function(printMode) { 
+        var renderer = new Tine.Calendar.Printer.SplitViewRenderer({printMode: printMode});
         renderer.print(this);
     },
     
@@ -459,6 +459,7 @@ Tine.Calendar.CalendarPanelSplitPlugin.SplitBtn = Ext.extend(Ext.Button, {
 });
 
 Tine.Calendar.Printer.SplitViewRenderer = Ext.extend(Tine.Calendar.Printer.BaseRenderer, {
+    getAdditionalHeaders: Tine.Calendar.Printer.DaysViewRenderer.prototype.getAdditionalHeaders,
     generateBody: function(splitView) {
         var viewRenderer = splitView.calPanel.view.printRenderer,
         htmlArray = [];
@@ -466,11 +467,11 @@ Tine.Calendar.Printer.SplitViewRenderer = Ext.extend(Tine.Calendar.Printer.BaseR
         this.paperHeight = viewRenderer.paperHeight;
         
         splitView.attendeeViews.each(function(v, i) {
-            var renderer = new v.printRenderer();
+            var renderer = new v.printRenderer({printMode: this.printMode});
             renderer.extraTitle = v.title + ' // ';
             renderer.titleStyle = i > 0 ? 'page-break-before:always' : '';
 
-            htmlArray.push(renderer.generateBody(v));
+            htmlArray.push('<div class="page">' + renderer.generateBody(v) + '</div>');
         }, this);
         
         return htmlArray.join('');