--- /dev/null
+( /* the toolbar groups -*-cperl-*- */
+ ( { link = "#";
+ isSafe = NO;
+ label = "Close";
+ onclick = "window.close(); return false;";
+ image = "tb-mail-stop-flat-24x24.png"; } )
+)
--- /dev/null
+( /* the toolbar groups -*-cperl-*- */
+ ( { link = "#";
+ label = "Save and Close";
+ onclick = "return saveEvent();";
+ image = "tb-compose-save-flat-24x24.png"; },
+ { link = "#";
+ hasMenu = YES;
+ label = "Privacy";
+ onclick = "return onSelectPrivacy(event);";
+ image = "tb-compose-security-flat-24x24.png"; },
+ { link = "#";
+ label = "Documents";
+ onclick = "return onPopupUrlWindow();";
+ image = "tb-compose-attach-flat-24x24.png"; } )
+)
--- /dev/null
+/* UIxAttendeesEditor.h - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * 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.
+ */
+
+#ifndef UIXATTENDEESEDITOR_H
+#define UIXATTENDEESEDITOR_H
+
+#import <SOGoUI/UIxComponent.h>
+
+@interface UIxAttendeesEditor : UIxComponent
+{
+ NSString *item;
+// NSString *zoom;
+}
+
+- (void) setItem: (NSString *) newItem;
+- (NSString *) item;
+
+- (NSArray *) zoomList;
+- (void) setZoom: (NSString *) zoom;
+- (NSString *) zoom;
+- (NSString *) itemZoomText;
+
+@end
+
+#endif /* UIXATTENDEESEDITOR_H */
--- /dev/null
+/* UIxAttendeesEditor.m - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * 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/NSArray.h>
+#import <Foundation/NSString.h>
+
+#import <Common/UIxPageFrame.h>
+
+#import "UIxAttendeesEditor.h"
+
+@implementation UIxAttendeesEditor
+
+- (id) defaultAction
+{
+ [[self parent] setToolbar: @""];
+
+ return self;
+}
+
+- (void) setItem: (NSString *) newItem
+{
+ item = newItem;
+}
+
+- (NSString *) item
+{
+ return item;
+}
+
+- (NSArray *) zoomList
+{
+ static NSArray *zoomItems = nil;
+
+ if (!zoomItems)
+ {
+ zoomItems = [NSArray arrayWithObjects: @"400", @"200", @"100",
+ @"50", @"25", nil];
+ [zoomItems retain];
+ }
+
+ return zoomItems;
+}
+
+- (void) setZoom: (NSString *) zoom
+{
+// ASSIGN (zoom, _zoom);
+}
+
+- (NSString *) zoom
+{
+ return @"100";
+// return zoom;
+}
+
+- (NSString *) itemZoomText
+{
+ return [self labelForKey: [NSString stringWithFormat: @"zoom_%@", item]];
+}
+
+@end
--- /dev/null
+<?xml version='1.0' standalone='yes'?>
+<!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:rsrc="OGo:url"
+ xmlns:label="OGo:label"
+ className="UIxPageFrame"
+ const:toolbar="none"
+ const:popup="YES">
+ <script type="text/javascript" rsrc:src="skycalendar.js"><!-- space --></script>
+ <div id="attendeesView">
+ <div id="freeBusyViewButtons">
+ <var:string label:value="Suggest time slot:"/>
+ <a href="#" class="button _disabled"
+ ><var:string label:value="Previous slot" /></a>
+ <a href="#" class="button _disabled"
+ ><var:string label:value="Next slot" /></a>
+ </div>
+ <div id="freeBusyZoomButtons">
+ <var:string label:value="Zoom:"/>
+ <a href="#" class="button _disabled"><var:string label:value="-" /></a>
+ <var:popup list="zoomList" item="item"
+ string="itemZoomText" selection="zoom"/>
+ <a href="#" class="button _disabled"><var:string label:value="+" /></a>
+ </div>
+ <div id="freeBusyView">
+ <table id="freeBusy"
+ 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:rsrc="OGo:url"
+ xmlns:label="OGo:label">
+ <thead>
+ <tr class="freeBusyHeader1"
+ ><th class="attendees"><!--space --></th
+ ></tr>
+ <tr class="freeBusyHeader2"
+ ><th class="attendees"><!--space --></th
+ ></tr>
+ <tr class="freeBusyHeader3"
+ ><th class="attendees"><!--space --></th
+ ></tr>
+ </thead>
+
+ <tbody>
+ <tr class="futureAttendee"
+ ><td class="attendees"><input type="text" class="textField"
+ readonly="readonly" /></td
+ ></tr>
+ <tr class="attendeeModel"
+ ><td class="attendees"><input type="text" class="textField" /></td
+ ></tr>
+ </tbody>
+ </table>
+ </div>
+ <div id="freeBusyFooter">
+ <div id="legend" onmousedown="return false;">
+ <ul>
+ <li><span class="colorBox free"><!-- spacer --></span
+ ><var:string label:value="Free" /></li>
+ <li><span class="colorBox busy"><!-- spacer --></span
+ ><var:string label:value="Busy" /></li>
+ <li><span class="colorBox maybe-busy"><!-- spacer --></span
+ ><var:string label:value="Maybe busy" /></li>
+ <li><span class="colorBox noFreeBusy"><!-- spacer --></span
+ ><var:string label:value="No free-busy information" /></li>
+ </ul>
+ </div>
+ <div id="freeBusyButtons">
+ <a href="#" class="button _disabled"
+ ><var:string label:value="Previous hour" /></a>
+ <a href="#" class="button _disabled"
+ ><var:string label:value="Next hour" /></a>
+ </div>
+ <div id="freeBusyReplicas">
+ <div><var:string label:value="From"
+ /><var:component className="UIxTimeDateControl"
+ const:controlID="startTime"
+ const:dayStartHour="0"
+ const:dayEndHour="23"
+ /></div>
+ <div><var:string label:value="To"
+ /><var:component className="UIxTimeDateControl"
+ const:controlID="endTime"
+ const:dayStartHour="0"
+ const:dayEndHour="23"
+ /></div>
+ </div>
+ <div id="windowButtons">
+ <hr />
+ <a id="cancelButton" href="#" class="button"
+ ><var:string label:value="Cancel"/></a>
+ <a id="okButton" href="#" class="button"
+ ><var:string label:value="OK"/></a>
+ </div>
+ </div>
+ </div>
+</var:component>
--- /dev/null
+<?xml version="1.0" standalone="yes"?>
+<!DOCTYPE container>
+<container
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+ xmlns:const="http://www.skyrix.com/od/constant"
+ xmlns:rsrc="OGo:url"
+ xmlns:label="OGo:label">
+ <style type="text/css">
+ <var:foreach list="calendarFolders" item="currentCalendarFolder">
+.ownerIs<var:string value="currentCalendarLogin" />
+{ background-color: <var:string value="currentCalendarSpanBG" /> !important; }
+ </var:foreach>
+ </style>
+ <div id="calendarSelector">
+ <span id="calendarSelectorButtons">
+ <a href="#" class="toolbarButton"
+ ><span class="toolbarButton"><img rsrc:src="add-calendar.png"
+ label:title="Add..."
+ /></span></a>
+ <a href="#" class="toolbarButton"
+ ><span class="toolbarButton"><img rsrc:src="remove-calendar.png"
+ label:title="Remove"
+ /></span></a>
+ </span>
+ <ul id="calendarList" multiselect="yes">
+ <var:foreach list="calendarFolders" item="currentCalendarFolder"
+ ><li class="denied" var:id="currentCalendarFolder.folder">
+ <input type="checkbox" class="checkBox"
+ const:disabled="disabled"
+ var:checked="currentCalendarFolder.active" />
+ <div class="colorBox" var:style="currentCalendarStyle">OO</div>
+ <var:string value="currentCalendarFolder.displayName"
+ /></li>
+ </var:foreach>
+ </ul>
+ </div>
+</container>
--- /dev/null
+<?xml version='1.0' standalone='yes'?>
+<!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:rsrc="OGo:url"
+ xmlns:label="OGo:label"
+ className="UIxPageFrame"
+ const:popup="YES"
+ title="name"
+ var:toolbar="toolbar">
+ <script type="text/javascript" rsrc:src="skycalendar.js"><!-- space --></script>
+ <script type="text/javascript" rsrc:src="UIxComponentEditor.js"><!-- space --></script>
+
+ <div class="menu" id="privacy-menu">
+ <ul id="">
+ <li onmouseup="onMenuSetClassification(event, 'PUBLIC');"><var:string
+ label:value="Public Event" /></li>
+ <li onmouseup="onMenuSetClassification(event, 'CONFIDENTIAL');"><var:string
+ label:value="Show Time and Date Only" /></li>
+ <li onmouseup="onMenuSetClassification(event, 'PRIVACY');"><var:string
+ label:value="Private Event" /></li>
+ </ul>
+ </div>
+
+ <form var:href="saveURL" name="editform" onsubmit="return validateAptEditor();">
+ <div id="eventView">
+ <label><var:string label:value="Title:" /><span class="content"
+ ><input type="text" name="summary" id="summary"
+ class="textField"
+ var:value="title"
+ /></span></label>
+ <label><var:string label:value="Location:" /><span class="content"
+ ><input type="text" name="location" id="location"
+ class="textField"
+ var:value="location"
+ /></span></label>
+ <span class="checkBoxList"><var:string label:value="Category:" />
+ <span class="content"><var:popup list="categoryList" item="item"
+ label:noSelectionString="category_NONE"
+ string="itemCategoryText" selection="category"
+ /><var:string label:value="Calendar:" />
+ <var:popup const:id="calendarList"
+ list="calendarList" item="item"
+ string="item.displayName"
+ selection="componentCalendar"
+ /></span></span>
+ <label id="attendeesLabel" style="display: none;"><var:string label:value="Attendees:"
+ /><span class="content"
+ ><a href="#" id="attendeesHref"><!-- space --></a></span></label>
+ <hr />
+ <var:component-content />
+ <hr />
+ <label id="commentArea"><var:string label:value="Description:"
+ /><textarea name="comment" var:value="comment" /></label>
+ <label id="documentLabel" style="display: none;"><var:string label:value="Document:"
+ /><span class="content"
+ ><a href="#" id="documentHref"><!-- space --></a
+ ><a id="changeUrlButton" class="button" var:href="#"
+ ><var:string label:value="Change..."/></a
+ ></span></label>
+
+ <!-- hidden -->
+ <input type="hidden" name="url" id="url" var:value="url"/>
+ <input type="hidden" name="privacy" id="privacy"
+ var:value="privacy"/>
+ <input type="hidden" name="attendeesNames" id="attendeesNames"
+ var:value="attendeesNames"/>
+ <input type="hidden" name="attendeesEmails" id="attendeesEmails"
+ var:value="attendeesEmails"/>
+ <input type="hidden" name="calendarFoldersList"
+ id="calendarFoldersList"
+ var:value="calendarsFoldersList"/>
+ </div>
+ </form>
+</var:component>
--- /dev/null
+window.addEventListener("load", onComponentEditorLoad, false);
+
+function onPopupAttendeesWindow(event) {
+ if (event)
+ event.preventDefault();
+ window.open(ApplicationBaseURL + "editAttendees", null,
+ "width=803,height=573");
+
+ return false;
+}
+
+function onSelectPrivacy(event) {
+ popupToolbarMenu(event, "privacy-menu");
+
+ return false;
+}
+
+function onPopupUrlWindow(event) {
+ if (event)
+ event.preventDefault();
+
+ var urlInput = document.getElementById("url");
+ var newUrl = window.prompt(labels["Target:"].decodeEntities(), urlInput.value);
+ if (newUrl != null) {
+ var documentHref = $("documentHref");
+ var documentLabel = $("documentLabel");
+ if (documentHref.childNodes.length > 0) {
+ documentHref.childNodes[0].nodeValue = newUrl;
+ if (newUrl.length > 0)
+ documentLabel.style.display = "block;";
+ else
+ documentLabel.style.display = "none;";
+ }
+ else {
+ documentHref.appendChild(document.createTextNode(newUrl));
+ if (newUrl.length > 0)
+ documentLabel.style.display = "block;";
+ }
+ urlInput.value = newUrl;
+ }
+
+ return false;
+}
+
+function onPopupDocumentWindow(event) {
+ var documentUrl = $("url");
+
+ event.preventDefault();
+ window.open(documentUrl.value, "SOGo_Document");
+
+ return false;
+}
+
+function onMenuSetClassification(event, classification) {
+ event.cancelBubble = true;
+
+ var node = event.target;
+ if (node.tagName != "LI")
+ node = node.getParentWithTagName("li");
+ if (node.parentNode.chosenNode)
+ node.parentNode.chosenNode.removeClassName("_chosen");
+ node.addClassName("_chosen");
+ node.parentNode.chosenNode = node;
+
+ log("classification: " + classification);
+ var privacyInput = document.getElementById("privacy");
+ privacyInput.value = classification;
+}
+
+function onChangeCalendar(event) {
+ var calendars = $("calendarFoldersList").value.split(",");
+ var form = document.forms["editform"];
+ var urlElems = form.getAttribute("action").split("/");
+ var choice = calendars[this.value];
+ var ownerLogin;
+ if (choice.indexOf(":") > -1)
+ ownerLogin = choice.split(":")[0];
+ else
+ ownerLogin = UserLogin;
+ urlElems[urlElems.length-4] = ownerLogin;
+
+ form.setAttribute("action", urlElems.join("/"));
+ log ("after: " + form.getAttribute("action"));
+}
+
+function refreshAttendees() {
+ var attendeesLabel = $("attendeesLabel");
+ var attendeesNames = $("attendeesNames");
+ var attendeesHref = $("attendeesHref");
+
+ for (var i = 0; i < attendeesHref.childNodes.length; i++)
+ attendeesHref.removeChild(attendeesHref.childNodes[i]);
+
+ if (attendeesNames.value.length > 0) {
+ attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
+ attendeesLabel.style.display = "block;";
+ }
+ else
+ attendeesLabel.style.display = "none;";
+}
+
+function initializeAttendeesHref() {
+ var attendeesHref = $("attendeesHref");
+ var attendeesLabel = $("attendeesLabel");
+ var attendeesNames = $("attendeesNames");
+
+ attendeesHref.addEventListener("click", onPopupAttendeesWindow, false);
+ if (attendeesNames.value.length > 0) {
+ attendeesHref.style.textDecoration = "underline;";
+ attendeesHref.style.color = "#00f;";
+ attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
+ attendeesLabel.style.display = "block;";
+ }
+}
+
+function initializeDocumentHref() {
+ var documentHref = $("documentHref");
+ var documentLabel = $("documentLabel");
+ var documentUrl = $("url");
+
+ documentHref.addEventListener("click", onPopupDocumentWindow, false);
+ documentHref.style.textDecoration = "underline;";
+ documentHref.style.color = "#00f;";
+ if (documentUrl.value.length > 0) {
+ documentHref.appendChild(document.createTextNode(documentUrl.value));
+ documentLabel.style.display = "block;";
+ }
+
+ var changeUrlButton = $("changeUrlButton");
+ changeUrlButton.addEventListener("click", onPopupUrlWindow, false);
+}
+
+function initializePrivacyMenu() {
+ var privacy = $("privacy").value.toUpperCase();
+ log("privacy: " + privacy);
+ if (privacy.length > 0) {
+ var privacyMenu = $("privacy-menu").childNodesWithTag("ul")[0];
+ var menuEntries = privacyMenu.childNodesWithTag("li");
+ var chosenNode;
+ if (privacy == "CONFIDENTIAL")
+ chosenNode = menuEntries[1];
+ else if (privacy == "PRIVATE")
+ chosenNode = menuEntries[2];
+ else
+ chosenNode = menuEntries[0];
+ privacyMenu.chosenNode = chosenNode;
+ chosenNode.addClassName("_chosen");
+ }
+}
+
+function onComponentEditorLoad(event) {
+ if (!$("statusPercent"))
+ initializeAttendeesHref();
+ initializeDocumentHref();
+ initializePrivacyMenu();
+ $("calendarList").addEventListener("change", onChangeCalendar, false);
+}