diff --git a/UI/Contacts/English.lproj/Localizable.strings b/UI/Contacts/English.lproj/Localizable.strings index fd12c5f46..7d250bdc0 100644 --- a/UI/Contacts/English.lproj/Localizable.strings +++ b/UI/Contacts/English.lproj/Localizable.strings @@ -111,13 +111,17 @@ = "You don't have the required privileges to perform the operation."; "You cannot delete the card of \"%{0}\"." = "You cannot delete the card of \"%{0}\"."; +"Your personal address book cannot be deleted." += "Your personal address book cannot be deleted."; +"Global address books cannot be deleted." += "Global address books cannot be deleted."; "Address Book Name" = "Address Book Name"; "You cannot subscribe to a folder that you own!" -= "You cannot subscribe to a folder that you own!"; += "You cannot subscribe to a folder that you own."; "Unable to subscribe to that folder!" -= "Unable to subscribe to that folder!"; += "Unable to subscribe to that folder."; "Default Roles" = "Default Roles"; "User rights for:" = "User rights for:"; diff --git a/UI/Contacts/French.lproj/Localizable.strings b/UI/Contacts/French.lproj/Localizable.strings index 5fbb24564..71da5afbd 100644 --- a/UI/Contacts/French.lproj/Localizable.strings +++ b/UI/Contacts/French.lproj/Localizable.strings @@ -124,13 +124,17 @@ = "Vous n'avez pas les privilèges requis pour compléter l'opération."; "You cannot delete the card of \"%{0}\"." = "Vous ne pouvez pas supprimer la fiche de \"%{0}\"."; +"Your personal address book cannot be deleted." += "Votre carnet personnel ne peut être effacé."; +"Global address books cannot be deleted." += "Les carnets communs ne peuvent être effacés."; "Address Book Name" = "Nom du carnet d'adresses"; "You cannot subscribe to a folder that you own!" -= "Vous ne pouvez pas vous inscrire à un dossier qui vous appartient!"; += "Vous ne pouvez pas vous inscrire à un dossier qui vous appartient."; "Unable to subscribe to that folder!" -= "Impossible de vous inscrire à ce dossier!"; += "Impossible de vous inscrire à ce dossier."; "Default Roles" = "Rôles par défaut"; "User rights for:" = "Autorisations pour :"; diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 7385fbb05..12ec15cb2 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -653,19 +653,28 @@ function onAddressBookRemove(event) { var selector = $("contactFolders"); var nodes = selector.getSelectedNodes(); if (nodes.length > 0) { - nodes[0].deselect(); - var owner = nodes[0].getAttribute("owner"); - if (owner == UserLogin) { - var folderIdElements = nodes[0].getAttribute("id").split(":"); - var abId = folderIdElements[0].substr(1); - deletePersonalAddressBook(abId); - var personal = $("/personal"); - personal.selectElement(); - onFolderSelectionChange(); + var node = $(nodes[0]); + if (node.readAttribute("id") == "/personal") { + window.alert(labels["Your personal address book cannot be deleted."]); + } + else if (node.hasClassName("remote")) { + window.alert(labels["Global address books cannot be deleted."]); } else { - var folderId = nodes[0].getAttribute("id"); - unsubscribeFromFolder(folderId, owner, onFolderUnsubscribeCB, folderId); + node.deselect(); + var owner = node.getAttribute("owner"); + if (owner == UserLogin) { + var folderIdElements = node.getAttribute("id").split(":"); + var abId = folderIdElements[0].substr(1); + deletePersonalAddressBook(abId); + var personal = $("/personal"); + personal.selectElement(); + onFolderSelectionChange(); + } + else { + var folderId = node.getAttribute("id"); + unsubscribeFromFolder(folderId, owner, onFolderUnsubscribeCB, folderId); + } } }