Author: sebawagner
Date: Wed Mar 21 20:38:04 2012
New Revision: 1303562

URL: http://svn.apache.org/viewvc?rev=1303562&view=rev
Log:
OPENMEETINGS-7 - Add possibility to add calendar events by clicking / dragging 
in the day/week/month view and switch options for the day/week/month view

Added:
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalGridTempDrawView.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/resultset_next.png
   (with props)
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/resultset_previous.png
   (with props)
Modified:
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/calendar/dateSelector.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/explorer/explorerBox.lzx
    incubator/openmeetings/trunk/singlewebapp/WebContent/src/main.lzx
    incubator/openmeetings/trunk/singlewebapp/WebContent/src/maindebug.lzx
    incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/library.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzEditCalendarEvent.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/lzCalendar.lzx
    
incubator/openmeetings/trunk/singlewebapp/src/app/org/openmeetings/utils/math/TimezoneUtil.java

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/calendar/dateSelector.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/calendar/dateSelector.lzx?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/calendar/dateSelector.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/calendar/dateSelector.lzx
 Wed Mar 21 20:38:04 2012
@@ -225,11 +225,20 @@
                ]]>
        </handler>      
        
+       <method name="loadDate" args="datObj">
+               this.showingdate = datObj;
+               this.init();
+               this.showDate(this.selecteddate);
+               //this.onselect.sendEvent(this.selecteddate);
+       </method>
+       
        <method name="init">
         <![CDATA[ 
                super.init();
                
+               var tIsInit = false;
                if (this.showingdate==""){
+                       tIsInit = true;
                        this.showingdate = new Date();
                }
                this.setAttribute('year',this.showingdate.getFullYear());
@@ -251,7 +260,7 @@
                
                if ($debug) Debug.write("INIT ",ref,ref.daydate);
                
-               if (ref != null) {
+               if (ref != null && tIsInit) {
                        this.selectDate(ref.daydate, ref.dayIndexNumber, 
ref.weekIndexNumber);
                }
                ]]>
@@ -263,6 +272,9 @@
         if (this.showingdate.getMonth()== tDate.getMonth() && 
this.showingdate.getFullYear() == tDate.getFullYear()){
                //Debug.write("+++++++ Found Today");
                var ref = 
this.getDateRefByDateNumber(tDate.getDate(),tDate.getMonth());
+               if (ref == null) {
+                       if ($debug) Debug.warn("Could not find date ref",tDate);
+               }
                ref.setAttribute('bgcolor',0xCECECE);
                return ref;
         }
@@ -271,6 +283,25 @@
                ]]>
        </method>
        
+       <method name="showDate" args="dateObj">
+               <![CDATA[
+               if(this.selected!=null) 
this.selected.setAttribute('bgcolor',"white");
+               var i=0;
+               while (i<this.content.content.content.subviews.length){
+                       var k=0;
+                       while 
(k<this.content.content.content.subviews[i].content.subviews.length){
+                               var t = 
this.content.content.content.subviews[i].content.subviews[k].daydate;
+                               if (t.getDate()==dateObj.getDate() && 
t.getMonth()==dateObj.getMonth()){
+                                       
this.content.content.content.subviews[i].content.subviews[k].onclick.sendEvent(null);
+                                       return;
+                               }
+                               k++;
+                       }
+                       i++;
+               }
+               ]]>
+       </method>
+       
        <method name="selectDate" args="dateObj,dayIndex,weekIndex">
                dayIndexNumber = dayIndex;
                weekIndexNumber = weekIndex;
@@ -300,6 +331,7 @@
                                if (t.getDate()==dateObj.getDate() && 
t.getMonth()==dateObj.getMonth()){
                                        this.selected = 
this.content.content.content.subviews[i].content.subviews[k];
                                        
this.selected.setAttribute('bgcolor',0xCCD7E1);
+                                       return;
                                }
                                k++;
                        }

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/explorer/explorerBox.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/explorer/explorerBox.lzx?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/explorer/explorerBox.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/explorer/explorerBox.lzx
 Wed Mar 21 20:38:04 2012
@@ -52,7 +52,8 @@
                                new lz.boxInitEffect(parent,{
                                                        x:parent.getMouse("x"),
                                                        y:parent.getMouse("y"),
-                                                       width:20,
+                                                       width:2,
+                                                       height:2,
                                                        zielx:this.x,
                                                        ziely:this.y,
                                                        bgcolor:annimationColor,

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/src/main.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/main.lzx?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/src/main.lzx (original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/src/main.lzx Wed Mar 
21 20:38:04 2012
@@ -185,7 +185,7 @@
         this.setAttribute("visibility","hidden");
     </method>
     <animator name="showLoadingAnni" attribute="opacity" 
-               from="0" to="0.7" start="false" duration="500" />
+               from="0" to="0.7" start="false" duration="250" />
     <text name="_text" align="right" y="56" fontsize="14" 
fgcolor="red">Loading...</text>
 </view>
 

Modified: incubator/openmeetings/trunk/singlewebapp/WebContent/src/maindebug.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/maindebug.lzx?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/WebContent/src/maindebug.lzx 
(original)
+++ incubator/openmeetings/trunk/singlewebapp/WebContent/src/maindebug.lzx Wed 
Mar 21 20:38:04 2012
@@ -186,7 +186,7 @@
         this.setAttribute("visibility","hidden");
     </method>
     <animator name="showLoadingAnni" attribute="opacity" 
-               from="0" to="0.7" start="false" duration="500" />
+               from="0" to="0.7" start="false" duration="250" />
     <text name="_text" align="right" y="56" fontsize="14" 
fgcolor="red">Loading...</text>
 </view>
 

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/library.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/library.lzx?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/library.lzx 
(original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/library.lzx 
Wed Mar 21 20:38:04 2012
@@ -21,18 +21,14 @@
 <library>
        
        <include href="conference/" />
-       <!-- 
        <include href="chat/" />
        <include href="settings/" />
        <include href="invitation/" />
     <include href="lzrecordcontent/" />
-     -->
        <include href="dashboard/" />
-       <!-- 
        <include href="meetings/" />
     <include href="admin/" />
     <include href="sipintegration/" />
-     -->
     <include href="lzcalendar/" />
 
 </library>

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/library.lzx
 Wed Mar 21 20:38:04 2012
@@ -27,9 +27,11 @@
        <resource name="calendar_add_user_external_rsc" 
src="resources/user_go.png" />
        <resource name="calendar_delete_button" src="resources/delete.png" />
        <resource name="single_event_popup_background_rsc" 
src="resources/single_event_popup_background.swf" />
-       
+       <resource name="calendar_resultset_next_rsc" 
src="resources/resultset_next.png" />
+       <resource name="calendar_resultset_previous_rsc" 
src="resources/resultset_previous.png" />
 
        <include href="addAttendee.lzx" />
+       <include href="lzCalGridTempDrawView.lzx" />
        <include href="addExternalAttendee.lzx" />
        <include href="attendeeListItem.lzx" />
        <include href="lzCalendarGrid.lzx" />

Added: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalGridTempDrawView.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalGridTempDrawView.lzx?rev=1303562&view=auto
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalGridTempDrawView.lzx
 (added)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalGridTempDrawView.lzx
 Wed Mar 21 20:38:04 2012
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+      http://www.apache.org/licenses/LICENSE-2.0
+         
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  
+-->
+<library>
+
+       <class name="lzCalGridTempDrawView" extends="view" bgcolor="0xA59CFC" 
width="${ parent.width }" height="60">
+       
+               <attribute name="starty" value="-1" type="number" />
+               
+               <attribute name="heightInMinutes" value="0" type="number" />
+               
+               <attribute name="tPixels30Minutes" value="0" type="number" />
+               
+               <handler name="onidle" reference="LzIdleService.LzIdle">
+                       <![CDATA[
+                               var tParentScrolly = 
parent.parent.parent.parent.getMouse("y");
+                               if (tParentScrolly < 0) {
+                                       if (parent.parent.parent.y < 0) {
+                                               if (parent.parent.parent.y+20 < 
0) {
+                                                       
parent.parent.parent.setAttribute("y",parent.parent.parent.y+20);
+                                               } else {
+                                                       
parent.parent.parent.setAttribute("y",0);
+                                               }
+                                       }
+                               } else if (parent.parent.parent.parent.height < 
tParentScrolly) {
+                                       var maxScroll = 
parent.parent.parent.parent.height - parent.parent.parent.height;
+                                       if (parent.parent.parent.y > maxScroll) 
{
+                                               if (parent.parent.parent.y-20 > 
maxScroll) {
+                                                       
parent.parent.parent.setAttribute("y",parent.parent.parent.y-20);
+                                               } else {
+                                                       
parent.parent.parent.setAttribute("y",maxScroll);
+                                               }
+                                       } else {
+                                               
parent.parent.parent.setAttribute("y",maxScroll);
+                                       }
+                               }
+                               
+                               var tNewMouseY = parent.getMouse("y");
+                               tNewMouseY = 
Math.round(tNewMouseY/tPixels30Minutes)*tPixels30Minutes;
+                               if (tNewMouseY > this.starty) {
+                                       var newHeight = tNewMouseY - starty;
+                                       if (newHeight > (parent.height-starty)) 
{
+                                               newHeight = 
parent.height-starty;
+                                       }
+                                       this.setAttribute("y",this.starty);
+                                       this.setAttribute("height",newHeight);
+                               } else {
+                                       if (tNewMouseY < 0) {
+                                               tNewMouseY = 0;
+                                       }
+                                       var newHeight = this.starty - 
tNewMouseY;
+                                       this.setAttribute("y",tNewMouseY);
+                                       this.setAttribute("height",newHeight);
+                               }
+                               if (this.height == 0) {
+                                       
this.setAttribute("height",tPixels30Minutes);
+                               }
+                               if (this.height == tPixels30Minutes 
+                                                       && this.height+this.y 
>= parent.parent.parent.height) {
+                                       this.setAttribute("y", 
parent.parent.parent.height-tPixels30Minutes);
+                               }
+                               
+                               var startMinutesTotal = 
this.getStartMinutesTotal();
+                               var startHours = 
Math.floor(startMinutesTotal/60);
+                               var startMinutes = 
startMinutesTotal-(startHours*60);
+                               if (startHours < 10) {
+                                       startHours = "0"+startHours;
+                               }
+                               if (startMinutes < 10) {
+                                       startMinutes = "0"+startMinutes;
+                               }
+                               
+                               var endMinutesTotal = this.getEndMinutesTotal();
+                               var endHours = Math.floor(endMinutesTotal/60);
+                               var endMinutes = endMinutesTotal-(endHours*60);
+                               if (endHours < 10) {
+                                       endHours = "0"+endHours;
+                               }
+                               if (endMinutes < 10) {
+                                       endMinutes = "0"+endMinutes;
+                               }
+                               
+                               
this.fromToTime.setAttribute("text",""+startHours+":"+startMinutes+" - 
"+endHours+":"+endMinutes);
+                               
+                       ]]>
+               </handler>
+               
+               <method name="getStartMinutesTotal">
+                       return Math.round(this.y/heightInMinutes);
+               </method>
+               
+               <method name="getEndMinutesTotal">
+                       return Math.round((this.y+this.height)/heightInMinutes);
+               </method>
+               
+               <text name="fromToTime" resize="true" fontsize="10" 
fgcolor="0x666666" />
+       
+       </class>
+
+</library>
\ No newline at end of file

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzCalendarGrid.lzx
 Wed Mar 21 20:38:04 2012
@@ -34,12 +34,27 @@
                
                <event name="onScollContent" />
                
+               <event name="onSelectDate" />
+               
+               <event name="onNewEventDate" />
+               
+               <event name="onStartEndDate" />
+               
+               <attribute name="tStartDate" value="null" />
+               <attribute name="tEndDate" value="null" />
+               
                <method name="setCurrentDate" args="tDate">
                        if (this.currentDate != tDate) {
                                this.currentDate = tDate;
                        }
                </method>
                
+               <method name="selectStartEndDateTime" 
args="tStartDate,tEndDate">
+                       this.tStartDate = tStartDate;
+                       this.tEndDate = tEndDate;
+                       this.onStartEndDate.sendEvent(null);
+               </method>
+               
                <method name="checkAndShow" args="tDate,dayIndex,weekIndex">
                        this.setCurrentDate(tDate);
                        this.currentWeek = weekIndex + 1; //the index in the 
xml dataset list construct starts counting with 1
@@ -171,7 +186,49 @@
                                                                </handler>
                                                                
                                                                <view 
name="_content" width="${ parent.width -1 }" bgcolor="0xFFFFFF"
-                                                                               
                height="720">
+                                                                               
                height="720" clickable="true" showhandcursor="false">
+                                                                               
                
+                                                                       
<attribute name="lzCalGridTempDrawView" value="null" />
+                                                                       
+                                                                       
<handler name="onmousedown">
+                                                                               
<![CDATA[
+                                                                               
        var heightInMinutes = this.height/1440;
+                                                                               
        //round by 30 minutes
+                                                                               
        var tPixels30Minutes = heightInMinutes*30;
+                                                                               
        var tStarty = this.getMouse("y");
+                                                                               
        tStarty = Math.round(tStarty/tPixels30Minutes)*tPixels30Minutes;
+                                                                               
        this.lzCalGridTempDrawView = new lz.lzCalGridTempDrawView(this,{
+                                                                               
                                                                                
        y:tStarty,
+                                                                               
                                                                                
        starty:tStarty,
+                                                                               
                                                                                
        height:tPixels30Minutes,
+                                                                               
                                                                                
        heightInMinutes:heightInMinutes,
+                                                                               
                                                                                
        tPixels30Minutes:tPixels30Minutes
+                                                                               
                                                                                
});
+                                                                               
]]>                                                             
+                                                                       
</handler>
+                                                                       
+                                                                       
<handler name="onmouseup">
+                                                                               
if (this.lzCalGridTempDrawView != null) {
+                                                                               
        var tStartDate = new Date();
+                                                                               
        //clone Date to have day and month
+                                                                               
        tStartDate.setTime(parent.dayDate.getTime());
+                                                                               
        var startMinutesTotal = 
this.lzCalGridTempDrawView.getStartMinutesTotal();
+                                                                               
        tStartDate.setHours(Math.floor(startMinutesTotal/60));
+                                                                               
        tStartDate.setMinutes(startMinutesTotal-(tStartDate.getHours()*60));
+                                                                               
        
+                                                                               
        var tEndDate = new Date();
+                                                                               
        //clone Date to have day and month
+                                                                               
        tEndDate.setTime(parent.dayDate.getTime());
+                                                                               
        var endMinutesTotal = this.lzCalGridTempDrawView.getEndMinutesTotal();
+                                                                               
        tEndDate.setHours(Math.floor(endMinutesTotal/60));
+                                                                               
        tEndDate.setMinutes(endMinutesTotal-(tEndDate.getHours()*60));
+                                                                               
+                                                                               
        this.lzCalGridTempDrawView.destroy();
+                                                                               
        this.lzCalGridTempDrawView = null;
+                                                                               
        
+                                                                               
        
parent.parent.parent.parent.parent.parent.selectStartEndDateTime(tStartDate,tEndDate);
+                                                                               
}
+                                                                       
</handler>
                                                                        
                                                                        <view 
name="dayBg2" resource="calendar_one_day_hours_index_bg_rsc" stretches="width" 
                                                                                
width="${ parent.width }"  ></view>
@@ -240,13 +297,21 @@
                                                                                
                                                <text name="_title" width="${ 
parent.width -1 }" fgcolor="0x666666"
                                                                                
datapath="tDate" bgcolor="0xFFFFFF" height="19" >
+                                                       <attribute name="tDate" 
value="null" />
                                                        <handler name="ondata" 
args="d">
-                                                               var tDate = 
parseDateOnlyFromXmlString(d.childNodes[0].data);
-                                                               
+                                                               this.tDate = 
parseDateOnlyFromXmlString(d.childNodes[0].data);
                                                                var 
tStringWeekDay = canvas.dayShortNames[tDate.getDay()];
-                                                               if ($debug) 
Debug.write("Calc Week day ",tStringWeekDay,tDate.getDay(),tDate);
-                                                               
-                                                               
this.setAttribute("text",canvas.dayShortNames[tDate.getDay()]+" 
"+tDate.getDate()+"."+(tDate.getMonth()+1)+".");
+                                                               if ($debug) 
Debug.write("Calc Week day ",tStringWeekDay,this.tDate.getDay(),this.tDate);
+                                                               
this.setAttribute("text",canvas.dayShortNames[this.tDate.getDay()]+" 
"+this.tDate.getDate()+"."+(this.tDate.getMonth()+1)+".");
+                                                       </handler>
+                                                       <handler 
name="onmouseover">
+                                                               
this.setAttribute("fontstyle","bold");
+                                                       </handler>
+                                                       <handler 
name="onmouseout">
+                                                               
this.setAttribute("fontstyle","plain");
+                                                       </handler>
+                                                       <handler name="onclick">
+                                                               
parent.parent.parent.parent.onSelectDate.sendEvent(this.tDate);
                                                        </handler>
                                                </text>
                                                
@@ -261,7 +326,7 @@
                                                <view width="${ parent.width-10 
}" height="721" >
                                                
                                                        <handler name="oninit">
-                                                               
this.setAttribute("y",parent.height-721);
+                                                               
this.setAttribute("y",parent.height-this.height);
                                                        </handler>
                                                        
                                                        <handler name="ony" 
args="y">
@@ -310,7 +375,49 @@
                                                                </handler>
                                                                
                                                                <view 
name="_content" width="${ parent.width -1 }" bgcolor="0xFFFFFF"
-                                                                               
                height="720">
+                                                                               
                height="720" clickable="true" showhandcursor="false">
+                                                                               
                
+                                                                       
<attribute name="lzCalGridTempDrawView" value="null" />
+                                                                       
+                                                                       
<handler name="onmousedown">
+                                                                               
<![CDATA[
+                                                                               
        var heightInMinutes = this.height/1440;
+                                                                               
        //round by 30 minutes
+                                                                               
        var tPixels30Minutes = heightInMinutes*30;
+                                                                               
        var tStarty = this.getMouse("y");
+                                                                               
        tStarty = Math.round(tStarty/tPixels30Minutes)*tPixels30Minutes;
+                                                                               
        this.lzCalGridTempDrawView = new lz.lzCalGridTempDrawView(this,{
+                                                                               
                                                                                
        y:tStarty,
+                                                                               
                                                                                
        starty:tStarty,
+                                                                               
                                                                                
        height:tPixels30Minutes,
+                                                                               
                                                                                
        heightInMinutes:heightInMinutes,
+                                                                               
                                                                                
        tPixels30Minutes:tPixels30Minutes
+                                                                               
                                                                                
});
+                                                                               
]]>                                                             
+                                                                       
</handler>
+                                                                       
+                                                                       
<handler name="onmouseup">
+                                                                               
if (this.lzCalGridTempDrawView != null) {
+                                                                               
        var tStartDate = new Date();
+                                                                               
        //clone Date to have day and month
+                                                                               
        tStartDate.setTime(parent.dayDate.getTime());
+                                                                               
        var startMinutesTotal = 
this.lzCalGridTempDrawView.getStartMinutesTotal();
+                                                                               
        tStartDate.setHours(Math.floor(startMinutesTotal/60));
+                                                                               
        tStartDate.setMinutes(startMinutesTotal-(tStartDate.getHours()*60));
+                                                                               
        
+                                                                               
        var tEndDate = new Date();
+                                                                               
        //clone Date to have day and month
+                                                                               
        tEndDate.setTime(parent.dayDate.getTime());
+                                                                               
        var endMinutesTotal = this.lzCalGridTempDrawView.getEndMinutesTotal();
+                                                                               
        tEndDate.setHours(Math.floor(endMinutesTotal/60));
+                                                                               
        tEndDate.setMinutes(endMinutesTotal-(tEndDate.getHours()*60));
+                                                                               
+                                                                               
        this.lzCalGridTempDrawView.destroy();
+                                                                               
        this.lzCalGridTempDrawView = null;
+                                                                               
        
+                                                                               
        
parent.parent.parent.parent.parent.parent.selectStartEndDateTime(tStartDate,tEndDate);
+                                                                               
}
+                                                                       
</handler>
                                                                        
                                                                        <view 
name="dayBg2" resource="calendar_day_bg_rsc" stretches="width" 
                                                                                
width="${ parent.width }"  ></view>
@@ -407,9 +514,32 @@
                                                </method>
                                                
                                                <view name="_content" width="${ 
parent.width -1 }" bgcolor="0xFFFFFF"
-                                                                               
height="${ parent.height -1 }">
-                                                                               
-                                                       <text name="_title" />
+                                                                               
height="${ parent.height -1 }" clickable="true" showhandcursor="false">
+                                                       
+                                                       <handler name="onclick">
+                                                               
lz.Cursor.restoreCursor();
+                                                               
parent.parent.parent.parent.onNewEventDate.sendEvent(parent.dayDate);
+                                                       </handler>
+                                                       
+                                                       <handler 
name="onmouseover">
+                                                               
lz.Cursor.setCursorGlobal("edit_add_rsc");
+                                                       </handler>
+                                                       
+                                                       <handler 
name="onmouseout">
+                                                               
lz.Cursor.restoreCursor();
+                                                       </handler>
+                                                                       
+                                                       <text name="_title">
+                                                               <handler 
name="onmouseover">
+                                                                       
this.setAttribute("fontstyle","bold");
+                                                               </handler>
+                                                               <handler 
name="onmouseout">
+                                                                       
this.setAttribute("fontstyle","plain");
+                                                               </handler>
+                                                               <handler 
name="onclick">
+                                                                       
parent.parent.parent.parent.parent.onSelectDate.sendEvent(parent.parent.dayDate);
+                                                               </handler>
+                                                       </text>
                                                
                                                        <view width="${ 
parent.width }" y="18">
                                                                <view 
datapath="appointments" bgcolor="0xA59CFC" width="${ parent.width }">

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzEditCalendarEvent.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzEditCalendarEvent.lzx?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzEditCalendarEvent.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/lzEditCalendarEvent.lzx
 Wed Mar 21 20:38:04 2012
@@ -103,15 +103,15 @@
                                if ($debug) Debug.write("appointmentstart 
",updateObj.appointmentstart);
                                var tTimeStart = this._timeStart.getText();
                                var hours = Number(tTimeStart.substr(0,2));
-                               var mins = Number(tTimeStart.substr(4,2));
-                               if ($debug) 
Debug.write("hours:mins",hours,mins,tTimeStart.substr(4,2));
+                               var mins = Number(tTimeStart.substr(3,2));
+                               if ($debug) 
Debug.write("hours:mins",hours,mins,tTimeStart.substr(4),tTimeStart);
                                updateObj.appointmentstart.setHours(hours);
                                updateObj.appointmentstart.setMinutes(mins);
                                
                                updateObj.appointmentend = 
this._dateEnd.getDate();
                                var tTimeEnd = this._timeEnd.getText();
                                var hours = Number(tTimeEnd.substr(0,2));
-                               var mins = Number(tTimeEnd.substr(4,2));
+                               var mins = Number(tTimeEnd.substr(3,2));
                                updateObj.appointmentend.setHours(hours);
                                updateObj.appointmentend.setMinutes(mins);
                                
@@ -372,6 +372,10 @@
                        
                                var tViewObj = this._content._inner.subviews[i];
                                
+                               if (!tViewObj.isLoaded) {
+                                       continue;
+                               }
+                               
                                var tObject = new Object();
                                tObject.meetingMemberId = tViewObj.memberId;
                                        tObject.firstname = tViewObj.firstName;
@@ -392,8 +396,12 @@
                        <view name="_inner">
                                <attendeeListItem 
datapath="local:classroot.eventDS:/meetingMember"
                                                        width="$once{ 
parent.parent.width-10 }">
+                                                       
+                                       <attribute name="isLoaded" 
value="false" type="boolean" />
+                                       
                                        <handler name="ondata" args="d">
                                                if ($debug) 
Debug.write("meetingMember -- ondata ",d);
+                                               this.isLoaded = true;
                                                var tDataPointer = new 
lz.datapointer();
                                                tDataPointer.setPointer(d);
                                                this.userId = 
tDataPointer.xpathQuery( 'userid/text()' );

Added: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/resultset_next.png
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/resultset_next.png?rev=1303562&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/resultset_next.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/resultset_previous.png
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/resultset_previous.png?rev=1303562&view=auto
==============================================================================
Binary file - no diff available.

Propchange: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/resources/resultset_previous.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/lzCalendar.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/lzCalendar.lzx?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/lzCalendar.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/lzCalendar.lzx
 Wed Mar 21 20:38:04 2012
@@ -29,6 +29,9 @@
        
        <attribute name="lzViewCalendarEvent" value="null" />
        
+       <attribute name="tStartDate" value="null" />
+       <attribute name="tEndDate" value="null" />
+       
        <handler name="oninit">
                <![CDATA[
                        _mainScrollBar.setAttribute("visibility","hidden");
@@ -143,20 +146,34 @@
                        newAppointment.title = canvas.getLabelName(1444);
                        
                        var tDate = new Date();
-                       tDate.setTime(this.currentDate.getTime());
-                       tDate.setMinutes(0);
-                       tDate.setSeconds(0);
-                       tDate.setHours(tDate.getHours()+1);
-                       if (tDate.getHours() == 23) {
-                               tDate.setHours(22);
+                       
+                       //There seems to be a difference in the way OpenLaszlo 
makes a Date to a XML string:
+                       //OpenLaszlo generates a time in UTC instead of the 
local time when converted to an XML String
+                       var timeZoneOffSetInMilliSeconds = 
tDate.getTimezoneOffset()*60*1000;
+                       
+                       if (this.tStartDate == null) {
+                               
tDate.setTime(this.currentDate.getTime()-timeZoneOffSetInMilliSeconds);
+                               tDate.setMinutes(0);
+                               tDate.setSeconds(0);
+                               if (tDate.getHours() == 23) {
+                                       tDate.setHours(22);
+                               }
+                       } else {
+                               
tDate.setTime(this.tStartDate.getTime()-timeZoneOffSetInMilliSeconds);
+                               tDate.setSeconds(0);
+                               this.tStartDate = null;
                        }
                        newAppointment.start = tDate;
                        
                        var tDate2 = new Date();
-                       tDate.setTime(tDate.getTime());
-                       tDate2.setMinutes(0);
-                       tDate2.setSeconds(0);
-                       tDate2.setHours(tDate.getHours()+1);
+                       if (this.tEndDate == null) {
+                               tDate2.setTime(tDate.getTime());
+                               tDate2.setHours(tDate.getHours()+1);
+                       } else {
+                               
tDate2.setTime(this.tEndDate.getTime()-timeZoneOffSetInMilliSeconds);
+                               tDate2.setSeconds(0);
+                               this.tEndDate = null;
+                       }
                        newAppointment.end = tDate2;
                        
                        newAppointment.comment = "";
@@ -183,15 +200,14 @@
        <dataset name="getAppointmentReminderTypList" type="http" />
        
        <view name="statusInfo" width="204" y="4">
-                       
-                       <labelText name="currentDate" align="center"
-                               fontsize="12" resize="true" fontstyle="bold" />
-                       
+               <labelText name="currentDate" align="center"
+                       fontsize="12" resize="true" fontstyle="bold" />
        </view>
        
        <!-- 176 pixels is the width of the mini calendar -->
        <simpleLabelButton labelid="1444" height="24" 
                        width="176" x="12" y="26" style="calendarButtonStyle">
+               <view resource="edit_add_rsc" x="4" y="4" />
         <handler name="onclick">
             parent.editCalendarEvent(null);
         </handler>
@@ -245,6 +261,16 @@
        
                <view name="buttons" align="left" y="2">
                
+                       <method name="getCurrentViewState">
+                               if (!this._showDay.enabled) {
+                                       return "day";
+                               } else if (!this._showWeek.enabled) {
+                                       return "week";
+                               } else if (!this._showMonth.enabled) {
+                                       return "month";
+                               }
+                       </method>
+               
                        <simpleLabelButton name="_showDay" labelid="799" 
height="22" >
                        <handler name="onclick">
                                parent._showWeek.setAttribute("enabled",true);
@@ -275,6 +301,55 @@
                        <simplelayout axis="x" spacing="0" />
                </view>
                
+               <view align="right" y="2">
+               
+                       <simpleLabelButton name="_nextBtn" height="22" 
width="20">
+                               <view 
resource="calendar_resultset_previous_rsc" x="2" y="3" />
+                       <handler name="onclick">
+                               var tDate = parent.parent.parent.currentDate;
+                               if (parent.parent.buttons.getCurrentViewState() 
== "day") {
+                                       tDate.setTime(tDate.getTime() - 
86400000);
+                               } else if 
(parent.parent.buttons.getCurrentViewState() == "month") {
+                                       if (tDate.getMonth() == 0) {
+                                               tDate.setMonth(11);
+                                               
tDate.setFullYear(tDate.getFullYear()-1);
+                                       } else {
+                                               
tDate.setMonth(tDate.getMonth()-1);
+                                       }
+                               } else if 
(parent.parent.buttons.getCurrentViewState() == "week") {
+                                       tDate.setTime(tDate.getTime() - 
(86400000*7));
+                               }
+                               parent.parent.parent.currentDate = null;
+                               if ($debug) Debug.write("loadDate :: ",tDate);
+                               parent.parent.parent._calendar.loadDate(tDate);
+                       </handler>
+                   </simpleLabelButton>
+                   
+                   <simpleLabelButton name="_preBtn" height="22" width="20">
+                               <view resource="calendar_resultset_next_rsc" 
x="2" y="3" />
+                       <handler name="onclick">
+                           var tDate = parent.parent.parent.currentDate;
+                               if (parent.parent.buttons.getCurrentViewState() 
== "day") {
+                                       tDate.setTime(tDate.getTime() + 
86400000);
+                               } else if 
(parent.parent.buttons.getCurrentViewState() == "month") {
+                                       if (tDate.getMonth() == 11) {
+                                               tDate.setMonth(0);
+                                               
tDate.setFullYear(tDate.getFullYear()+1);
+                                       } else {
+                                               
tDate.setMonth(tDate.getMonth()+1);
+                                       }
+                               } else if 
(parent.parent.buttons.getCurrentViewState() == "week") {
+                                       tDate.setTime(tDate.getTime() + 
(86400000*7));
+                               }
+                               parent.parent.parent.currentDate = null;
+                               if ($debug) Debug.write("loadDate :: ",tDate);
+                               parent.parent.parent._calendar.loadDate(tDate);
+                       </handler>
+                   </simpleLabelButton>
+                       
+                       <simplelayout axis="x" spacing="0" />
+               </view>
+               
        </view>
        
        <lzCalendarGrid name="_lzCalendarGrid" 
@@ -285,6 +360,23 @@
                <handler name="onScollContent" args="tRef">
                        parent.clearWindows();
                </handler>
+               <handler name="onSelectDate" args="tDate">
+                       parent._calendar.showDate(tDate);
+                       
parent._lzCalendarTobBar.buttons._showDay.onclick.sendEvent(null);
+               </handler>
+               <handler name="onNewEventDate" args="tDate">
+                       parent.tStartDate = tDate;
+                       //only use the date part here
+                       parent.tStartDate.setHours(this.currentDate.getHours());
+                       parent.tStartDate.setMinutes(0);
+                       parent.tEndDate = null;
+                       parent.editCalendarEvent();
+               </handler>
+               <handler name="onStartEndDate" args="tEmptyRef">
+                       parent.tStartDate = this.tStartDate;
+                       parent.tEndDate = this.tEndDate;
+                       parent.editCalendarEvent();
+               </handler>
        </lzCalendarGrid>
        
 </class>

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/app/org/openmeetings/utils/math/TimezoneUtil.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/app/org/openmeetings/utils/math/TimezoneUtil.java?rev=1303562&r1=1303561&r2=1303562&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/app/org/openmeetings/utils/math/TimezoneUtil.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/app/org/openmeetings/utils/math/TimezoneUtil.java
 Wed Mar 21 20:38:04 2012
@@ -112,6 +112,11 @@ public class TimezoneUtil {
        public TimeZone getTimezoneByInternalJName(String jName) {
 
                OmTimeZone omTimeZone = omTimeZoneDaoImpl.getOmTimeZone(jName);
+               
+               if (omTimeZone == null) {
+                       log.error("There is not omTimeZone for this jName: 
"+jName);
+                       throw new RuntimeException("There is not omTimeZone for 
this jName: "+jName);
+               }
 
                TimeZone timeZone = TimeZone.getTimeZone(omTimeZone.getIcal());
 


Reply via email to