delete many addresses at once

This commit is contained in:
Alexey Shpakovsky 2021-05-30 00:23:08 +02:00
parent 4f9542a833
commit e497adeae3
No known key found for this signature in database
GPG key ID: 5797A726A2A4230A

View file

@ -293,18 +293,20 @@ class abook_carddav extends addressbook_backend {
}
/**
* Delete address
* @param alias
* Delete addresses
* @param aliases array of nicknames to delete
* @return boolean
*/
function remove($alias) {
function remove($aliases) {
if (!$this->writeable) {
return $this->set_error(_("Addressbook is read-only"));
}
// TODO: edit this if we use different nick-naming scheme
$uri = $this->abook->getUriPath() . $alias;
$this->abook->deleteCard($uri);
foreach($aliases as $alias) {
// TODO: edit this if we use different nick-naming scheme
$uri = $this->abook->getUriPath() . $alias;
$this->abook->deleteCard($uri);
}
// FIXME:
// return true if operation is succesful.