feat(calendar(web)): allow to change the classification of an event
parent
3796009eca
commit
4a83733039
|
@ -285,27 +285,35 @@
|
||||||
* @apiParam {String} alarm.relation Either START or END
|
* @apiParam {String} alarm.relation Either START or END
|
||||||
* @apiParam {Boolean} [alarm.attendees] Alert attendees by email if 1 and action is email
|
* @apiParam {Boolean} [alarm.attendees] Alert attendees by email if 1 and action is email
|
||||||
* @apiParam {Boolean} [alarm.organizer] Alert organizer by email if 1 and action is email
|
* @apiParam {Boolean} [alarm.organizer] Alert organizer by email if 1 and action is email
|
||||||
|
* @apiParam {String} [classification] Either public, confidential or private
|
||||||
*/
|
*/
|
||||||
- (id <WOActionResults>) rsvpAction
|
- (id <WOActionResults>) rsvpAction
|
||||||
{
|
{
|
||||||
|
static NSArray *validClassifications = nil;
|
||||||
iCalPerson *delegatedAttendee;
|
iCalPerson *delegatedAttendee;
|
||||||
NSDictionary *params, *jsonResponse;
|
NSDictionary *params, *jsonResponse;
|
||||||
WOResponse *response;
|
WOResponse *response;
|
||||||
WORequest *request;
|
WORequest *request;
|
||||||
iCalAlarm *anAlarm;
|
iCalAlarm *anAlarm;
|
||||||
|
iCalEvent *event;
|
||||||
NSException *ex;
|
NSException *ex;
|
||||||
NSString *status;
|
NSString *status;
|
||||||
id alarm;
|
id alarm, classification;
|
||||||
|
|
||||||
int replyList;
|
int replyList;
|
||||||
|
|
||||||
|
if (!validClassifications)
|
||||||
|
validClassifications = [[NSArray alloc] initWithObjects: @"PUBLIC", @"CONFIDENTIAL", @"PRIVATE", nil];
|
||||||
|
|
||||||
request = [context request];
|
request = [context request];
|
||||||
params = [[request contentAsString] objectFromJSONString];
|
params = [[request contentAsString] objectFromJSONString];
|
||||||
|
event = [self event];
|
||||||
|
|
||||||
delegatedAttendee = nil;
|
delegatedAttendee = nil;
|
||||||
anAlarm = nil;
|
anAlarm = nil;
|
||||||
status = nil;
|
status = nil;
|
||||||
|
|
||||||
|
// Set invitation reply
|
||||||
replyList = [[params objectForKey: @"reply"] intValue];
|
replyList = [[params objectForKey: @"reply"] intValue];
|
||||||
|
|
||||||
switch (replyList)
|
switch (replyList)
|
||||||
|
@ -368,6 +376,25 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update classification
|
||||||
|
classification = [params objectForKey: @"classification"];
|
||||||
|
if (classification &&
|
||||||
|
[classification isKindOfClass: [NSString class]] &&
|
||||||
|
[validClassifications containsObject: [classification uppercaseString]] &&
|
||||||
|
![[classification uppercaseString] isEqualToString: [event accessClass]])
|
||||||
|
{
|
||||||
|
[event setAccessClass: [classification uppercaseString]];
|
||||||
|
ex = [[self clientObject] saveComponent: event force: NO];
|
||||||
|
if (ex)
|
||||||
|
{
|
||||||
|
jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
|
[ex reason], @"message",
|
||||||
|
nil];
|
||||||
|
return [self responseWithStatus: [ex httpStatus]
|
||||||
|
andString: [jsonResponse jsonRepresentation]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set an alarm for the user
|
// Set an alarm for the user
|
||||||
alarm = [params objectForKey: @"alarm"];
|
alarm = [params objectForKey: @"alarm"];
|
||||||
if ([alarm isKindOfClass: [NSDictionary class]])
|
if ([alarm isKindOfClass: [NSDictionary class]])
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<md-dialog flex="60" flex-sm="80" flex-xs="100">
|
<md-dialog flex="60" flex-sm="80" flex-xs="100">
|
||||||
<form name="eventForm" class="md-inline-form" ng-submit="editor.save(eventForm)">
|
<form name="eventForm" class="md-inline-form" ng-submit="editor.save(eventForm)">
|
||||||
<md-toolbar>
|
<md-toolbar>
|
||||||
<div class="md-toolbar-tools">
|
<div class="md-toolbar-tools sg-no-transition">
|
||||||
<md-icon class="material-icons sg-icon-toolbar-bg">event</md-icon>
|
<md-icon class="material-icons sg-icon-toolbar-bg">event</md-icon>
|
||||||
<!-- summary -->
|
<!-- summary -->
|
||||||
<md-icon ng-if="editor.component.classification == 'confidential'">visibility_off</md-icon>
|
<md-icon ng-if="editor.component.classification == 'confidential'">visibility_off</md-icon>
|
||||||
|
|
|
@ -8,10 +8,10 @@
|
||||||
<md-toolbar>
|
<md-toolbar>
|
||||||
<div class="md-toolbar-tools">
|
<div class="md-toolbar-tools">
|
||||||
<md-icon class="material-icons sg-icon-toolbar-bg">event</md-icon>
|
<md-icon class="material-icons sg-icon-toolbar-bg">event</md-icon>
|
||||||
<div class="sg-md-title md-flex">
|
<div class="sg-md-title md-flex sg-no-transition">
|
||||||
<!-- classification -->
|
<!-- classification -->
|
||||||
<md-icon ng-if="::editor.component.classification == 'confidential'">visibility_off</md-icon>
|
<md-icon ng-if="editor.component.classification == 'confidential'">visibility_off</md-icon>
|
||||||
<md-icon ng-if="::editor.component.classification == 'private'">vpn_key</md-icon>
|
<md-icon ng-if="editor.component.classification == 'private'">vpn_key</md-icon>
|
||||||
<!-- priority -->
|
<!-- priority -->
|
||||||
<md-icon ng-if="::editor.highPriority()">priority_high</md-icon>
|
<md-icon ng-if="::editor.highPriority()">priority_high</md-icon>
|
||||||
<!-- summary -->
|
<!-- summary -->
|
||||||
|
@ -110,6 +110,22 @@
|
||||||
<div ng-bind="::editor.component.calendar"><!-- calendar --></div>
|
<div ng-bind="::editor.component.calendar"><!-- calendar --></div>
|
||||||
</div>
|
</div>
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
|
<!-- classification -->
|
||||||
|
<md-list-item>
|
||||||
|
<md-icon>visibility</md-icon>
|
||||||
|
<md-radio-group layout="row"
|
||||||
|
ng-model="editor.component.classification">
|
||||||
|
<md-radio-button class="sg-padded--right" value="public">
|
||||||
|
<var:string label:value="label_Public"/>
|
||||||
|
</md-radio-button>
|
||||||
|
<md-radio-button class="sg-padded--right" value="confidential">
|
||||||
|
<var:string label:value="label_Confidential"/>
|
||||||
|
</md-radio-button>
|
||||||
|
<md-radio-button value="private">
|
||||||
|
<var:string label:value="label_Private"/>
|
||||||
|
</md-radio-button>
|
||||||
|
</md-radio-group>
|
||||||
|
</md-list-item>
|
||||||
<!-- start/end dates -->
|
<!-- start/end dates -->
|
||||||
<md-list-item ng-class="{ 'md-2-line': editor.component.isAllDay, 'md-3-line': !editor.component.isAllDay }">
|
<md-list-item ng-class="{ 'md-2-line': editor.component.isAllDay, 'md-3-line': !editor.component.isAllDay }">
|
||||||
<md-icon>access_time</md-icon>
|
<md-icon>access_time</md-icon>
|
||||||
|
|
|
@ -941,7 +941,8 @@
|
||||||
data = {
|
data = {
|
||||||
reply: this.reply,
|
reply: this.reply,
|
||||||
delegatedTo: this.delegatedTo,
|
delegatedTo: this.delegatedTo,
|
||||||
alarm: this.$hasAlarm? this.alarm : {}
|
alarm: this.$hasAlarm? this.alarm : {},
|
||||||
|
classification: this.classification
|
||||||
};
|
};
|
||||||
|
|
||||||
return Component.$$resource.save(path, data, { action: 'rsvpAppointment' })
|
return Component.$$resource.save(path, data, { action: 'rsvpAppointment' })
|
||||||
|
|
|
@ -128,10 +128,11 @@
|
||||||
// Retrieve master event
|
// Retrieve master event
|
||||||
component = Calendar.$get(this.component.pid).$getComponent(this.component.id);
|
component = Calendar.$get(this.component.pid).$getComponent(this.component.id);
|
||||||
component.$futureComponentData.then(function() {
|
component.$futureComponentData.then(function() {
|
||||||
// Propagate the participant status and alarm to the master event
|
// Propagate the participant status, classification and alarm to the master event
|
||||||
component.reply = vm.component.reply;
|
component.reply = vm.component.reply;
|
||||||
component.delegatedTo = vm.component.delegatedTo;
|
component.delegatedTo = vm.component.delegatedTo;
|
||||||
component.$hasAlarm = vm.component.$hasAlarm;
|
component.$hasAlarm = vm.component.$hasAlarm;
|
||||||
|
component.classification = vm.component.classification;
|
||||||
component.alarm = vm.component.alarm;
|
component.alarm = vm.component.alarm;
|
||||||
// Send reply to the server
|
// Send reply to the server
|
||||||
vm.reply(component);
|
vm.reply(component);
|
||||||
|
|
|
@ -54,4 +54,12 @@ html * {
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove "leave" transition
|
||||||
|
// Convenient with a ng-switch statement or when using multiple ng-if statements that are mutually exclusive
|
||||||
|
.sg-no-transition {
|
||||||
|
.ng-leave {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue