From db44f9b8e0ba341401c89e0ce002c01a63250eea Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Sat, 9 Aug 2008 18:27:38 +0000 Subject: [PATCH] Monotone-Parent: eacf14246d4dde8712de638d29d8a7cdc77fac45 Monotone-Revision: 24072b56a700014098e8df3a7ba0e45f26e74a2a Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-08-09T18:27:38 Monotone-Branch: ca.inverse.sogo --- UI/Contacts/English.lproj/Localizable.strings | 6 ++++-- UI/Contacts/French.lproj/Localizable.strings | 7 +++++-- UI/WebServerResources/ContactsUI.js | 7 ++++++- UI/WebServerResources/generic.js | 7 +++++-- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/UI/Contacts/English.lproj/Localizable.strings b/UI/Contacts/English.lproj/Localizable.strings index 9d61eb57d..1bc1051bb 100644 --- a/UI/Contacts/English.lproj/Localizable.strings +++ b/UI/Contacts/English.lproj/Localizable.strings @@ -105,8 +105,10 @@ "Name of the Address Book" = "Name of the Address Book"; "Are you sure you want to delete the selected address book?" = "Are you sure you want to delete the selected address book?"; -"You cannot delete the selected contact(s)" -= "You cannot delete the selected contact(s)."; +"You don't have the required privileges to perform the operation." += "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}\"."; "Address Book Name" = "Address Book Name"; diff --git a/UI/Contacts/French.lproj/Localizable.strings b/UI/Contacts/French.lproj/Localizable.strings index 84579e6d7..807551017 100644 --- a/UI/Contacts/French.lproj/Localizable.strings +++ b/UI/Contacts/French.lproj/Localizable.strings @@ -118,8 +118,11 @@ "Name of the Address Book" = "Nom du carnet d'adresses"; "Are you sure you want to delete the selected address book?" = "Voulez-vous vraiment supprimer le carnet d'adresses sélectionné ?"; -"You cannot delete the selected contact(s)" -= "Vous ne pouvez pas supprimer les contacts sélectionnés."; +"You don't have the required privileges to perform the operation." += "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}\"."; + "Address Book Name" = "Nom du carnet d'adresses"; "You cannot subscribe to a folder that you own!" diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 947ff7ce4..f620608c1 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -272,7 +272,7 @@ function actionContactCallback(http) { var error = html.select("p").first().firstChild.nodeValue.trim(); log("actionContactCallback failed: error " + http.status + " (" + error + ")"); if (parseInt(http.status) == 403) - window.alert(labels["You cannot delete the selected contact(s)"]); + window.alert(labels["You don't have the required privileges to perform the operation."]); else if (error) window.alert(labels[error]); refreshCurrentFolder(); @@ -450,6 +450,11 @@ function onContactDeleteEventCallback(http) { var row = $(http.callbackData); row.parentNode.removeChild(row); } + else if (parseInt(http.status) == 403) { + var row = $(http.callbackData); + var displayName = row.down("TD.displayName").firstChild.nodeValue.trim(); + window.alert(labels["You cannot delete the card of \"%{0}\"."].formatted(displayName)); + } } } diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 5863dccb3..936fa7e36 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -179,7 +179,7 @@ function sanitizeMailTo(dirtyMailTo) { function sanitizeWindowName(dirtyWindowName) { // IE is picky about the characters used for the window name. - return dirtyWindowName.replace(/[\s\/-]/g, "_"); + return dirtyWindowName.replace(/[\s\.\/-]/g, "_"); } function openUserFolderSelector(callback, type) { @@ -515,7 +515,10 @@ function acceptMultiSelect(node) { function onRowClick(event) { var node = getTarget(event); var rowIndex = null; - + + if (node.tagName != 'TD' && node.tagName != 'LI') + node = this; + if (node.tagName == 'TD') { node = node.parentNode; // select TR rowIndex = node.rowIndex - $(node).up('table').down('thead').getElementsByTagName('tr').length;