mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-24 14:29:28 +00:00
Events list is done.
This commit is contained in:
@@ -145,6 +145,29 @@
|
||||
"Hide already accepted and rejected appointments" = "Hide already accepted and rejected appointments";
|
||||
"Show already accepted and rejected appointments" = "Show already accepted and rejected appointments";
|
||||
|
||||
/* Print view */
|
||||
"LIST" = "List";
|
||||
"WEEK" = "Weekly";
|
||||
"MONTH" = "Monthly";
|
||||
"Print Settings" = "Print Settings";
|
||||
"Title:" = "Title:";
|
||||
"Layout:" = "Layout:";
|
||||
"What to Print" = "What to Print";
|
||||
"Events" = "Events";
|
||||
"Tasks" = "Tasks";
|
||||
"Current view" = "Current view";
|
||||
"Selected events and tasks" = "Selected events and tasks";
|
||||
"Custom date range" = "Custom date range";
|
||||
"From:" = "From:";
|
||||
"To:" = "To:";
|
||||
"Options" = "Options";
|
||||
"Locale" = "Locale";
|
||||
"GMT" = "GMT";
|
||||
"Tasks with no due date" = "Tasks with no due date";
|
||||
"Completed tasks" = "Completed tasks";
|
||||
"Display time:" = "Display time:";
|
||||
|
||||
|
||||
|
||||
/* Appointments */
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* UIxCalView.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006-2009 Inverse inc.
|
||||
* Copyright (C) 2006-2014 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
* Author: Alexandre Cloutier <acloutier@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
|
||||
@@ -20,11 +20,11 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
#include <SOGoUI/UIxComponent.h>
|
||||
|
||||
@interface UIxCalViewPrint : UIxComponent
|
||||
{
|
||||
|
||||
id item;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* UIxCalView.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006-2009 Inverse inc.
|
||||
* Copyright (C) 2006-2014 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
* Author: Alexandre Cloutier <acloutier@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
|
||||
@@ -21,11 +21,63 @@
|
||||
*/
|
||||
|
||||
#import <Foundation/NSString.h>
|
||||
#import "UIxCalViewPrint.h"
|
||||
#import <Foundation/NSArray.h>
|
||||
|
||||
#import <UIxCalViewPrint.h>
|
||||
|
||||
static NSArray *layoutItems = nil;
|
||||
|
||||
@implementation UIxCalViewPrint
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
|
||||
if (!layoutItems)
|
||||
{
|
||||
layoutItems = [NSArray arrayWithObjects: @"LIST", @"WEEK", @"MONTH", nil];
|
||||
[layoutItems retain];
|
||||
}
|
||||
|
||||
}
|
||||
- (id) init
|
||||
{
|
||||
item = nil;
|
||||
return [super init];
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[item release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
/****************************************************************/
|
||||
/* Interfacing; populating the popup list for the print layouts */
|
||||
|
||||
- (void) setItem: (NSString *) newItem
|
||||
{
|
||||
ASSIGN (item, newItem);
|
||||
}
|
||||
|
||||
- (NSString *) item
|
||||
{
|
||||
return item;
|
||||
}
|
||||
|
||||
- (NSArray *) printLayoutList
|
||||
{
|
||||
return layoutItems;
|
||||
}
|
||||
|
||||
- (NSString *) itemPrintLayoutText
|
||||
{
|
||||
return [self labelForKey: [NSString stringWithFormat: item]];
|
||||
}
|
||||
|
||||
- (NSString *) layoutSelectedByUser
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
/******************************************************************/
|
||||
/* */
|
||||
|
||||
@end
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
className="UIxPageFrame"
|
||||
const:popup="YES"
|
||||
const:cssFiles="datepicker.css"
|
||||
const:jsFiles="datepicker.js">
|
||||
|
||||
const:jsFiles="datepicker.js" >
|
||||
|
||||
<div id="leftSide" class="no-print">
|
||||
<!-- Print settings -->
|
||||
<span class="caption"><var:string label:value="Print Settings" /></span>
|
||||
@@ -19,18 +19,15 @@
|
||||
<td style="width: 30%;">
|
||||
<label id="labelTitle"><var:string label:value="Title:" /></label></td>
|
||||
<td>
|
||||
<input type="text" name="title" /></td>
|
||||
<input type="text" id="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>
|
||||
<var:popup list="printLayoutList" item="item"
|
||||
const:id="printLayoutList"
|
||||
string="itemPrintLayoutText" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -40,29 +37,29 @@
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" name="printSelection" value="selectEvents" />
|
||||
<input type="checkbox" id="printEvents" value="eventsSelected" checked="true" onChange="onEventsCheck(this);"/>
|
||||
<var:string label:value="Events"/></label>
|
||||
<label>
|
||||
<input type="checkbox" name="printSelection" value="selectTasks" />
|
||||
<input type="checkbox" id ="printTasks" value="tasksSelected" checked="true" onChange="onTasksCheck(this);"/>
|
||||
<var:string label:value="Tasks"/></label></td></tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input name="printView" type="radio" />
|
||||
<input type="radio" name="printView" value="currentViewSelected" checked="true" onChange="printDateCheck();"/>
|
||||
<var:string label:value="Current view" /></label></td></tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input name="printView" type="radio" />
|
||||
<input type="radio" name="printView" value="eventsTasksSelected" onChange="printDateCheck();"/>
|
||||
<var:string label:value="Selected events and tasks" /></label></td></tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input name="printView" type="radio" />
|
||||
<input type="radio" name="printView" id="customDate" value="customDateSelected" onChange="printDateCheck();" />
|
||||
<var:string label:value="Custom date range" /></label></td></tr>
|
||||
<tr>
|
||||
<td id="dateRangeFrom">
|
||||
<td id="dateRangeFrom" name="dateRange">
|
||||
<label id="labelFrom"><var:string label:value="From:" /></label>
|
||||
<var:component className="UIxDatePicker"
|
||||
const:dateID="startingDate"
|
||||
@@ -71,7 +68,7 @@
|
||||
year="startYear"
|
||||
label:label="Select starting date"/></td></tr>
|
||||
<tr>
|
||||
<td id="dateRangeTo">
|
||||
<td id="dateRangeTo" name="dateRange">
|
||||
<label id="labelTo"><var:string label:value="To:" /></label>
|
||||
<var:component className="UIxDatePicker"
|
||||
const:dateID="endingDate"
|
||||
@@ -85,27 +82,41 @@
|
||||
<span class="caption"><var:string label:value="Options" /></span>
|
||||
<table class="frame">
|
||||
<tr>
|
||||
<td>
|
||||
<var:string label:value="Display time:" /></td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" name="printOptions" value="selectNoDueDateTasks" />
|
||||
<input type="radio" name="printTime" value="localTimeSelected" onChange="displayTimeCheck(this);" checked="true"/>
|
||||
<var:string label:value="Locale" /></label>
|
||||
<label>
|
||||
<input type="radio" name="printTime" value="gmtTimeSelected" onChange="displayTimeCheck(this);"/>
|
||||
<var:string label:value="GMT" /></label></td></tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<hr><!-- spacer --></hr></td></tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" name="printOptions" value="selectNoDueDateTasks" checked="true" />
|
||||
<var:string label:value="Tasks with no due date" /></label></td></tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" name="printOptions" value="selectCompletedTasks" />
|
||||
<input type="checkbox" name="printOptions" value="selectCompletedTasks" checked="true" />
|
||||
<var:string label:value="Completed tasks" /></label></td></tr>
|
||||
</table>
|
||||
</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>
|
||||
<span id="rightFrameTitle"><!-- Spacer --></span>
|
||||
<span id="rightFrameEvents"><!-- Spacer --></span>
|
||||
<span id="rightFrameTasks"><!-- Spacer --></span>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</var:component>
|
||||
@@ -1,4 +1,5 @@
|
||||
|
||||
/****** Window & layouts ******/
|
||||
BODY
|
||||
{
|
||||
top: 1em;
|
||||
@@ -9,40 +10,14 @@ BODY
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
{ display:none;}
|
||||
|
||||
DIV#rightSide
|
||||
{
|
||||
min-height:370px;
|
||||
max-height:370px;
|
||||
min-width:330px;
|
||||
max-width:330px;
|
||||
float:right;
|
||||
|
||||
position: absolute;
|
||||
left:230px;
|
||||
height:370px;
|
||||
width:330px;
|
||||
}
|
||||
DIV#rightFrame
|
||||
{
|
||||
@@ -60,34 +35,93 @@ DIV#rightSide
|
||||
margin-bottom: 1em;
|
||||
padding-left:10px;
|
||||
padding-right:10px;
|
||||
overflow:scroll;
|
||||
overflow-y:scroll;
|
||||
overflow-x:hidden;
|
||||
}
|
||||
|
||||
DIV#leftSide
|
||||
{
|
||||
position: absolute;
|
||||
height:370px;
|
||||
width:220px;
|
||||
}
|
||||
|
||||
DIV.colorBox
|
||||
{ display: inline-block; }
|
||||
|
||||
TD DIV.colorBox, TD DIV.colorBox:hover
|
||||
{ border-color: #fff; }
|
||||
|
||||
TABLE#eventsList .colorBox
|
||||
{ margin-right: 4px; }
|
||||
|
||||
|
||||
/******************************/
|
||||
/****** Print settings *******/
|
||||
|
||||
#title
|
||||
{
|
||||
width:120px;
|
||||
}
|
||||
|
||||
/******************************/
|
||||
/****** What to print ********/
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
/************************/
|
||||
/****** Buttons ********/
|
||||
|
||||
#printButton
|
||||
{
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
/**************************/
|
||||
/****** RightSide ********/
|
||||
|
||||
.divEventsPreview
|
||||
{
|
||||
border:solid black 2px;
|
||||
border-radius:5px;
|
||||
margin-top:4px;
|
||||
margin-bottom:4px;
|
||||
}
|
||||
.eventsPreview
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#rightFrameEvents{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************/
|
||||
/****** Overriding the general.css ********/
|
||||
|
||||
TABLE.frame{
|
||||
width:97%;
|
||||
text-align: left;
|
||||
background:#dddddd;
|
||||
border-radius:8px;
|
||||
display:table;
|
||||
}
|
||||
|
||||
SPAN.caption
|
||||
{
|
||||
background: -webkit-linear-gradient(bottom, #E6E7E6, #dddddd); /* For Safari 5.1 to 6.0 */
|
||||
@@ -96,8 +130,8 @@ SPAN.caption
|
||||
background: linear-gradient(to bottom, #E6E7E6, #dddddd); /* Standard syntax (must be last) */
|
||||
}
|
||||
|
||||
|
||||
/******************************/
|
||||
/**************************************************/
|
||||
/****** Calling print(); from the browser ********/
|
||||
|
||||
@media print
|
||||
{
|
||||
@@ -107,19 +141,15 @@ SPAN.caption
|
||||
}
|
||||
DIV#rightSide
|
||||
{
|
||||
border:solid red 1px;
|
||||
max-width:100%;
|
||||
max-height:99%;
|
||||
float:none;
|
||||
position:absolute;
|
||||
top:5px;
|
||||
left:5px;
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
DIV#rightFrame
|
||||
{
|
||||
border:solid green 1px;
|
||||
width:100%;
|
||||
height:99%;
|
||||
marging: 0;
|
||||
padding: 0;
|
||||
//border:0;
|
||||
border: none;
|
||||
overflow:visible;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,14 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
/******************************** Global variables *******************************************/
|
||||
var firstDayOfWeek = window.opener.firstDayOfWeek;
|
||||
var displayTime;
|
||||
/*********************************************************************************************/
|
||||
|
||||
this.onAdjustTime = function(event) {
|
||||
onAdjustDueTime(event);
|
||||
};
|
||||
}
|
||||
|
||||
this.onAdjustDueTime = function(event) {
|
||||
/*var dateDelta = (window.getStartDate().valueOf() - window.getShadowStartDate().valueOf());
|
||||
@@ -33,13 +37,13 @@ this.onAdjustDueTime = function(event) {
|
||||
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']).closest('.date').datepicker({autoclose: true, weekStart: 0});
|
||||
jQuery(widgets['end']['date']).closest('.date').datepicker({autoclose: true, weekStart: 0});
|
||||
|
||||
//jQuery(widgets['start']['date']).change(onAdjustTime);
|
||||
|
||||
@@ -50,10 +54,201 @@ this.initTimeWidgets = function (widgets) {
|
||||
setStartDate: lastDay,
|
||||
startView: 2,
|
||||
position: "below-shifted-left"});*/
|
||||
};
|
||||
}
|
||||
function refreshCalendarDisplay(){
|
||||
refreshCalendarEvents();
|
||||
refreshCalendarTasks();
|
||||
}
|
||||
|
||||
function refreshCalendarTasks(){
|
||||
|
||||
}
|
||||
|
||||
function refreshCalendarEvents() {
|
||||
var todayDate = new Date();
|
||||
var sd;
|
||||
var ed;
|
||||
var currentDay = window.parentvar("currentDay");
|
||||
var currentView = window.parentvar("currentView");
|
||||
|
||||
if (!currentDay)
|
||||
currentDay = todayDate.getDayString();
|
||||
|
||||
if (currentView == "dayview") {
|
||||
sd = currentDay;
|
||||
ed = sd;
|
||||
}
|
||||
else if (currentView == "weekview") {
|
||||
var startDate;
|
||||
startDate = currentDay.asDate();
|
||||
startDate = startDate.beginOfWeek();
|
||||
sd = startDate.getDayString();
|
||||
var endDate = new Date();
|
||||
endDate.setTime(startDate.getTime());
|
||||
endDate.addDays(6);
|
||||
ed = endDate.getDayString();
|
||||
}
|
||||
else {
|
||||
var monthDate;
|
||||
monthDate = currentDay.asDate();
|
||||
monthDate.setDate(1);
|
||||
sd = monthDate.beginOfWeek().getDayString();
|
||||
|
||||
var lastMonthDate = new Date();
|
||||
lastMonthDate.setTime(monthDate.getTime());
|
||||
lastMonthDate.setMonth(monthDate.getMonth() + 1);
|
||||
lastMonthDate.addDays(-1);
|
||||
ed = lastMonthDate.endOfWeek().getDayString();
|
||||
}
|
||||
if (document.refreshCalendarEventsAjaxRequest) {
|
||||
document.refreshCalendarEventsAjaxRequest.aborted = true;
|
||||
document.refreshCalendarEventsAjaxRequest.abort();
|
||||
}
|
||||
var url = (ApplicationBaseURL + "/eventsblocks?sd=" + sd + "&ed=" + ed
|
||||
+ "&view=" + currentView);
|
||||
|
||||
document.refreshCalendarEventsAjaxRequest
|
||||
= triggerAjaxRequest(url, refreshCalendarEventsCallback,
|
||||
{"startDate": sd, "endDate": ed});
|
||||
}
|
||||
|
||||
function refreshCalendarEventsCallback(http) {
|
||||
if (http.readyState == 4
|
||||
&& http.status == 200) {
|
||||
if (http.responseText.length > 0) {
|
||||
var layout = $("printLayoutList").value;
|
||||
var eventsBlocks = http.responseText.evalJSON(true);
|
||||
$("rightFrameEvents").innerHTML = "";
|
||||
// 0 == listLayout
|
||||
if (layout == "0"){
|
||||
_drawListEvents(eventsBlocks);
|
||||
}
|
||||
// 1 == weekLayout
|
||||
if (layout == "1"){
|
||||
_drawWeekEvents(eventsBlocks);
|
||||
}
|
||||
// 2 == monthLayout
|
||||
if (layout == "2"){
|
||||
_drawMonthEvents(eventsBlocks);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
log("AJAX error when refreshing calendar events");
|
||||
}
|
||||
|
||||
function _drawListEvents(eventsBlocks) {
|
||||
for(var i=0; i<eventsBlocks[0].length; i++)
|
||||
{
|
||||
var event = _parseEvent(eventsBlocks[0][i]);
|
||||
$("rightFrameEvents").innerHTML += event;
|
||||
}
|
||||
}
|
||||
|
||||
function _parseEvent(event)
|
||||
{
|
||||
var startDate = new Date(event[5] *1000);
|
||||
var endDate = new Date(event[6] *1000);
|
||||
var parsedEvent;
|
||||
parsedEvent = "<div class=divEventsPreview><table>";
|
||||
parsedEvent += "<tr><td><b>"+ event[4] +"</b></td></tr>";
|
||||
if (displayTime)
|
||||
parsedEvent += "<tr><td>"+ startDate.toLocaleString() + " - " + endDate.toLocaleString() + "</td></tr>";
|
||||
else
|
||||
parsedEvent += "<tr><td>"+ startDate.toGMTString() + "<br />" + endDate.toGMTString() + "</td></tr>";
|
||||
parsedEvent += "<tr><td>Calendar : " + event[2] + "</td></tr>";
|
||||
parsedEvent += "</table></div>";
|
||||
return parsedEvent;
|
||||
}
|
||||
|
||||
function _drawMonthCalendarEvents(events, eventsData) {
|
||||
var daysView = $("monthDaysView");
|
||||
var days = daysView.childNodesWithTag("div");
|
||||
for (var i = 0; i < days.length; i++) {
|
||||
var parentDiv = days[i];
|
||||
for (var j = 0; j < events[i].length; j++) {
|
||||
var eventRep = events[i][j];
|
||||
var nbr = eventRep.nbr;
|
||||
var eventCell = newMonthEventDIV(eventRep, eventsData[nbr]);
|
||||
parentDiv.appendChild(eventCell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*********************** Input Field, Checkboxes, Radio and listMenu *********************************/
|
||||
|
||||
function onInputTitle(event){
|
||||
var titleValue = $("title").value;
|
||||
if (titleValue)
|
||||
document.getElementById("rightFrameTitle").innerHTML = titleValue + "<br />";
|
||||
else
|
||||
document.getElementById("rightFrameTitle").innerHTML = titleValue;
|
||||
}
|
||||
|
||||
function onPrintLayoutListChange(event) {
|
||||
// TODO : Common filtering; what to display on the view
|
||||
|
||||
// legend for the events display; 0=list, 1=week, 2=month
|
||||
|
||||
refreshCalendarDisplay();
|
||||
}
|
||||
|
||||
function initializeLayoutList() {
|
||||
var printLayoutList = $("printLayoutList");
|
||||
var title = $("title");
|
||||
if (printLayoutList) {
|
||||
onPrintLayoutListChange();
|
||||
printLayoutList.observe("change", onPrintLayoutListChange);
|
||||
|
||||
}
|
||||
if (title){
|
||||
title.observe("change", onInputTitle);
|
||||
}
|
||||
}
|
||||
|
||||
function onTasksCheck(checkBox) {
|
||||
if (checkBox) {
|
||||
var printOptions = document.getElementsByName("printOptions");
|
||||
for (var i = 0; i < printOptions.length; i++)
|
||||
if (printOptions[i] != checkBox)
|
||||
printOptions[i].disabled = !checkBox.checked;
|
||||
|
||||
if(checkBox.checked)
|
||||
document.getElementById("rightFrameTasks").style.display = 'block';
|
||||
else
|
||||
document.getElementById("rightFrameTasks").style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function onEventsCheck(checkBox) {
|
||||
if (checkBox){
|
||||
if(checkBox.checked)
|
||||
document.getElementById("rightFrameEvents").style.display = 'block';
|
||||
else
|
||||
document.getElementById("rightFrameEvents").style.display = 'none';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function printDateCheck() {
|
||||
var dateRange = document.getElementsByName("dateRange");
|
||||
var customDate = document.getElementById("customDate");
|
||||
for (var i = 0; i < dateRange.length; i++)
|
||||
if (dateRange[i].children[1].children[0].disabled == customDate.checked)
|
||||
dateRange[i].children[1].children[0].disabled = !customDate.checked;
|
||||
}
|
||||
|
||||
function displayTimeCheck(){
|
||||
var radioButtons = document.getElementsByName("printTime");
|
||||
if (radioButtons[0].checked)
|
||||
displayTime = true;
|
||||
else
|
||||
displayTime = false;
|
||||
|
||||
refreshCalendarDisplay();
|
||||
}
|
||||
|
||||
/******************************* Buttons ***********************************************/
|
||||
|
||||
function onPrintCancelClick(event) {
|
||||
this.blur();
|
||||
@@ -64,8 +259,7 @@ function onPrintClick(event) {
|
||||
this.blur();
|
||||
window.print();
|
||||
}
|
||||
|
||||
|
||||
/**************************** Initialization *******************************************/
|
||||
|
||||
function init() {
|
||||
|
||||
@@ -75,7 +269,10 @@ function init() {
|
||||
var widgets = {'start': {'date': $("startingDate")},
|
||||
'end': {'date': $("endingDate")}};
|
||||
initTimeWidgets(widgets);
|
||||
|
||||
printDateCheck();
|
||||
displayTimeCheck();
|
||||
initializeLayoutList();
|
||||
refreshCalendarDisplay();
|
||||
}
|
||||
|
||||
document.observe("dom:loaded", init);
|
||||
|
||||
Reference in New Issue
Block a user