mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-18 03:47:59 +00:00
(feat) initial selection + ops in calendar module
This commit is contained in:
@@ -255,6 +255,31 @@
|
||||
return d.promise;
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $deleteComponents
|
||||
* @memberof Calendar
|
||||
* @desc Delete multiple components from calendar.
|
||||
* @return a promise of the HTTP operation
|
||||
*/
|
||||
Calendar.$deleteComponents = function(components) {
|
||||
|
||||
// We create a c_folder -> event hash
|
||||
var calendars = {}, _this = this;
|
||||
|
||||
_.forEach(components, function(component) {
|
||||
if (!angular.isDefined(calendars[component.c_folder]))
|
||||
calendars[component.c_folder] = [];
|
||||
|
||||
calendars[component.c_folder].push(component.c_name);
|
||||
});
|
||||
|
||||
_.forEach(calendars, function(uids, c_folder) {
|
||||
Calendar.$$resource.post(c_folder, 'batchDelete', {uids: uids});
|
||||
});
|
||||
|
||||
_this.$Component.$events = _.difference(_this.$Component.$events, components);
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $save
|
||||
* @memberof Calendar.prototype
|
||||
|
||||
Reference in New Issue
Block a user