- Invia Ris a e Ricevi Ris

- Tutorial Guidato Passi da Compiere
- Provincia in cui vivi
- Policy aggiornata
This commit is contained in:
Surya Paolo
2023-03-11 01:01:11 +01:00
parent 6a4c270c91
commit e705594294
8 changed files with 390 additions and 65 deletions

View File

@@ -47,6 +47,10 @@ const CircuitSchema = new Schema({
{
type: Number,
}],
strProv:
{
type: String,
},
pub_to_share: {
type: Number, // PUB_TO_SHARE_ALL, PUB_TO_SHARE_ONLY_TABLE_FOLLOW
},
@@ -225,7 +229,7 @@ CircuitSchema.statics.findAllIdApp = async function (idapp) {
const whatToShow = this.getWhatToShow(idapp, '');
return await Circuit.find(myfind, whatToShow).sort({status: -1, numMembers: -1, name: 1});
return await Circuit.find(myfind, whatToShow).sort({ status: -1, numMembers: -1, name: 1 });
};
CircuitSchema.statics.getFieldsForSearch = function () {
@@ -271,6 +275,7 @@ CircuitSchema.statics.getWhatToShow = function (idapp, username) {
valuta_per_euro: 1,
symbol: 1,
idCity: 1,
strProv: 1,
pub_to_share: 1,
visibility: 1,
color: 1,
@@ -332,6 +337,7 @@ CircuitSchema.statics.getWhatToShow_Unknown = function (idapp, username) {
symbol: 1,
color: 1,
idCity: 1,
strProv: 1,
pub_to_share: 1,
visibility: 1,
abbrev: 1,
@@ -370,14 +376,14 @@ CircuitSchema.statics.getCircuitsByUsername = async function (idapp, username, u
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
}).sort({status: -1, numMembers: -1, name: 1}).lean();
}).sort({ status: -1, numMembers: -1, name: 1 }).lean();
let listcircuits = await Circuit.find({
idapp,
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
}, whatToShow_Unknown).sort({status: -1, numMembers: -1, name: 1}).lean();
}, whatToShow_Unknown).sort({ status: -1, numMembers: -1, name: 1 }).lean();
let asked_circuits = await Circuit.find({
idapp,
@@ -387,7 +393,7 @@ CircuitSchema.statics.getCircuitsByUsername = async function (idapp, username, u
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
}, whatToShow_Unknown).sort({status: -1}).lean();
}, whatToShow_Unknown).sort({ status: -1 }).lean();
let refused_circuits = await Circuit.find({
idapp,
@@ -397,7 +403,7 @@ CircuitSchema.statics.getCircuitsByUsername = async function (idapp, username, u
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
}, whatToShow_Unknown).sort({status: -1}).lean();
}, whatToShow_Unknown).sort({ status: -1 }).lean();
return {
listcircuits,
@@ -575,7 +581,7 @@ CircuitSchema.statics.getUsersSingleCircuit = async function (idapp, username, c
username: 1,
name: 1,
surname: 1,
profile: 1,
profile: 1,
idapp: 1 /*, 'circuit.name': 1, 'circuit._id': 1*/
},
@@ -687,7 +693,7 @@ CircuitSchema.statics.sendCoins = async function (onlycheck, idapp, usernameOrig
extrarec.saldoDest = accountdestTable.saldo;
let orig = usernameOrig + (extrarec.grouporig ? extrarec.grouporig : '') + (extrarec.contoComOrig ? extrarec.contoComOrig : '');
let dest = (extrarec.dest ? extrarec.dest : '') + (extrarec.groupDest ? extrarec.groupDest : '') + (extrarec.contoComDest ? extrarec.contoComDest : '');
let dest = (extrarec.dest ? extrarec.dest : '') + (extrarec.groupDest ? extrarec.groupDest : '') + (extrarec.contoComDest ? extrarec.contoComDest : '');
ris.result = true;
let msg = 'Inviate Monete da ' + orig + ' a ' + dest + ' ' + myqty + ' ' + circuittable.symbol + ' [causale: ' + extrarec.causal + `] [Saldo ${orig}: ` + extrarec.saldoOrig + ' ' + circuittable.symbol + '] ' + ` [Saldo ${dest}: ` + extrarec.saldoDest + ' ' + circuittable.symbol + ']';
@@ -835,6 +841,25 @@ CircuitSchema.statics.getListAdminsByCircuitPath = async function (idapp, circui
// Imposta a tutti i Conti Collettivi, i seguenti minimi e massimi
CircuitSchema.statics.setstrProvByIdCityCircuits = async function (idapp) {
const { City } = require('../models/city');
const arrcircuits = await Circuit.find({ idapp }).lean();
try {
for (const rec of arrcircuits) {
let recstrProv = await City.findOne({ _id: rec.idCity[0] });
if (recstrProv) {
let objProv = {}
objProv['strProv'] = recstrProv.prov;
await Circuit.updateOne({ _id: rec._id }, { $set: objProv });
}
}
} catch (e) {
}
};
CircuitSchema.statics.SetDefMinMaxCollettivi = async function (idapp, valmin, valmax) {
ris = await Circuit.updateMany({ idapp, contocom: { "$nin": [null, ""] } },

View File

@@ -117,6 +117,9 @@ const MyGroupSchema = new Schema({
circuitname: { type: String },
date: { type: Date },
}],
lastdate_reqRisGroup: {
type: Date,
},
});
MyGroupSchema.statics.getFieldsForSearch = function () {
@@ -223,14 +226,14 @@ MyGroupSchema.statics.removeAdminOfMyGroup = async function (idapp, username, gr
};
MyGroupSchema.statics.getListAdminsByGroupName = async function (idapp, groupname) {
let arr = await MyGroup.findOne({
idapp,
groupname,
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
}, {admins: 1}).lean();
}, { admins: 1 }).lean();
return arr && arr.admins ? arr.admins : [];
@@ -259,6 +262,7 @@ MyGroupSchema.statics.getWhatToShow = function (idapp, username) {
date_created: 1,
date_updated: 1,
mycircuits: 1,
lastdate_reqRisGroup: 1,
};
};
@@ -276,6 +280,7 @@ MyGroupSchema.statics.getWhatToShow_Unknown = function (idapp, username) {
date_created: 1,
date_updated: 1,
mycircuits: 1,
lastdate_reqRisGroup: 1,
};
};
@@ -496,10 +501,14 @@ MyGroupSchema.statics.ifCircuitAlreadyInGroup = async function (idapp, groupname
// aggiungo il Circuito all'interno del Gruppo
MyGroupSchema.statics.addCircuitFromGroup = async function (idapp, groupname, circuitname) {
return await this.updateOne({ idapp, groupname },
{ $push: { 'mycircuits': {
circuitname,
date: new Date(),
} } });
{
$push: {
'mycircuits': {
circuitname,
date: new Date(),
}
}
});
};
@@ -510,6 +519,117 @@ MyGroupSchema.statics.removeCircuitFromGroup = async function (idapp, groupname,
};
MyGroupSchema.statics.getQueryReceiveRISGroups = function (idapp, hours) {
const query = [
{
$match: {
idapp,
'lastdate_reqRisGroup': { $gte: tools.IncDateNow(-(1000 * 60 * 60 * hours)) },
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
},
},
{
$group:
{
_id: "$groupname",
count: {
$sum: 1,
},
}
},
{ $sort: { 'lastdate_reqRisGroup': -1 } },
{ $limit: 30 },
{
$lookup: {
from: "mygroups",
let: {
groupname: "$_id",
idapp,
},
pipeline: [
{
$match: {
$expr: {
$and: [
{
$eq: [
"$$groupname",
"$groupname",
],
},
{
$eq: [
"$$idapp",
"$idapp",
],
},
],
},
},
},
],
as: "mygroup",
},
},
{ $unwind: "$mygroup" },
{
$replaceRoot: {
newRoot: {
$mergeObjects: ["$mygroup", "$$ROOT"],
},
},
},
{
$project: {
_id: 0,
groupname: 1,
title: 1,
descr: 1,
visibility: 1,
idCatGrp: 1,
userId: 1,
photos: 1,
idCity: 1,
website: 1,
link_telegram: 1,
note: 1,
admins: 1,
blocked: 1,
req_users: 1,
createdBy: 1,
date_created: 1,
date_updated: 1,
lastdate_reqRisGroup: 1,
},
},
];
return query;
};
MyGroupSchema.statics.getReceiveRISGroups = async function (idapp) {
return await this.aggregate(this.getQueryReceiveRISGroups(idapp, 8)).then(ris => {
return ris;
});
};
MyGroupSchema.statics.setReceiveRisGroup = async function (idapp, groupname) {
return await this.findOneAndUpdate({
idapp, groupname,
},
{ $set: { 'lastdate_reqRisGroup': new Date() } }, { new: false }).lean().then((record) => {
return !!record;
});
};
const MyGroup = mongoose.model('MyGroup', MyGroupSchema);

View File

@@ -91,7 +91,7 @@ ProvinceSchema.statics.executeQueryPickup = async function(idapp, params) {
ProvinceSchema.statics.findAllIdApp = async function(idapp) {
const myfind = {};
return Province.find(myfind).sort({prov: 1});
return Province.find(myfind).sort({descr: 1});
};
const Province = mongoose.model('Province', ProvinceSchema);

View File

@@ -398,7 +398,12 @@ const UserSchema = new mongoose.Schema({
circuitname: { type: String },
date: { type: Date },
}],
last_circuitpath: {
type: String,
},
lastdate_reqRis: {
type: Date,
},
notifs: [
{
_id: false,
@@ -433,6 +438,12 @@ const UserSchema = new mongoose.Schema({
type: String,
trim: true,
},
stepTutorial: {
type: Number,
},
noNameSurname: {
type: Boolean,
}
},
});
@@ -3764,6 +3775,7 @@ UserSchema.statics.getLastOnlineUsers = async function (idapp) {
name: 1,
surname: 1,
lasttimeonline: 1,
date_reg: 1,
'profile.img': 1,
index: 1,
}).sort({ lasttimeonline: -1 }).limit(lastn).then((arr) => {
@@ -3790,6 +3802,7 @@ UserSchema.statics.getLastSharedLink = async function (idapp) {
name: 1,
surname: 1,
lasttimeonline: 1,
date_reg: 1,
'profile.img': 1,
index: 1,
}).sort({ date_tokenreg: -1 }).limit(lastn).then((arr) => {
@@ -3822,6 +3835,16 @@ UserSchema.statics.getBestStretteDiManoUsers = async function (idapp) {
};
UserSchema.statics.getReceiveRISUsers = async function (idapp) {
const User = this;
return await User.aggregate(User.getQueryReceiveRISUsers(idapp, 8)).then(ris => {
// console.table(ris);
return ris;
});
};
UserSchema.statics.checkUser = async function (idapp, username) {
const User = this;
@@ -4020,8 +4043,10 @@ UserSchema.statics.getQueryUsersDiffusori = function (idapp) {
name: 1,
surname: 1,
lasttimeonline: 1,
date_reg: 1,
idapp: 1,
"profile.img": 1,
'profile.mycircuits': 1,
},
},
];
@@ -4110,6 +4135,92 @@ UserSchema.statics.getQueryUsersStretteDiMano = function (idapp) {
name: 1,
surname: 1,
lasttimeonline: 1,
date_reg: 1,
idapp: 1,
"profile.img": 1,
'profile.handshake': 1,
'profile.mycircuits': 1,
},
},
];
return query;
};
UserSchema.statics.getQueryReceiveRISUsers = function (idapp, hours) {
const query = [
{
$match: {
idapp,
'profile.lastdate_reqRis': { $gte: tools.IncDateNow(-(1000 * 60 * 60 * hours)) },
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
},
},
{
$group:
{
_id: "$username",
count: {
$sum: 1,
},
}
},
{ $sort: { 'profile.lastdate_reqRis': -1 } },
{ $limit: 30 },
{
$lookup: {
from: "users",
let: {
username: "$_id",
idapp,
},
pipeline: [
{
$match: {
$expr: {
$and: [
{
$eq: [
"$$username",
"$username",
],
},
{
$eq: [
"$$idapp",
"$idapp",
],
},
],
},
},
},
],
as: "user",
},
},
{ $unwind: "$user" },
{
$replaceRoot: {
newRoot: {
$mergeObjects: ["$user", "$$ROOT"],
},
},
},
{
$project: {
_id: 0,
count: 1,
aportador_solidario: 1,
username: 1,
name: 1,
surname: 1,
lasttimeonline: 1,
'profile.lastdate_reqRis': 1,
'profile.mycircuits': 1,
date_reg: 1,
idapp: 1,
"profile.img": 1,
'profile.handshake': 1,
@@ -4184,7 +4295,7 @@ UserSchema.statics.getnumRegNDays = function (idapp, nrec) {
UserSchema.statics.calcnumRegUntilDay = async function (idapp) {
const User = this;
return await User.aggregate(User.getnumRegNDays(idapp, 30)).then((arr) => {
return await User.aggregate(User.getnumRegNDays(idapp, 60)).then((arr) => {
return arr.reduce((sum, rec) => sum + rec.count, 0);
});
@@ -4622,6 +4733,27 @@ UserSchema.statics.tooManyReqPassword = async function (idapp, email, set) {
};
UserSchema.statics.setLastCircuitOpened = async function (idapp, username, circuitpath) {
try {
return await User.findOneAndUpdate({ idapp, username }, { $set: { 'profile.last_circuitpath': circuitpath } });
} catch (e) {
return false;
}
};
UserSchema.statics.setReceiveRis = async function (idapp, username) {
const User = this;
return await User.findOneAndUpdate({
idapp, username,
},
{ $set: { 'profile.lastdate_reqRis': new Date() } }, { new: false }).lean().then((record) => {
return !!record;
});
};
UserSchema.statics.createNewSubRecord = async function (idapp, req) {
const User = this;

View File

@@ -79,6 +79,8 @@ router.post('/load', authenticate, async (req, res) => {
const arrrecnotif = await SendNotif.findAllNotifByUsernameIdAndIdApp(req.user.username, lastdr, idapp);
const useraccounts = await Account.getUserAccounts(idapp, req.user.username);
await User.setLastCircuitOpened(idapp, req.user.username, path);
res.send({ circuit: data, users_in_circuit, arrrecnotif, useraccounts });
} catch (e) {

View File

@@ -7,6 +7,8 @@ const server_constants = require('../tools/server_constants');
const { authenticate } = require('../middleware/authenticate');
const { MyGroup } = require('../models/mygroup');
const mongoose = require('mongoose').set('debug', false)
const { User } = require('../models/user');
@@ -50,6 +52,8 @@ router.post('/load', async (req, res) => {
lastsonline: await User.getLastOnlineUsers(idapp),
lastssharedlink: await User.getLastSharedLink(idapp),
diffusorilist: await User.getDiffusoriUsers(idapp),
receiveRislist: await User.getReceiveRISUsers(idapp),
receiveRislistgroup: await MyGroup.getReceiveRISGroups(idapp),
strettelist: await User.getBestStretteDiManoUsers(idapp),
checkuser: await User.checkUser(idapp, username),
// navi_partite: await Nave.getNaviPartite(idapp),

View File

@@ -396,6 +396,38 @@ router.patch('/:id', authenticate, (req, res) => {
});
});
router.post('/receiveris', authenticate, (req, res) => {
const username = req.user ? req.user.username : '';
const groupname = req.body.groupname;
const idapp = req.body.idapp;
try {
if (!username)
return res.send({ code: server_constants.RIS_CODE_ERR });
if (groupname) {
return MyGroup.setReceiveRisGroup(idapp, groupname)
.then(risult => {
res.send({ code: server_constants.RIS_CODE_OK });
}).catch((err) => {
tools.mylog('ERRORE IN receiveris: ' + err.message);
res.status(400).send();
});
} else if (username) {
return User.setReceiveRis(idapp, username)
.then(risult => {
res.send({ code: server_constants.RIS_CODE_OK });
}).catch((err) => {
tools.mylog('ERRORE IN receiveris: ' + err.message);
res.status(400).send();
});
}
} catch (e) {
res.status(400).send();
};
});
router.post('/profile', (req, res) => {
const usernameOrig = req.user ? req.user.username : '';
const perm = req.user ? req.user.perm : tools.Perm.PERM_NONE;
@@ -405,7 +437,6 @@ router.post('/profile', (req, res) => {
//++Todo: controlla che tipo di dati ha il permesso di leggere
try {
// Check if ìs a Notif to read
const idnotif = req.body['idnotif'] ? req.body['idnotif'] : '';
@@ -477,13 +508,13 @@ router.post('/notifs', authenticate, async (req, res) => {
/* const notifs = req.body['notifs'];
idapp = req.body.idapp;
locale = req.body.locale;
const myuser = req.user;
if (!myuser) {
return res.status(404).
send({code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: ''});
}
try {
if (!!myuser) {
if (tools.isArray(notifs) && notifs.length >= 0) {
@@ -497,7 +528,7 @@ router.post('/notifs', authenticate, async (req, res) => {
tools.mylogserr('Error profile: ', e);
res.status(400).send();
}
*/
});
@@ -809,11 +840,11 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
// await Nave.setCol(idapp, 1);
// const num = await Nave.remove({ idapp, date_start: { $gte: tools.IncDateNow(-1000 * 60 * 60 * 24 * 3) } });
// ris = { num };
} else if (mydata.dbop === 'delNaviProvvisorie') {
ris = await Nave.delNaviProvvisorie(idapp);
} else if (mydata.dbop === 'visuListaNave') {
mystr = await Nave.showListaOrd(idapp);
ris = { mystr };
@@ -860,14 +891,14 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
ris = { mystr };
} else if (mydata.dbop === 'convNaviTessinListaIngressoRec') {
let num = 0;
const arrnavitess = await Nave.find({ idapp, num_tess: { $gte: 3 } });
for (const recnave of arrnavitess) {
if (recnave.num_tess === 3 || recnave.num_tess === 5 || recnave.num_tess === 7) {
const ind_order = recnave.ind_order;
// Prima controlla se ho già 2 record dello stesso ind_order, allora non lo faccio:
const arringr = await ListaIngresso.find({ idapp, ind_order });
let dafare = true;
@@ -880,41 +911,41 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
if (dafare) {
// const user = await User.findByOldOrder(idapp, ind_order);
const user = await User.findByIndOrder(idapp, ind_order);
if (!!user) {
//let note = recnave.num_tess;
// Crea record ListaIngresso
const newrecingr = await ListaIngresso.addUserInListaIngresso(idapp, user.username, user.username, user.lang, false, true, recnave.created, '', true);
const fieldsvalue = {
ind_order: newrecingr.ind_order,
num_tess: 1,
};
// Aggiorna la nave con l'Ind_order nuovo e il num_tess a 1
await Nave.findOneAndUpdate({ _id: recnave._id }, { $set: fieldsvalue }, { new: false });
num++;
}
}
}
}
const arrnavitess2 = await Nave.find({ idapp, num_tess: 2 });
for (const recnave of arrnavitess2) {
}
ris = { num };
} else if (mydata.dbop === 'initListaIngresso') {
// const aaa = await User.updateMany({ idapp }, { $set: { 'profile.nationality': 'IT' } });
const num = await ListaIngresso.updateMany({ idapp }, { $set: { added: false } });
ris = { num };
} else if (mydata.dbop === 'ImpostaATuttiPaypal') {
const listautenti = await User.find({ idapp });
@@ -928,8 +959,8 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
}
// const num = await User.f({ idapp }, { $set: { 'profile: false } });
}
ris = { num };
} else if (mydata.dbop === 'numtessUno') {
const listanavi = await ListaIngresso.find({ idapp });
@@ -944,10 +975,10 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
}
// const num = await User.f({ idapp }, { $set: { 'profile: false } });
}
ris = { num };
} else if (mydata.dbop === 'Corregginumtess') {
const listanavi = await Nave.find({ idapp });
let num = 0;
@@ -963,19 +994,19 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
indextess++;
}
}
ris = { num };
*/
/*
}
else if (mydata.dbop === 'CreaNaviPersistenti') {
const listanavi = await Nave.find({ idapp }).sort({riga: 1, col: 1});
let params = {
idapp
};
let num = 0;
for (let rec of listanavi) {
let mypos = {
@@ -987,7 +1018,7 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
tools.getRigaColByPosUp(mypos);
let persistente = await NavePersistente.findByRigaCol(idapp, mypos.riga, mypos.col, 0);
if (!persistente) {
params.date_start = rec.date_start;
params.date_gift_chat_open = rec.date_gift_chat_open;
params.riga = mypos.riga;
@@ -1005,7 +1036,7 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
}
}
}
ris = { num }; */
/*} else if (mydata.dbop === 'CorreggiDataGiftChat') {
const listanavi = await NavePersistente.find({ idapp });
@@ -1019,7 +1050,7 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
num++;
}
}
ris = { num };
*/
} else if (mydata.dbop === 'creaUtentiTest') {
@@ -1057,14 +1088,14 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
ris = { num };
/*} else if (mydata.dbop === 'visuPlacca') {
mystr = '✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨\n' +
'NAVI CHE SALPANO DALLA ' + mydata.riga + '.' + mydata.col + ' ALLA ' + mydata.riga + '.' + (parseInt(mydata.col) + 7) + '\n' +
'AUGURI ALLA NUOVA SOGNATRICE !!!\n' +
'✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨';
const visu_nave_Bot = await Settings.getValDbSettings(idapp, 'VISU_NAVE_BOT');
for (let ind = 0; ind < 8; ind++) {
mystr += await Nave.getNavePos(idapp, parseInt(mydata.riga), parseInt(mydata.col) + ind, false);
mystr += tools.ACAPO;
@@ -1073,10 +1104,10 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
mystr = '';
}
}
if (visu_nave_Bot)
await telegrambot.sendMsgTelegramToTheAdmin(idapp, mystr, true);
ris = { mystr };
*/
} else if (mydata.dbop === 'CorreggiTabHours') {
@@ -1111,6 +1142,10 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
await Circuit.SetDefMinMaxCollettivi(idapp, mydata.valmin, mydata.valmax);
} else if (mydata.dbop === 'setstrProvByIdCityCircuits') {
await Circuit.setstrProvByIdCityCircuits(idapp);
} else if (mydata.dbop === 'CreateAccountCircuits') {
const allcirc = await Circuit.find({ idapp });
@@ -1205,6 +1240,12 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
ris = await populate.popolaTabelleNuove();
} else if (mydata.dbop === 'saveStepTut') {
await User.findOneAndUpdate({ _id: mydata._id },
{ $set: { 'profile.stepTutorial': mydata.value } });
} else if (mydata.dbop === 'noNameSurname') {
await User.findOneAndUpdate({ _id: mydata._id },
{ $set: { 'profile.noNameSurname': mydata.value } });
} else if (mydata.dbop === 'ricreaTabCitiesProvinces') {
// Svuota e Ricrea
@@ -1242,28 +1283,28 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
/*} else if (mydata.dbop === 'visuNave') {
mystr = await Nave.getNavePos(idapp, parseInt(mydata.riga), parseInt(mydata.col));
const visu_nave_Bot = await Settings.getValDbSettings(idapp, 'VISU_NAVE_BOT');
if (visu_nave_Bot)
telegrambot.sendMsgTelegramToTheAdmin(idapp, mystr, true);
ris = { mystr };
} else if (mydata.dbop === 'getnavibyuser') {
let arrnavi = null;
const user = await User.getUserShortDataByUsername(idapp, mydata.username);
if (user) {
arrnavi = await Nave.getArrPosizioniByUsername(idapp, user.username);
for (let mynave of arrnavi) {
mynave._doc.rec = await Nave.getNaveByRigaCol(idapp, mynave.riga, mynave.col);
}
}
ris = { data: arrnavi };
*/
}

View File

@@ -135,6 +135,7 @@ module.exports = {
TABLES_USER_INCLUDE_MY: ['mygroups', 'circuits'],
TABLES_GETCOMPLETEREC: ['myskills', 'mybachecas', 'myhosps', 'mygoods'],
TABLES_INSERT_ALMOST_ONE_TO_ENABLE_CIRCUIT: ['myskills', 'myhosps', 'mygoods'],
//++Todo: per abilitare gli utenti ad inserire un Circuito aggiungere 'circuits' alla lista TABLES_PERM_NEWREC
TABLES_PERM_NEWREC: ['skills', 'goods', 'subskills', 'mygroups', 'myhosps'],
TABLES_REC_ID: ['skills', 'goods', 'subskills'],