toggle to send or not notifications

pull/12/head
Ludovic Marcotte 2013-06-18 14:14:42 -04:00
parent f25344182d
commit 47a3f1a19d
6 changed files with 44 additions and 8 deletions

1
NEWS
View File

@ -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)

View File

@ -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])

View File

@ -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?";

View File

@ -1,8 +1,6 @@
/* UIxAppointmentEditor.h - this file is part of SOGo
*
* Copyright (C) 2007-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* 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;

View File

@ -2,9 +2,6 @@
*
* Copyright (C) 2007-2013 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Francis Lachapelle <flachapelle@inverse.ca>
*
* 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

View File

@ -53,6 +53,13 @@
var:checked="isTransparent"
/> <var:string label:value="Show Time as Free"
/></span></span></label>
<label><span class="content">
<span id="sendAppointmentNotifications"><input class="checkBox"
type="checkbox" name="sendAppointmentNotifications" var:selection="sendAppointmentNotifications"
var:checked="sendAppointmentNotifications"
/> <var:string label:value="Send Appointment Notifications"
/></span></span></label>
</var:if>
<var:if condition="eventIsReadOnly">
<var:if condition="isAllDay">