mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-30 01:09:29 +00:00
(js) Delete an event or a task
This commit is contained in:
@@ -872,6 +872,21 @@
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $delete
|
||||
* @memberof Component.prototype
|
||||
* @desc Delete the component from the server.
|
||||
* @param {boolean} occurrenceOnly - delete this occurrence only
|
||||
*/
|
||||
Component.prototype.remove = function(occurrenceOnly) {
|
||||
var _this = this, path = [this.pid, this.id];
|
||||
|
||||
if (occurrenceOnly && this.occurrenceId)
|
||||
path.push(this.occurrenceId);
|
||||
|
||||
return Component.$$resource.remove(path.join('/'));
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $unwrap
|
||||
* @memberof Component.prototype
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
vm.editAllOccurrences = editAllOccurrences;
|
||||
vm.reply = reply;
|
||||
vm.replyAllOccurrences = replyAllOccurrences;
|
||||
vm.deleteOccurrence = deleteOccurrence;
|
||||
vm.deleteAllOccurrences = deleteAllOccurrences;
|
||||
|
||||
// Load all attributes of component
|
||||
if (angular.isUndefined(vm.component.$futureComponentData)) {
|
||||
@@ -88,7 +90,21 @@
|
||||
reply(component);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function deleteOccurrence() {
|
||||
vm.component.remove(true).then(function() {
|
||||
$rootScope.$broadcast('calendars:list');
|
||||
$mdDialog.hide();
|
||||
});
|
||||
}
|
||||
|
||||
function deleteAllOccurrences() {
|
||||
vm.component.remove().then(function() {
|
||||
$rootScope.$broadcast('calendars:list');
|
||||
$mdDialog.hide();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngInject
|
||||
|
||||
Reference in New Issue
Block a user