parent
02fc147624
commit
ea7934a73c
1
NEWS
1
NEWS
|
@ -35,6 +35,7 @@ Bug fixes
|
||||||
- [web] handle URI in vCard photos (#2683)
|
- [web] handle URI in vCard photos (#2683)
|
||||||
- [web] handle semicolon in values during LDIF import (#1760)
|
- [web] handle semicolon in values during LDIF import (#1760)
|
||||||
- [web] fixed computation of week number (#3973, #3976)
|
- [web] fixed computation of week number (#3973, #3976)
|
||||||
|
- [web] fixed saving of inactive calendars (#3862, #3980)
|
||||||
- [eas] properly skip folders we don't want to synchronize (#3943)
|
- [eas] properly skip folders we don't want to synchronize (#3943)
|
||||||
- [eas] fixed 30 mins freebusy offset with S Planner
|
- [eas] fixed 30 mins freebusy offset with S Planner
|
||||||
- [eas] now correctly handles reminders on tasks (#3964)
|
- [eas] now correctly handles reminders on tasks (#3964)
|
||||||
|
|
|
@ -20,12 +20,15 @@
|
||||||
|
|
||||||
|
|
||||||
#import <NGObjWeb/NSException+HTTP.h>
|
#import <NGObjWeb/NSException+HTTP.h>
|
||||||
#import <NGObjWeb/WOContext.h>
|
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||||
#import <NGObjWeb/WOResponse.h>
|
#import <NGObjWeb/WOResponse.h>
|
||||||
#import <NGObjWeb/WORequest.h>
|
#import <NGObjWeb/WORequest.h>
|
||||||
|
|
||||||
#import <SoObjects/SOGo/SOGoParentFolder.h>
|
#import <SoObjects/SOGo/SOGoParentFolder.h>
|
||||||
|
#import <SoObjects/SOGo/SOGoUser.h>
|
||||||
|
#import <SoObjects/SOGo/SOGoUserSettings.h>
|
||||||
|
|
||||||
|
#import <SOGo/NSArray+Utilities.h>
|
||||||
#import <SOGo/NSDictionary+Utilities.h>
|
#import <SOGo/NSDictionary+Utilities.h>
|
||||||
#import <SOGo/NSString+Utilities.h>
|
#import <SOGo/NSString+Utilities.h>
|
||||||
|
|
||||||
|
@ -91,4 +94,49 @@
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (WOResponse *) saveFoldersActivationAction
|
||||||
|
{
|
||||||
|
NSDictionary *params;
|
||||||
|
NSEnumerator *foldersEnumerator;
|
||||||
|
NSMutableArray *folderSubscription;
|
||||||
|
NSMutableDictionary *moduleSettings;
|
||||||
|
NSString *baseFolder, *folderName;
|
||||||
|
SOGoParentFolder *clientObject;
|
||||||
|
SOGoUser *activeUser;
|
||||||
|
SOGoUserSettings *us;
|
||||||
|
WORequest *request;
|
||||||
|
BOOL makeActive;
|
||||||
|
|
||||||
|
request = [context request];
|
||||||
|
params = [[request contentAsString] objectFromJSONString];
|
||||||
|
activeUser = [context activeUser];
|
||||||
|
clientObject = [self clientObject];
|
||||||
|
baseFolder = [clientObject nameInContainer];
|
||||||
|
us = [activeUser userSettings];
|
||||||
|
moduleSettings = [us objectForKey: baseFolder];
|
||||||
|
if (!moduleSettings)
|
||||||
|
moduleSettings = [NSMutableDictionary dictionary];
|
||||||
|
[us setObject: moduleSettings forKey: baseFolder];
|
||||||
|
folderSubscription = [moduleSettings objectForKey: @"InactiveFolders"];
|
||||||
|
if (!folderSubscription)
|
||||||
|
{
|
||||||
|
folderSubscription = [NSMutableArray array];
|
||||||
|
[moduleSettings setObject: folderSubscription forKey: @"InactiveFolders"];
|
||||||
|
}
|
||||||
|
|
||||||
|
foldersEnumerator = [params keyEnumerator];
|
||||||
|
while ((folderName = [foldersEnumerator nextObject]))
|
||||||
|
{
|
||||||
|
makeActive = [[params objectForKey: folderName] boolValue];
|
||||||
|
if (makeActive)
|
||||||
|
[folderSubscription removeObject: folderName];
|
||||||
|
else
|
||||||
|
[folderSubscription addObjectUniquely: folderName];
|
||||||
|
}
|
||||||
|
[us synchronize];
|
||||||
|
|
||||||
|
return [self responseWith204];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -78,6 +78,11 @@
|
||||||
actionClass = "UIxParentFolderActions";
|
actionClass = "UIxParentFolderActions";
|
||||||
actionName = "createFolder";
|
actionName = "createFolder";
|
||||||
};
|
};
|
||||||
|
saveFoldersActivation = {
|
||||||
|
protectedBy = "Change Images And Files";
|
||||||
|
actionClass = "UIxParentFolderActions";
|
||||||
|
actionName = "saveFoldersActivation";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
SOGoFolder = {
|
SOGoFolder = {
|
||||||
|
|
|
@ -94,7 +94,6 @@
|
||||||
list = this.$calendars;
|
list = this.$calendars;
|
||||||
|
|
||||||
sibling = _.findIndex(list, function(o, i) {
|
sibling = _.findIndex(list, function(o, i) {
|
||||||
console.debug(i + ': "' + o.id + '".localeCompare("' + calendar.name + '") = ' + o.name.localeCompare(calendar.name));
|
|
||||||
return (calendar.id == 'personal' ||
|
return (calendar.id == 'personal' ||
|
||||||
(o.id != 'personal' && o.name.localeCompare(calendar.name) > 0));
|
(o.id != 'personal' && o.name.localeCompare(calendar.name) > 0));
|
||||||
});
|
});
|
||||||
|
@ -325,6 +324,24 @@
|
||||||
return Calendar.$q.all(promises);
|
return Calendar.$q.all(promises);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @function saveFoldersActivation
|
||||||
|
* @memberof Calendar
|
||||||
|
* @desc Save to the user's settings the activation state of the calendars
|
||||||
|
* @param {string[]} folders - the folders IDs
|
||||||
|
* @returns a promise of the HTTP operation
|
||||||
|
*/
|
||||||
|
Calendar.saveFoldersActivation = function(ids) {
|
||||||
|
var request = {};
|
||||||
|
|
||||||
|
_.forEach(ids, function(id) {
|
||||||
|
var calendar = Calendar.$get(id);
|
||||||
|
request[calendar.id] = calendar.active;
|
||||||
|
});
|
||||||
|
|
||||||
|
return Calendar.$$resource.post(null, 'saveFoldersActivation', request);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function saveFoldersOrder
|
* @function saveFoldersOrder
|
||||||
* @desc Save to the user's settings the current calendars order.
|
* @desc Save to the user's settings the current calendars order.
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
function(newList, oldList) {
|
function(newList, oldList) {
|
||||||
var commonList, ids, promises;
|
var commonList, ids, promise;
|
||||||
|
|
||||||
// Identify which calendar has changed
|
// Identify which calendar has changed
|
||||||
commonList = _.intersectionBy(newList, oldList, 'id');
|
commonList = _.intersectionBy(newList, oldList, 'id');
|
||||||
|
@ -66,17 +66,14 @@
|
||||||
var oldObject = _.find(oldList, { id: o.id });
|
var oldObject = _.find(oldList, { id: o.id });
|
||||||
return !_.isEqual(o, oldObject);
|
return !_.isEqual(o, oldObject);
|
||||||
}), 'id');
|
}), 'id');
|
||||||
promises = [];
|
promise = Calendar.$q.when();
|
||||||
|
|
||||||
if (ids.length > 0) {
|
if (ids.length > 0) {
|
||||||
$log.debug(ids.join(', ') + ' changed');
|
$log.debug(ids.join(', ') + ' changed');
|
||||||
_.forEach(ids, function(id) {
|
promise = Calendar.saveFoldersActivation(ids);
|
||||||
var calendar = Calendar.$get(id);
|
|
||||||
promises.push(calendar.$setActivation());
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (promises.length > 0 || commonList.length != newList.length || commonList.length != oldList.length)
|
if (ids.length > 0 || commonList.length != newList.length || commonList.length != oldList.length)
|
||||||
Calendar.$q.all(promises).then(function() {
|
promise.then(function() {
|
||||||
$rootScope.$emit('calendars:list');
|
$rootScope.$emit('calendars:list');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue