(feat) "Materialization" of the IMIP handling template

This commit is contained in:
Ludovic Marcotte authored and Francis Lachapelle committed 2015-06-12 12:03:59 -04:00
1 parent fb992db5ad
commit 8124faa6d4
13 files changed
+453 -220

No files matched your search

+7 -3
View File
@@ -1,6 +1,6 @@
/* UIxMailPartICalActions.m - this file is part of SOGo
*
* Copyright (C) 2007-2014 Inverse inc.
* Copyright (C) 2007-2015 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
@@ -288,12 +288,15 @@
// BOOL receiveUpdates;
NSString *delegatedEmail, *delegatedUid;
iCalPerson *delegatedAttendee;
NSDictionary *content;
SOGoUser *user;
WORequest *request;
WOResponse *response;
request = [context request];
delegatedEmail = [request formValueForKey: @"to"];
content = [[request contentAsString] objectFromJSONString];
delegatedEmail = [content objectForKey: @"delegatedTo"];
if ([delegatedEmail length])
{
user = [context activeUser];
@@ -307,13 +310,14 @@
delegatedUser = [SOGoUser userWithLogin: delegatedUid];
[delegatedAttendee setCn: [delegatedUser cn]];
}
[delegatedAttendee setRole: @"REQ-PARTICIPANT"];
[delegatedAttendee setRsvp: @"TRUE"];
[delegatedAttendee setParticipationStatus: iCalPersonPartStatNeedsAction];
[delegatedAttendee setDelegatedFrom:
[NSString stringWithFormat: @"mailto:%@", [[user allEmails] objectAtIndex: 0]]];
// receiveUpdates = [[request formValueForKey: @"receiveUpdates"] boolValue];
// receiveUpdates = [[content objectForKey: @"receiveUpdates"] boolValue];
// if (receiveUpdates)
// [delegatedAttendee setRole: @"NON-PARTICIPANT"];
+16 -18
View File
@@ -1,22 +1,20 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
OGo is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with OGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
* Copyright (C) 2007-2015 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
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef UIXMAILPARTICALVIEWER_H
+55 -6
View File
@@ -1,6 +1,5 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
Copyright (C) 2006-2013 Inverse inc.
Copyright (C) 2006-2015 Inverse inc.
This file is part of SOGo.
@@ -182,6 +181,59 @@
return date;
}
/*
In v3.0, we moved the template's logic here to format
the event's start/end date-time. The previous logic was:
<dd><var:string value="startDate" />
<var:if condition="inEvent.isAllDay" const:negate="YES">
<var:string value="startTime" />
</var:if>
<var:if condition="isEndDateOnSameDay">
<var:if condition="inEvent.isAllDay" const:negate="YES">
<var:string label:value="to" />
<var:string value="endTime" />
</var:if>
</var:if>
<var:if condition="isEndDateOnSameDay" const:negate="YES">
<var:string label:value="to" />
<var:string value="endDate" />
<var:if condition="inEvent.isAllDay" const:negate="YES">
<var:string value="endTime" />
</var:if>
</var:if>
</dd>
*/
- (NSString *) formattedDateTime
{
NSMutableString *s;
s = [NSMutableString string];
[s appendString: [self startDate]];
if (![[self inEvent] isAllDay])
[s appendFormat: @" %@", [self startTime]];
if ([self isEndDateOnSameDay] &&
![[self inEvent] isAllDay])
{
[s appendFormat: @" %@", [self labelForKey: @"to"]];
[s appendFormat: @" %@", [self endTime]];
}
else if (![self isEndDateOnSameDay])
{
[s appendFormat: @" %@", [self labelForKey: @"to"]];
[s appendFormat: @" %@", [self endDate]];
if (![[self inEvent] isAllDay])
[s appendFormat: @" %@", [self endTime]];
}
return s;
}
- (NSString *) startDate
{
return [[self dateFormatter] formattedDate: [self startCalendarDate]];
@@ -388,10 +440,7 @@
cssClass = [[attendee partStatWithDefault] lowercaseString];
if ([[attendee rfc822Email] isEqualToString: [self loggedInUserEMail]])
cssClass = [cssClass stringByAppendingString: @" attendeeUser"];
return cssClass;
return [NSString stringWithFormat: @"sg-%@", cssClass];
}
/* derived fields */
+9
View File
@@ -328,6 +328,15 @@
return url;
}
- (NSString *) pathToAttachmentFromMessage
{
SOGoMailBodyPart *bodyPart;
bodyPart = [self clientPart];
return [NSString stringWithFormat: @"%@/%@", [bodyPart nameInContainer], [self _filenameForAttachment: bodyPart]];
}
- (NSString *) pathToAttachment
{
return [self _pathForAttachmentOrDownload: NO];
-5
View File
@@ -43,11 +43,6 @@
actionClass = "UIxMailPartICalActions";
actionName = "updateUserStatus";
};
/* tentative = {
protectedBy = "View";
actionClass = "UIxMailPartICalAction";
actionName = "markTentative";
}; */
addToCalendar = {
protectedBy = "View";
actionClass = "UIxMailPartICalActions";