]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1189 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 19 Oct 2007 16:22:49 +0000 (16:22 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 19 Oct 2007 16:22:49 +0000 (16:22 +0000)
UI/Templates/SchedulerUI/UIxDatePicker.wox
UI/WebServerResources/MailerUI.js
UI/WebServerResources/SchedulerUI.js
UI/WebServerResources/UIxAppointmentEditor.js
UI/WebServerResources/UIxTaskEditor.js
UI/WebServerResources/generic.js

index 2086001bd7336d2cca0b286825475ae19d74eb00..d3c387dd49e8df63edce420597aa490657a4d77a 100644 (file)
@@ -22,7 +22,4 @@
         var:alt="label"
         /></a
       >
-    <script type="text/javascript">
-      assignCalendar('<var:string value="dateID" />');
-    </script>
   </span>
index f70c792eb343b8229d3c36764ae8fef408bf2268..105f96ba1d80793035843114b1915a4515d5ca33 100644 (file)
@@ -1020,7 +1020,7 @@ function configureMessageListBodyEvents(table) {
       rows[i].dndTypes = function() { return new Array("mailRow"); };
       rows[i].dndGhost = messageListGhost;
       rows[i].dndDataForType = messageListData;
-      document.DNDManager.registerSource(rows[i]);
+//       document.DNDManager.registerSource(rows[i]);
 
       for (var j = 0; j < rows[i].cells.length; j++) {
        var cell = rows[i].cells[j];
@@ -1095,7 +1095,7 @@ function openInbox(node) {
 
 function initMailer(event) {
   if (!document.body.hasClassName("popup")) {
-    initDnd();
+//     initDnd();
     initMailboxTree();
   }
 }
index 2ace43224c8368cad64f2da5253161feb3994e85..e1b86a0ab4e77a906bd7fbe00377f069355f1cfe 100644 (file)
@@ -826,15 +826,15 @@ function calendarDisplayCallback(http) {
 }
 
 function assignCalendar(name) {
-   if (typeof(skycalendar) != "undefined") {
-      var node = $(name);
+  if (typeof(skycalendar) != "undefined") {
+    var node = $(name);
       
-      node.calendar = new skycalendar(node);
-      node.calendar.setCalendarPage(ResourcesURL + "/skycalendar.html");
-      var dateFormat = node.getAttribute("dateFormat");
-      if (dateFormat)
-        node.calendar.setDateFormat(dateFormat);
-   }
+    node.calendar = new skycalendar(node);
+    node.calendar.setCalendarPage(ResourcesURL + "/skycalendar.html");
+    var dateFormat = node.getAttribute("dateFormat");
+    if (dateFormat)
+      node.calendar.setDateFormat(dateFormat);
+  }
 }
 
 function popupCalendar(node) {
index 9f89c798f2758a8356226da4fcec68e00606dc95..3fbb575845cce413b335b3df1bba0e09055761a9 100644 (file)
@@ -1,37 +1,37 @@
 /*
- Copyright (C) 2005 SKYRIX Software AG
 Copyright (C) 2005 SKYRIX Software AG
  
- This file is part of OpenGroupware.org.
 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 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.
 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.
 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.
 */
 
 var contactSelectorAction = 'calendars-contacts';
 
 function uixEarlierDate(date1, date2) {
   // can this be done in a sane way?
-//   cuicui = 'year';
+  //   cuicui = 'year';
   if (date1.getYear()  < date2.getYear()) return date1;
   if (date1.getYear()  > date2.getYear()) return date2;
   // same year
-//   cuicui += '/month';
+  //   cuicui += '/month';
   if (date1.getMonth() < date2.getMonth()) return date1;
   if (date1.getMonth() > date2.getMonth()) return date2;
-//   // same month
-//   cuicui += '/date';
+  //   // same month
+  //   cuicui += '/date';
   if (date1.getDate() < date2.getDate()) return date1;
   if (date1.getDate() > date2.getDate()) return date2;
   // same day
@@ -68,10 +68,10 @@ function validateAptEditor() {
     alert(labels.validate_invalid_enddate);
     return false;
   }
-//   cuicui = '';
+  //   cuicui = '';
   tmpdate = uixEarlierDate(startdate, enddate);
   if (tmpdate == enddate) {
-//     window.alert(cuicui);
+    //     window.alert(cuicui);
     alert(labels.validate_endbeforestart);
     return false;
   }
@@ -195,7 +195,7 @@ function _getShadowDate(which) {
   date.setHours(intValue);
   intValue = parseInt(window.timeWidgets[which]['minute'].getAttribute("shadow-value"));
   date.setMinutes(intValue);
-//   window.alert("shadow: " + date);
+  //   window.alert("shadow: " + date);
 
   return date;
 }
@@ -230,14 +230,14 @@ function setStartDate(newStartDate) {
 }
 
 function setEndDate(newEndDate) {
-//   window.alert(newEndDate);
+  //   window.alert(newEndDate);
   this._setDate('end', newEndDate);
 }
 
 function onAdjustEndTime(event) {
   var dateDelta = (window.getStartDate().valueOf()
                    - window.getShadowStartDate().valueOf());
-//   window.alert(window.getEndDate().valueOf() + '  ' + dateDelta);
+  //   window.alert(window.getEndDate().valueOf() + '  ' + dateDelta);
   var newEndDate = new Date(window.getEndDate().valueOf() + dateDelta);
   window.setEndDate(newEndDate);
   window.timeWidgets['start']['date'].updateShadowValue();
@@ -246,38 +246,44 @@ function onAdjustEndTime(event) {
 }
 
 function onAllDayChanged(event) {
-   for (var type in window.timeWidgets) {
-      window.timeWidgets[type]['hour'].disabled = this.checked;
-      window.timeWidgets[type]['minute'].disabled = this.checked;
-   }
+  for (var type in window.timeWidgets) {
+    window.timeWidgets[type]['hour'].disabled = this.checked;
+    window.timeWidgets[type]['minute'].disabled = this.checked;
+  }
 }
 
 function initTimeWidgets(widgets) {
   this.timeWidgets = widgets;
 
-  Event.observe(widgets['start']['date'], "change", this.onAdjustEndTime, false);
-  Event.observe(widgets['start']['hour'], "change", this.onAdjustEndTime, false);
-  Event.observe(widgets['start']['minute'], "change", this.onAdjustEndTime, false);
+  Event.observe(widgets['start']['date'], "change",
+               this.onAdjustEndTime, false);
+  Event.observe(widgets['start']['hour'], "change",
+               this.onAdjustEndTime, false);
+  Event.observe(widgets['start']['minute'], "change",
+               this.onAdjustEndTime, false);
 
   var allDayLabel = $("allDay");
   var input = $(allDayLabel).childNodesWithTag("input")[0];
   Event.observe(input, "change", onAllDayChanged.bindAsEventListener(input));
   if (input.checked) {
-     for (var type in widgets) {
-       widgets[type]['hour'].disabled = true;
-       widgets[type]['minute'].disabled = true;
-     }
+    for (var type in widgets) {
+      widgets[type]['hour'].disabled = true;
+      widgets[type]['minute'].disabled = true;
+    }
   }
 }
 
 function onAppointmentEditorLoad() {
-   var widgets = {'start': {'date': $("startTime_date"),
-                           'hour': $("startTime_time_hour"),
-                           'minute': $("startTime_time_minute")},
-                 'end': {'date': $("endTime_date"),
-                         'hour': $("endTime_time_hour"),
-                         'minute': $("endTime_time_minute")}};
-   initTimeWidgets(widgets);
+  assignCalendar('startTime_date');
+  assignCalendar('endTime_date');
+
+  var widgets = {'start': {'date': $("startTime_date"),
+                          'hour': $("startTime_time_hour"),
+                          'minute': $("startTime_time_minute")},
+                'end': {'date': $("endTime_date"),
+                        'hour': $("endTime_time_hour"),
+                        'minute': $("endTime_time_minute")}};
+  initTimeWidgets(widgets);
 }
 
 addEvent(window, 'load', onAppointmentEditorLoad);
index 5207d57e723875ae26d6a71f97586aa2517cdac6..5d98047afb0c05558dba82cbc6b20d116a7e20a9 100644 (file)
@@ -6,12 +6,12 @@ function uixEarlierDate(date1, date2) {
   if (date1 && date2) {
     if (date1.getYear()  < date2.getYear()) return date1;
     if (date1.getYear()  > date2.getYear()) return date2;
-  // same year
-  //   cuicui += '/month';
+    // same year
+    //   cuicui += '/month';
     if (date1.getMonth() < date2.getMonth()) return date1;
     if (date1.getMonth() > date2.getMonth()) return date2;
-  //   // same month
-  //   cuicui += '/date';
+    //   // same month
+    //   cuicui += '/date';
     if (date1.getDate() < date2.getDate()) return date1;
     if (date1.getDate() > date2.getDate()) return date2;
   }
@@ -187,110 +187,114 @@ this._getDate = function(which) {
   return date;
 }
 
-this._getShadowDate = function(which) {
-  var date = window.timeWidgets[which]['date'].getAttribute("shadow-value").asDate();
-  var intValue = parseInt(window.timeWidgets[which]['hour'].getAttribute("shadow-value"));
-  date.setHours(intValue);
-  intValue = parseInt(window.timeWidgets[which]['minute'].getAttribute("shadow-value"));
-  date.setMinutes(intValue);
-//   window.alert("shadow: " + date);
+  this._getShadowDate = function(which) {
+    var date = window.timeWidgets[which]['date'].getAttribute("shadow-value").asDate();
+    var intValue = parseInt(window.timeWidgets[which]['hour'].getAttribute("shadow-value"));
+    date.setHours(intValue);
+    intValue = parseInt(window.timeWidgets[which]['minute'].getAttribute("shadow-value"));
+    date.setMinutes(intValue);
+    //   window.alert("shadow: " + date);
 
-  return date;
-}
-
-this.getStartDate = function() {
-  return this._getDate('start');
-}
-
-this.getDueDate = function() {
-  return this._getDate('due');
-}
-
-this.getShadowStartDate = function() {
-  return this._getShadowDate('start');
-}
-
-this.getShadowDueDate = function() {
-  return this._getShadowDate('due');
-}
-
-this._setDate = function(which, newDate) {
-  window.timeWidgets[which]['date'].setValueAsDate(newDate);
-  window.timeWidgets[which]['hour'].value = newDate.getHours();
-  var minutes = newDate.getMinutes();
-  if (minutes % 15)
-    minutes += (15 - minutes % 15);
-  window.timeWidgets[which]['minute'].value = minutes;
-}
-
-this.setStartDate = function(newStartDate) {
-  this._setDate('start', newStartDate);
-}
-
-this.setDueDate = function(newDueDate) {
-//   window.alert(newDueDate);
-  this._setDate('due', newDueDate);
-}
-
-this.onAdjustDueTime = function(event) {
-  if (!window.timeWidgets['due']['date'].disabled) {
-    var dateDelta = (window.getStartDate().valueOf()
-                     - window.getShadowStartDate().valueOf());
-    var newDueDate = new Date(window.getDueDate().valueOf() + dateDelta);
-    window.setDueDate(newDueDate);
+    return date;
   }
-  window.timeWidgets['start']['date'].updateShadowValue();
-  window.timeWidgets['start']['hour'].updateShadowValue();
-  window.timeWidgets['start']['minute'].updateShadowValue();
-}
 
-this.initTimeWidgets = function (widgets) {
-  this.timeWidgets = widgets;
+    this.getStartDate = function() {
+      return this._getDate('start');
+    }
 
-  Event.observe(widgets['start']['date'], "change", this.onAdjustDueTime, false);
-  Event.observe(widgets['start']['hour'], "change", this.onAdjustDueTime, false);
-  Event.observe(widgets['start']['minute'], "change", this.onAdjustDueTime, false);
-}
+      this.getDueDate = function() {
+       return this._getDate('due');
+      }
 
-function onStatusListChange(event) {
-   var value = $("statusList").value;
-   var statusTimeDate = $("statusTime_date");
-   var statusPercent = $("statusPercent");
-
-   if (value == "WONoSelectionString") {
-      statusTimeDate.disabled = true;
-      statusPercent.disabled = true;
-      statusPercent.value = "";
-   }
-   else if (value == "0") {
-      statusTimeDate.disabled = true;
-      statusPercent.disabled = false;
-   }
-   else if (value == "1") {
-      statusTimeDate.disabled = true;
-      statusPercent.disabled = false;
-   }
-   else if (value == "2") {
-      statusTimeDate.disabled = false;
-      statusPercent.disabled = false;
-      statusPercent.value = "100";
-   }
-   else if (value == "3") {
-      statusTimeDate.disabled = true;
-      statusPercent.disabled = true;
-   }
-   else {
-      statusTimeDate.disabled = true;
-   }
-}
+       this.getShadowStartDate = function() {
+         return this._getShadowDate('start');
+       }
+
+         this.getShadowDueDate = function() {
+           return this._getShadowDate('due');
+         }
+
+           this._setDate = function(which, newDate) {
+             window.timeWidgets[which]['date'].setValueAsDate(newDate);
+             window.timeWidgets[which]['hour'].value = newDate.getHours();
+             var minutes = newDate.getMinutes();
+             if (minutes % 15)
+               minutes += (15 - minutes % 15);
+             window.timeWidgets[which]['minute'].value = minutes;
+           }
+
+             this.setStartDate = function(newStartDate) {
+               this._setDate('start', newStartDate);
+             }
+
+               this.setDueDate = function(newDueDate) {
+                 //   window.alert(newDueDate);
+                 this._setDate('due', newDueDate);
+               }
+
+                 this.onAdjustDueTime = function(event) {
+                   if (!window.timeWidgets['due']['date'].disabled) {
+                     var dateDelta = (window.getStartDate().valueOf()
+                                      - window.getShadowStartDate().valueOf());
+                     var newDueDate = new Date(window.getDueDate().valueOf() + dateDelta);
+                     window.setDueDate(newDueDate);
+                   }
+                   window.timeWidgets['start']['date'].updateShadowValue();
+                   window.timeWidgets['start']['hour'].updateShadowValue();
+                   window.timeWidgets['start']['minute'].updateShadowValue();
+                 }
+
+                   this.initTimeWidgets = function (widgets) {
+                     this.timeWidgets = widgets;
+
+                     Event.observe(widgets['start']['date'], "change", this.onAdjustDueTime, false);
+                     Event.observe(widgets['start']['hour'], "change", this.onAdjustDueTime, false);
+                     Event.observe(widgets['start']['minute'], "change", this.onAdjustDueTime, false);
+                   }
+
+                     function onStatusListChange(event) {
+                       var value = $("statusList").value;
+                       var statusTimeDate = $("statusTime_date");
+                       var statusPercent = $("statusPercent");
+
+                       if (value == "WONoSelectionString") {
+                         statusTimeDate.disabled = true;
+                         statusPercent.disabled = true;
+                         statusPercent.value = "";
+                       }
+                       else if (value == "0") {
+                         statusTimeDate.disabled = true;
+                         statusPercent.disabled = false;
+                       }
+                       else if (value == "1") {
+                         statusTimeDate.disabled = true;
+                         statusPercent.disabled = false;
+                       }
+                       else if (value == "2") {
+                         statusTimeDate.disabled = false;
+                         statusPercent.disabled = false;
+                         statusPercent.value = "100";
+                       }
+                       else if (value == "3") {
+                         statusTimeDate.disabled = true;
+                         statusPercent.disabled = true;
+                       }
+                       else {
+                         statusTimeDate.disabled = true;
+                       }
+                     }
 
 function initializeStatusLine() {
-   var statusList = $("statusList");
-   Event.observe(statusList, "mouseup", onStatusListChange, false);
+  var statusList = $("statusList");
+  Event.observe(statusList, "mouseup", onStatusListChange, false);
 }
 
 function onTaskEditorLoad() {
-   initializeStatusLine();
+  assignCalendar('startTime_date');
+  assignCalendar('dueTime_date');
+  assignCalendar('statusTime_date');
+
+  initializeStatusLine();
 }
 
 addEvent(window, 'load', onTaskEditorLoad);
index fc73a4aec98b4464675c9f79b39becd629c79979..c2971d66ba4fd88668e5e368d2b0dde0591dd95f 100644 (file)
@@ -776,9 +776,12 @@ function popupSubmenu(event) {
     parentNode.submenuItem = this;
     parentNode.submenu = submenuNode;
 
-    var menuTop = (parentNode.offsetTop - 2 + this.offsetTop);
-    if (window.height() < (menuTop + submenuNode.offsetHeight))
-      menuTop = window.height() - submenuNode.offsetHeight - 3;
+    var menuTop = (parentNode.offsetTop - 1
+                  + this.offsetTop);
+    if (window.height()
+       < (menuTop + submenuNode.offsetHeight)
+       && submenuNode.offsetHeight < window.height())
+      menuTop = this.offsetTop - submenuNode.offsetHeight + 1;
     var menuLeft = (parentNode.offsetLeft + parentNode.offsetWidth - 3);
     if (window.width()
        < (menuLeft + submenuNode.offsetWidth))
@@ -796,8 +799,8 @@ function popupSubmenu(event) {
                  onMouseEnteredParentMenu.bindAsEventListener(parentNode));
     $(this).addClassName("submenu-selected");
     submenuNode.setStyle({ top: menuTop + "px",
-         left: menuLeft + "px",
-         visibility: "visible" });
+                          left: menuLeft + "px",
+                          visibility: "visible" });
     preventDefault(event);
   }
 }
@@ -1140,10 +1143,8 @@ function initMenu(menuDIV, callbacks) {
     var callback = callbacks[j];
     if (callback) {
       if (typeof(callback) == "string") {
-       if (callback == "-") {
+       if (callback == "-")
          node.addClassName("separator");
-         node.appendChild(document.createElement("hr"));
-       }
        else {
          node.submenu = callback;
          node.addClassName("submenu");