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)) {
}
if (!found) {
var myCard = {};
myCard.uid = cardbookUtils.getUUID();;
cardbookUtils.setCardUUID(myCard);
myCard.fn = aEmail;
myCard.lastname = "";
myCard.firstname = "";
......@@ -1365,6 +1365,10 @@ if ("undefined" == typeof(wdw_cardEdition)) {
if (wdw_cardEdition.validate()) {
var myOutCard = new cardbookCardParser();
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();
window.arguments[0].cardOut = myOutCard;
wdw_cardEdition.workingCard = null;
......
......@@ -9,18 +9,22 @@ if ("undefined" == typeof(cardbookCardParser)) {
}
function cardbookCardParser(vCardData, vSiteUrl, vEtag, vDirPrefId) {
this._init();
this._init(vDirPrefId);
if (vCardData != null && vCardData !== undefined && vCardData != "") {
this._parseCard(vCardData, vSiteUrl, vEtag, vDirPrefId);
this._parseCard(vCardData, vSiteUrl, vEtag);
}
this._finish();
}
cardbookCardParser.prototype = {
_init: function () {
_init: function (vDirPrefId) {
if (vDirPrefId != null && vDirPrefId !== undefined && vDirPrefId != "") {
this.dirPrefId = vDirPrefId;
} else {
this.dirPrefId = "";
}
this.cardurl = "";
this.cacheuri = "";
this.etag = "";
......@@ -137,9 +141,7 @@ if ("undefined" == typeof(cardbookCardParser)) {
}
},
_parseCard: function (vCardData, vSiteUrl, vEtag, vDirPrefId) {
this.dirPrefId = vDirPrefId;
_parseCard: function (vCardData, vSiteUrl, vEtag) {
var re = /[\n\u0085\u2028\u2029]|\r\n?/;
var vCardDataArray = cardbookUtils.cleanArrayWithoutTrim(vCardData.split(re));
if (vCardDataArray.indexOf("VERSION:3.0") >= 0 || vCardDataArray.indexOf("VERSION:4.0") >= 0
......
......@@ -1583,6 +1583,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
request.propfind(["DAV: resourcetype", "DAV: displayname"], true);
},
// no errors to report in this function
discoverPhase4: function(aConnection, aRootUrl, aOperationType, aParams) {
var listener_checkpropfind4 = {
onDAVQueryComplete: function(status, responseXML, askCertificate) {
......@@ -1594,13 +1595,13 @@ if ("undefined" == typeof(cardbookSynchronization)) {
cardbookSynchronization.discoverPhase4(aConnection, aRootUrl, aOperationType, aParams);
} else {
cardbookUtils.formatStringForOutput("synchronizationFailed", [aConnection.connDescription, "discoverPhase4", aConnection.connUrl, status], "Error");
cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++;
// cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++;
cardbookRepository.cardbookServerDiscoveryResponse[aConnection.connPrefId]++;
cardbookRepository.cardbookServerSyncResponse[aConnection.connPrefId]++;
}
} else {
cardbookUtils.formatStringForOutput("synchronizationFailed", [aConnection.connDescription, "discoverPhase4", aConnection.connUrl, status], "Error");
cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++;
// cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++;
cardbookRepository.cardbookServerDiscoveryResponse[aConnection.connPrefId]++;
cardbookRepository.cardbookServerSyncResponse[aConnection.connPrefId]++;
}
......@@ -1627,7 +1628,7 @@ if ("undefined" == typeof(cardbookSynchronization)) {
if (aOperationType == "GETDISPLAYNAME" || !cardbookSynchronization.handleWrondPassword(aConnection, status, response)) {
cardbookUtils.formatStringForOutput("synchronizationFailed", [aConnection.connDescription, "discoverPhase4", aConnection.connUrl, status], "Error");
}
cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++;
// cardbookRepository.cardbookServerDiscoveryError[aConnection.connPrefId]++;
cardbookRepository.cardbookServerDiscoveryResponse[aConnection.connPrefId]++;
cardbookRepository.cardbookServerSyncResponse[aConnection.connPrefId]++;
}
......
......@@ -1364,6 +1364,15 @@ if ("undefined" == typeof(cardbookUtils)) {
var myFieldArray = aField.split(".");
var myField = myFieldArray[0];
var myPosition = myFieldArray[1];
if (myField == "org") {
var orgStructure = cardbookPreferences.getStringPref("extensions.cardbook.orgStructure");
if (orgStructure != "") {
var myOrgValue = cardbookUtils.unescapeArray(cardbookUtils.escapeString(aCard[myField]).split(";"));
result.push(myOrgValue[myPosition]);
} else {
result.push(aCard[myField]);
}
} else {
var myType = myFieldArray[2];
if (myType == "all") {
if (aCard[myField]) {
......@@ -1414,6 +1423,7 @@ if ("undefined" == typeof(cardbookUtils)) {
}
}
}
}
} else if (aField == "age") {
result.push(cardbookDates.getAge(aCard));
} else if (aField == "ABName") {
......
......@@ -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] = temp;
wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
}
},
......@@ -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] = temp;
wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
}
},
......@@ -757,7 +755,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
}
wdw_cardbookConfiguration.allOrg.push(myArgs.type);
wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
}
},
......@@ -784,7 +781,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
}
}
wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
}
}
},
......@@ -801,7 +797,6 @@ if ("undefined" == typeof(wdw_cardbookConfiguration)) {
}
}
wdw_cardbookConfiguration.refreshListBoxOrg();
wdw_cardbookConfiguration.loadFnFormula();
}
},
......
......@@ -101,7 +101,7 @@ if ("undefined" == typeof(ovl_synchro)) {
prefs.setCharPref("accountsShown", "all");
prefs.setCharPref("accountShown", "");
prefs.setCharPref("uncategorizedCards", "");
prefs.setCharPref("addonVersion", "34.2");
prefs.setCharPref("addonVersion", "34.3");
prefs.setCharPref("defaultRegion", "NOTSET");
prefs.setBoolPref("localDataEncryption", false);
......
......@@ -106,6 +106,15 @@ if ("undefined" == typeof(wdw_cardbook)) {
var myTreecols = document.getElementById('cardsTreecols');
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;
for (var i = 0; i < myColumns.length; i++) {
var myCode = myColumns[i][0];
......@@ -2292,7 +2301,7 @@ if ("undefined" == typeof(wdw_cardbook)) {
if (!myDirPrefIds[myCard.dirPrefId]) {
var myNewList = new cardbookCardParser();
myNewList.dirPrefId = myCard.dirPrefId;
myNewList.uid = cardbookUtils.getUUID();
cardbookUtils.setCardUUID(myNewList);
myNewList.version = cardbookPreferences.getVCardVersion(myCard.dirPrefId);
myNewList.fn = aCategoryName;
myDirPrefIds[myCard.dirPrefId] = {};
......
......@@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>cardbook@vigneau.philippe</em:id>
<em:name>CardBook</em:name>
<em:version>34.2</em:version>
<em:version>34.3</em:version>
<em:type>2</em:type>
<em:description>vCard Address Book</em:description>
<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