Author: sebawagner
Date: Fri Mar 16 15:49:54 2012
New Revision: 1301603

URL: http://svn.apache.org/viewvc?rev=1301603&view=rev
Log:
OPENMEETINGS-7 Fix save/meetingmembers as DataElement manipulation and loading 
Calendar Edit Form with preselected Event data

Modified:
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/auth/checkLoginData.lzx
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/scrollbars/resources/x_scrolltrack.swf
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/scrollbars/resources/y_scrolltrack.swf
    
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/attendeeListItem.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/app/data/calendar/beans/MeetingMemberDTO.java

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/auth/checkLoginData.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/auth/checkLoginData.lzx?rev=1301603&r1=1301602&r2=1301603&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/auth/checkLoginData.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/auth/checkLoginData.lzx
 Fri Mar 16 15:49:54 2012
@@ -63,7 +63,7 @@
     <attribute name="labeliderror" value="0" type="number" />
     <attribute name="enterPressed" type="boolean" value="false"/>
     
-    <labelText name="n1" labelid="109" width="300" y="26" resize="false" 
x="2"/>
+    <labelText name="n1" labelid="109" width="300" y="26" resize="false" x="2" 
fontstyle="bold"/>
     <customEdittext name="username" y="24" x="120" width="330" >
         <handler name="oninit">
             var g = canvas.getUserData();
@@ -86,7 +86,7 @@
         </handler>
     </customEdittext>    
 
-    <labelText name="n2" labelid="110" width="300" y="56" resize="false" 
x="2"/>
+    <labelText name="n2" labelid="110" width="300" y="56" resize="false" x="2" 
fontstyle="bold"/>
     <customEdittext name="userpass" y="54" password="true" x="120" width="330" 
>
         <handler name="oninit">
             var g = canvas.getUserData();
@@ -108,7 +108,7 @@
         </handler>
     </customEdittext>
     
-       <labelText name="n5" labelid="1370" width="300" y="86" resize="false" 
x="2"/>  
+       <labelText name="n5" labelid="1370" width="300" y="86" resize="false" 
x="2" fontstyle="bold"/>  
     
     <resetCombobox name="colors" width="330" y="84" x="120">
         <attribute name="initselect" value="true" type="boolean" />
@@ -164,7 +164,7 @@
         </handler>
     </resetCombobox>    
     
-    <labelText name="nlabelquality" labelid="1371" y="116" x="2" 
visible="true" width="140" />     
+    <labelText name="nlabelquality" labelid="1371" y="116" x="2" 
visible="true" width="140" fontstyle="bold"/>     
     <resetCombobox name="ncomboquality" width="330" y="114" x="120" 
editable="false" >
         <handler name="oninit">
             this.addItem(canvas.getLabelName(1381) + " ~ 16KB " + 
canvas.getLabelName(1382),"best");
@@ -196,7 +196,7 @@
         </handler>
     </resetCombobox>
         
-       <labelText name="domain_label" labelid="1372" width="300" y="144" 
resize="false" x="2" />     
+       <labelText name="domain_label" labelid="1372" width="300" y="144" 
resize="false" x="2" fontstyle="bold"/>     
     <resetCombobox name="domain" width="330" y="144" x="120" editable="false">
        <handler name="oninit">
                //this.selectItemAt(0);
@@ -239,7 +239,8 @@
     <labelText name="organisation_label_info" labelid="617" width="350" 
                multiline="true" y="22" resize="false" x="2" visible="false" /> 
    
     
-    <labelText name="organisation_label" labelid="184" width="300" y="86" 
resize="false" x="2" visible="false" />     
+    <labelText name="organisation_label" labelid="184" width="300" y="86" 
+                       resize="false" x="2" visible="false" fontstyle="bold" 
/>     
         <resetCombobox name="organisation" width="330" y="84" x="120" 
editable="false" visible="false" />
         
     <simpleLabelButton labelid="123" name="_register" width="120" y="$once{ 
parent.height-40 }" 

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/scrollbars/resources/x_scrolltrack.swf
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/scrollbars/resources/x_scrolltrack.swf?rev=1301603&r1=1301602&r2=1301603&view=diff
==============================================================================
Binary files - no diff available.

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/scrollbars/resources/y_scrolltrack.swf
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/base/components/scrollbars/resources/y_scrolltrack.swf?rev=1301603&r1=1301602&r2=1301603&view=diff
==============================================================================
Binary files - no diff available.

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/attendeeListItem.lzx
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/attendeeListItem.lzx?rev=1301603&r1=1301602&r2=1301603&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/attendeeListItem.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/compontents/attendeeListItem.lzx
 Fri Mar 16 15:49:54 2012
@@ -29,11 +29,7 @@
                <attribute name="email" value="" type="string" />
                <attribute name="jNameTimeZone" value="" type="string" />
                
-               <view name="member">
-                       <text resize="true" text="$once{ 
parent.parent.firstName + ',' + parent.parent.lastName }" />
-                       <text resize="true" text="$once{ '(' + 
parent.parent.email + ')' }" />
-                       <simplelayout axis="x" spacing="2" />
-               </view>
+               <text name="memberText" width="$once{ parent.width - 18 }" />
                
                <miniIcons x="$once{ parent.width - 16 }" y="2" 
resource="calendar_delete_button" showhandcursor="true"
                                   width="16" height="16">

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=1301603&r1=1301602&r2=1301603&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
 Fri Mar 16 15:49:54 2012
@@ -30,6 +30,8 @@
                
                <attribute name="reRenderLock" value="false" type="boolean" />
                
+               <attribute name="calendarEvent" value="null" />
+               
                <method name="setCurrentDate" args="tDate">
                        if (this.currentDate != tDate) {
                                this.currentDate = tDate;
@@ -75,6 +77,11 @@
                        this.reRenderLock = false;
                </method>
                
+               <method name="selectCalendarEvent" args="tRef">
+                       if ($debug) Debug.write("selectCalendarEvent ",tRef);
+                       this.setAttribute("calendarEvent",tRef);
+               </method>
+               
                <state name="day" applied="${ classroot.viewType == 'day' }">
                
                        <view width="${ parent.width }" height="${ 
parent.height }">
@@ -379,6 +386,12 @@
                                                
                                                        <view width="$once{ 
parent.width }" y="18">
                                                                <view 
datapath="appointments" bgcolor="0xA59CFC" width="$once{ parent.width }">
+                                                                       
<handler name="onclick" >
+                                                                               
var appointmentId = this.datapath.xpathQuery('appointmentId/text()');
+                                                                               
if ($debug) Debug.write("click ",appointmentId);
+                                                                               
parent.parent.parent.parent.parent.parent.selectCalendarEvent(this);
+                                                                               
//this.setAttribute("text",parseTimeStringFromXmlString(d.childNodes[0].data));
+                                                                       
</handler>
                                                                        <text 
name="_time" datapath="start" >
                                                                                
<handler name="ondata" args="d">
                                                                                
        
this.setAttribute("text",parseTimeStringFromXmlString(d.childNodes[0].data));

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=1301603&r1=1301602&r2=1301603&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
 Fri Mar 16 15:49:54 2012
@@ -27,9 +27,12 @@
                <attribute name="reminderTypeId" value="0" type="number" />
                
                <attribute name="dataElement" value="null" />
+               <attribute name="remindertypes" value="null" />
                
                <attribute name="baseUrl" value="" type="string" />
                
+               <attribute name="lzCalendarRef" value="null" />
+               
                <dataset name="eventDS" />
                    
                <handler name="oninit">
@@ -54,16 +57,11 @@
                                if ($debug) Debug.write("urlObject ",urlObject);
                    if ($debug) Debug.write("this.baseUrl ",this.baseUrl);
                        
-                               var downloadurl = canvas.protocol + 
'://'+canvas.rtmphostlocal+':'+canvas.red5httpport
-                                      
+canvas.httpRootKey+'services/CalendarService/getAppointmentReminderTypList?'
-                                      +'SID='+canvas.sessionId;
-                      
-                   
this.getAppointmentReminderTypList.setAttribute("src",downloadurl);
-                   this.getAppointmentReminderTypList.doRequest();
-                   
                    if ($debug) Debug.write("this.dataElement 
",this.dataElement);
                    
-                   this.eventDS.setData(this.dataElement.childNodes);
+                   
this.getAppointmentReminderTypList.setData(this.remindertypes.data);
+                   
+               this.eventDS.setData(this.dataElement.childNodes);
                    
                    if ($debug) Debug.write("this.eventDS ",this.eventDS);
                    
@@ -137,6 +135,8 @@
                        ]]>
                </method>
                
+               <dataset name="getAppointmentReminderTypList" />
+               
                <!-- 
                String SID, String appointmentName,
                        String appointmentLocation, String 
appointmentDescription,
@@ -153,11 +153,14 @@
                                tPointer.setPointer(d);
                                var returnValue = 
tPointer.xpathQuery('saveAppointmentResponse/return/text()');
                                if ($debug) Debug.write("returnValue 
"+returnValue);
+                               var tNumber = Number(returnValue);
+                               if (tNumber > 0) {
+                                       parent.lzCalendarRef.reload();
+                                       parent.close();
+                               }
                        </handler>
                </dataset>
                
-               <dataset name="getAppointmentReminderTypList" type="http" />
-               
                <labelText name="_titleLabel" x="4" y="24" labelid="572" 
fontstyle="bold" /> 
                        
                <customEdittext name="_title" x="100" y="24" 
datapath="local:classroot.eventDS:/title"
@@ -201,31 +204,26 @@
                <labelText name="_reminderTypeLabel" x="4" y="76" labelid="565" 
fontstyle="bold" /> 
                
                <resetCombobox name="_reminderType" x="100" width="$once{ 
parent.width-110 }"
-                                                 editable="false" 
shownitems="5" y="76" >
+                                                 editable="false" 
shownitems="5" y="76" datapath="local:classroot.eventDS:/reminderId">
                        <handler name="onvalue" args="v">                       
                        
                                if ($debug) Debug.write("reminderTypeId: 
",parent.reminderTypeId);
                                if(this.getValue == 0 ) {
-                                       parent.preminderTypeId = null;
+                                       parent.reminderTypeId = null;
                                } else{
                                        parent.reminderTypeId = 
this.getValue();                                                                
                                
                                        if ($debug) 
Debug.write("reminderTypeId: ",parent.reminderTypeId);
                                }
                        </handler> 
-                       <handler name="ondata" args="remindtype">
-                               if ($debug) Debug.write("remindtype ondata: ", 
remindtype);
-                               var remTypeId = 
Number(remindtype.attributes.value);
+                       <handler name="ondata" args="remindtypeNode">
+                               if ($debug) Debug.write("remindtype ondata 1: 
", remindtypeNode.childNodes[0].data);
+                               var remTypeId = 
Number(remindtypeNode.childNodes[0].data);
                                if (remTypeId > 0) {
                                        parent.reminderTypeId = remTypeId;
                                    this.selectItem(remTypeId);
                            }
                        </handler>
                        <textlistitem 
datapath="local:classroot.getAppointmentReminderTypList:/getAppointmentReminderTypListResponse/return"
-                               text="$path{'name/text()'}" 
value="$path{'typId/text()'}">
-                               <handler name="ondata" args="d">
-                                       //if ($debug) Debug.write("ondata 
combobox ",parent);
-                                       parent.selectItemAt(2);
-                               </handler>
-                       </textlistitem>
+                               text="$path{'name/text()'}" 
value="$path{'typId/text()'}" />
                </resetCombobox> 
                
                <!-- Roomtype -->
@@ -285,15 +283,19 @@
            
             <method name="addListItem" 
args="userId,firstName,lastName,email,memberId,jNameTimeZone">
                <![CDATA[
-                       new lz.attendeeListItem(this._content._inner,{
-                                                       userId:userId,
-                                                       firstName:firstName,
-                                                       lastName:lastName,
-                                                       email:email,
-                                                       memberId:memberId,
-                                                       
jNameTimeZone:jNameTimeZone,
-                                                       
width:this._content.width-10
-                                               });
+                       var tObject = new Object();
+                       tObject.meetingMember = new Object();
+                       tObject.meetingMember.userid = userId;
+                               tObject.meetingMember.firstname = firstName;
+                               tObject.meetingMember.lastname = lastName;
+                               tObject.meetingMember.email = email;
+                               tObject.meetingMember.meetingMemberId = 
memberId;
+                               tObject.meetingMember.jNameTimeZone = 
jNameTimeZone;
+                               var tDataElement = 
LzDataElement.valueToElement(tObject);
+                               var tPointer = new lz.datapointer();
+                               tPointer.setPointer(tDataElement.childNodes[0]);
+                               
parent.eventDS.getPointer().addNodeFromPointer(tPointer);
+                               //parent.eventDS.getPointer().updateData();
                ]]>
             </method>  
             
@@ -323,6 +325,22 @@
                <view name="_content" bgcolor="0xFFFFFF" x="1" y="1" clip="true"
                                width="$once{ parent.width-1 }" height="$once{ 
parent.height-1 }">
                        <view name="_inner">
+                               <attendeeListItem 
datapath="local:classroot.eventDS:/meetingMember"
+                                                       width="$once{ 
parent.parent.width-10 }">
+                                       <handler name="ondata" args="d">
+                                               if ($debug) 
Debug.write("meetingMember -- ondata ",d);
+                                               var tDataPointer = new 
lz.datapointer();
+                                               tDataPointer.setPointer(d);
+                                               this.userId = 
tDataPointer.xpathQuery( 'userid/text()' );
+                                               this.firstName = 
tDataPointer.xpathQuery( 'firstname/text()' );
+                                               this.lastName = 
tDataPointer.xpathQuery( 'lastname/text()' );
+                                               this.email = 
tDataPointer.xpathQuery( 'email/text()' );
+                                               this.memberId = 
tDataPointer.xpathQuery( 'meetingMemberId/text()' );
+                                               this.jNameTimeZone = 
tDataPointer.xpathQuery( 'jNameTimeZone/text()' );
+                                               
this.memberText.setAttribute("text",this.firstName+' '+this.lastName+' 
['+this.email+']');
+                                       </handler>
+                                       
+                               </attendeeListItem>
                                <simplelayout axis="y" spacing="1" />
                        </view>
                        <om_vscrollbar />

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=1301603&r1=1301602&r2=1301603&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/lzCalendar.lzx
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/src/modules/lzcalendar/lzCalendar.lzx
 Fri Mar 16 15:49:54 2012
@@ -29,6 +29,14 @@
        <handler name="oninit">
                <![CDATA[
                        _mainScrollBar.setAttribute("visibility","hidden");
+                       
+                       var downloadurl = canvas.protocol + 
'://'+canvas.rtmphostlocal+':'+canvas.red5httpport
+                                      
+canvas.httpRootKey+'services/CalendarService/getAppointmentReminderTypList?'
+                                      +'SID='+canvas.sessionId;
+                      
+            this.getAppointmentReminderTypList.setAttribute("src",downloadurl);
+            this.getAppointmentReminderTypList.doRequest();
+                       
                        canvas.monthnames = 
[canvas.getLabelName(469),canvas.getLabelName(470),
                                                                
canvas.getLabelName(471),canvas.getLabelName(472),
                                                                
canvas.getLabelName(473),canvas.getLabelName(474),
@@ -90,8 +98,27 @@
         ]]>
        </method>
        
-       <method name="newCalendarEvent">
+       <method name="editCalendarEvent" args="appointment">
+               <![CDATA[
+                       var dataElement = null;
+                       if (appointment == null) {
+                               appointment = this.generateBlankEvent();
+                               dataElement = 
LzDataElement.valueToElement(appointment);
+                       } else {
+                               dataElement = appointment;
+                       }
+                       
+                       new lz.lzEditCalendarEvent(canvas,{
+                                                               
dataElement:dataElement,
+                                                               
remindertypes:getAppointmentReminderTypList,
+                                                               
lzCalendarRef:this
+                                                       });
+               ]]>
+       </method>
+       
+       <method name="generateBlankEvent">
                <![CDATA[
+               
                        var newAppointment = new Object();
                        newAppointment.appointmentId = 0;
                        newAppointment.categoryId = 1;
@@ -101,6 +128,7 @@
                        
tDate.setMilliseconds(this.currentDate.getMilliseconds());
                        tDate.setMinutes(0);
                        tDate.setSeconds(0);
+                       tDate.setHours(tDate.getHours()+1);
                        if (tDate.getHours() == 23) {
                                tDate.setHours(22);
                        }
@@ -117,26 +145,28 @@
                        newAppointment.reminderId = 3;
                        newAppointment.roomsId = 0;
                        newAppointment.location = "";
-                       newAppointment.meetingMember = new Array();
                        newAppointment.isPasswordProtected = false;
                        
-                       var dataElement = 
LzDataElement.valueToElement(newAppointment);
-                       
-                       new 
lz.lzEditCalendarEvent(canvas,{dataElement:dataElement});
-               
+                       return newAppointment;
                ]]>
        </method>
        
+       <method name="reload">
+               this.getAppointmentsByWeekCalendar.doRequest();
+       </method>
+       
        <dataset name="getAppointmentsByWeekCalendar" type="http">
                <handler name="ondata" args="d">
                        if ($debug) Debug.write("ondata",d);
                </handler>
        </dataset>
        
+       <dataset name="getAppointmentReminderTypList" type="http" />
+       
        <!-- 176 pixels is the width of the mini calendar -->
        <simpleLabelButton labelid="1444" height="24" width="176" x="12" y="10" 
>
         <handler name="onclick">
-            parent.newCalendarEvent();
+            parent.editCalendarEvent(null);
         </handler>
     </simpleLabelButton>
        
@@ -212,7 +242,11 @@
        </view>
        
        <lzCalendarGrid name="_lzCalendarGrid"
-               datapath="local:classroot.getAppointmentsByWeekCalendar:/" />
+               datapath="local:classroot.getAppointmentsByWeekCalendar:/">
+               <handler name="oncalendarEvent" args="sel">
+                       
parent.editCalendarEvent(sel.datapath.data.cloneNode(true));
+               </handler>      
+       </lzCalendarGrid>
        
 </class>
 

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/app/org/openmeetings/app/data/calendar/beans/MeetingMemberDTO.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/app/org/openmeetings/app/data/calendar/beans/MeetingMemberDTO.java?rev=1301603&r1=1301602&r2=1301603&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/app/org/openmeetings/app/data/calendar/beans/MeetingMemberDTO.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/app/org/openmeetings/app/data/calendar/beans/MeetingMemberDTO.java
 Fri Mar 16 15:49:54 2012
@@ -11,6 +11,7 @@ public class MeetingMemberDTO {
        private String firstname;
        private String lastname;
        private Long userid;
+       private String jNameTimeZone;
 
        public MeetingMemberDTO(MeetingMember meetingMemberItem) {
                meetingMemberId = meetingMemberItem.getMeetingMemberId();
@@ -21,6 +22,8 @@ public class MeetingMemberDTO {
                lastname = meetingMemberItem.getLastname();
                userid = (meetingMemberItem.getUserid() != null) ? 
meetingMemberItem
                                .getUserid().getUser_id() : 0;
+               jNameTimeZone = (meetingMemberItem.getOmTimeZone() != null) ? 
meetingMemberItem
+                               .getOmTimeZone().getJname() : "";
        }
 
        public long getMeetingMemberId() {
@@ -79,4 +82,12 @@ public class MeetingMemberDTO {
                this.userid = userid;
        }
 
+       public String getjNameTimeZone() {
+               return jNameTimeZone;
+       }
+
+       public void setjNameTimeZone(String jNameTimeZone) {
+               this.jNameTimeZone = jNameTimeZone;
+       }
+
 }


Reply via email to