Creation of the first version of the printing interface

pull/36/head
Alexandre Cloutier 2014-04-14 10:29:23 -04:00
parent cb5e6e7ef2
commit 8f6b0f80a7
9 changed files with 387 additions and 104 deletions

View File

@ -23,6 +23,7 @@ SchedulerUI_OBJC_FILES = \
UIxCalFolderActions.m \
\
UIxCalView.m \
UIxCalViewPrint.m \
UIxCalDayView.m \
UIxCalMulticolumnDayView.m \
UIxCalWeekView.m \

View File

@ -38,7 +38,7 @@
image = "month-view.png";
tooltip = "Switch to month view"; } ),
( { link = "#";
onclick = "";
onclick = "return printView();";
cssClass = "tbicon_print single-window-not-conditional";
image = "tb-mail-print-flat-24x24.png";
label = "Print View";

View File

@ -0,0 +1,31 @@
/* UIxCalView.h - this file is part of SOGo
*
* Copyright (C) 2006-2009 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import <SOGoUI/UIxComponent.h>
@interface UIxCalViewPrint : UIxComponent
{
}
@end

View File

@ -0,0 +1,31 @@
/* UIxCalView.m - this file is part of SOGo
*
* Copyright (C) 2006-2009 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSString.h>
#import "UIxCalViewPrint.h"
@implementation UIxCalViewPrint
{
}
@end

View File

@ -40,6 +40,11 @@
protectedBy = "View";
pageName = "UIxCalMainView";
};
printView = {
protectedBy = "<public>";
pageName = "UIxCalViewPrint";
actionClass = "UIxCalViewPrint";
};
addWebCalendar = {
protectedBy = "View";
actionClass = "UIxCalMainActions";

View File

@ -1,109 +1,111 @@
<?xml version='1.0' standalone='yes'?>
<?xml version='1.0'?>
<!DOCTYPE var:component>
<var:component
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:label="OGo:label"
className="UIxPageFrame"
title="name"
const:popup="YES">
<div>
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:uix="OGo:uix"
xmlns:label="OGo:label"
className="UIxPageFrame"
const:popup="YES"
const:cssFiles="datepicker.css"
const:jsFiles="datepicker.js">
<!-- Print settings -->
<span class="caption"><var:string label:value="Print Settings" /></span>
<table class="frame">
<tr>
<td>
<label><var:string label:"Title">
<input type="text" class="textField" name="title" id="title" /></label></td></tr>
<tr>
<td>
<label><var:string label:"Layout">
<var:popup list="layoutList" item="item"
label:noSelectionString="layoutList_list"
string="itemLayoutListText"
selection="" /></label></td></tr>
</table>
<div id="leftSide" class="no-print">
<!-- Print settings -->
<span class="caption"><var:string label:value="Print Settings" /></span>
<table class="frame">
<tr>
<td style="width: 30%;">
<label id="labelTitle"><var:string label:value="Title:" /></label></td>
<td>
<input type="text" name="title" /></td>
</tr>
<tr>
<td>
<label><var:string label:value="Layout:" /></label></td>
<td>
<var:popup list="languages" item="item"
const:id="language"
const:name="language"
string="languageText"
selection="language"
label:noSelectionString="choose" /></td>
</tr>
</table>
<!-- What to print -->
<span class="caption"><var:string label:value="What to Print" /></span>
<table class="frame">
<tr>
<td>
<label>
<input type="checkbox"
const:name="selectEvents"
const:id="selectEvents"
var:checked="printEvents" />
<var:string label:value="Events"/></label></td>
<td>
<label>
<input type="checkbox"
const:name="selectTasks"
const:id="selectTasks"
var:checked="printTasks" />
<var:string label:value="Tasks"/></label></td></tr>
<tr>
<td>
<label>
<var:string label:"Current view">
<!-- TODO-Radio button --></label></td></tr>
<tr>
<td>
<label>
<var:string label:"Selected events/tasks">
<!-- TODO-Radio button --></label></td></tr>
<tr>
<td>
<label>
<var:string label:"Custom date range">
<!-- TODO-Radio button --></label></td></tr>
<tr>
<td>
<label>
<var:string label:"From:">
<!-- TODO-Date picker --></label></td></tr>
<tr>
<td>
<label>
<var:string label:"To:">
<!-- TODO-Date picker --></label></td></tr>
</table>
<!-- What to print -->
<span class="caption"><var:string label:value="What to Print" /></span>
<table class="frame">
<tr>
<td>
<label>
<input type="checkbox" name="printSelection" value="selectEvents" />
<var:string label:value="Events"/></label>
<label>
<input type="checkbox" name="printSelection" value="selectTasks" />
<var:string label:value="Tasks"/></label></td></tr>
<tr>
<td>
<label>
<input name="printView" type="radio" />
<var:string label:value="Current view" /></label></td></tr>
<tr>
<td>
<label>
<input name="printView" type="radio" />
<var:string label:value="Selected events and tasks" /></label></td></tr>
<tr>
<td>
<label>
<input name="printView" type="radio" />
<var:string label:value="Custom date range" /></label></td></tr>
<tr>
<td id="dateRangeFrom">
<label id="labelFrom"><var:string label:value="From:" /></label>
<var:component className="UIxDatePicker"
const:dateID="startingDate"
day="startDay"
month="startMonth"
year="startYear"
label:label="Select starting date"/></td></tr>
<tr>
<td id="dateRangeTo">
<label id="labelTo"><var:string label:value="To:" /></label>
<var:component className="UIxDatePicker"
const:dateID="endingDate"
day="endDay"
month="endMonth"
year="endYear"
label:label="Select ending date"/></td></tr>
</table>
<!-- Options -->
<span class="caption"><var:string label:value="Options" /></span>
<table class="frame">
<tr>
<td>
<label>
<input type="checkbox"
const:name="selectNoDueDateTasks"
const:id="selectNoDueDateTasks"
var:checked="printNoDueDateTasks" />
<var:string label:value="Tasks with no due date"/></label></td></tr>
<tr>
<td>
<label>
<input type="checkbox"
const:name="selectCompletedTasks"
const:id="selectCompletedTasks"
var:checked="printCompletedTasks" />
<var:string label:value="Completed tasks"/></label></td></tr>
</table>
<!-- Buttons -->
<div id="buttons">
<a class="button" name="submit" id="submitButton">
<span>
<var:string label:value="Print" /></span></a>
<a class="button" name="cancel" id="cancelButton">
<span>
<var:string label:value="Cancel"/></span></a>
<!-- Options -->
<span class="caption"><var:string label:value="Options" /></span>
<table class="frame">
<tr>
<td>
<label>
<input type="checkbox" name="printOptions" value="selectNoDueDateTasks" />
<var:string label:value="Tasks with no due date" /></label></td></tr>
<tr>
<td>
<label>
<input type="checkbox" name="printOptions" value="selectCompletedTasks" />
<var:string label:value="Completed tasks" /></label></td></tr>
</table>
</div>
</div>
<div id="rightSide">
<div id="rightFrame">
<p>Lorem ipsum dolor sit amet, facilisis eros non lacus interdum lectus, sed vel bibendum lorem sagittis velit enim, amet placerat, placerat lacus, feugiat non donec auctor. Metus non sollicitudin, et pulvinar, nam sit euismod, dolor arcu est neque, non velit maecenas cras vestibulum. Sit illum, libero imperdiet amet velit cursus rerum lorem, risus morbi orci commodo lectus quam phasellus. Wisi morbi, a ac, adipiscing integer sapien nec dignissim a, venenatis mi placerat id ut, vehicula cursus nam sit praesent pharetra curabitur. Id nonummy. Sollicitudin sit mattis. Nec nunc pede arcu nullam, sit in amet dui erat, aliquam in tortor semper nulla, non sem purus consectetuer aliquam. Sollicitudin sagittis nulla id placerat nunc, volutpat condimentum tempus viverra, mi molestie nulla, ac est egestas nunc lacus purus. Tincidunt libero nam montes felis volutpat, placerat leo nisl ligula urna lacinia, wisi phasellus velit suscipit. Sagittis amet quis tellus lorem, tortor arcu ac, sollicitudin varius dolor, pharetra sit, pellentesque nulla duis. Dolor scelerisque maecenas ultrices, aliquet adipiscing augue semper egestas nec vivamus, nunc amet ullamcorper id.
Dictum id quis nisl quidem, fugit sapien vehicula per. Ultricies sit adipiscing vel ullamcorper ut consequat, et arcu dictum tortor semper cursus. Vestibulum lorem vestibulum pretium quisque. Vel ac nisl duis enim, eu habitasse cras ipsum lectus, elit blandit vitae. Volutpat congue eget curabitur consequat sollicitudin sed, quis dictum consectetuer lectus integer felis. Eget nibh ac ipsum metus magna, ut velit sed ac, quam adipiscing, velit nunc mollis in accumsan ut vestibulum. Ac massa tempor diam metus scelerisque, senectus sem habitasse vel orci semper, vulputate leo.
Suspendisse erat dolor vestibulum, curabitur lacinia ac suspendisse fringilla vestibulum. Viverra nisl in convallis, ac class nibh dui tincidunt vestibulum fusce. Platea vitae non. Ipsum neque justo, urna lacus. Nostra adipiscing cras placerat vestibulum vestibulum ultrices, justo turpis ac urna et auctor. Integer aliquam enim, felis aliquam nostra sem, arcu tempus pede tortor ullamcorper enim, suspendisse luctus id enim leo tincidunt. Enim pede sed urna sed aenean aliquam. Sagittis laoreet mattis morbi incidunt, volutpat et gravida duis sed. Ornare sollicitudin in.
Tincidunt justo. Diam velit dolor, mauris volutpat nullam dolor, laoreet pede eget pellentesque gravida, sollicitudin diam nam ultrices eleifend integer, cras elementum libero pellentesque volutpat donec. Tincidunt mi in sem. Mauris elementum odio tortor. Suscipit lorem sapien enim viverra nam, sed ut nunc, turpis vitae nisl. Aliquam ullamcorper at suscipit, lacinia velit nec ut lorem sed. Faucibus ac leo neque fringilla erat felis. Venenatis mauris erat, justo laoreet amet sociis.</p>
</div>
<div id="printButtons" class="no-print">
<a class="button" name="print" id="printButton">
<span><var:string label:value="Print" /></span></a>
<a class="button" name="cancel" id="cancelButton">
<span><var:string label:value="Cancel"/></span></a>
</div>

View File

@ -33,6 +33,13 @@ var categoriesStyleSheet = null;
var clipboard = null;
var eventsToCopy = [];
function printView() {
window.open("printView","","width=660,height=470");
return false; /* stop following the link */
}
function newEvent(type, day, hour, duration) {
var folder = null;
if (UserDefaults['SOGoDefaultCalendar'] == 'personal')

View File

@ -0,0 +1,125 @@
BODY
{
top: 1em;
bottom: 1em;
right: 1em;
left: 1em;
overflow:scroll;
}
.toolbar
{
display:none;
}
#labelTitle
{
width:100%;
text-align:left;
}
#printButton
{
font-weight:bold;
}
DIV#leftSide
{
min-height:370px;
max-height:370px;
max-width:220px;
min-width:220px;
float:left;
}
DIV#rightSide
{
min-height:370px;
max-height:370px;
min-width:330px;
max-width:330px;
float:right;
}
DIV#rightFrame
{
min-height:350px;
max-height:350px;
background-color:#FFFFFF;
border-radius:8px;
border-top: 1px solid #909090;
border-left: 1px solid #909090;
border-bottom: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
margin-top: 12px;
margin-left: auto;
margin-right: auto;
margin-bottom: 1em;
padding-left:10px;
padding-right:10px;
overflow:scroll;
}
#dateRangeFrom, #dateRangeTo
{
text-align: right;
}
/* Overiding the general.css */
TABLE.frame{
width:97%;
text-align: left;
background:#dddddd;
border-radius:8px;
display:table;
}
#startingDate, #endingDate
{
width:auto;
vertical-align:8px;
}
#labelFrom, #labelTo
{
vertical-align:8px;
}
SPAN.caption
{
background: -webkit-linear-gradient(bottom, #E6E7E6, #dddddd); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(bottom, #E6E7E6, #dddddd); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(bottom, #E6E7E6, #dddddd); /* For Firefox 3.6 to 15 */
background: linear-gradient(to bottom, #E6E7E6, #dddddd); /* Standard syntax (must be last) */
}
/******************************/
@media print
{
.no-print, SPAN.caption
{
display:none;
}
DIV#rightSide
{
border:solid red 1px;
max-width:100%;
max-height:99%;
float:none;
}
DIV#rightFrame
{
border:solid green 1px;
width:100%;
height:99%;
marging: 0;
padding: 0;
//border:0;
overflow:visible;
}
}

View File

@ -0,0 +1,81 @@
/* -*- Mode: js2-mode; tab-width: 4; c-label-minimum-indentation: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2005 SKYRIX Software AG
Copyright (C) 2006-2011 Inverse
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
this.onAdjustTime = function(event) {
onAdjustDueTime(event);
};
this.onAdjustDueTime = function(event) {
/*var dateDelta = (window.getStartDate().valueOf() - window.getShadowStartDate().valueOf());
var newDueDate = new Date(window.getDueDate().valueOf() + dateDelta);
window.setDueDate(newDueDate);*/
window.timeWidgets['start']['date'].updateShadowValue();
};
this.initTimeWidgets = function (widgets) {
this.timeWidgets = widgets;
jQuery(widgets['start']['date']).closest('.date').datepicker({autoclose: true, weekStart: 0, position: "bellow"});
jQuery(widgets['end']['date']).closest('.date').datepicker({autoclose: true, weekStart: 0, position: "bellow"});
//jQuery(widgets['start']['date']).change(onAdjustTime);
/*jQuery(widgets['startingDate']['date']).closest('.date').datepicker({autoclose: true,
weekStart: 0,
endDate: lastDay,
startDate: firstDay,
setStartDate: lastDay,
startView: 2,
position: "below-shifted-left"});*/
};
function onPrintCancelClick(event) {
this.blur();
onCloseButtonClick(event);
}
function onPrintClick(event) {
this.blur();
window.print();
}
function init() {
$("cancelButton").observe("click", onPrintCancelClick);
$("printButton").observe("click", onPrintClick);
var widgets = {'start': {'date': $("startingDate")},
'end': {'date': $("endingDate")}};
initTimeWidgets(widgets);
}
document.observe("dom:loaded", init);