Commit b532d41b authored by CardBook's avatar CardBook

version 34.3

parent ab5111f3
<clientConfig version="1.1">
<carddavProvider id="CardDAVEngine">
<carddavURL>https://carddav.aol.com/.well-known/carddav</carddavURL>
<vCardVersion>3.0</vCardVersion>
</carddavProvider>
</clientConfig>
\ No newline at end of file
...@@ -200,7 +200,7 @@ if ("undefined" == typeof(wdw_cardEdition)) { ...@@ -200,7 +200,7 @@ if ("undefined" == typeof(wdw_cardEdition)) {
} }
if (!found) { if (!found) {
var myCard = {}; var myCard = {};
myCard.uid = cardbookUtils.getUUID();; cardbookUtils.setCardUUID(myCard);
myCard.fn = aEmail; myCard.fn = aEmail;
myCard.lastname = ""; myCard.lastname = "";
myCard.firstname = ""; myCard.firstname = "";
...@@ -1365,6 +1365,10 @@ if ("undefined" == typeof(wdw_cardEdition)) { ...@@ -1365,6 +1365,10 @@ if ("undefined" == typeof(wdw_cardEdition)) {
if (wdw_cardEdition.validate()) { if (wdw_cardEdition.validate()) {
var myOutCard = new cardbookCardParser(); var myOutCard = new cardbookCardParser();
wdw_cardEdition.calculateResult(myOutCard); wdw_cardEdition.calculateResult(myOutCard);
myOutCard.uid = myOutCard.uid.replace(/^urn:uuid:/i, "");
if (cardbookPreferences.getUrnuuid(myOutCard.dirPrefId)) {
myOutCard.uid = "urn:uuid:" + myOutCard.uid;
}
wdw_cardEdition.saveMailPopularity(); wdw_cardEdition.saveMailPopularity();
window.arguments[0].cardOut = myOutCard; window.arguments[0].cardOut = myOutCard;
wdw_cardEdition.workingCard = null; wdw_cardEdition.workingCard = null;
......
...@@ -9,18 +9,22 @@ if ("undefined" == typeof(cardbookCardParser)) { ...@@ -9,18 +9,22 @@ if ("undefined" == typeof(cardbookCardParser)) {
} }
function cardbookCardParser(vCardData, vSiteUrl, vEtag, vDirPrefId) { function cardbookCardParser(vCardData, vSiteUrl, vEtag, vDirPrefId) {
this._init(); this._init(vDirPrefId);
if (vCardData != null && vCardData !== undefined && vCardData != "") { if (vCardData != null && vCardData !== undefined && vCardData != "") {
this._parseCard(vCardData, vSiteUrl, vEtag, vDirPrefId); this._parseCard(vCardData, vSiteUrl, vEtag);
} }
this._finish(); this._finish();
} }
cardbookCardParser.prototype = { cardbookCardParser.prototype = {
_init: function () { _init: function (vDirPrefId) {
this.dirPrefId = ""; if (vDirPrefId != null && vDirPrefId !== undefined && vDirPrefId != "") {
this.dirPrefId = vDirPrefId;
} else {
this.dirPrefId = "";
}
this.cardurl = ""; this.cardurl = "";
this.cacheuri = ""; this.cacheuri = "";
this.etag = ""; this.etag = "";
...@@ -137,9 +141,7 @@ if ("undefined" == typeof(cardbookCardParser)) { ...@@ -137,9 +141,7 @@ if ("undefined" == typeof(cardbookCardParser)) {
} }
}, },
_parseCard: function (vCardData, vSiteUrl, vEtag, vDirPrefId) { _parseCard: function (vCardData, vSiteUrl, vEtag) {
this.dirPrefId = vDirPrefId;
var re = /[\n\u0085\u2028\u2029]|\r\n?/; var re = /[\n\u0085\u2028\u2029]|\r\n?/;
var vCardDataArray = cardbookUtils.cleanArrayWithoutTrim(vCardData.split(re)); var vCardDataArray = cardbookUtils.cleanArrayWithoutTrim(vCardData.split(re));
if (vCardDataArray.indexOf("VERSION:3.0") >= 0 || vCardDataArray.indexOf("VERSION:4.0") >= 0 if (vCardDataArray.indexOf("VERSION:3.0") >= 0 || vCardDataArray.indexOf("VERSION:4.0") >= 0
......
...@@ -1583,6 +1583,7 @@ if ("undefined" == typeof(cardbookSynchronization)) { ...@@ -1583,6 +1583,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
request.propfind(["DAV: resourcetype", "DAV: displayname"], true); request.propfind(["DAV: resourcetype", "DAV: displayname"], true);
}, },
// no errors to report in this function
discoverPhase4: function(aConnection, aRootUrl, aOperationType, aParams) { discoverPhase4: function(aConnection, aRootUrl, aOperationType, aParams) {
var listener_checkpropfind4 = { var listener_checkpropfind4 = {
onDAVQueryComplete: function(status, responseXML, askCertificate) { onDAVQueryComplete: function(status, responseXML, askCertificate) {
...@@ -1594,13 +1595,13 @@ if ("undefined" == typeof(cardbookSynchronization)) { ...@@ -1594,13 +1595,13 @@ if ("undefined" == typeof(cardbookSynchronization)) {
cardbookSynchronization.discoverPhase4(aConnection, aRootUrl, aOperationType, aParams); cardbookSynchronization.discoverPhase4(aConnection, aRootUrl, aOperationType, aParams);
} else { } else {
cardbookUtils.formatStringForOutput("synchronizationFailed", [aConnection.connDescription, "discoverPhase4", aConnection.connUrl, status], "Error"); cardbookUtils.formatStringForOutput("synchronizationFailed", [aConnection.connDescription, "discoverPhase4", aConnection.connUrl, status], "Error");
cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++; // cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++;
cardbookRepository.cardbookServerDiscoveryResponse[aConnection.connPrefId]++; cardbookRepository.cardbookServerDiscoveryResponse[aConnection.connPrefId]++;
cardbookRepository.cardbookServerSyncResponse[aConnection.connPrefId]++; cardbookRepository.cardbookServerSyncResponse[aConnection.connPrefId]++;
} }
} else { } else {
cardbookUtils.formatStringForOutput("synchronizationFailed", [aConnection.connDescription, "discoverPhase4", aConnection.connUrl, status], "Error"); cardbookUtils.formatStringForOutput("synchronizationFailed", [aConnection.connDescription, "discoverPhase4", aConnection.connUrl, status], "Error");
cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++; // cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++;
cardbookRepository.cardbookServerDiscoveryResponse[aConnection.connPrefId]++; cardbookRepository.cardbookServerDiscoveryResponse[aConnection.connPrefId]++;
cardbookRepository.cardbookServerSyncResponse[aConnection.connPrefId]++; cardbookRepository.cardbookServerSyncResponse[aConnection.connPrefId]++;
} }
...@@ -1627,7 +1628,7 @@ if ("undefined" == typeof(cardbookSynchronization)) { ...@@ -1627,7 +1628,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
if (aOperationType == "GETDISPLAYNAME" || !cardbookSynchronization.handleWrondPassword(aConnection, status, response)) { if (aOperationType == "GETDISPLAYNAME" || !cardbookSynchronization.handleWrondPassword(aConnection, status, response)) {
cardbookUtils.formatStringForOutput("synchronizationFailed", [aConnection.connDescription, "discoverPhase4", aConnection.connUrl, status], "Error"); cardbookUtils.formatStringForOutput("synchronizationFailed", [aConnection.connDescription, "discoverPhase4", aConnection.connUrl, status], "Error");
} }
cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++; // cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++;
cardbookRepository.cardbookServerDiscoveryResponse[aConnection.connPrefId]++; cardbookRepository.cardbookServerDiscoveryResponse[aConnection.connPrefId]++;
cardbookRepository.cardbookServerSyncResponse[aConnection.connPrefId]++; cardbookRepository.cardbookServerSyncResponse[aConnection.connPrefId]++;
} }
......
...@@ -1364,50 +1364,60 @@ if ("undefined" == typeof(cardbookUtils)) { ...@@ -1364,50 +1364,60 @@ if ("undefined" == typeof(cardbookUtils)) {
var myFieldArray = aField.split("."); var myFieldArray = aField.split(".");
var myField = myFieldArray[0]; var myField = myFieldArray[0];
var myPosition = myFieldArray[1]; var myPosition = myFieldArray[1];
var myType = myFieldArray[2]; if (myField == "org") {
if (myType == "all") { var orgStructure = cardbookPreferences.getStringPref("extensions.cardbook.orgStructure");
if (aCard[myField]) { if (orgStructure != "") {
for (var i = 0; i < aCard[myField].length; i++) { var myOrgValue = cardbookUtils.unescapeArray(cardbookUtils.escapeString(aCard[myField]).split(";"));
if (aCard[myField][i][0][myPosition] != "") { result.push(myOrgValue[myPosition]);
result.push(aCard[myField][i][0][myPosition]); } else {
} result.push(aCard[myField]);
}
}
} else if (myType == "array") {
if (aCard[myField].length != 0) {
result = result.concat(aCard[myField]);
} }
} else { } else {
if (aCard[myField]) { var myType = myFieldArray[2];
var ABType = cardbookPreferences.getType(aCard.dirPrefId); if (myType == "all") {
var ABTypeFormat = cardbookRepository.getABTypeFormat(ABType); if (aCard[myField]) {
for (var i = 0; i < aCard[myField].length; i++) { for (var i = 0; i < aCard[myField].length; i++) {
if (myType == "notype") { if (aCard[myField][i][0][myPosition] != "") {
if (aCard[myField][i][1].length == 0 && aCard[myField][i][3].length == 0 && aCard[myField][i][2] == "") {
result.push(aCard[myField][i][0][myPosition]); result.push(aCard[myField][i][0][myPosition]);
} }
} else { }
if (aCard[myField][i][3].length != 0 && aCard[myField][i][2] != "") { }
let found = false; } else if (myType == "array") {
for (var j = 0; j < aCard[myField][i][3].length; j++) { if (aCard[myField].length != 0) {
let tmpArray = aCard[myField][i][3][j].split(":"); result = result.concat(aCard[myField]);
if (tmpArray[0] == "X-ABLABEL") { }
var myInputTypes = [ tmpArray[1] ]; } else {
found = true; if (aCard[myField]) {
break; var ABType = cardbookPreferences.getType(aCard.dirPrefId);
} var ABTypeFormat = cardbookRepository.getABTypeFormat(ABType);
} for (var i = 0; i < aCard[myField].length; i++) {
if (!found) { if (myType == "notype") {
var myInputTypes = cardbookUtils.getOnlyTypesFromTypes(aCard[myField][i][1]); if (aCard[myField][i][1].length == 0 && aCard[myField][i][3].length == 0 && aCard[myField][i][2] == "") {
result.push(aCard[myField][i][0][myPosition]);
} }
} else { } else {
var myInputTypes = cardbookUtils.getOnlyTypesFromTypes(aCard[myField][i][1]); if (aCard[myField][i][3].length != 0 && aCard[myField][i][2] != "") {
} let found = false;
if (cardbookTypes.isMyCodePresent(myField, myType, ABTypeFormat, myInputTypes)) { for (var j = 0; j < aCard[myField][i][3].length; j++) {
if (aIncludePref && myField!= "adr" && cardbookUtils.getPrefBooleanFromTypes(aCard[myField][i][1])) { let tmpArray = aCard[myField][i][3][j].split(":");
result.push(cardbookRepository.prefCSVPrefix + aCard[myField][i][0][myPosition]); if (tmpArray[0] == "X-ABLABEL") {
var myInputTypes = [ tmpArray[1] ];
found = true;
break;
}
}
if (!found) {
var myInputTypes = cardbookUtils.getOnlyTypesFromTypes(aCard[myField][i][1]);
}
} else { } else {
result.push(aCard[myField][i][0][myPosition]); var myInputTypes = cardbookUtils.getOnlyTypesFromTypes(aCard[myField][i][1]);
}
if (cardbookTypes.isMyCodePresent(myField, myType, ABTypeFormat, myInputTypes)) {
if (aIncludePref && myField!= "adr" && cardbookUtils.getPrefBooleanFromTypes(aCard[myField][i][1])) {
result.push(cardbookRepository.prefCSVPrefix + aCard[myField][i][0][myPosition]);
} else {
result.push(aCard[myField][i][0][myPosition]);
}
} }
} }
} }
......
...@@ -728,7 +728,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) { ...@@ -728,7 +728,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex-1] = wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex]; wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex-1] = wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex];
wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex] = temp; wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex] = temp;
wdw_cardbookConfiguration.refreshListBoxOrg(); wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
} }
}, },
...@@ -741,7 +740,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) { ...@@ -741,7 +740,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex+1] = wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex]; wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex+1] = wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex];
wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex] = temp; wdw_cardbookConfiguration.allOrg[myListBox.selectedIndex] = temp;
wdw_cardbookConfiguration.refreshListBoxOrg(); wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
} }
}, },
...@@ -757,7 +755,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) { ...@@ -757,7 +755,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
} }
wdw_cardbookConfiguration.allOrg.push(myArgs.type); wdw_cardbookConfiguration.allOrg.push(myArgs.type);
wdw_cardbookConfiguration.refreshListBoxOrg(); wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
} }
}, },
...@@ -784,7 +781,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) { ...@@ -784,7 +781,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
} }
} }
wdw_cardbookConfiguration.refreshListBoxOrg(); wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
} }
} }
}, },
...@@ -801,7 +797,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) { ...@@ -801,7 +797,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
} }
} }
wdw_cardbookConfiguration.refreshListBoxOrg(); wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
} }
}, },
......
...@@ -101,7 +101,7 @@ if ("undefined" == typeof(ovl_synchro)) { ...@@ -101,7 +101,7 @@ if ("undefined" == typeof(ovl_synchro)) {
prefs.setCharPref("accountsShown", "all"); prefs.setCharPref("accountsShown", "all");
prefs.setCharPref("accountShown", ""); prefs.setCharPref("accountShown", "");
prefs.setCharPref("uncategorizedCards", ""); prefs.setCharPref("uncategorizedCards", "");
prefs.setCharPref("addonVersion", "34.2"); prefs.setCharPref("addonVersion", "34.3");
prefs.setCharPref("defaultRegion", "NOTSET"); prefs.setCharPref("defaultRegion", "NOTSET");
prefs.setBoolPref("localDataEncryption", false); prefs.setBoolPref("localDataEncryption", false);
......
...@@ -105,7 +105,16 @@ if ("undefined" == typeof(wdw_cardbook)) { ...@@ -105,7 +105,16 @@ if ("undefined" == typeof(wdw_cardbook)) {
var myColumns = cardbookUtils.getAllAvailableColumns("cardstree"); var myColumns = cardbookUtils.getAllAvailableColumns("cardstree");
var myTreecols = document.getElementById('cardsTreecols'); var myTreecols = document.getElementById('cardsTreecols');
cardbookElementTools.deleteRows(myTreecols.id) cardbookElementTools.deleteRows(myTreecols.id)
var orgStructure = cardbookPreferences.getStringPref("extensions.cardbook.orgStructure");
if (orgStructure != "") {
var orgArray = cardbookUtils.unescapeArray(cardbookUtils.escapeString(orgStructure).split(";"));
for (var i = 0; i < orgArray.length; i++) {
myColumns.push(["org." + i, orgArray[i]]);
}
}
myColumns = cardbookUtils.sortMultipleArrayByString(myColumns,1,1);
var myOrdinal = 0; var myOrdinal = 0;
for (var i = 0; i < myColumns.length; i++) { for (var i = 0; i < myColumns.length; i++) {
var myCode = myColumns[i][0]; var myCode = myColumns[i][0];
...@@ -2292,7 +2301,7 @@ if ("undefined" == typeof(wdw_cardbook)) { ...@@ -2292,7 +2301,7 @@ if ("undefined" == typeof(wdw_cardbook)) {
if (!myDirPrefIds[myCard.dirPrefId]) { if (!myDirPrefIds[myCard.dirPrefId]) {
var myNewList = new cardbookCardParser(); var myNewList = new cardbookCardParser();
myNewList.dirPrefId = myCard.dirPrefId; myNewList.dirPrefId = myCard.dirPrefId;
myNewList.uid = cardbookUtils.getUUID(); cardbookUtils.setCardUUID(myNewList);
myNewList.version = cardbookPreferences.getVCardVersion(myCard.dirPrefId); myNewList.version = cardbookPreferences.getVCardVersion(myCard.dirPrefId);
myNewList.fn = aCategoryName; myNewList.fn = aCategoryName;
myDirPrefIds[myCard.dirPrefId] = {}; myDirPrefIds[myCard.dirPrefId] = {};
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest"> <Description about="urn:mozilla:install-manifest">
<em:id>cardbook@vigneau.philippe</em:id> <em:id>cardbook@vigneau.philippe</em:id>
<em:name>CardBook</em:name> <em:name>CardBook</em:name>
<em:version>34.2</em:version> <em:version>34.3</em:version>
<em:type>2</em:type> <em:type>2</em:type>
<em:description>vCard Address Book</em:description> <em:description>vCard Address Book</em:description>
<em:creator>Philippe Vigneau</em:creator> <em:creator>Philippe Vigneau</em:creator>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment