added themecolor and themebgcolor to todos and projects
This commit is contained in:
@@ -71,6 +71,13 @@ var TodoSchema = new mongoose.Schema({
|
||||
hoursworked: {
|
||||
type: Number,
|
||||
},
|
||||
themecolor: {
|
||||
type: String,
|
||||
},
|
||||
themebgcolor: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
modified: {
|
||||
type: Boolean,
|
||||
},
|
||||
@@ -375,47 +382,55 @@ TodoSchema.statics.calculateTreeTodo = async function (actualphase, userId, idpr
|
||||
.then(() => {
|
||||
// console.log('objdata', objdata);
|
||||
// 2) Calculate the Todos of this project
|
||||
return Todo.calculateTodoHoursAndProgress(userId, idproj, myrecproj.actualphase);
|
||||
if (!!myrecproj)
|
||||
return Todo.calculateTodoHoursAndProgress(userId, idproj, myrecproj.actualphase);
|
||||
else
|
||||
return null
|
||||
})
|
||||
.then((objdatatodos) => {
|
||||
|
||||
if (myrecproj.actualphase === actualphase) {
|
||||
// console.log('objdatatodos', objdatatodos);
|
||||
objdata.addDataTodo(objdatatodos);
|
||||
if (!!objdatatodos) {
|
||||
if (!!myrecproj) {
|
||||
if (myrecproj.actualphase === actualphase) {
|
||||
// console.log('objdatatodos', objdatatodos);
|
||||
objdata.addDataTodo(objdatatodos);
|
||||
|
||||
// End Calculate
|
||||
objdata.endDataCalc();
|
||||
// End Calculate
|
||||
objdata.endDataCalc();
|
||||
|
||||
// Update into the DB:
|
||||
return Project.updateCalc(userId, idproj, objdata, null)
|
||||
.then((ris) => {
|
||||
if (ris)
|
||||
return objdata.getData();
|
||||
else
|
||||
return null;
|
||||
});
|
||||
} else {
|
||||
return null;
|
||||
// Update into the DB:
|
||||
return Project.updateCalc(userId, idproj, objdata, null)
|
||||
.then((ris) => {
|
||||
if (ris)
|
||||
return objdata.getData();
|
||||
else
|
||||
return null;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.then((ris) => {
|
||||
if (calcalsoUpper) {
|
||||
if (!!myrecproj.id_parent) {
|
||||
// Calculate also the upper Projects !
|
||||
return new Promise((resolve, reject) => {
|
||||
Todo.calculateTreeTodo(actualphase, userId, myrecproj.id_parent, true, masterproj, false);
|
||||
resolve(ris)
|
||||
});
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve()
|
||||
});
|
||||
if (!!myrecproj) {
|
||||
if (!!myrecproj.id_parent) {
|
||||
// Calculate also the upper Projects !
|
||||
return new Promise((resolve, reject) => {
|
||||
Todo.calculateTreeTodo(actualphase, userId, myrecproj.id_parent, true, masterproj, false);
|
||||
resolve(ris)
|
||||
});
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve()
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve()
|
||||
});
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve()
|
||||
});
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user