- Sistemato i Referenti (e non Editori), quando crei un nuovo Catalogo ti imposta la proprietà a te, ma chiunque Collaboratore potrebbe cmq modificartelo.
This commit is contained in:
@@ -984,7 +984,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
async cloneCatalog(idapp, idOrig, newName, idPageAssigned) {
|
||||
async cloneCatalog(idapp, idOrig, newName, idPageAssigned, referenti) {
|
||||
try {
|
||||
// Recupera il catalogo originale
|
||||
const mycatalog = await Catalog.findOne({ idapp, _id: idOrig }).lean();
|
||||
@@ -1014,6 +1014,7 @@ module.exports = {
|
||||
pagina_introduttiva_sfondo_nero: mycatalog.pagina_introduttiva_sfondo_nero,
|
||||
backcolor: mycatalog.backcolor,
|
||||
idPageAssigned: idPageAssigned,
|
||||
referenti,
|
||||
};
|
||||
|
||||
const mydirpath = tools.getdirByIdApp(idapp);
|
||||
@@ -1034,7 +1035,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
async newEmptyCatalog(idapp, newName, idPageAssigned) {
|
||||
async newEmptyCatalog(idapp, newName, idPageAssigned, referenti) {
|
||||
try {
|
||||
|
||||
const clonedCatalog = {
|
||||
@@ -1042,6 +1043,7 @@ module.exports = {
|
||||
active: true,
|
||||
title: newName,
|
||||
idPageAssigned: idPageAssigned,
|
||||
referenti,
|
||||
};
|
||||
|
||||
// Salva la pagina
|
||||
@@ -1126,7 +1128,7 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
async addNewCatalog(idapp, newCatalog) {
|
||||
async addNewCatalog(idapp, newCatalog, username) {
|
||||
try {
|
||||
if (newCatalog) {
|
||||
const myNewrecs = await this.duplicatePage(newCatalog.idPageTemplate, newCatalog.path, newCatalog.title);
|
||||
@@ -1144,13 +1146,15 @@ module.exports = {
|
||||
idapp,
|
||||
newCatalog.idCatalogToCopy,
|
||||
newCatalog.title,
|
||||
myNewrecs?.newPage._id
|
||||
myNewrecs?.newPage._id,
|
||||
[username],
|
||||
);
|
||||
} else {
|
||||
mynewCatalog = await this.newEmptyCatalog(
|
||||
idapp,
|
||||
newCatalog.title,
|
||||
myNewrecs?.newPage._id
|
||||
myNewrecs?.newPage._id,
|
||||
[username],
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user