Reportistica Ore 2

This commit is contained in:
Paolo Arena
2021-02-24 04:48:31 +01:00
parent 14a3292da2
commit 39c08afb95
13 changed files with 427 additions and 56 deletions

View File

@@ -131,6 +131,9 @@ var ProjectSchema = new mongoose.Schema({
privacywrite: {
type: String
},
tipovisu: {
type: Number,
},
deleted: {
type: Boolean,
default: false,
@@ -178,6 +181,37 @@ ProjectSchema.statics.findProjectByUserId = function (userId, idproj) {
}
};
ProjectSchema.statics.findColorsByProject = async function (idproj) {
const Project = this;
let finito = false;
let idparent = idproj;
let colori = {};
while (!finito) {
let rec = await Project.findOne({ '_id': idparent });
if (!rec)
break;
if (rec) {
colori.themebgcolor = rec.themebgcolor;
colori.themecolor = rec.themecolor
}
if (!rec.themebgcolor && !rec.themecolor) {
// Cerca nel progetto ereditato
idparent = rec.id_parent
} else {
break;
}
}
return colori;
};
ProjectSchema.statics.findAllProjByUserId = async function (userId, idapp) {
var Project = this;