- aggiornato la versione STAMPA, che non funzionava
This commit is contained in:
@@ -484,7 +484,7 @@ MyElemSchema.statics.findallSchedeTemplate = async function (idapp) {
|
|||||||
|
|
||||||
if (resultWithTitles.length > 0) {
|
if (resultWithTitles.length > 0) {
|
||||||
console.log('Duplicati e titoli delle pagine:', JSON.stringify(resultWithTitles, null, 2));
|
console.log('Duplicati e titoli delle pagine:', JSON.stringify(resultWithTitles, null, 2));
|
||||||
await deleteOldMyElems(idapp);
|
// await deleteOldMyElems(idapp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ const MyPageSchema = new Schema({
|
|||||||
only_admin: {
|
only_admin: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
|
only_collab: {
|
||||||
|
type: Boolean,
|
||||||
|
},
|
||||||
color: {
|
color: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
@@ -211,6 +214,7 @@ MyPageSchema.statics.findOnlyStruttRec = async function (idapp) {
|
|||||||
isTemplate: 1,
|
isTemplate: 1,
|
||||||
only_residenti: 1,
|
only_residenti: 1,
|
||||||
only_admin: 1,
|
only_admin: 1,
|
||||||
|
only_collab: 1,
|
||||||
inmenu: 1,
|
inmenu: 1,
|
||||||
submenu: 1,
|
submenu: 1,
|
||||||
iconsize: 1,
|
iconsize: 1,
|
||||||
@@ -239,6 +243,7 @@ MyPageSchema.statics.findInternalPages = async function (idapp) {
|
|||||||
onlyif_logged: 1,
|
onlyif_logged: 1,
|
||||||
only_residenti: 1,
|
only_residenti: 1,
|
||||||
only_admin: 1,
|
only_admin: 1,
|
||||||
|
only_collab: 1,
|
||||||
}).lean();
|
}).lean();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -701,6 +701,7 @@ router.post('/join-pdf', authenticate, async (req, res) => {
|
|||||||
options.mydir = tools.getdirByIdApp(idapp);
|
options.mydir = tools.getdirByIdApp(idapp);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const mydirpath = tools.getdirByIdApp(options.idapp);
|
const mydirpath = tools.getdirByIdApp(options.idapp);
|
||||||
const full_dir_out = tools.fixFilePath(path.join(mydirpath, options.dir_out));
|
const full_dir_out = tools.fixFilePath(path.join(mydirpath, options.dir_out));
|
||||||
await fs.promises.mkdir(full_dir_out, { recursive: true });
|
await fs.promises.mkdir(full_dir_out, { recursive: true });
|
||||||
@@ -752,7 +753,7 @@ router.post('/join-pdf', authenticate, async (req, res) => {
|
|||||||
if (options.stampa) {
|
if (options.stampa) {
|
||||||
raccolta.pdf_online_stampa_size = size;
|
raccolta.pdf_online_stampa_size = size;
|
||||||
} else {
|
} else {
|
||||||
raccolta.pdf_online = size;
|
raccolta.pdf_online_size = size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -764,7 +765,7 @@ router.post('/join-pdf', authenticate, async (req, res) => {
|
|||||||
// risout
|
// risout
|
||||||
|
|
||||||
return res.status(200).send(risout);
|
return res.status(200).send(risout);
|
||||||
} catch (e) {
|
} catch (e) {5
|
||||||
console.error('Err join-pdf', e.message);
|
console.error('Err join-pdf', e.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1016,7 +1016,7 @@ async function importPage(req, idapp, jsonString) {
|
|||||||
const table = globalTables.getTableByTableName(tableName);
|
const table = globalTables.getTableByTableName(tableName);
|
||||||
|
|
||||||
if (tableName === 'mypages') {
|
if (tableName === 'mypages') {
|
||||||
if (User.isEditor(req.user.perm) || User.isCommerciale(req.user.perm)) {
|
if (User.isAdmin(req.user.perm) || User.isEditor(req.user.perm) || User.isCommerciale(req.user.perm) || User.isCollaboratore(req.user.perm)) {
|
||||||
for (const page of myexp.mypages) {
|
for (const page of myexp.mypages) {
|
||||||
const { ImportedRecords, newId } = await upsertRecord(table, page, idapp);
|
const { ImportedRecords, newId } = await upsertRecord(table, page, idapp);
|
||||||
if (!newIdPage && newId) {
|
if (!newIdPage && newId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user