Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #41 from cbonnissent/1.6.7

1.6.7 (closes #3880, closes #3863, closes #3864)
  • Loading branch information...
commit 2c45fffe1252d02b57340e8ef94b1af9ec7382f7 2 parents a9786c7 + 2cad9cb
@Eric-Brison Eric-Brison authored
View
2  VERSION
@@ -1 +1 @@
-1.6.6
+1.6.7
View
18 chrome/dcpOffline/content/bindings/system/dcpoffline-system-look.css
@@ -57,7 +57,7 @@ dcpDocHeader {
}
.document-state {
- font-size: 1.5em
+ font-size: 1.5em;
font-weight: normal;
}
@@ -111,7 +111,7 @@ dcpAttribute[type=longtext] textarea{
}
dcpRow{
- display: -moz-grid-line
+ display: -moz-grid-line;
}
dcpArrayRowTools,
@@ -159,16 +159,16 @@ dcpAttribute[type=htmltext] a{
.dcpImage {
max-width:100px;
-
+
}
-.dcpValue {
+.dcpValue {
-moz-box-flex: 1;
}
.dcpIcon {
width:16px;
- height:16px;
+ height:16px;
}
dcpAttribute[type=docid] image {
width:20px;
@@ -179,13 +179,13 @@ dcpAttribute[type=array] grid {
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: -moz-use-text-color;
-
+
-moz-border-image: none;
-moz-border-top-colors: threedshadow threeddarkshadow;
-moz-border-right-colors: threedhighlight threedlightshadow;
-moz-border-bottom-colors: threedhighlight threedlightshadow;
-moz-border-left-colors: threedshadow threeddarkshadow;
-
+
background-color: -moz-field;
color: -moz-fieldtext;
}
@@ -194,13 +194,13 @@ dcpRow{
border-bottom-width: 2px;
border-bottom-style: solid;
border-bottom-color: -moz-use-text-color;
-
+
-moz-border-image: none;
-moz-border-top-colors: threedshadow threeddarkshadow;
-moz-border-right-colors: threedhighlight threedlightshadow;
-moz-border-bottom-colors: threedhighlight threedlightshadow;
-moz-border-left-colors: threedshadow threeddarkshadow;
-
+
background-color: -moz-field;
color: -moz-fieldtext;
}
View
21 chrome/dcpOffline/content/main.js
@@ -547,6 +547,11 @@ function openDocument(config) {
doc = docManager.getLocalDocument({
initid : config.documentId
});
+ if (!doc) {
+ // This is not a real document
+ logIHM("Try to open a non known document "+config.documentId);
+ return;
+ }
template = doc.getBinding(mode);
if (template) {
template = 'url("' + template + '")';
@@ -707,18 +712,20 @@ function updateOpenDocumentList() {
*/
function addDocumentToOpenList(config) {
logIHM("addDocumentToOpenList");
- var currentDocs = {};
+ var currentDocument, currentDocs = {};
if (config && config.documentId) {
if (getListOfOpenDocuments()) {
currentDocs = getListOfOpenDocuments();
}
- var title = docManager.getLocalDocument({
+ currentDocument = docManager.getLocalDocument({
initid : config.documentId
- }).getTitle();
- currentDocs[config.documentId] = {
- title : title,
- mode : config.mode
- };
+ });
+ if (currentDocument) {
+ currentDocs[config.documentId] = {
+ title : currentDocument.getTitle(),
+ mode : config.mode
+ };
+ }
Preferences.set("offline.user." + getCurrentDomain()
+ ".currentListOfOpenDocuments", JSON.stringify(currentDocs));
applicationEvent.publish("postUpdateListOfOpenDocumentsPreference");
View
2  chrome/dcpOffline/locale/en_US/bindings/leaf-attributes-binding.dtd
@@ -3,4 +3,4 @@
<!ENTITY attribute.image.button.modify "Modify">
<!ENTITY attribute.image.button.delete "Delete">
<!ENTITY attribute.enum.multiple.button.clear.selection "Clean">
-<!ENTITY attribute.docid.noDocumentSet "Value not set">
+<!ENTITY attribute.docid.noDocumentSet "">
View
2  chrome/dcpOffline/locale/fr_FR/bindings/leaf-attributes-binding.dtd
@@ -3,5 +3,5 @@
<!ENTITY attribute.image.button.modify "Modifier">
<!ENTITY attribute.image.button.delete "Supprimer">
<!ENTITY attribute.enum.multiple.button.clear.selection "Effacer la sélection">
-<!ENTITY attribute.docid.noDocumentSet "Valeur non saisie">
+<!ENTITY attribute.docid.noDocumentSet "">
View
66 chrome/dcpOffline/modules/localDocument.jsm
@@ -85,14 +85,14 @@ localDocument.prototype = {
this.setValue(aid, config.values[aid]);
}
}
-
+
var r = storageManager.execQuery({
query : 'select name from families where famid=:famId',
params : {
famId : config.fromid
}
});
-
+
if (r.length == 1) {
this.properties.fromname = r[0].name;
} else {
@@ -105,9 +105,10 @@ localDocument.prototype = {
},
getValue : function(id, index) {
+ var value;
if (id) {
if( (index === undefined) || (index === -1) ){
- var value = this.values[id];
+ value = this.values[id];
if(value === undefined){
value = '';
}
@@ -118,7 +119,7 @@ localDocument.prototype = {
}
var arrayValue = this.getValue(id);
if( Array.isArray(arrayValue) ){
- var value = arrayValue[index];
+ value = arrayValue[index];
if(value === undefined){
value = '';
}
@@ -133,14 +134,15 @@ localDocument.prototype = {
}
},
getTitle : function() {
- return this.properties.title;
+ return this.properties.title || '';
},
getProperty : function(id) {
if (id) {
- if (this.properties) return this.properties[id];
+ if (this.properties && this.properties[id]) {
+ return this.properties[id];
+ }
return null;
} else {
- // FIXME
throw new ArgException("getValue :: missing arguments");
}
},
@@ -166,7 +168,7 @@ localDocument.prototype = {
}
return _propertyNames;
},
-
+
getPullExtraData : function () {
return this.getProperty('pullextradata');
},
@@ -180,7 +182,9 @@ localDocument.prototype = {
* @returns {localDocument}
*/
setPushExtraData : function (key,value) {
- if (this.properties.pushextradata == null) this.properties.pushextradata={};
+ if (this.properties.pushextradata === null) {
+ this.properties.pushextradata={};
+ }
this.properties.pushextradata[key]=value;
return this;
},
@@ -227,15 +231,15 @@ localDocument.prototype = {
this._dirty = true;
return this;
},
-
+
save : function(config) {
if (this.inMemoryDoc){
throw "This is an inMemoryDoc. You must store it before saving";
- };
+ }
if (this.canEdit() || (config && config.force)) {
var now = new Date();
if ((!config) || (! config.noModificationDate)) {
- this.properties.revdate = parseInt(now.getTime() / 1000);
+ this.properties.revdate = parseInt(now.getTime() / 1000, 10);
this.properties.mdate = utils.toIso8601(now, true);
}
var saveConfig = {
@@ -272,7 +276,7 @@ localDocument.prototype = {
}
return this;
},
-
+
store: function(config){
try{
if (config && config.recomputeTitle) {
@@ -311,7 +315,7 @@ localDocument.prototype = {
lastsavelocal:new Date().toISOString()
}
});
-
+
//says the doc has been saved in DB
this.inMemoryDoc = false;
this.save(config);
@@ -321,7 +325,7 @@ localDocument.prototype = {
throw(e);
}
},
-
+
/*
* Check if the document has been modified and not saved
*/
@@ -373,7 +377,7 @@ localDocument.prototype = {
}
return this._modified;
},
-
+
/**
* @return boolean true if can
*/
@@ -389,7 +393,7 @@ localDocument.prototype = {
if (!this.domainId) {
throw new ArgException("canEdit :: missing arguments");
}
-
+
var r = storageManager
.execQuery({
query : 'select docsbydomain.editable from documents, docsbydomain where docsbydomain.initid = documents.initid and docsbydomain.domainid=:domainid and docsbydomain.initid=:initid',
@@ -398,11 +402,11 @@ localDocument.prototype = {
initid : this._initid
}
});
-
+
if (r.length == 1) {
return (r[0].editable == 1);
}
-
+
return false;
},
/**
@@ -410,7 +414,7 @@ localDocument.prototype = {
* @returns {Boolean}
*/
isLocked: function() {
-
+
if(this.isOnlyLocal()){
//non syncronized documents are editable
return false;
@@ -418,7 +422,7 @@ localDocument.prototype = {
if (!this.domainId) {
throw new ArgException("isLocked :: missing arguments");
}
-
+
var r = storageManager
.execQuery({
query : 'select docsbydomain.editable from documents, docsbydomain where docsbydomain.initid = documents.initid and docsbydomain.domainid=:domainid and docsbydomain.initid=:initid',
@@ -427,14 +431,14 @@ localDocument.prototype = {
initid : this._initid
}
});
-
+
if (r.length == 1) {
return (r[0].editable == 1);
}
-
+
return false;
},
-
+
/**
* @deprecated
* @param id
@@ -449,7 +453,7 @@ localDocument.prototype = {
throw new ArgException("getDisplayValue :: missing arguments");
}
},
-
+
/**
* @param string
* mode view|edit
@@ -460,10 +464,10 @@ localDocument.prototype = {
var file= Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile);
file.append('Bindings');
file.append(famName+'.xml');
-
+
Components.utils.import("resource://modules/formater.jsm");
var fileURI = formater.getURI({file: file});
-
+
if(file.exists()){
return fileURI.spec+'#document-'+famName+'-'+mode;
} else {
@@ -487,7 +491,7 @@ localDocument.prototype = {
famname : famName
}
});
-
+
if (r.length > 0) {
return r[0].icon;
}
@@ -515,7 +519,7 @@ localDocument.prototype = {
* @param string attrid
*/
getRowNumber: function (attrid) {
-
+
},
/**
* test if document has been localy created and never synchronized
@@ -625,7 +629,7 @@ localDocument.prototype = {
oldDate = new Date(Date.parse(oldDate));
if (newDate > oldDate) {
that.properties.mdate = utils.toIso8601(newDate, true);
- that.properties.revdate = parseInt(newDate.getTime() / 1000);
+ that.properties.revdate = parseInt(newDate.getTime() / 1000, 10);
storageManager.execQuery({
query : 'UPDATE synchrotimes'
+ ' SET lastsavelocal=:lastsavelocal'
@@ -641,7 +645,7 @@ localDocument.prototype = {
+ ' WHERE initid=:initid',
params : {
mdate : utils.toIso8601(newDate, true),
- revdate : parseInt(newDate.getTime() / 1000),
+ revdate : parseInt(newDate.getTime() / 1000, 10),
initid : that._initid
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.