openmeetings-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ia...@apache.org
Subject svn commit: r1451522 - in /openmeetings/trunk/singlewebapp/src/org/apache/openmeetings: data/calendar/daos/AppointmentDao.java data/calendar/daos/MeetingMemberDao.java data/conference/InvitationManager.java utils/math/TimezoneUtil.java
Date Fri, 01 Mar 2013 08:36:23 GMT
Author: iarkh
Date: Fri Mar  1 08:36:23 2013
New Revision: 1451522

URL: http://svn.apache.org/r1451522
Log:
[OPENMEETINGS-378]: Email notification rules have been changed; NullPointerException when
invite external guest is fixed.

Modified:
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentDao.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/MeetingMemberDao.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/InvitationManager.java
    openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/utils/math/TimezoneUtil.java

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentDao.java?rev=1451522&r1=1451521&r2=1451522&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentDao.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/AppointmentDao.java
Fri Mar  1 08:36:23 2013
@@ -420,6 +420,12 @@ public class AppointmentDao {
 			AppointmentCategory appointmentCategory = appointmentCategoryDaoImpl
 					.getAppointmentCategoryById(categoryId);
 
+			boolean sendMail = !ap.getAppointmentName().equals(appointmentName) ||
+					!ap.getAppointmentDescription().equals(appointmentDescription) ||
+					!ap.getAppointmentLocation().equals(appointmentLocation) ||
+					!ap.getAppointmentStarttime().equals(appointmentstart) ||
+					!ap.getAppointmentEndtime().equals(appointmentend);
+			
 			// change connected events of other participants
 			if (ap.getIsConnectedEvent() != null && ap.getIsConnectedEvent()) {
 				this.updateConnectedEvents(ap, appointmentName,
@@ -509,7 +515,7 @@ public class AppointmentDao {
 				} else {
 					// Notify member of changes
 					invitationManager.updateInvitation(ap, memberRemote,
-							users_id, language_id, invitorName);
+							users_id, language_id, invitorName, sendMail);
 
 				}
 			}
@@ -581,8 +587,10 @@ public class AppointmentDao {
 
 						// Not In Remote List available - intern OR extern user
 						meetingMemberLogic.addMeetingMember(
-								clientMember.get("firstname").toString(),
-								clientMember.get("lastname").toString(),
+								clientMember.get("firstname") == null ?
+										clientMember.get("firstname").toString() : "",
+								clientMember.get("lastname") == null ? 
+										clientMember.get("lastname").toString() : "",
 								"0", // member - Status
 								"0", // appointement - Status
 								appointmentId,
@@ -623,6 +631,9 @@ public class AppointmentDao {
 
 			Appointment ap = this.getAppointmentById(appointmentId);
 
+			if (!ap.getStarttime().equals(appointmentstart) ||
+					!ap.getAppointmentEndtime().equals(appointmentend)) {
+
 			// change connected events of other participants
 			if (ap.getIsConnectedEvent() != null && ap.getIsConnectedEvent()) {
 				this.updateConnectedEventsTimeOnly(ap, appointmentstart,
@@ -639,11 +650,9 @@ public class AppointmentDao {
 
 			if (ap.getAppointmentId() == null) {
 				em.persist(ap);
-			} else {
-				if (!em.contains(ap)) {
+				} else if (!em.contains(ap)) {
 					em.merge(ap);
 				}
-			}
 
 			List<MeetingMember> meetingsRemoteMembers = meetingMemberDao
 					.getMeetingMemberByAppointmentId(ap.getAppointmentId());
@@ -658,10 +667,10 @@ public class AppointmentDao {
 
 				// Notify member of changes
 				invitationManager.updateInvitation(ap, memberRemote,
-						users_id, language_id, invitorName);
+							users_id, language_id, invitorName, true);
 
 			}
-
+			}
 			return appointmentId;
 		} catch (Exception ex2) {
 			log.error("[updateAppointmentByTime]: ", ex2);

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/MeetingMemberDao.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/MeetingMemberDao.java?rev=1451522&r1=1451521&r2=1451522&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/MeetingMemberDao.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/calendar/daos/MeetingMemberDao.java
Fri Mar  1 08:36:23 2013
@@ -188,7 +188,7 @@ public class MeetingMemberDao {
 			gm.setMemberStatus(memberStatus);
 			gm.setAppointmentStatus(appointmentStatus);
 			gm.setAppointment(appointmentDao.getAppointmentById(appointmentId));
-			gm.setUserid(usersDao.get(userid));
+			gm.setUserid(userid == null ? null : usersDao.get(userid));
 			gm.setEmail(email);
 			gm.setPhone(phone);
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/InvitationManager.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/InvitationManager.java?rev=1451522&r1=1451521&r2=1451522&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/InvitationManager.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/data/conference/InvitationManager.java
Fri Mar  1 08:36:23 2013
@@ -360,7 +360,7 @@ public class InvitationManager {
 	 */
 	// -----------------------------------------------------------------------------------------------
 	public void updateInvitation(Appointment appointment, MeetingMember member,
-			Long canceling_user_id, Long language_id, String invitorName) {
+			Long canceling_user_id, Long language_id, String invitorName, boolean sendMail) {
 
 		log.debug("updateInvitation");
 
@@ -398,6 +398,7 @@ public class InvitationManager {
 
 		// checking reminderType and send emails, reminder type 1 receives
 		// nothing
+		if (sendMail) {
 		if (appointment.getRemind().getTypId() == 2) {
 			sendInvitationUpdateMail(member.getEmail(), appointment, user
 					.getAdresses().getEmail(), subject, message);
@@ -414,6 +415,7 @@ public class InvitationManager {
 						+ member.getEmail() + " : " + e.getMessage());
 			}
 		}
+		}
 
 	}
 

Modified: openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/utils/math/TimezoneUtil.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/utils/math/TimezoneUtil.java?rev=1451522&r1=1451521&r2=1451522&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/utils/math/TimezoneUtil.java
(original)
+++ openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/utils/math/TimezoneUtil.java
Fri Mar  1 08:36:23 2013
@@ -179,6 +179,7 @@ public class TimezoneUtil {
 		cal.set(Calendar.HOUR_OF_DAY, calOrig.get(Calendar.HOUR_OF_DAY));
 		cal.set(Calendar.MINUTE, calOrig.get(Calendar.MINUTE));
 		cal.set(Calendar.SECOND, calOrig.get(Calendar.SECOND));
+		cal.set(Calendar.MILLISECOND, 0);
 
 		return cal;
 	}



Mime
View raw message