]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1048 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 13 Apr 2007 15:03:37 +0000 (15:03 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 13 Apr 2007 15:03:37 +0000 (15:03 +0000)
UI/Scheduler/Toolbars/SOGoComponentClose.toolbar [new file with mode: 0644]
UI/Scheduler/Toolbars/SOGoTaskObject.toolbar [new file with mode: 0644]
UI/Scheduler/UIxAttendeesEditor.h [new file with mode: 0644]
UI/Scheduler/UIxAttendeesEditor.m [new file with mode: 0644]
UI/Templates/SchedulerUI/UIxAttendeesEditor.wox [new file with mode: 0644]
UI/Templates/SchedulerUI/UIxCalendarSelector.wox [new file with mode: 0644]
UI/Templates/SchedulerUI/UIxComponentEditor.wox [new file with mode: 0644]
UI/WebServerResources/UIxComponentEditor.js [new file with mode: 0644]
UI/WebServerResources/arrow-dwn-sharp.gif [new file with mode: 0644]
UI/WebServerResources/remove-calendar.png [new file with mode: 0644]

diff --git a/UI/Scheduler/Toolbars/SOGoComponentClose.toolbar b/UI/Scheduler/Toolbars/SOGoComponentClose.toolbar
new file mode 100644 (file)
index 0000000..571e1f6
--- /dev/null
@@ -0,0 +1,7 @@
+( /* the toolbar groups -*-cperl-*- */
+  ( { link = "#";
+      isSafe = NO;
+      label = "Close";
+      onclick = "window.close(); return false;";
+      image = "tb-mail-stop-flat-24x24.png"; } )
+)
diff --git a/UI/Scheduler/Toolbars/SOGoTaskObject.toolbar b/UI/Scheduler/Toolbars/SOGoTaskObject.toolbar
new file mode 100644 (file)
index 0000000..2ad120e
--- /dev/null
@@ -0,0 +1,15 @@
+( /* 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"; } )
+)
diff --git a/UI/Scheduler/UIxAttendeesEditor.h b/UI/Scheduler/UIxAttendeesEditor.h
new file mode 100644 (file)
index 0000000..ad556e5
--- /dev/null
@@ -0,0 +1,44 @@
+/* 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 */
diff --git a/UI/Scheduler/UIxAttendeesEditor.m b/UI/Scheduler/UIxAttendeesEditor.m
new file mode 100644 (file)
index 0000000..b8b0c0e
--- /dev/null
@@ -0,0 +1,79 @@
+/* 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
diff --git a/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox b/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox
new file mode 100644 (file)
index 0000000..1a37f96
--- /dev/null
@@ -0,0 +1,102 @@
+<?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>
diff --git a/UI/Templates/SchedulerUI/UIxCalendarSelector.wox b/UI/Templates/SchedulerUI/UIxCalendarSelector.wox
new file mode 100644 (file)
index 0000000..bee2ff0
--- /dev/null
@@ -0,0 +1,38 @@
+<?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>
diff --git a/UI/Templates/SchedulerUI/UIxComponentEditor.wox b/UI/Templates/SchedulerUI/UIxComponentEditor.wox
new file mode 100644 (file)
index 0000000..48cb8e0
--- /dev/null
@@ -0,0 +1,78 @@
+<?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>
diff --git a/UI/WebServerResources/UIxComponentEditor.js b/UI/WebServerResources/UIxComponentEditor.js
new file mode 100644 (file)
index 0000000..525a9b1
--- /dev/null
@@ -0,0 +1,157 @@
+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);
+}
diff --git a/UI/WebServerResources/arrow-dwn-sharp.gif b/UI/WebServerResources/arrow-dwn-sharp.gif
new file mode 100644 (file)
index 0000000..8b265a6
Binary files /dev/null and b/UI/WebServerResources/arrow-dwn-sharp.gif differ
diff --git a/UI/WebServerResources/remove-calendar.png b/UI/WebServerResources/remove-calendar.png
new file mode 100644 (file)
index 0000000..c60dceb
Binary files /dev/null and b/UI/WebServerResources/remove-calendar.png differ