Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/css/print.css =================================================================== --- /sandbox/2.4.2-expresso1/prototype/modules/calendar/css/print.css (revision 6915) +++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/css/print.css (revision 6976) @@ -72,4 +72,5 @@ font: 10px arial; margin: 5px 0; + word-wrap: break-word; } .week { Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js =================================================================== --- /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js (revision 6974) +++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js (revision 6976) @@ -101,4 +101,55 @@ } +function printNow(){ + + var window_print = window.open('','ExpressoCalendar','width=800,height=600,scrollbars=yes'); + window_print.document.open(); + + var start = $("#calendar").fullCalendar('getView').visStart.getTime()/1000; + var end = $("#calendar").fullCalendar('getView').visEnd.getTime()/1000; + var criteria = DataLayer.criteria("schedulable:calendar", {'start':start, 'end':end} ); + + var data = DataLayer.get("schedulable:print", criteria); + + if($("#calendar").fullCalendar('getView').name == "month"){ + window_print.document.write(DataLayer.render('templates/calendar_month_print.ejs', { + 'InfoPage' : $("#calendar").fullCalendar('getView').title, + 'days' : data + } )); + } + if($("#calendar").fullCalendar('getView').name == "agendaDay"){ + window_print.document.write(DataLayer.render('templates/calendar_day_print.ejs', { + 'InfoPage' : $("#calendar").fullCalendar('getView').title, + 'days' : data + } )); + } + if($("#calendar").fullCalendar('getView').name == "agendaWeek"){ + window_print.document.write(DataLayer.render('templates/calendar_week_print.ejs', { + 'InfoPage' : $("#calendar").fullCalendar('getView').title, + 'days' : data + })); + + var aux = 0; + setTimeout(function(){$(window_print.document).find(".all-day").each(function(){ + if($(this).height() > aux) + aux = $(this).height(); + }); + $(window_print.document).find(".all-day").each(function(){ + $(this).height(aux); + }); + $(window_print.document).find(".all-day-line .write").height(aux); + aux = 0; + },20); + } + if($("#calendar").fullCalendar('getView').name == "year"){ + window_print.document.write(DataLayer.render('templates/calendar_year_print.ejs', { + 'html' : $('#calendar .fc-content').html(), + 'header': $('#calendar').find('.fc-header-center h2').text() + } )); + } + window_print.document.close(); + setTimeout(window_print.print(), 300); +} + function printEvents(){ //var html = DataLayer.render( path + 'templates/attendee_permissions.ejs', {} ); @@ -113,51 +164,7 @@ $('.fc-header-right').append(print); $('.fc-button-print').click(function(){ - var window_print = window.open('','ExpressoCalendar','width=800,height=600,scrollbars=yes'); - window_print.document.open(); - var end = $("#calendar").fullCalendar('getView').visEnd.getTime()/1000; - var start = $("#calendar").fullCalendar('getView').visStart.getTime()/1000; - var criteria = DataLayer.criteria("schedulable:calendar", {'start':start, 'end':end} ); - - var data = DataLayer.get("schedulable:print", criteria); - if($("#calendar").fullCalendar('getView').name == "month"){ - window_print.document.write(DataLayer.render('templates/calendar_month_print.ejs', { - 'InfoPage' : $("#calendar").fullCalendar('getView').title, - 'days' : data - } )); - } - if($("#calendar").fullCalendar('getView').name == "agendaDay"){ - window_print.document.write(DataLayer.render('templates/calendar_day_print.ejs', { - 'InfoPage' : $("#calendar").fullCalendar('getView').title, - 'days' : data - } )); - } - if($("#calendar").fullCalendar('getView').name == "agendaWeek"){ - window_print.document.write(DataLayer.render('templates/calendar_week_print.ejs', { - 'InfoPage' : $("#calendar").fullCalendar('getView').title, - 'days' : data - })); - - var aux = 0; - setTimeout(function(){$(window_print.document).find(".all-day").each(function(){ - if($(this).height() > aux) - aux = $(this).height(); - }); - $(window_print.document).find(".all-day").each(function(){ - $(this).height(aux); - }); - $(window_print.document).find(".all-day-line .write").height(aux); - aux = 0; - },20); - } - if($("#calendar").fullCalendar('getView').name == "year"){ - window_print.document.write(DataLayer.render('templates/calendar_year_print.ejs', { - 'html' : $('#calendar .fc-content').html(), - 'header': $('#calendar').find('.fc-header-center h2').text() - } )); - } - window_print.document.close(); - window_print.print(); + alert('A tela de impressão será melhor visualizada com a preferência "Paisagem" do seu browser selecionada.'); + printNow(); }); - } Index: /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/calendar_month_print.ejs =================================================================== --- /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/calendar_month_print.ejs (revision 6915) +++ /sandbox/2.4.2-expresso1/prototype/modules/calendar/templates/calendar_month_print.ejs (revision 6976) @@ -8,5 +8,5 @@