diff --git a/NEWS b/NEWS index 334e5d7c2..9839af190 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ Enhancements - new message submissions rate-limiting options. See the new SOGoMaximumMessageSubmissionCount, SOGoMaximumRecipientCount, SOGoMaximumSubmissionInterval and SOGoMessageSubmissionBlockInterval defaults + - now possible to send or not event notifications on a per-event basis Bug fixes - Fixed decoding of the charset parameter when using single quotes (#2306) diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index e71ec34e5..2169f8f6e 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -760,6 +760,10 @@ SOGoUser *ownerUser; SOGoDomainDefaults *dd; + // If defined, we return immediately. When not defined, we send the notifications correctly + if ([object firstChildWithTag: @"X-SOGo-Send-Appointment-Notifications"]) + return; + ownerUser = [SOGoUser userWithLogin: owner]; dd = [ownerUser domainDefaults]; if ([dd appointmentSendEMailNotifications] && [object isStillRelevant]) diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 7f6188e55..119c6b90e 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -373,6 +373,9 @@ "Show Time as Free" = "Show Time as Free"; +/* email notifications */ +"Send Appointment Notifications" = "Send Appointment Notifications"; + /* validation errors */ validate_notitle = "No title is set, continue?"; diff --git a/UI/Scheduler/UIxAppointmentEditor.h b/UI/Scheduler/UIxAppointmentEditor.h index f3482ce1d..daa0193f2 100644 --- a/UI/Scheduler/UIxAppointmentEditor.h +++ b/UI/Scheduler/UIxAppointmentEditor.h @@ -1,8 +1,6 @@ /* UIxAppointmentEditor.h - this file is part of SOGo * - * Copyright (C) 2007-2012 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2007-2013 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +29,7 @@ @interface UIxAppointmentEditor : UIxComponent { iCalEvent *event; - BOOL isAllDay, isTransparent; + BOOL isAllDay, isTransparent, sendAppointmentNotifications; NSCalendarDate *aptStartDate; NSCalendarDate *aptEndDate; NSString *item; @@ -50,6 +48,9 @@ - (void) setIsTransparent: (BOOL) newIsOpaque; - (BOOL) isTransparent; +- (void) setSendAppointmentNotifications: (BOOL) theBOOL; +- (BOOL) sendAppointmentNotifications; + - (void) setAptStartDate: (NSCalendarDate *) newAptStartDate; - (NSCalendarDate *) aptStartDate; diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 98609a034..377ee460a 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -2,9 +2,6 @@ * * Copyright (C) 2007-2013 Inverse inc. * - * Author: Wolfgang Sourdeau - * Francis Lachapelle - * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) @@ -75,6 +72,7 @@ event = nil; isAllDay = NO; isTransparent = NO; + sendAppointmentNotifications = YES; componentCalendar = nil; user = [[self context] activeUser]; @@ -139,6 +137,17 @@ isTransparent = newIsTransparent; } +- (void) setSendAppointmentNotifications: (BOOL) theBOOL +{ + sendAppointmentNotifications = theBOOL; +} + +- (BOOL) sendAppointmentNotifications +{ + return sendAppointmentNotifications; +} + + - (void) setAptStartDate: (NSCalendarDate *) newAptStartDate { ASSIGN (aptStartDate, newAptStartDate); @@ -279,6 +288,7 @@ endDate = [startDate dateByAddingYears: 0 months: 0 days: 0 hours: hours minutes: minutes seconds: 0]; + sendAppointmentNotifications = YES; } else { @@ -296,7 +306,8 @@ endDate = [endDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0 seconds:-offset]; } - isTransparent = ![event isOpaque]; + isTransparent = ![event isOpaque]; + sendAppointmentNotifications = ([event firstChildWithTag: @"X-SOGo-Send-Appointment-Notifications"] ? NO : YES); } [startDate setTimeZone: timeZone]; @@ -541,6 +552,7 @@ NSTimeZone *timeZone; SOGoUserDefaults *ud; signed int offset; + id o; [self event]; [super takeValuesFromRequest: _rq inContext: _ctx]; @@ -594,6 +606,14 @@ } [event setTransparency: (isTransparent? @"TRANSPARENT" : @"OPAQUE")]; + + o = [event firstChildWithTag: @"X-SOGo-Send-Appointment-Notifications"]; + + if (!sendAppointmentNotifications && !o) + [event addChild: [CardElement simpleElementWithTag: @"X-SOGo-Send-Appointment-Notifications" value: @"NO"]]; + else if (sendAppointmentNotifications && o) + [event removeChild: o]; + } - (id) _statusChangeAction: (NSString *) newStatus diff --git a/UI/Templates/SchedulerUI/UIxAppointmentEditor.wox b/UI/Templates/SchedulerUI/UIxAppointmentEditor.wox index 8550b4487..607b32a38 100644 --- a/UI/Templates/SchedulerUI/UIxAppointmentEditor.wox +++ b/UI/Templates/SchedulerUI/UIxAppointmentEditor.wox @@ -53,6 +53,13 @@ var:checked="isTransparent" /> + +