From e497adeae38c521d14e918899c50141ccda60e2a Mon Sep 17 00:00:00 2001 From: Alexey Shpakovsky Date: Sun, 30 May 2021 00:23:08 +0200 Subject: [PATCH] delete many addresses at once --- abook_class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/abook_class.php b/abook_class.php index 5bd95fb..d5edea3 100755 --- a/abook_class.php +++ b/abook_class.php @@ -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.