- gestione dell'editor delle pagine (non funzionante!)

This commit is contained in:
Surya Paolo
2025-09-08 20:42:42 +02:00
parent 03c2bcb78e
commit d00e086646
2 changed files with 139 additions and 119 deletions

View File

@@ -140,9 +140,6 @@ const MyPageSchema = new Schema({
showFooter: {
type: Boolean,
},
mainMenu: {
type: Boolean,
},
sottoMenu: [{
type: String
}],
@@ -221,7 +218,6 @@ MyPageSchema.statics.findOnlyStruttRec = async function (idapp) {
iconsize: 1,
extraclass: 1,
loadFirst: 1,
mainMenu: 1,
sottoMenu: 1,
}).lean();

View File

@@ -61,7 +61,6 @@ module.exports = {
OPTIONS_SEARCH_USER_ALL_WORDS: 4,
OPTIONS_ADD_COUNT_FAVORITE: 8,
PROD: {
GAS: 1,
BOTTEGA: 2,
@@ -145,12 +144,7 @@ module.exports = {
TablePickup: ['countries', 'phones'],
PaymentTypes: [
'Nessuno',
'Bonifico Bancario',
'Paypal',
'In Contanti alla CNM',
],
PaymentTypes: ['Nessuno', 'Bonifico Bancario', 'Paypal', 'In Contanti alla CNM'],
PARAM_SHOW_PROVINCE: 1,
@@ -166,13 +160,15 @@ module.exports = {
TABLES_LISTA_EDITORI: 'lista_editori',
TABLES_RACCOLTACATALOGHIS: 'raccoltacataloghis',
MYTABS: [{ id: 0, table: 'none' },
{ id: 1, table: this.TABLES_MYSKILLS },
{ id: 2, table: 'mybachecas' },
{ id: 3, table: 'myhosps' },
{ id: 4, table: 'mygoods' },
{ id: 5, table: 'myevents' },
{ id: 6, table: 'attivitas' }],
MYTABS: [
{ id: 0, table: 'none' },
{ id: 1, table: this.TABLES_MYSKILLS },
{ id: 2, table: 'mybachecas' },
{ id: 3, table: 'myhosps' },
{ id: 4, table: 'mygoods' },
{ id: 5, table: 'myevents' },
{ id: 6, table: 'attivitas' },
],
CMD_REACTION: {
SET_FAVORITE: 1,
@@ -181,8 +177,7 @@ module.exports = {
SET_ATTEND: 4,
},
REACTIONS_FIELD:
{
REACTIONS_FIELD: {
numseen: 1,
numbook: 1,
numfav: 1,
@@ -198,25 +193,41 @@ module.exports = {
// Condivise
TABLES_FAVORITE_BOOKMARK: ['myskills', 'mygoods', 'mybachecas', 'myhosps', 'attivitas'],
TABLEFORUSERS: [
'myskills',
'mygoods',
'mybachecas',
'myhosps',
],
TABLEFORUSERS: ['myskills', 'mygoods', 'mybachecas', 'myhosps'],
// Solo per NODEJS
TABLES_ENABLE_GETREC_BYID: ['mybachecas', 'myhosps', 'myskills', 'mygoods', 'attivitas'],
TABLES_ENABLE_GETREC_BYID: [
'mybachecas',
'myhosps',
'myskills',
'mygoods',
'attivitas',
],
TABLES_USER_INCLUDE_MY: ['mygroups', 'circuits'],
TABLES_GETCOMPLETEREC: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'attivitas'],
//++Todo: per abilitare gli utenti ad inserire un Circuito aggiungere 'circuits' alla lista TABLES_PERM_NEWREC
TABLES_PERM_NEWREC: ['skills', 'goods', 'subskills', 'mygroups', 'myhosps', 'catalogs', 'raccoltacataloghis'],
TABLES_PERM_NEWREC: [
'skills',
'goods',
'subskills',
'mygroups',
'myhosps',
'catalogs',
'raccoltacataloghis',
],
TABLES_REACTIONS: ['mybachecas', 'myhosps', 'myskills', 'mygoods', 'attivitas'],
TABLES_VISU_STAT_IN_HOME: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups', 'circuits'],
TABLES_VISU_STAT_IN_HOME: [
'myskills',
'mybachecas',
'myhosps',
'mygoods',
'mygroups',
'circuits',
],
TABLES_ADV_NOTIFICATION: ['myskills', 'myhosps', 'mygoods'],
TABLES_ORDER_DATE_UPDATED: ['myskills', 'myhosps', 'mygoods'],
@@ -229,12 +240,7 @@ module.exports = {
TABLES_NUM_AS_ID_NUMBER: [],
TABLES_ID_STRING: [
'circuits',
'accounts',
'movements',
'mygroups',
],
TABLES_ID_STRING: ['circuits', 'accounts', 'movements', 'mygroups'],
TABLES_ID_NUMBER: [
'permissions',
@@ -258,13 +264,26 @@ module.exports = {
],
TABLES_USER_ID: ['mygroups', 'myskills', 'mybachecas', 'myhosps', 'mygoods'],
TABLES_CREATEDBY: ['mygroups', 'circuits', 'attivitas'],
TABLES_UPDATE_LASTMODIFIED: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'bots', 'mygroups', 'circuits', 'attivitas', 'myelems', 'mypages', 'products', 'catalogs', 'crons'],
TABLES_UPDATE_LASTMODIFIED: [
'myskills',
'mybachecas',
'myhosps',
'mygoods',
'bots',
'mygroups',
'circuits',
'attivitas',
'myelems',
'mypages',
'products',
'catalogs',
'crons',
],
TABLES_FIELDS_DESCR_AND_CITY_AND_USER: ['myskills', 'mybachecas', 'myhosps', 'mygoods'],
TABLES_PERM_CHANGE_FOR_USERS: ['myskills', 'mybachecas', 'myhosps', 'mygoods'],
TABLES_POPULATE_DATA: [
{
table: 'adtypegoods',
@@ -296,7 +315,6 @@ module.exports = {
// { table: 'queryais', key: 'descr' },
],
VISIB_ALL: 0,
VISIB_ONLYIF_VERIFIED: 1,
VISIB_ONLY_MANAGER: 2,
@@ -307,7 +325,6 @@ module.exports = {
MULT_FIDO_GROUP: 2.0,
},
Visibility_Group: {
PRIVATE: 1,
HIDDEN: 2,
@@ -330,7 +347,6 @@ module.exports = {
Outcoming: 2,
},
Cmd: {
PROVINCE: 1,
COMUNI: 2,
@@ -465,7 +481,6 @@ module.exports = {
},
],
CallFunz: {
SOSTITUISCI: 345,
AGGIUNGI_NUOVO_IMBARCO: 380,
@@ -483,15 +498,14 @@ module.exports = {
ENTRA_RIS_ITALIA: 30,
},
OrderStatus: {
NONE: 0,
IN_CART: 1,
CHECKOUT_SENT: 2,
ORDER_CONFIRMED: 3,
PAYED: 4,
DELIVERED: 5, // Consegnato
SHIPPED: 6, //Spedito
DELIVERED: 5, // Consegnato
SHIPPED: 6, //Spedito
RECEIVED: 7,
CANCELED: 10,
PREPARED: 15,
@@ -501,14 +515,39 @@ module.exports = {
OrderStat: {
// IN_CART: { label: 'In Carrello', value: 1 }, //IN_CART
IN_CORSO: { label: 'In Corso', value: 2, icon: 'fas fa-tasks', color: 'text-black' }, //CHECKOUT_SENT
CONFERMATI: { label: 'Confermati', value: 3, icon: 'fas fa-calendar', color: 'text-blue' }, //ORDER_CONFIRMED
PAGATI: { label: 'Pagati', value: 4, icon: 'money', color: 'text-green' }, //PAYED
DELIVERED: { label: 'Consegnato', value: 5, icon: 'fas fa-calendar', color: 'text-blue' }, //DELIVERED
SHIPPED: { label: 'Spediti', value: 6, icon: 'fas fa-shipping-fast', color: 'text-green' }, //SHIPPED
CONFERMATI: {
label: 'Confermati',
value: 3,
icon: 'fas fa-calendar',
color: 'text-blue',
}, //ORDER_CONFIRMED
PAGATI: { label: 'Pagati', value: 4, icon: 'money', color: 'text-green' }, //PAYED
DELIVERED: {
label: 'Consegnato',
value: 5,
icon: 'fas fa-calendar',
color: 'text-blue',
}, //DELIVERED
SHIPPED: {
label: 'Spediti',
value: 6,
icon: 'fas fa-shipping-fast',
color: 'text-green',
}, //SHIPPED
RECEIVED: { label: 'Ricevuti', value: 7, icon: '', color: 'text-blue' }, //RECEIVED
COMPLETATI: { label: 'Completati', value: 8, icon: 'fas fa-check', color: 'text-blue' }, //COMPLETED
COMPLETATI: {
label: 'Completati',
value: 8,
icon: 'fas fa-check',
color: 'text-blue',
}, //COMPLETED
CANCELLATI: { label: 'Cancellati', value: 10, icon: 'delete', color: 'text-red' }, //CANCELED
PREPARED: { label: 'Preparati', value: 15, icon: 'fas fa-archive', color: 'text-blue' },
PREPARED: {
label: 'Preparati',
value: 15,
icon: 'fas fa-archive',
color: 'text-blue',
},
},
OrderStatusStr: [
@@ -552,7 +591,6 @@ module.exports = {
label: 'Cancellato',
value: 10,
},
],
ConfSite: {
@@ -692,7 +730,6 @@ module.exports = {
ID_TEST_NEW_REC: 1,
},
// Tipi di Notifiche:
/*
Notif: {
@@ -714,7 +751,6 @@ module.exports = {
*/
fieldsUserToChange() {
return [
'_id',
@@ -741,37 +777,38 @@ module.exports = {
'old_order',
'numinvitati',
'numinvitatiattivi',
'qualified'];
'qualified',
];
},
DEFAULT_NOTIFS_USER: [
{
'dir': 1,
'value': 88
dir: 1,
value: 88,
},
{
'dir': 2,
'value': 4
dir: 2,
value: 4,
},
{
'dir': 3,
'value': 1
dir: 3,
value: 1,
},
{
'dir': 4,
'value': 1
dir: 4,
value: 1,
},
{
'dir': 5,
'value': 1
dir: 5,
value: 1,
},
{
'dir': 11,
'value': 1
dir: 11,
value: 1,
},
{
'dir': 12,
'value': 1
dir: 12,
value: 1,
},
],
@@ -795,19 +832,18 @@ module.exports = {
},
getProjectByTable(table, proj_add) {
let proj = {}
let proj = {};
if (table === this.TABLES_MYGOODS) {
proj = {
'recGood': 1,
'sectorGood': 1,
'idSectorGood': 1,
'idGood': 1,
'idShipping': 1,
'idStatusGood': 1,
recGood: 1,
sectorGood: 1,
idSectorGood: 1,
idGood: 1,
idShipping: 1,
idStatusGood: 1,
//**ADDFIELD_MYGOOD
}
};
} else if (table === this.TABLES_MYGROUPS) {
proj = {
groupname: 1,
@@ -830,7 +866,7 @@ module.exports = {
recCatGrp: 1,
mycircuits: 1,
lastdate_reqRisGroup: 1,
}
};
} else if (table === this.TABLES_CIRCUITS) {
proj = {
_id: 1,
@@ -877,9 +913,9 @@ module.exports = {
admins: 1,
req_users: 1,
refused_users: 1,
'mycities': 1,
mycities: 1,
//**ADDFIELD_CIRCUITS
}
};
} else if (table === this.TABLES_MYSKILLS) {
proj = {
recSkill: 1,
@@ -895,8 +931,7 @@ module.exports = {
note: 1,
website: 1,
//**ADDFIELD_MYSKILL
}
};
} else if (table === this.TABLES_MYHOSPS) {
proj = {
visibile: 1,
@@ -911,8 +946,7 @@ module.exports = {
note: 1,
website: 1,
link_maplocation: 1,
}
};
} else if (table === this.TABLES_ATTIVITAS) {
proj = {
recSkill: 1,
@@ -937,7 +971,6 @@ module.exports = {
createdBy: 1,
//**ADDFIELD_ATTIVITA
};
} else if (table === this.TABLES_MYBACHECAS) {
proj = {
recSkill: 1,
@@ -960,19 +993,18 @@ module.exports = {
contribstr: 1,
link_maplocation: 1,
//**ADDFIELD_MYBACHECAS
}
};
}
const proj_common = {
'mygrp.groupname': 1,
'mygrp.title': 1,
'mygrp.photos': 1,
}
};
proj = Object.assign({}, proj, proj_common);
if (proj_add)
proj = Object.assign({}, proj, proj_add);
if (proj_add) proj = Object.assign({}, proj, proj_add);
return proj;
},
@@ -1024,8 +1056,7 @@ module.exports = {
perm: 1,
};
if (proj_add)
proj = Object.assign({}, proj, proj_add);
if (proj_add) proj = Object.assign({}, proj, proj_add);
proj = { ...proj, ...this.REACTIONS_FIELD };
proj = { ...proj, ...this.ANNUNCI_FIELDS };
@@ -1040,30 +1071,29 @@ module.exports = {
getDirectoryByTable(table, barre = false) {
let add = '';
if (barre)
add = '/';
if (barre) add = '/';
if (table === 'myskills') {
return add + 'myservice' + add
return add + 'myservice' + add;
} else if (table === 'mybachecas') {
return add + 'mypage' + add
return add + 'mypage' + add;
} else if (table === 'myhosps') {
return add + 'myhosps' + add
return add + 'myhosps' + add;
} else if (table === 'mygoods') {
return add + 'mygood' + add
return add + 'mygood' + add;
} else if (table === 'mygroups') {
return add + 'grp' + add
return add + 'grp' + add;
} else if (table === 'circuits') {
return add + 'circuit' + add
return add + 'circuit' + add;
} else if (table === 'catalogs') {
return add + 'catalogs' + add
return add + 'catalogs' + add;
}
return ''
return '';
},
getStatusStr(status) {
const trovatorec = this.OrderStatusStr.find((rec) => rec.value === status)
return (trovatorec) ? trovatorec.label : ''
const trovatorec = this.OrderStatusStr.find((rec) => rec.value === status);
return trovatorec ? trovatorec.label : '';
},
getDirectoryImgByTable(table, username) {
@@ -1072,7 +1102,6 @@ module.exports = {
}
return ris;
},
ButtonCodeAction: {
@@ -1080,19 +1109,12 @@ module.exports = {
NEXT_10: 1,
},
CAMPI_PRODUCTINFO_CONVERT: [
'weight_and_unit',
'weight_and_unit_lordo',
],
CAMPI_PRODUCTINFO_CONVERT: ['weight_and_unit', 'weight_and_unit_lordo'],
CAMPI_PRODUCTINFO_RICOPIA_DATI: [
'old_code',
],
CAMPI_PRODUCTINFO_RICOPIA_DATI: ['old_code'],
PRODUCTINFO: {
CAMPI_FIRST_UPPERCASE: [
'name',
],
CAMPI_FIRST_UPPERCASE: ['name'],
},
CAMPI_TYPE: {
@@ -1147,10 +1169,7 @@ module.exports = {
'sconto2',
],
CAMPI_EURO: [
'price',
'price_acquistato',
],
CAMPI_EURO: ['price', 'price_acquistato'],
MAX_QTA_PREORD: 5000,
MAX_QTA_NON_IMPOSTATA: -1,
@@ -1243,6 +1262,7 @@ module.exports = {
IMAGEUPLOAD: 35,
SEPARATOR: 40,
VIDEO: 50,
VIDEO_YOUTUBE: 52,
PAGE: 55,
PAGEINTRO: 58,
CALENDAR: 70,
@@ -1295,6 +1315,10 @@ module.exports = {
SECTION: 1000,
ROW: 1100,
COLUMN: 1200,
IMAGE_GALLERY: 101,
HEADING: 102,
LIST: 103,
CODE: 104,
DIVIDER: 105,
},
};