Aggiornamenti 2
This commit is contained in:
30
emails/admin/registration/esEs/html.pug
Normal file
30
emails/admin/registration/esEs/html.pug
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
p #{name} #{surname} acaba de registrarse en #{nomeapp}
|
||||||
|
p Con los siguientes datos de acceso:
|
||||||
|
span Username:
|
||||||
|
strong #{username}<br>
|
||||||
|
span Email:
|
||||||
|
strong #{emailto}<br>
|
||||||
|
p <br>Saludos
|
||||||
|
|
||||||
|
style(type="text/css").
|
||||||
|
html, body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divbtn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-lg {
|
||||||
|
padding: 5px;
|
||||||
|
margin: 5px;
|
||||||
|
font-size: 26px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: white;
|
||||||
|
background: #027be3 !important;
|
||||||
|
border-radius: 28px;
|
||||||
|
|
||||||
|
}
|
||||||
1
emails/admin/registration/esEs/subject.pug
Normal file
1
emails/admin/registration/esEs/subject.pug
Normal file
@@ -0,0 +1 @@
|
|||||||
|
=`Nuevo registro de ${name} ${surname} (${username}) en ${nomeapp}`
|
||||||
13
emails/registration/it/textold.pug
Normal file
13
emails/registration/it/textold.pug
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
Benvenuto #{name} nel portale di #{nomeapp}!
|
||||||
|
I tuoi dati di accesso da ricordare sono:
|
||||||
|
Username: #{username}
|
||||||
|
|
||||||
|
hai dimenticato la Password?
|
||||||
|
Trovala qui: #{forgetpwd}
|
||||||
|
|
||||||
|
Email #{emailto}
|
||||||
|
|
||||||
|
Per confermare la registrazione clicca su questo link:
|
||||||
|
#{strlinkreg}
|
||||||
|
|
||||||
|
Potrai cosi' accedere al sito digitando i tuoi dati di accesso.
|
||||||
1
src/server/locales/enUs.json
Normal file
1
src/server/locales/enUs.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
1
src/server/locales/fr.json
Normal file
1
src/server/locales/fr.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
1
src/server/locales/pt.json
Normal file
1
src/server/locales/pt.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
1
src/server/locales/si.json
Normal file
1
src/server/locales/si.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -25,9 +25,18 @@ const CalZoomSchema = new Schema({
|
|||||||
typeconf: {
|
typeconf: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
icon: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
date_start: {
|
date_start: {
|
||||||
type: Date
|
type: Date
|
||||||
},
|
},
|
||||||
|
benvenuto: {
|
||||||
|
type: Boolean
|
||||||
|
},
|
||||||
date_end: {
|
date_end: {
|
||||||
type: Date
|
type: Date
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ ListaIngressoSchema.statics.findByUsername = function (idapp, username) {
|
|||||||
ListaIngressoSchema.statics.getTotInLista = async function (idapp) {
|
ListaIngressoSchema.statics.getTotInLista = async function (idapp) {
|
||||||
const ListaIngresso = this;
|
const ListaIngresso = this;
|
||||||
|
|
||||||
const myfind = { idapp };
|
const myfind = { idapp, added: false, deleted: false };
|
||||||
|
|
||||||
return await ListaIngresso.count(myfind);
|
return await ListaIngresso.count(myfind);
|
||||||
};
|
};
|
||||||
@@ -100,6 +100,21 @@ ListaIngressoSchema.statics.findByIndOrderETess = function (idapp, ind_order, nu
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ListaIngressoSchema.statics.findAllByIndOrder = function (idapp, ind_order) {
|
||||||
|
const ListaIngresso = this;
|
||||||
|
|
||||||
|
try {
|
||||||
|
return ListaIngresso.find({
|
||||||
|
'idapp': idapp,
|
||||||
|
'ind_order': ind_order,
|
||||||
|
added: false,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
ListaIngressoSchema.statics.deleteUserInListaIngresso = async function (idapp, ind_order) {
|
ListaIngressoSchema.statics.deleteUserInListaIngresso = async function (idapp, ind_order) {
|
||||||
const ListaIngresso = this;
|
const ListaIngresso = this;
|
||||||
|
|
||||||
@@ -131,8 +146,8 @@ ListaIngressoSchema.statics.addUserInListaIngresso = async function (idapp, ind_
|
|||||||
return await listaingresso.save().then(async (ris) => {
|
return await listaingresso.save().then(async (ris) => {
|
||||||
if (addednowreal) {
|
if (addednowreal) {
|
||||||
if (!!ris) {
|
if (!!ris) {
|
||||||
msgtext = tools.gettranslate('ADDED_TOLISTAINGRESSO', lang);
|
|
||||||
const username = await User.getUsernameByIndOrder(idapp, ind_order);
|
const username = await User.getUsernameByIndOrder(idapp, ind_order);
|
||||||
|
msgtext = '🔵 ' + username + ' ' + tools.gettranslate('ADDED_TOLISTAINGRESSO', lang);
|
||||||
await telegrambot.sendMsgTelegram(idapp, username, msgtext, true); // Anche a STAFF
|
await telegrambot.sendMsgTelegram(idapp, username, msgtext, true); // Anche a STAFF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,7 +168,7 @@ ListaIngressoSchema.statics.addUserInListaIngresso = async function (idapp, ind_
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
@@ -180,6 +195,22 @@ function getQueryProj(myfilter, myobjField, myfilter2) {
|
|||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ListaIngressoSchema.statics.getPosizioneInLista = async function (idapp, ind_order, num_tess) {
|
||||||
|
|
||||||
|
arrrec = await ListaIngresso.getProssimiInLista(idapp, true);
|
||||||
|
|
||||||
|
let posiz = 0;
|
||||||
|
let totposiz = arrrec.length;
|
||||||
|
|
||||||
|
for (let ind = 0; ind < arrrec.length; ind++) {
|
||||||
|
if (arrrec[ind].ind_order === ind_order && arrrec[ind].num_tess === num_tess) {
|
||||||
|
posiz = ind;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { posiz: posiz + 1, totposiz, num_tess }
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
ListaIngressoSchema.statics.showListaOrd = async function (idapp, solonuovi) {
|
ListaIngressoSchema.statics.showListaOrd = async function (idapp, solonuovi) {
|
||||||
const ListaIngresso = this;
|
const ListaIngresso = this;
|
||||||
@@ -274,6 +305,18 @@ ListaIngressoSchema.statics.getProssimiInLista = async function (idapp, solonuov
|
|||||||
for (const rec of arrlista) {
|
for (const rec of arrlista) {
|
||||||
rec.numinvitati = await User.getnumInvitati(idapp, rec.username);
|
rec.numinvitati = await User.getnumInvitati(idapp, rec.username);
|
||||||
rec.numinvitatiattivi = await User.getnumInvitatiAttivi(idapp, rec.username);
|
rec.numinvitatiattivi = await User.getnumInvitatiAttivi(idapp, rec.username);
|
||||||
|
|
||||||
|
if (rec.num_tess > 2) {
|
||||||
|
rec.numinvitati = rec.numinvitati - (rec.num_tess - 1);
|
||||||
|
rec.numinvitatiattivi = rec.numinvitatiattivi - (rec.num_tess - 1);
|
||||||
|
}
|
||||||
|
if (rec.numinvitati < 0) {
|
||||||
|
rec.numinvitati = 0;
|
||||||
|
}
|
||||||
|
if (rec.numinvitatiattivi < 0) {
|
||||||
|
rec.numinvitatiattivi = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (rec.numinvitatiattivi > 2)
|
if (rec.numinvitatiattivi > 2)
|
||||||
rec.numinvitatiattivi = 2;
|
rec.numinvitatiattivi = 2;
|
||||||
}
|
}
|
||||||
@@ -285,7 +328,7 @@ ListaIngressoSchema.statics.getProssimiInLista = async function (idapp, solonuov
|
|||||||
|
|
||||||
return arrlista;
|
return arrlista;
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
return null
|
return null
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ NaveSchema.statics.findGeneric = function (myrigacol) {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -591,7 +591,7 @@ NaveSchema.statics.getPlaccaGenerica = async function (idapp, riga, col, offset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -755,9 +755,9 @@ NaveSchema.statics.getNavePos = async function (idapp, riga, col, solorecord, in
|
|||||||
if (!!recnavepersistente.tutor_namesurname)
|
if (!!recnavepersistente.tutor_namesurname)
|
||||||
data += '👤 ' + tools.get__('Tutor che affianchèra il Mediatore', lang) + ': "' + recnavepersistente.tutor_namesurname + '"' + tools.ACAPO;
|
data += '👤 ' + tools.get__('Tutor che affianchèra il Mediatore', lang) + ': "' + recnavepersistente.tutor_namesurname + '"' + tools.ACAPO;
|
||||||
|
|
||||||
data += '💬 ' + tools.get__('Giorno di Apertura GIFT CHAT', lang) + ': ' + tools.getstrDateLong(recnavepersistente.date_gift_chat_open) + tools.ACAPO;
|
data += '💬 ' + tools.get__('Giorno di Apertura GIFT CHAT', lang) + ': ' + tools.getstrDateLong(recnavepersistente.date_gift_chat_open, lang) + tools.ACAPO;
|
||||||
|
|
||||||
data += '🎁 ' + tools.get__('Giorno in cui Inviare il DONO', lang) + ' : ' + tools.getstrDateLong(recnavepersistente.date_start) + tools.ACAPO;
|
data += '🎁 ' + tools.get__('Giorno in cui Inviare il DONO', lang) + ' : ' + tools.getstrDateLong(recnavepersistente.date_start, lang) + tools.ACAPO;
|
||||||
if (!!recnavepersistente.note_bot)
|
if (!!recnavepersistente.note_bot)
|
||||||
data += tools.get__('Note', lang) + ": " + recnavepersistente.note_bot + tools.ACAPO;
|
data += tools.get__('Note', lang) + ": " + recnavepersistente.note_bot + tools.ACAPO;
|
||||||
|
|
||||||
@@ -771,7 +771,7 @@ NaveSchema.statics.getNavePos = async function (idapp, riga, col, solorecord, in
|
|||||||
|
|
||||||
return mystr;
|
return mystr;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -955,7 +955,7 @@ async function addRecordNaveByParams(params, siRitesse) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -964,7 +964,7 @@ NaveSchema.statics.checkifDeveRitessersi = async function (recuser) {
|
|||||||
|
|
||||||
let deveritessersi = true;
|
let deveritessersi = true;
|
||||||
|
|
||||||
arrrec = await Nave.find({ idapp: recuser.idapp, ind_order: recuser.ind_order });
|
arrrec = await Nave.find({ idapp: recuser.idapp, ind_order: recuser.ind_order, num_tess: recuser.num_tess });
|
||||||
|
|
||||||
if (!!arrrec) {
|
if (!!arrrec) {
|
||||||
if ((arrrec.length % 2) === 0) {
|
if ((arrrec.length % 2) === 0) {
|
||||||
@@ -1009,11 +1009,11 @@ NaveSchema.statics.addUserFromListaIngresso_IntoNave = async function (init, ida
|
|||||||
if (!!recmediatore) {
|
if (!!recmediatore) {
|
||||||
const ris = await Nave.checkifDeveRitessersi(recmediatore);
|
const ris = await Nave.checkifDeveRitessersi(recmediatore);
|
||||||
if (ris.deveritessersi) {
|
if (ris.deveritessersi) {
|
||||||
console.log('Si deve ritesere: [riga=', params.riga, 'col', params.col, ']');
|
console.log('Si deve ritessere: [riga=', params.riga, 'col', params.col, ']');
|
||||||
if (ris.deveritessersi) {
|
if (ris.deveritessersi) {
|
||||||
params.ind_order = recmediatore.ind_order;
|
params.ind_order = recmediatore.ind_order;
|
||||||
params.id = recmediatore._id;
|
params.id = recmediatore._id;
|
||||||
params.num_tess = ris.num_tess + 1;
|
params.num_tess = recmediatore.num_tess + 1;
|
||||||
|
|
||||||
await addRecordNaveByParams(params, true);
|
await addRecordNaveByParams(params, true);
|
||||||
}
|
}
|
||||||
@@ -1189,7 +1189,14 @@ NaveSchema.statics.getNaveByUser = async function (idapp, ind_order, lang, fuoco
|
|||||||
};
|
};
|
||||||
tools.getRigaColByPosUp(mypos);
|
tools.getRigaColByPosUp(mypos);
|
||||||
|
|
||||||
mystr += await Nave.getNavePos(idapp, mypos.riga, mypos.col, false, ind_order);
|
let persistente = await NavePersistente.findByRigaColByDonatore(idapp, pos.riga, pos.col, 0);
|
||||||
|
if (!!persistente) {
|
||||||
|
if (persistente.provvisoria) {
|
||||||
|
mystr += tools.ACAPO + tools.get__('NAVE', lang) + ' ' + '[' + mypos.riga + '.' + mypos.col + '] - ' + tools.get__('TEMPORANEA', lang) + tools.ACAPO+ tools.ACAPO;
|
||||||
|
} else {
|
||||||
|
mystr += await Nave.getNavePos(idapp, mypos.riga, mypos.col, false, ind_order);
|
||||||
|
}
|
||||||
|
}
|
||||||
// mystr += await Nave.getPlaccaPerDonatore(idapp, pos.riga, pos.col, false, rec);
|
// mystr += await Nave.getPlaccaPerDonatore(idapp, pos.riga, pos.col, false, rec);
|
||||||
// mystr += await Nave.getPlaccaPerMediatore(idapp, pos.riga, pos.col, false, rec);
|
// mystr += await Nave.getPlaccaPerMediatore(idapp, pos.riga, pos.col, false, rec);
|
||||||
}
|
}
|
||||||
@@ -1299,13 +1306,32 @@ NaveSchema.statics.ricalcolaNave = async function (idapp, nave, riga1don, col1do
|
|||||||
|
|
||||||
nave._doc.rec = nave.rec;
|
nave._doc.rec = nave.rec;
|
||||||
}
|
}
|
||||||
}catch (e) {
|
} catch (e) {
|
||||||
console.error(e.message);
|
console.error(e.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nave;
|
return nave;
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
|
NaveSchema.statics.getNextNumTess = async function (idapp, ind_order) {
|
||||||
|
const Nave = this;
|
||||||
|
|
||||||
|
const rec = await Nave.findOne({ idapp, ind_order }, { num_tess: 1 }).sort({ num_tess: -1 });
|
||||||
|
if (!!rec) {
|
||||||
|
|
||||||
|
if (rec.num_tess % 2 === 0) {
|
||||||
|
rec.num_tess++;
|
||||||
|
} else {
|
||||||
|
rec.num_tess += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rec.num_tess
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const Nave = mongoose.model('Nave', NaveSchema);
|
const Nave = mongoose.model('Nave', NaveSchema);
|
||||||
|
|||||||
@@ -183,6 +183,27 @@ NavePersistenteSchema.statics.getListaNavi = function (idapp) {
|
|||||||
).sort({ riga: 1, col: 1 });
|
).sort({ riga: 1, col: 1 });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
NavePersistenteSchema.statics.getLastNave = function (idapp) {
|
||||||
|
const NavePersistente = this;
|
||||||
|
|
||||||
|
const myfind = { idapp, date_start: { $lte: tools.IncDateNow(0) }, provvisoria: false };
|
||||||
|
|
||||||
|
return NavePersistente.findOne(myfind,
|
||||||
|
{
|
||||||
|
index: 1,
|
||||||
|
riga: 1,
|
||||||
|
col: 1,
|
||||||
|
riga1don: 1,
|
||||||
|
col1don: 1,
|
||||||
|
date_start: 1,
|
||||||
|
provvisoria: 1,
|
||||||
|
DoniConfermati: 1,
|
||||||
|
DoniTotali: 1,
|
||||||
|
DoniMancanti: 1,
|
||||||
|
}
|
||||||
|
).sort({ riga: -1, col: -1 }).limit(1);
|
||||||
|
};
|
||||||
|
|
||||||
NavePersistenteSchema.statics.findByRigaColByDonatore = function (idapp, riga, col, offset) {
|
NavePersistenteSchema.statics.findByRigaColByDonatore = function (idapp, riga, col, offset) {
|
||||||
const NavePersistente = this;
|
const NavePersistente = this;
|
||||||
|
|
||||||
|
|||||||
@@ -279,6 +279,14 @@ UserSchema.statics.isManager = function (perm) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
UserSchema.statics.isTraduttrici = function (perm) {
|
||||||
|
try {
|
||||||
|
return ((perm & shared_consts.Permissions.Traduttrici) === shared_consts.Permissions.Traduttrici);
|
||||||
|
} catch (e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
UserSchema.statics.isTutor = function (perm) {
|
UserSchema.statics.isTutor = function (perm) {
|
||||||
try {
|
try {
|
||||||
return ((perm & shared_consts.Permissions.Tutor) === shared_consts.Permissions.Tutor);
|
return ((perm & shared_consts.Permissions.Tutor) === shared_consts.Permissions.Tutor);
|
||||||
@@ -324,10 +332,16 @@ UserSchema.statics.findByCredentials = function (idapp, username, password) {
|
|||||||
const User = this;
|
const User = this;
|
||||||
let pwd = "";
|
let pwd = "";
|
||||||
|
|
||||||
return User.findOne({ idapp, username: username }).then((user) => {
|
return User.findOne({
|
||||||
|
idapp, username: username,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
}).then((user) => {
|
||||||
if (!user) {
|
if (!user) {
|
||||||
// Check if with email:
|
// Check if with email:
|
||||||
return User.findOne({ idapp, email: username.toLowerCase() })
|
return User.findOne({
|
||||||
|
idapp, email: username.toLowerCase(),
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
return !user.deleted ? user : null
|
return !user.deleted ? user : null
|
||||||
}
|
}
|
||||||
@@ -361,6 +375,7 @@ UserSchema.statics.findByUsername = async function (idapp, username, alsoemail)
|
|||||||
return await User.findOne({
|
return await User.findOne({
|
||||||
'idapp': idapp,
|
'idapp': idapp,
|
||||||
'username': regexusername,
|
'username': regexusername,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
}).then(async (ris) => {
|
}).then(async (ris) => {
|
||||||
if ((!ris) && (alsoemail)) {
|
if ((!ris) && (alsoemail)) {
|
||||||
regexemail = new RegExp(["^", username.toLowerCase(), "$"].join(""), "i");
|
regexemail = new RegExp(["^", username.toLowerCase(), "$"].join(""), "i");
|
||||||
@@ -368,6 +383,7 @@ UserSchema.statics.findByUsername = async function (idapp, username, alsoemail)
|
|||||||
return User.findOne({
|
return User.findOne({
|
||||||
'idapp': idapp,
|
'idapp': idapp,
|
||||||
'email': regexemail,
|
'email': regexemail,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return ris;
|
return ris;
|
||||||
@@ -380,6 +396,7 @@ UserSchema.statics.getUserShortDataByUsername = async function (idapp, username)
|
|||||||
const myrec = await User.findOne({
|
const myrec = await User.findOne({
|
||||||
'idapp': idapp,
|
'idapp': idapp,
|
||||||
'username': username,
|
'username': username,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
}, {
|
}, {
|
||||||
lang: 1,
|
lang: 1,
|
||||||
ind_order: 1,
|
ind_order: 1,
|
||||||
@@ -427,6 +444,7 @@ UserSchema.statics.getDownlineByUsername = async function (idapp, username) {
|
|||||||
const arrrec = await User.find({
|
const arrrec = await User.find({
|
||||||
'idapp': idapp,
|
'idapp': idapp,
|
||||||
'aportador_solidario': username,
|
'aportador_solidario': username,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
}, {
|
}, {
|
||||||
lang: 1,
|
lang: 1,
|
||||||
aportador_solidario: 1,
|
aportador_solidario: 1,
|
||||||
@@ -473,24 +491,38 @@ UserSchema.statics.getnumInvitatiAttivi = function (idapp, username) {
|
|||||||
return User.countDocuments({
|
return User.countDocuments({
|
||||||
idapp,
|
idapp,
|
||||||
aportador_solidario: username,
|
aportador_solidario: username,
|
||||||
$or: [
|
$and: [
|
||||||
{
|
{
|
||||||
'profile.special_req': true
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
$or: [
|
||||||
|
{
|
||||||
|
'profile.special_req': true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
|
||||||
verified_email: true,
|
verified_email: true,
|
||||||
'profile.teleg_id': { $gt: 1 },
|
'profile.teleg_id': { $gt: 1 },
|
||||||
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
||||||
'profile.saw_zoom_presentation': true,
|
'profile.saw_zoom_presentation': true,
|
||||||
'profile.my_dream': { $exists: true },
|
'profile.my_dream': { $exists: true },
|
||||||
'profile.paymenttypes': { "$in": ['paypal'] },
|
'profile.paymenttypes': { "$in": ['paypal'] },
|
||||||
$and: [
|
$and: [
|
||||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
{ 'profile.my_dream': { $exists: true } },
|
||||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
||||||
],
|
{
|
||||||
}]
|
$and: [
|
||||||
});
|
{ 'profile.email_paypal': { $exists: true } },
|
||||||
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
;
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.isUserQualified7 = async function (idapp, username) {
|
UserSchema.statics.isUserQualified7 = async function (idapp, username) {
|
||||||
@@ -502,23 +534,29 @@ UserSchema.statics.isUserQualified7 = async function (idapp, username) {
|
|||||||
const myquery = {
|
const myquery = {
|
||||||
'idapp': idapp,
|
'idapp': idapp,
|
||||||
'username': username,
|
'username': username,
|
||||||
$or: [
|
$and: [
|
||||||
{
|
{
|
||||||
'profile.special_req': true
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
verified_email: true,
|
$or: [
|
||||||
'profile.teleg_id': { $gt: 1 },
|
{
|
||||||
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
'profile.special_req': true
|
||||||
'profile.saw_zoom_presentation': true,
|
},
|
||||||
'profile.my_dream': { $exists: true },
|
{
|
||||||
'profile.email_paypal': { $exists: true },
|
verified_email: true,
|
||||||
'profile.paymenttypes': { "$in": ['paypal'] },
|
'profile.teleg_id': { $gt: 1 },
|
||||||
$and: [
|
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
||||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
'profile.saw_zoom_presentation': true,
|
||||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
'profile.my_dream': { $exists: true },
|
||||||
],
|
'profile.email_paypal': { $exists: true },
|
||||||
$where: "this.profile.paymenttypes.length >= 1",
|
'profile.paymenttypes': { "$in": ['paypal'] },
|
||||||
|
$and: [
|
||||||
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
||||||
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
||||||
|
],
|
||||||
|
$where: "this.profile.paymenttypes.length >= 1",
|
||||||
|
}]
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -545,6 +583,7 @@ UserSchema.statics.getnumPaymentOk = function (idapp) {
|
|||||||
|
|
||||||
return User.count({
|
return User.count({
|
||||||
idapp,
|
idapp,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
'profile.paymenttypes': { "$in": ['paypal'] },
|
'profile.paymenttypes': { "$in": ['paypal'] },
|
||||||
$where: "this.profile.paymenttypes.length >= 1",
|
$where: "this.profile.paymenttypes.length >= 1",
|
||||||
'profile.email_paypal': { $exists: true },
|
'profile.email_paypal': { $exists: true },
|
||||||
@@ -554,7 +593,7 @@ UserSchema.statics.getnumPaymentOk = function (idapp) {
|
|||||||
UserSchema.statics.getUsersNationalityQuery = function (idapp) {
|
UserSchema.statics.getUsersNationalityQuery = function (idapp) {
|
||||||
const query = [
|
const query = [
|
||||||
{
|
{
|
||||||
$match: { idapp }
|
$match: { idapp, $or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }], }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
$group: { _id: "$profile.nationality", count: { $sum: 1 } }
|
$group: { _id: "$profile.nationality", count: { $sum: 1 } }
|
||||||
@@ -583,6 +622,7 @@ UserSchema.statics.getnumInvitati = function (idapp, username) {
|
|||||||
return User.count({
|
return User.count({
|
||||||
idapp,
|
idapp,
|
||||||
aportador_solidario: username,
|
aportador_solidario: username,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -628,13 +668,17 @@ UserSchema.statics.findByEmail = function (idapp, email) {
|
|||||||
return User.findOne({
|
return User.findOne({
|
||||||
'idapp': idapp,
|
'idapp': idapp,
|
||||||
'email': email,
|
'email': email,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.getLastUser = function (idapp) {
|
UserSchema.statics.getLastUser = function (idapp) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return User.findOne({ idapp }).sort({ ind_order: -1 })
|
return User.findOne({
|
||||||
|
idapp,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
|
}).sort({ ind_order: -1 })
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.findByIndOrder = function (idapp, ind_order) {
|
UserSchema.statics.findByIndOrder = function (idapp, ind_order) {
|
||||||
@@ -645,9 +689,10 @@ UserSchema.statics.findByIndOrder = function (idapp, ind_order) {
|
|||||||
return User.findOne({
|
return User.findOne({
|
||||||
idapp,
|
idapp,
|
||||||
ind_order,
|
ind_order,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -684,7 +729,10 @@ UserSchema.methods.removeToken = function (token) {
|
|||||||
UserSchema.statics.getEmailByUsername = async function (idapp, username) {
|
UserSchema.statics.getEmailByUsername = async function (idapp, username) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return await User.findOne({ idapp, username })
|
return await User.findOne({
|
||||||
|
idapp, username,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
})
|
||||||
.then((arrrec) => {
|
.then((arrrec) => {
|
||||||
return ((arrrec) ? arrrec.email : '');
|
return ((arrrec) ? arrrec.email : '');
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
@@ -695,7 +743,10 @@ UserSchema.statics.getEmailByUsername = async function (idapp, username) {
|
|||||||
UserSchema.statics.getUsernameById = async function (idapp, id) {
|
UserSchema.statics.getUsernameById = async function (idapp, id) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return await User.findOne({ idapp, _id: id }, { username: 1 })
|
return await User.findOne({
|
||||||
|
idapp, _id: id,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
}, { username: 1 })
|
||||||
.then((myuser) => {
|
.then((myuser) => {
|
||||||
return ((myuser) ? myuser.username : '');
|
return ((myuser) ? myuser.username : '');
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
@@ -706,19 +757,28 @@ UserSchema.statics.getUsernameById = async function (idapp, id) {
|
|||||||
UserSchema.statics.getUserById = function (idapp, id) {
|
UserSchema.statics.getUserById = function (idapp, id) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return User.findOne({ idapp, _id: id })
|
return User.findOne({
|
||||||
|
idapp, _id: id,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.getUserByAportador = function (idapp, aportador_solidario) {
|
UserSchema.statics.getUserByAportador = function (idapp, aportador_solidario) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return User.findOne({ idapp, aportador_solidario })
|
return User.findOne({
|
||||||
|
idapp, aportador_solidario,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.getAportadorSolidarioByUsername = async function (idapp, username) {
|
UserSchema.statics.getAportadorSolidarioByUsername = async function (idapp, username) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return await User.findOne({ idapp, username })
|
return await User.findOne({
|
||||||
|
idapp, username,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
})
|
||||||
.then((rec) => {
|
.then((rec) => {
|
||||||
return ((rec) ? rec.aportador_solidario : '');
|
return ((rec) ? rec.aportador_solidario : '');
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
@@ -729,7 +789,10 @@ UserSchema.statics.getAportadorSolidarioByUsername = async function (idapp, user
|
|||||||
UserSchema.statics.UserByIdTelegram = async function (idapp, teleg_id) {
|
UserSchema.statics.UserByIdTelegram = async function (idapp, teleg_id) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return await User.findOne({ idapp, 'profile.teleg_id': teleg_id })
|
return await User.findOne({
|
||||||
|
idapp, 'profile.teleg_id': teleg_id,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
|
})
|
||||||
.then((rec) => {
|
.then((rec) => {
|
||||||
return (!!rec) ? rec._doc : null;
|
return (!!rec) ? rec._doc : null;
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
@@ -740,7 +803,10 @@ UserSchema.statics.UserByIdTelegram = async function (idapp, teleg_id) {
|
|||||||
UserSchema.statics.UsersByIdTelegram = async function (idapp, teleg_id) {
|
UserSchema.statics.UsersByIdTelegram = async function (idapp, teleg_id) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return await User.find({ idapp, 'profile.teleg_id': teleg_id })
|
return await User.find({
|
||||||
|
idapp, 'profile.teleg_id': teleg_id,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
})
|
||||||
.then((rec) => {
|
.then((rec) => {
|
||||||
return (!!rec) ? rec._doc : null;
|
return (!!rec) ? rec._doc : null;
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
@@ -751,7 +817,10 @@ UserSchema.statics.UsersByIdTelegram = async function (idapp, teleg_id) {
|
|||||||
UserSchema.statics.TelegIdByUsername = async function (idapp, username) {
|
UserSchema.statics.TelegIdByUsername = async function (idapp, username) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return await User.findOne({ idapp, username }, { 'profile.teleg_id': 1 })
|
return await User.findOne({
|
||||||
|
idapp, username,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
}, { 'profile.teleg_id': 1 })
|
||||||
.then((rec) => {
|
.then((rec) => {
|
||||||
return (!!rec) ? rec.profile.teleg_id : null;
|
return (!!rec) ? rec.profile.teleg_id : null;
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
@@ -839,7 +908,10 @@ UserSchema.statics.SetTelegramWasBlocked = async function (idapp, teleg_id) {
|
|||||||
UserSchema.statics.getNameSurnameByUsername = async function (idapp, username) {
|
UserSchema.statics.getNameSurnameByUsername = async function (idapp, username) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return await User.findOne({ idapp, username }, { name: 1, surname: 1 })
|
return await User.findOne({
|
||||||
|
idapp, username,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
}, { name: 1, surname: 1 })
|
||||||
.then((rec) => {
|
.then((rec) => {
|
||||||
return (!!rec) ? `${rec.name} ${rec.surname}` : '';
|
return (!!rec) ? `${rec.name} ${rec.surname}` : '';
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
@@ -850,7 +922,10 @@ UserSchema.statics.getNameSurnameByUsername = async function (idapp, username) {
|
|||||||
UserSchema.statics.getSmallRecByIndOrder = async function (idapp, ind_order) {
|
UserSchema.statics.getSmallRecByIndOrder = async function (idapp, ind_order) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
return await User.findOne({ idapp, ind_order },
|
return await User.findOne({
|
||||||
|
idapp, ind_order,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
idapp: 1,
|
idapp: 1,
|
||||||
ind_order: 1,
|
ind_order: 1,
|
||||||
@@ -1005,7 +1080,10 @@ UserSchema.statics.executeQueryTable = function (idapp, params) {
|
|||||||
UserSchema.statics.findAllIdApp = function (idapp) {
|
UserSchema.statics.findAllIdApp = function (idapp) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
const myfind = { idapp };
|
const myfind = {
|
||||||
|
idapp,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
};
|
||||||
|
|
||||||
return User.find(myfind, (err, arrrec) => {
|
return User.find(myfind, (err, arrrec) => {
|
||||||
return arrrec
|
return arrrec
|
||||||
@@ -1054,23 +1132,76 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dashboard.arrposizioni = await Nave.getArrPosizioniByIndOrder(idapp, dashboard.myself.ind_order);
|
if (!!dashboard.myself.ind_order)
|
||||||
|
dashboard.arrposizioni = await Nave.getArrPosizioniByIndOrder(idapp, dashboard.myself.ind_order);
|
||||||
|
else
|
||||||
|
dashboard.arrposizioni = [];
|
||||||
|
|
||||||
|
if (!!dashboard.myself.ind_order)
|
||||||
|
dashboard.arrimbarchi = await ListaIngresso.findAllByIndOrder(idapp, dashboard.myself.ind_order);
|
||||||
|
else
|
||||||
|
dashboard.arrimbarchi = [];
|
||||||
|
|
||||||
|
for (let myimbarco of dashboard.arrimbarchi) {
|
||||||
|
myimbarco._doc.posiz = await ListaIngresso.getPosizioneInLista(idapp, myimbarco.ind_order, myimbarco.num_tess);
|
||||||
|
}
|
||||||
dashboard.navi_partenza = await NavePersistente.getListaNavi(idapp);
|
dashboard.navi_partenza = await NavePersistente.getListaNavi(idapp);
|
||||||
|
|
||||||
|
dashboard.lastnave = await NavePersistente.getLastNave(idapp);
|
||||||
|
|
||||||
//for (let indriga = 0; indriga < 10; indriga++) {
|
//for (let indriga = 0; indriga < 10; indriga++) {
|
||||||
// dashboard.navi_partenza.push(await Nave.getPrimaNaveByRiga(idapp, indriga));
|
// dashboard.navi_partenza.push(await Nave.getPrimaNaveByRiga(idapp, indriga));
|
||||||
//}
|
//}
|
||||||
|
|
||||||
for (let mypos of dashboard.arrposizioni) {
|
for (let mypos of dashboard.arrposizioni) {
|
||||||
mypos._doc.rec = await Nave.getNaveByRigaCol(idapp, mypos.riga, mypos.col);
|
mypos._doc.rec = await Nave.getNaveByRigaCol(idapp, mypos.riga, mypos.col);
|
||||||
|
mypos._doc.nave_partenza = await NavePersistente.findByRigaColByDonatore(idapp, mypos.riga, mypos.col, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.table(dashboard.arrnavi);
|
const arrnew = [];
|
||||||
|
|
||||||
|
for (let mypos of dashboard.arrposizioni) {
|
||||||
|
// Controlla se è presente la Nave con il num_tess pari
|
||||||
|
|
||||||
|
let trovato = false;
|
||||||
|
|
||||||
|
if (mypos.num_tess % 2 !== 0) {
|
||||||
|
for (let myrec of dashboard.arrposizioni) {
|
||||||
|
if (myrec.num_tess === mypos.num_tess + 1) {
|
||||||
|
trovato = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
trovato = true;
|
||||||
|
}
|
||||||
|
if (!trovato) {
|
||||||
|
const mymediatore = mypos._doc.rec.mediatore.arrdonatori[7];
|
||||||
|
if (!!mymediatore) {
|
||||||
|
const myrec = {
|
||||||
|
riga: mymediatore.riga,
|
||||||
|
col: mymediatore.col,
|
||||||
|
name: mypos._doc.rec.mediatore.recmediatore.name,
|
||||||
|
surname: mypos._doc.rec.mediatore.recmediatore.surname,
|
||||||
|
username: mypos._doc.rec.mediatore.recmediatore.username,
|
||||||
|
num_tess: mypos._doc.rec.mediatore.recmediatore.num_tess + 1,
|
||||||
|
rec: await Nave.getNaveByRigaCol(idapp, mymediatore.riga, mymediatore.col),
|
||||||
|
nave_partenza: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
myrec.nave_partenza = await NavePersistente.findByRigaColByDonatore(idapp, myrec.riga, myrec.col, 0);
|
||||||
|
|
||||||
|
arrnew.push(myrec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dashboard.arrposizioni = [...dashboard.arrposizioni, ...arrnew];
|
||||||
|
|
||||||
|
// console.table(dashboard.arrnavi);
|
||||||
|
|
||||||
return dashboard;
|
return dashboard;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1101,6 +1232,7 @@ UserSchema.statics.findByCellAndNameSurname = function (idapp, cell, name, surna
|
|||||||
'profile.cell': cell,
|
'profile.cell': cell,
|
||||||
'name': name,
|
'name': name,
|
||||||
'surname': surname,
|
'surname': surname,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1121,21 +1253,25 @@ UserSchema.statics.getUsersQualified = async function (idapp, numinvitati) {
|
|||||||
|
|
||||||
const arrusers = await User.find({
|
const arrusers = await User.find({
|
||||||
idapp,
|
idapp,
|
||||||
$or: [
|
$and: [
|
||||||
|
{ $or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }] },
|
||||||
{
|
{
|
||||||
'profile.special_req': true
|
$or: [
|
||||||
},
|
{
|
||||||
{
|
'profile.special_req': true
|
||||||
verified_email: true,
|
},
|
||||||
'profile.teleg_id': { $gt: 0 },
|
{
|
||||||
'profile.paymenttypes': { "$in": ['paypal'] },
|
verified_email: true,
|
||||||
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
'profile.teleg_id': { $gt: 0 },
|
||||||
'profile.saw_zoom_presentation': true,
|
'profile.paymenttypes': { "$in": ['paypal'] },
|
||||||
'profile.my_dream': { $exists: true },
|
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
||||||
$and: [
|
'profile.saw_zoom_presentation': true,
|
||||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
'profile.my_dream': { $exists: true },
|
||||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
$and: [
|
||||||
],
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
||||||
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
||||||
|
],
|
||||||
|
}]
|
||||||
}]
|
}]
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
@@ -1164,21 +1300,25 @@ UserSchema.statics.visuUtentiNonInNavi = async function (idapp) {
|
|||||||
|
|
||||||
const arrusers = await User.find({
|
const arrusers = await User.find({
|
||||||
idapp,
|
idapp,
|
||||||
$or: [
|
$and: [
|
||||||
|
{ $or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }] },
|
||||||
{
|
{
|
||||||
'profile.special_req': true
|
$or: [
|
||||||
},
|
{
|
||||||
{
|
'profile.special_req': true
|
||||||
verified_email: true,
|
},
|
||||||
'profile.teleg_id': { $gt: 0 },
|
{
|
||||||
'profile.paymenttypes': { "$in": ['paypal'] },
|
verified_email: true,
|
||||||
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
'profile.teleg_id': { $gt: 0 },
|
||||||
'profile.saw_zoom_presentation': true,
|
'profile.paymenttypes': { "$in": ['paypal'] },
|
||||||
'profile.my_dream': { $exists: true },
|
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
||||||
$and: [
|
'profile.saw_zoom_presentation': true,
|
||||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
'profile.my_dream': { $exists: true },
|
||||||
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
$and: [
|
||||||
],
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
||||||
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
||||||
|
],
|
||||||
|
}]
|
||||||
}]
|
}]
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
@@ -1202,24 +1342,60 @@ UserSchema.statics.visuUtentiNonInNavi = async function (idapp) {
|
|||||||
let numnoinlista = 0;
|
let numnoinlista = 0;
|
||||||
let numeliminati = 0;
|
let numeliminati = 0;
|
||||||
let numsospesi = 0;
|
let numsospesi = 0;
|
||||||
|
let strnavidoppie = '';
|
||||||
|
let esiste = false;
|
||||||
|
|
||||||
for (const user of arrusers) {
|
for (const user of arrusers) {
|
||||||
if (user.deleted) {
|
esiste = true;
|
||||||
numeliminati++;
|
if (!!user.deleted) {
|
||||||
} else {
|
if (user.deleted) {
|
||||||
|
numeliminati++;
|
||||||
|
esiste = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (esiste) {
|
||||||
|
|
||||||
|
let visualizza = false;
|
||||||
|
|
||||||
|
// Controlla se ho un doppione nelle Navi !
|
||||||
|
let mienavi = await Nave.find({ idapp, ind_order: user.ind_order }, { num_tess: 1 });
|
||||||
|
|
||||||
|
let strnavidoppie = [];
|
||||||
|
if (!!mienavi) {
|
||||||
|
strnavidoppie = mienavi.reduce((acc, currentValue, index, array) => {
|
||||||
|
if (array.indexOf(currentValue.num_tess) > -1 && !acc.includes(currentValue.num_tess))
|
||||||
|
acc.push(currentValue.num_tess);
|
||||||
|
return acc;
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strnavidoppie.length > 1) {
|
||||||
|
visualizza = true;
|
||||||
|
}
|
||||||
|
|
||||||
user.numinvitati = await User.getnumInvitati(idapp, user.username);
|
user.numinvitati = await User.getnumInvitati(idapp, user.username);
|
||||||
reg++;
|
reg++;
|
||||||
let mianave = await Nave.findOne({ idapp, ind_order: user.ind_order });
|
let mianave = await Nave.findOne({ idapp, ind_order: user.ind_order });
|
||||||
let mialistaingresso = await ListaIngresso.findOne({ idapp, ind_order: user.ind_order });
|
let mialistaingresso = await ListaIngresso.findOne({ idapp, ind_order: user.ind_order });
|
||||||
let trovato = false;
|
let trovato = false;
|
||||||
if (!mianave) {
|
|
||||||
|
if (!mianave)
|
||||||
|
visualizza = true;
|
||||||
|
|
||||||
|
if (visualizza) {
|
||||||
mystr += user.username + ' ' + user.name + ' ' + user.surname + ' [' + user.ind_order + '] [inv=' + user.numinvitati + ']'
|
mystr += user.username + ' ' + user.name + ' ' + user.surname + ' [' + user.ind_order + '] [inv=' + user.numinvitati + ']'
|
||||||
noninnave++;
|
|
||||||
trovato = true;
|
trovato = true;
|
||||||
} else {
|
|
||||||
innave++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strnavidoppie.length > 1) {
|
||||||
|
mystr += ' NAVI DUPLICATE! ' + strnavidoppie.join(',');
|
||||||
|
}
|
||||||
|
if (!mianave)
|
||||||
|
noninnave++;
|
||||||
|
else
|
||||||
|
innave++;
|
||||||
|
|
||||||
|
|
||||||
if (user.sospeso) {
|
if (user.sospeso) {
|
||||||
numsospesi++;
|
numsospesi++;
|
||||||
}
|
}
|
||||||
@@ -1422,7 +1598,10 @@ UserSchema.statics.getUsersRegDaily = function (idapp, nrec) {
|
|||||||
|
|
||||||
const query = [
|
const query = [
|
||||||
{
|
{
|
||||||
$match: { idapp, date_reg: { $gte: tools.IncDateNow(-(1000 * 60 * 60 * 24 * nrec)) } }
|
$match: {
|
||||||
|
idapp, date_reg: { $gte: tools.IncDateNow(-(1000 * 60 * 60 * 24 * nrec)) },
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
$group: { _id: { $dateToString: { format: "%Y-%m-%d", date: "$date_reg" } }, count: { $sum: 1 } }
|
$group: { _id: { $dateToString: { format: "%Y-%m-%d", date: "$date_reg" } }, count: { $sum: 1 } }
|
||||||
@@ -1434,12 +1613,35 @@ UserSchema.statics.getUsersRegDaily = function (idapp, nrec) {
|
|||||||
return query
|
return query
|
||||||
};
|
};
|
||||||
|
|
||||||
|
UserSchema.statics.getUsersRegWeekly = function (idapp, nrec) {
|
||||||
|
|
||||||
|
const query = [
|
||||||
|
{
|
||||||
|
$match: {
|
||||||
|
idapp, date_reg: { $gte: tools.IncDateNow(-(1000 * 60 * 60 * 24 * nrec)) },
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$group: { _id: { $dateToString: { format: "%Y-%U", date: "$date_reg" } }, count: { $sum: 1 } }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$sort: { _id: 1 }
|
||||||
|
}
|
||||||
|
];
|
||||||
|
return query
|
||||||
|
};
|
||||||
|
|
||||||
UserSchema.statics.getnumRegNDays = function (idapp, nrec) {
|
UserSchema.statics.getnumRegNDays = function (idapp, nrec) {
|
||||||
|
|
||||||
|
|
||||||
const query = [
|
const query = [
|
||||||
{
|
{
|
||||||
$match: { idapp, date_reg: { $lt: tools.IncDateNow(-(1000 * 60 * 60 * 24 * nrec)) } }
|
$match: {
|
||||||
|
idapp,
|
||||||
|
date_reg: { $lt: tools.IncDateNow(-(1000 * 60 * 60 * 24 * nrec)) },
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
$group: { _id: { $dateToString: { format: "%Y-%m-%d", date: "$date_reg" } }, count: { $sum: 1 } }
|
$group: { _id: { $dateToString: { format: "%Y-%m-%d", date: "$date_reg" } }, count: { $sum: 1 } }
|
||||||
@@ -1471,6 +1673,16 @@ UserSchema.statics.calcRegDaily = async function (idapp) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
UserSchema.statics.calcRegWeekly = async function (idapp) {
|
||||||
|
const User = this;
|
||||||
|
|
||||||
|
return User.aggregate(User.getUsersRegWeekly(idapp, 20 * 7))
|
||||||
|
.then(ris => {
|
||||||
|
// console.table(ris);
|
||||||
|
return JSON.stringify(ris.slice(0, -1));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
if (tools.INITDB_FIRSTIME) {
|
if (tools.INITDB_FIRSTIME) {
|
||||||
console.log(' createIndex User Index...');
|
console.log(' createIndex User Index...');
|
||||||
@@ -1573,7 +1785,10 @@ UserSchema.statics.DbOp = async function (idapp, mydata) {
|
|||||||
|
|
||||||
await ListaIngresso.deleteMany({ idapp, added: false });
|
await ListaIngresso.deleteMany({ idapp, added: false });
|
||||||
|
|
||||||
arrusers = await User.find({ 'idapp': idapp }).sort({ ind_order: 1 });
|
arrusers = await User.find({
|
||||||
|
'idapp': idapp,
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }]
|
||||||
|
}).sort({ ind_order: 1 });
|
||||||
let num = 0;
|
let num = 0;
|
||||||
|
|
||||||
num += await addUtentiInLista(idapp, 1, arrusers);
|
num += await addUtentiInLista(idapp, 1, arrusers);
|
||||||
@@ -1588,7 +1803,7 @@ UserSchema.statics.DbOp = async function (idapp, mydata) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
return jwt.sign(myobj, process.env.SIGNCODE).toString().substring(0, 180);
|
return jwt.sign(myobj, process.env.SIGNCODE).toString().substring(0, 180);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ module.exports = {
|
|||||||
return Subscription.deleteOne({ userId: rec._id })
|
return Subscription.deleteOne({ userId: rec._id })
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ router.delete('/:id/:notify/:idapp', authenticate, (req, res) => {
|
|||||||
// res.send({ bookedevent: arrdata[0], eventlist: arrdata[1], operators: arrdata[2], wheres: arrdata[3], contribtype: arrdata[4] });
|
// res.send({ bookedevent: arrdata[0], eventlist: arrdata[1], operators: arrdata[2], wheres: arrdata[3], contribtype: arrdata[4] });
|
||||||
// })
|
// })
|
||||||
// .catch((e) => {
|
// .catch((e) => {
|
||||||
// console.log(e);
|
// console.log(e.message);
|
||||||
// res.status(400).send(e);
|
// res.status(400).send(e);
|
||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -22,35 +22,40 @@ const _ = require('lodash');
|
|||||||
const { ObjectID } = require('mongodb');
|
const { ObjectID } = require('mongodb');
|
||||||
|
|
||||||
router.post('/', authenticate, async (req, res) => {
|
router.post('/', authenticate, async (req, res) => {
|
||||||
const idapp = req.body.idapp;
|
try {
|
||||||
let username = req.body.username;
|
const idapp = req.body.idapp;
|
||||||
|
let username = req.body.username;
|
||||||
|
|
||||||
if ((!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm)) && (username) !== req.user.username) {
|
if ((!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm)) && (username) !== req.user.username) {
|
||||||
// If without permissions, exit
|
// If without permissions, exit
|
||||||
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
||||||
}
|
}
|
||||||
let aportador_solidario = req.user.aportador_solidario;
|
let aportador_solidario = req.user.aportador_solidario;
|
||||||
let aportador_solidario_nome_completo = req.user.aportador_solidario_nome_completo;
|
let aportador_solidario_nome_completo = req.user.aportador_solidario_nome_completo;
|
||||||
|
|
||||||
// if (User.isAdmin(req.user.perm) || User.isManager(req.user.perm)) {
|
// if (User.isAdmin(req.user.perm) || User.isManager(req.user.perm)) {
|
||||||
// const recuser = await User.findByUsername(idapp, username);
|
// const recuser = await User.findByUsername(idapp, username);
|
||||||
// if (recuser) {
|
// if (recuser) {
|
||||||
// aportador_solidario_nome_completo = recuser.name + ' ' + recuser.surname;
|
// aportador_solidario_nome_completo = recuser.name + ' ' + recuser.surname;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (username) {
|
if (username) {
|
||||||
aportador_solidario = await User.getAportadorSolidarioByUsername(idapp, username);
|
aportador_solidario = await User.getAportadorSolidarioByUsername(idapp, username);
|
||||||
aportador_solidario_nome_completo = await User.getNameSurnameByUsername(idapp, username);
|
aportador_solidario_nome_completo = await User.getNameSurnameByUsername(idapp, username);
|
||||||
} else {
|
} else {
|
||||||
username = req.user.username;
|
username = req.user.username;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dashboard = await User.getDashboard(idapp, aportador_solidario, username, aportador_solidario_nome_completo);
|
const dashboard = await User.getDashboard(idapp, aportador_solidario, username, aportador_solidario_nome_completo);
|
||||||
if (dashboard)
|
if (dashboard)
|
||||||
res.send({ dashboard });
|
res.send({ dashboard });
|
||||||
else
|
else
|
||||||
|
res.status(400).send(e);
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -188,7 +193,7 @@ router.post('/getdoninavi', authenticate, async (req, res) => {
|
|||||||
else
|
else
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e.message)
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -206,7 +211,7 @@ router.post('/getdata', authenticate, async (req, res) => {
|
|||||||
else
|
else
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e)
|
console.log(e.message)
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ const tools = require('../tools/general');
|
|||||||
const server_constants = require('../tools/server_constants');
|
const server_constants = require('../tools/server_constants');
|
||||||
const actions = require('./api/actions');
|
const actions = require('./api/actions');
|
||||||
|
|
||||||
|
const shared_consts = require('../tools/shared_nodejs');
|
||||||
|
|
||||||
UserCost = {
|
UserCost = {
|
||||||
FIELDS_REQUISITI: ['verified_email',
|
FIELDS_REQUISITI: ['verified_email',
|
||||||
'profile.teleg_id',
|
'profile.teleg_id',
|
||||||
@@ -97,7 +99,7 @@ router.post(process.env.LINKVERIF_REG, (req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send();
|
res.status(400).send();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -126,7 +128,7 @@ router.post(process.env.LINK_REQUEST_NEWPASSWORD, (req, res) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send();
|
res.status(400).send();
|
||||||
res.send({ code: server_constants.RIS_CODE_ERR, msg: e });
|
res.send({ code: server_constants.RIS_CODE_ERR, msg: e });
|
||||||
});
|
});
|
||||||
@@ -166,7 +168,7 @@ router.post(process.env.LINK_UPDATE_PWD, (req, res) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send();
|
res.status(400).send();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -251,7 +253,7 @@ router.post('/settable', authenticate, (req, res) => {
|
|||||||
return res.send(rec);
|
return res.send(rec);
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -270,7 +272,7 @@ router.post('/gettable', authenticate, (req, res) => {
|
|||||||
return res.send(ris);
|
return res.send(ris);
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -370,7 +372,7 @@ router.patch('/chval', authenticate, async (req, res) => {
|
|||||||
// tools.mylogshow('PATCH CHVAL: ', id, fieldsvalue);
|
// tools.mylogshow('PATCH CHVAL: ', id, fieldsvalue);
|
||||||
|
|
||||||
// If I change my record...
|
// If I change my record...
|
||||||
if ((!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm) && !User.isTutor(req.user.perm)) && !(req.user._id.toString() === id) && !tools.ModificheConsentite(mydata.table, fieldsvalue)) {
|
if ((!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm) && !User.isTraduttrici(req.user.perm) && !User.isTutor(req.user.perm)) && !(req.user._id.toString() === id) && !tools.ModificheConsentite(mydata.table, fieldsvalue)) {
|
||||||
// If without permissions, exit
|
// If without permissions, exit
|
||||||
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
||||||
}
|
}
|
||||||
@@ -408,6 +410,23 @@ router.patch('/chval', authenticate, async (req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mydata.table === 'users') {
|
||||||
|
if ('aportador_solidario' in fieldsvalue) {
|
||||||
|
const myuserfound = await User.findByUsername(idapp, fieldsvalue.aportador_solidario, false);
|
||||||
|
if (!!myuserfound) {
|
||||||
|
if (!!myuserfound._id && !myuserfound.deleted) {
|
||||||
|
fieldsvalue.aportador_solidario = await User.getUsernameById(idapp, myuserfound._id);
|
||||||
|
//Aggiorna record !
|
||||||
|
await mytable.findByIdAndUpdate(id, { $set: fieldsvalue });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res.send({ code: server_constants.RIS_CODE_ERR, msg: 'Non aggiornato' });
|
||||||
|
res.status(400).send();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (tools.ModificheConsentite(mydata.table, fieldsvalue)) {
|
if (tools.ModificheConsentite(mydata.table, fieldsvalue)) {
|
||||||
let msg = '';
|
let msg = '';
|
||||||
if (mydata.table === 'users') {
|
if (mydata.table === 'users') {
|
||||||
@@ -454,17 +473,25 @@ router.patch('/callfunz', authenticate, async (req, res) => {
|
|||||||
const mydata = req.body.data;
|
const mydata = req.body.data;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// If I change my record...
|
let entra = false;
|
||||||
if ((!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm) && !User.isTutor(req.user.perm)) && !(req.user._id.toString() === id) && !tools.ModificheConsentite(mydata.table, fieldsvalue)) {
|
if (mydata.myfunc === shared_consts.CallFunz.AGGIUNGI_NUOVO_IMBARCO ||
|
||||||
// If without permissions, exit
|
mydata.myfunc === shared_consts.CallFunz.CANCELLA_IMBARCO) {
|
||||||
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
entra = true
|
||||||
|
}
|
||||||
|
if (!entra) {
|
||||||
|
// If I change my record...
|
||||||
|
if ((!User.isAdmin(req.user.perm) && !User.isManager(req.user.perm) && !User.isTutor(req.user.perm)) && !(req.user._id.toString() === id) && !tools.ModificheConsentite(mydata.table, fieldsvalue)) {
|
||||||
|
// If without permissions, exit
|
||||||
|
return res.status(404).send({ code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: '' });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const myuser = await User.findOne({ idapp, ind_order });
|
const myuser = await User.findOne({ idapp, ind_order });
|
||||||
|
|
||||||
let rimosso = 0;
|
let rimosso = 0;
|
||||||
|
|
||||||
if (mydata.myfunc === 345) { // SOSTITUISCI
|
|
||||||
|
if (mydata.myfunc === shared_consts.CallFunz.SOSTITUISCI) { // SOSTITUISCI
|
||||||
mianavedasost = await Nave.findOne({ idapp, riga: mydata.data.riga, col: mydata.data.col });
|
mianavedasost = await Nave.findOne({ idapp, riga: mydata.data.riga, col: mydata.data.col });
|
||||||
|
|
||||||
// Sostituisci l'Utente
|
// Sostituisci l'Utente
|
||||||
@@ -524,7 +551,7 @@ router.patch('/callfunz', authenticate, async (req, res) => {
|
|||||||
if (!rec) {
|
if (!rec) {
|
||||||
return res.status(404).send();
|
return res.status(404).send();
|
||||||
} else {
|
} else {
|
||||||
if (mydata.notifBot) {
|
if (mydata.notifBot && !!navepersistente.link_chat) {
|
||||||
// Send Notification to the BOT
|
// Send Notification to the BOT
|
||||||
let messaggio = 'Sei stato Spostato in una Nuova Nave !';
|
let messaggio = 'Sei stato Spostato in una Nuova Nave !';
|
||||||
|
|
||||||
@@ -557,9 +584,29 @@ router.patch('/callfunz', authenticate, async (req, res) => {
|
|||||||
res.status(400).send();
|
res.status(400).send();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
} else if (mydata.myfunc === shared_consts.CallFunz.AGGIUNGI_NUOVO_IMBARCO) {
|
||||||
|
// Ottieni il prossimo Numero di Tessitura
|
||||||
|
let num_tess = await Nave.getNextNumTess(idapp, ind_order);
|
||||||
|
|
||||||
|
let listaingr = await ListaIngresso.find({ idapp, ind_order }).sort({ num_tess: 1 });
|
||||||
|
const trovato = listaingr.find((rec) => rec.num_tess === num_tess);
|
||||||
|
if (trovato) {
|
||||||
|
num_tess = listaingr.slice(-1)[0].num_tess + 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
ris = await ListaIngresso.addUserInListaIngresso(idapp, ind_order, myuser.lang, true, num_tess);
|
||||||
|
|
||||||
|
arrimbarchi = await ListaIngresso.findAllByIndOrder(idapp, ind_order);
|
||||||
|
return res.send({ code: server_constants.RIS_CODE_OK, arrimbarchi });
|
||||||
|
} else if (mydata.myfunc === shared_consts.CallFunz.CANCELLA_IMBARCO) {
|
||||||
|
|
||||||
|
await ListaIngresso.remove({ idapp, ind_order, num_tess: mydata.data.num_tess });
|
||||||
|
|
||||||
|
return res.send({ code: server_constants.RIS_CODE_OK });
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send();
|
res.status(400).send();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -644,7 +691,7 @@ router.delete('/delrec/:table/:id', authenticate, async (req, res) => {
|
|||||||
tools.mylog('DELETED ', rec._id);
|
tools.mylog('DELETED ', rec._id);
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send();
|
res.status(400).send();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -719,7 +766,7 @@ router.post('/duprec/:table/:id', authenticate, (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
res.status(400).send();
|
res.status(400).send();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@@ -800,7 +847,7 @@ router.get('/loadsite/:userId/:idapp/:sall', authenticate_noerror, (req, res) =>
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -850,7 +897,7 @@ router.get(process.env.LINK_CHECK_UPDATES, authenticate, async (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send({ code: server_constants.RIS_CODE_ERR, msg: e });
|
res.status(400).send({ code: server_constants.RIS_CODE_ERR, msg: e });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ router.get('/:userId/:idapp/:sall', authenticate, (req, res) => {
|
|||||||
return MyEvent.findAllByUserIdAndIdApp(userId, idapp, sall).then((recevent) => {
|
return MyEvent.findAllByUserIdAndIdApp(userId, idapp, sall).then((recevent) => {
|
||||||
res.send({ recevent });
|
res.send({ recevent });
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ async function ImportData(locale, idapp, strdata, settomailchimp) {
|
|||||||
return ris
|
return ris
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.err(e);
|
console.err(e.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ router.get('/', (req, res) => {
|
|||||||
}).then((objprojects) => {
|
}).then((objprojects) => {
|
||||||
res.send({ projects: objprojects.arrproj });
|
res.send({ projects: objprojects.arrproj });
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -159,7 +159,7 @@ router.get('/:userId', authenticate, (req, res) => {
|
|||||||
res.send({ projects: objprojects.arrproj });
|
res.send({ projects: objprojects.arrproj });
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ async function SendMsgTo(idapp, username, params) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ router.post('/', authenticate, (req, res) => {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
// res.status(400).send(e);
|
// res.status(400).send(e);
|
||||||
return res.send({ code: server_constants.RIS_CODE_ERR, msg: '' });
|
return res.send({ code: server_constants.RIS_CODE_ERR, msg: '' });
|
||||||
})
|
})
|
||||||
@@ -106,7 +106,7 @@ router.get('/:username/:lastdataread/:idapp', authenticate, (req, res) => {
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ const { authenticate } = require('../middleware/authenticate');
|
|||||||
const mongoose = require('mongoose');
|
const mongoose = require('mongoose');
|
||||||
|
|
||||||
const { User } = require('../models/user');
|
const { User } = require('../models/user');
|
||||||
|
const { Nave } = require('../models/nave');
|
||||||
|
const { ListaIngresso } = require('../models/listaingresso');
|
||||||
|
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
|
|
||||||
@@ -24,6 +26,8 @@ router.post('/load', async (req, res) => {
|
|||||||
|
|
||||||
let datastat = {
|
let datastat = {
|
||||||
num_reg: await User.getUsersRegistered(idapp),
|
num_reg: await User.getUsersRegistered(idapp),
|
||||||
|
num_passeggeri: await Nave.getTotInLista(idapp) + await ListaIngresso.getTotInLista(idapp),
|
||||||
|
num_imbarcati: await ListaIngresso.getTotInLista(idapp),
|
||||||
email_non_verif: await User.getEmailNotVerified(idapp),
|
email_non_verif: await User.getEmailNotVerified(idapp),
|
||||||
num_teleg_attivo: await User.getUsersTelegramAttivo(idapp),
|
num_teleg_attivo: await User.getUsersTelegramAttivo(idapp),
|
||||||
num_teleg_pending: await User.getUsersTelegramPending(idapp),
|
num_teleg_pending: await User.getUsersTelegramPending(idapp),
|
||||||
@@ -35,8 +39,11 @@ router.post('/load', async (req, res) => {
|
|||||||
arr_nations: await User.findAllDistinctNationality(idapp),
|
arr_nations: await User.findAllDistinctNationality(idapp),
|
||||||
numreg_untilday: await User.calcnumRegUntilDay(idapp),
|
numreg_untilday: await User.calcnumRegUntilDay(idapp),
|
||||||
reg_daily: await User.calcRegDaily(idapp),
|
reg_daily: await User.calcRegDaily(idapp),
|
||||||
|
reg_weekly: await User.calcRegWeekly(idapp),
|
||||||
lastsreg: await User.getLastUsers(idapp),
|
lastsreg: await User.getLastUsers(idapp),
|
||||||
checkuser: await User.checkUser(idapp, username),
|
checkuser: await User.checkUser(idapp, username),
|
||||||
|
// navi_partite: await Nave.getNaviPartite(idapp),
|
||||||
|
// navi_in_partenza: await Nave.getNaviInPartenza(idapp),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ router.get('/:userId', authenticate, (req, res) => {
|
|||||||
|
|
||||||
res.send({ todos: objtodos.arrtodos, categories: objtodos.arrcategories });
|
res.send({ todos: objtodos.arrtodos, categories: objtodos.arrcategories });
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ router.get('/', (req, res) => {
|
|||||||
|
|
||||||
res.send({ todos: objtodos.arrtodos, categories: objtodos.arrcategories });
|
res.send({ todos: objtodos.arrtodos, categories: objtodos.arrcategories });
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -141,12 +141,13 @@ router.post('/', async (req, res) => {
|
|||||||
user.ind_order = lastindorder + 1;
|
user.ind_order = lastindorder + 1;
|
||||||
|
|
||||||
const numero = user.name.slice(-1);
|
const numero = user.name.slice(-1);
|
||||||
if ((numero === '2') || (numero === '3') || (numero === '4')) {
|
if ((numero === '2') || (numero === '3') || (numero === '4') || (numero === '5') || (numero === '6')) {
|
||||||
recorig = await User.findByCellAndNameSurname(user.idapp, user.profile.cell, user.name.slice(0, -1), user.surname);
|
recorig = await User.findByCellAndNameSurname(user.idapp, user.profile.cell, user.name.slice(0, -1), user.surname);
|
||||||
if (!!recorig) {
|
if (!!recorig) {
|
||||||
user.profile.teleg_id = recorig.profile.teleg_id;
|
user.profile.teleg_id = recorig.profile.teleg_id;
|
||||||
user.profile.saw_zoom_presentation = recorig.profile.saw_zoom_presentation;
|
user.profile.saw_zoom_presentation = recorig.profile.saw_zoom_presentation;
|
||||||
user.profile.saw_and_accepted = recorig.profile.saw_and_accepted;
|
user.profile.saw_and_accepted = recorig.profile.saw_and_accepted;
|
||||||
|
user.profile.my_dream = recorig.profile.my_dream;
|
||||||
user.profile.email_paypal = recorig.profile.email_paypal;
|
user.profile.email_paypal = recorig.profile.email_paypal;
|
||||||
user.profile.paymenttypes = recorig.profile.paymenttypes;
|
user.profile.paymenttypes = recorig.profile.paymenttypes;
|
||||||
let msgseconda = '!!! REGISTRATA ';
|
let msgseconda = '!!! REGISTRATA ';
|
||||||
@@ -465,7 +466,7 @@ router.post('/dbop', authenticate, async (req, res) => {
|
|||||||
} else if (mydata.dbop === 'visuListaNave') {
|
} else if (mydata.dbop === 'visuListaNave') {
|
||||||
mystr = await Nave.showListaOrd(idapp);
|
mystr = await Nave.showListaOrd(idapp);
|
||||||
ris = { mystr };
|
ris = { mystr };
|
||||||
} else if (mydata.dbop === 'visuUtentiNonInNavi') {
|
} else if (mydata.dbop === 'visuStat') {
|
||||||
ris = await User.visuUtentiNonInNavi(idapp);
|
ris = await User.visuUtentiNonInNavi(idapp);
|
||||||
} else if (mydata.dbop === 'pulisciNonPresenzeInNave') {
|
} else if (mydata.dbop === 'pulisciNonPresenzeInNave') {
|
||||||
mystr = await Nave.pulisciNonPresenzeInNave(idapp);
|
mystr = await Nave.pulisciNonPresenzeInNave(idapp);
|
||||||
@@ -616,12 +617,34 @@ router.post('/dbop', authenticate, async (req, res) => {
|
|||||||
|
|
||||||
ris = { num };
|
ris = { num };
|
||||||
} else if (mydata.dbop === 'visuPlacca') {
|
} else if (mydata.dbop === 'visuPlacca') {
|
||||||
const rec = {};
|
|
||||||
|
mystr = '✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨\n' +
|
||||||
|
'ECCO LE NUOVE NAVI DEFINITIVE CHE APRONO DOMANI LA GIFT CHAT !!! 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;
|
||||||
|
if (visu_nave_Bot && ind === 3) {
|
||||||
|
await telegrambot.sendMsgTelegramToTheAdmin(idapp, mystr, true);
|
||||||
|
mystr = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (visu_nave_Bot)
|
||||||
|
await telegrambot.sendMsgTelegramToTheAdmin(idapp, mystr, true);
|
||||||
|
|
||||||
|
ris = { mystr };
|
||||||
|
|
||||||
|
/*const rec = {};
|
||||||
const placca = await Nave.getPlaccaPerDonatore(idapp, parseInt(mydata.riga), parseInt(mydata.col), false, rec);
|
const placca = await Nave.getPlaccaPerDonatore(idapp, parseInt(mydata.riga), parseInt(mydata.col), false, rec);
|
||||||
|
|
||||||
telegrambot.sendMsgTelegramToTheAdmin(idapp, placca);
|
telegrambot.sendMsgTelegramToTheAdmin(idapp, placca);
|
||||||
|
|
||||||
ris = { placca };
|
ris = { placca };*/
|
||||||
} else if (mydata.dbop === 'visuNave') {
|
} else if (mydata.dbop === 'visuNave') {
|
||||||
mystr = await Nave.getNavePos(idapp, parseInt(mydata.riga), parseInt(mydata.col));
|
mystr = await Nave.getNavePos(idapp, parseInt(mydata.riga), parseInt(mydata.col));
|
||||||
|
|
||||||
@@ -652,7 +675,7 @@ router.post('/dbop', authenticate, async (req, res) => {
|
|||||||
|
|
||||||
res.send(ris);
|
res.send(ris);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -656,7 +656,7 @@ module.exports = {
|
|||||||
this.sendEmail_Newsletter_Events("it", idapp, rec._id);
|
this.sendEmail_Newsletter_Events("it", idapp, rec._id);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -580,7 +580,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
return { nummsgsent, strout };
|
return { nummsgsent, strout };
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
return { nummsgsent, strout };
|
return { nummsgsent, strout };
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -927,7 +927,7 @@ class Telegram {
|
|||||||
} else if (MsgBot.PRINCIPE_AZZURRO.find((rec) => testo.indexOf(rec) > -1)) {
|
} else if (MsgBot.PRINCIPE_AZZURRO.find((rec) => testo.indexOf(rec) > -1)) {
|
||||||
risp = 'Chissà... Forse si!\nAnche se meglio averne un\'altro di scorta, nel caso il Principe non sia disponibile.';
|
risp = 'Chissà... Forse si!\nAnche se meglio averne un\'altro di scorta, nel caso il Principe non sia disponibile.';
|
||||||
} else if (MsgBot.AIUTO.find((rec) => testo.indexOf(rec) > -1)) {
|
} else if (MsgBot.AIUTO.find((rec) => testo.indexOf(rec) > -1)) {
|
||||||
risp = 'Clicca qui per entrare nella Chat AYNI - HELP di Supporto\n' + 'https://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w' + '\n\nI miei colleghi umani ti aiuteranno a risolvere !';
|
risp = 'Clicca qui per entrare nella Chat AYNI - HELP di Supporto\n' + 'https://t.me/joinchat/AL2qKE80rxDkgbeMGO-0bw' + '\n\nI miei colleghi umani ti aiuteranno a risolvere !';
|
||||||
} else if (MsgBot.SPOSAMI.find((rec) => testo.indexOf(rec) > -1)) {
|
} else if (MsgBot.SPOSAMI.find((rec) => testo.indexOf(rec) > -1)) {
|
||||||
risp = 'No Grazie! Sono per la Libertà a Vita! ' + emo.JOY + '\nMa se vuoi possiamo conoscerci meglio!' + emo.DANCER + emo.FIRE;
|
risp = 'No Grazie! Sono per la Libertà a Vita! ' + emo.JOY + '\nMa se vuoi possiamo conoscerci meglio!' + emo.DANCER + emo.FIRE;
|
||||||
} else if (MsgBot.CHE_TEMPO_FA.find((rec) => testo.indexOf(rec) > -1)) {
|
} else if (MsgBot.CHE_TEMPO_FA.find((rec) => testo.indexOf(rec) > -1)) {
|
||||||
@@ -956,7 +956,7 @@ class Telegram {
|
|||||||
} else if (testo.length >= 10) {
|
} else if (testo.length >= 10) {
|
||||||
noanswer = true;
|
noanswer = true;
|
||||||
risp = 'Questo messaggio è stato inviato alla Chat Help\nIo sono solo un Robot ' + emo.ROBOT_FACE + emo.JOY2 + '\n\nPer AIUTO, contatta la Chat AYNI - HELP';
|
risp = 'Questo messaggio è stato inviato alla Chat Help\nIo sono solo un Robot ' + emo.ROBOT_FACE + emo.JOY2 + '\n\nPer AIUTO, contatta la Chat AYNI - HELP';
|
||||||
// risp += '\nClicca qui per entrare nella Chat AYNI - HELP di Supporto\n' + 'https://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w' + '\n\nI miei colleghi umani ti aiuteranno a risolvere !';
|
// risp += '\nClicca qui per entrare nella Chat AYNI - HELP di Supporto\n' + 'https://t.me/joinchat/AL2qKE80rxDkgbeMGO-0bw' + '\n\nI miei colleghi umani ti aiuteranno a risolvere !';
|
||||||
await local_sendMsgTelegramToTheManagers(this.idapp, testo, msg, rec.username_bo);
|
await local_sendMsgTelegramToTheManagers(this.idapp, testo, msg, rec.username_bo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1362,7 +1362,7 @@ class Telegram {
|
|||||||
|
|
||||||
mystr += emo.STARS + tools.get__('ZOOM_CONFERENCE', this.getlang(msg)) + emo.STARS + '\n\n';
|
mystr += emo.STARS + tools.get__('ZOOM_CONFERENCE', this.getlang(msg)) + emo.STARS + '\n\n';
|
||||||
|
|
||||||
let pwd = 'Password: 123123';
|
// let pwd = 'Password: 123123';
|
||||||
|
|
||||||
let index = 1;
|
let index = 1;
|
||||||
listazoom.forEach((evento) => {
|
listazoom.forEach((evento) => {
|
||||||
@@ -1375,13 +1375,14 @@ class Telegram {
|
|||||||
mystr += emo.CHECK_VERDE + ' ' + tools.get__('ZOOM_INIZIATO', this.getlang(msg)) + ' ' + emo.CHECK_VERDE + '\n';
|
mystr += emo.CHECK_VERDE + ' ' + tools.get__('ZOOM_INIZIATO', this.getlang(msg)) + ' ' + emo.CHECK_VERDE + '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
mystr += `${emo.EYES} ${tools.getstrDateTimeShort(evento.date_start)} ${emo.EYES}`;
|
mystr += `${emo.EYES} ${tools.getstrDateTimeShort(evento.date_start, this.getlang(msg))} ${emo.EYES}`;
|
||||||
mystr += `\n${evento.title}\n(${evento.note})\n\n`;
|
mystr += `\n${evento.title}\n(${evento.note})\n\n`;
|
||||||
if (nextzoom) {
|
if (nextzoom) {
|
||||||
if (iniziata) {
|
if (iniziata) {
|
||||||
mystr += emo.FIRE + tools.get__('CLICCA_ENTRA', this.getlang(msg)) + ' ' + emo.FIRE + '\n';
|
mystr += emo.FIRE + tools.get__('CLICCA_ENTRA', this.getlang(msg)) + ' ' + emo.FIRE + '\n';
|
||||||
mystr += tools.getlinkzoom(evento.id_conf_zoom) + '\n';
|
mystr += tools.getlinkzoom(evento.id_conf_zoom) + '\n';
|
||||||
mystr += pwd + '\n\n';
|
mystr += '\n';
|
||||||
|
//mystr += pwd + '\n\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1391,7 +1392,7 @@ class Telegram {
|
|||||||
|
|
||||||
if (!nextzoom && index > 1) {
|
if (!nextzoom && index > 1) {
|
||||||
mystr += "✨✨✨✨✨✨✨✨✨✨✨✨\n" +
|
mystr += "✨✨✨✨✨✨✨✨✨✨✨✨\n" +
|
||||||
tools.get__('CLICCA_PER_ZOOM', this.getlang(msg)) + ':\n' + tools.getlinkzoom(listazoom[0].id_conf_zoom) + '\n' + "✨✨✨✨✨✨✨✨✨✨✨✨\n" + pwd + '\n\n';
|
tools.get__('CLICCA_PER_ZOOM', this.getlang(msg)) + ':\n' + tools.getlinkzoom(listazoom[0].id_conf_zoom) + '\n' + "✨✨✨✨✨✨✨✨✨✨✨✨\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return mystr
|
return mystr
|
||||||
@@ -1779,7 +1780,7 @@ class Telegram {
|
|||||||
}
|
}
|
||||||
rec.start_write_msgall = false;
|
rec.start_write_msgall = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ textlang = {
|
|||||||
"Nuova Registrazione": "Nuova Registrazione",
|
"Nuova Registrazione": "Nuova Registrazione",
|
||||||
"Effettuata una Nuova Registrazione": "Effettuata una Nuova Registrazione",
|
"Effettuata una Nuova Registrazione": "Effettuata una Nuova Registrazione",
|
||||||
"partecipanti": "partecipanti",
|
"partecipanti": "partecipanti",
|
||||||
'TESTO_ASSISTENZA': "Per entrare nel Sito AYNI:\nhttps://ayni.gifteconomy.app\n\nChat AYNI - EMPOWER: Entra ⛩ nella nostra Community chat:\n ITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nPER AIUTO: Leggi le Domande più Frequenti:\nhttps://ayni.gifteconomy.app/faq\n\nChat di Supporto 'AYNI - HELP'\nDa Lunedì al Sabato (8:00 - 20:00)\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Fai la tua domanda e chiedi assistenza.\n2 - Dopo aver ricevuto aiuto esci dalla chat.\nPotrai rientrare ogni qualvolta ne avrai la necessità.",
|
'TESTO_ASSISTENZA': "Per entrare nel Sito AYNI:\nhttps://ayni.gifteconomy.app\n\nChat AYNI - EMPOWER: Entra ⛩ nella nostra Community chat:\n ITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nPER AIUTO: Leggi le Domande più Frequenti:\nhttps://ayni.gifteconomy.app/faq\n\nChat di Supporto 'AYNI - HELP'\nDa Lunedì al Sabato (8:00 - 20:00)\nhttps://t.me/joinchat/AL2qKE80rxDkgbeMGO-0bw\n1 - Fai la tua domanda e chiedi assistenza.\n2 - Dopo aver ricevuto aiuto esci dalla chat.\nPotrai rientrare ogni qualvolta ne avrai la necessità.",
|
||||||
'BENVENUTO': "Benvenuto",
|
'BENVENUTO': "Benvenuto",
|
||||||
'TUE_NAVI': "Ecco le tue Navi programmate",
|
'TUE_NAVI': "Ecco le tue Navi programmate",
|
||||||
'HAI_I_7_REQUISITI': 'PRIMI PASSI OK!\nHai i Primi 7 Requisiti per Entrare nella Lista d\'Imbarco!',
|
'HAI_I_7_REQUISITI': 'PRIMI PASSI OK!\nHai i Primi 7 Requisiti per Entrare nella Lista d\'Imbarco!',
|
||||||
@@ -63,7 +63,7 @@ textlang = {
|
|||||||
'INFO_LAVAGNA_SITO': 'Per vedere in dettaglio lo stato della tua Nave, sul sito AYNI, clicca sulle 3 linee in alto a sinistra ed accedi alla voce "Lavagna".\n',
|
'INFO_LAVAGNA_SITO': 'Per vedere in dettaglio lo stato della tua Nave, sul sito AYNI, clicca sulle 3 linee in alto a sinistra ed accedi alla voce "Lavagna".\n',
|
||||||
'INFO_LINK_DA_CONDIVIDERE': 'Link da condividere ai tuoi invitati per farli registrare al sito di Ayni:\n\n%s',
|
'INFO_LINK_DA_CONDIVIDERE': 'Link da condividere ai tuoi invitati per farli registrare al sito di Ayni:\n\n%s',
|
||||||
'INFO_LINK_ZOOM': 'Link da condividere per partecipare allo Zoom (Conferenza OnLine):\n%s',
|
'INFO_LINK_ZOOM': 'Link da condividere per partecipare allo Zoom (Conferenza OnLine):\n%s',
|
||||||
'ZOOM_CONFERENCE': 'Qui trovi le date di programmazione agli Zoom:',
|
'ZOOM_CONFERENCE': 'Ecco il programma delle Conferenze (Zoom) aperti a TUTTI:',
|
||||||
"NON_VERIF": "Non Verificata",
|
"NON_VERIF": "Non Verificata",
|
||||||
"VERIF": "Verificata",
|
"VERIF": "Verificata",
|
||||||
'EMAIL': "Email",
|
'EMAIL': "Email",
|
||||||
@@ -107,7 +107,7 @@ textlang = {
|
|||||||
"Nuova Registrazione": "Nova Registracija",
|
"Nuova Registrazione": "Nova Registracija",
|
||||||
"Effettuata una Nuova Registrazione": "Izpelji novo Registracijo",
|
"Effettuata una Nuova Registrazione": "Izpelji novo Registracijo",
|
||||||
"partecipanti": "Udeleženci",
|
"partecipanti": "Udeleženci",
|
||||||
'TESTO_ASSISTENZA': "Za vstop na spletno stran:\nhttps://ayni.gifteconomy.app\n\nSi pozabil geslo za vstop na stran?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nKlepet AYNI BOT (questa):\nhttps://t.me/notevoleaynibot\n\nKlepet AYNI - EMPOWER: Vstopi ⛩ v našo Skupnost klepet:\n ITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nKlepet AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nKlepet za Pomoč in Suport: 'AYNI - HELP'\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Postavi svoje vprašanje in prosi za asistenco.\n2 - KO si sprejel pomoč, izstopi iz klepeta.\n Vstopil boš lahko vedno, ko boš potreboval pomoč.",
|
'TESTO_ASSISTENZA': "Za vstop na spletno stran:\nhttps://ayni.gifteconomy.app\n\nSi pozabil geslo za vstop na stran?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nKlepet AYNI BOT (questa):\nhttps://t.me/notevoleaynibot\n\nKlepet AYNI - EMPOWER: Vstopi ⛩ v našo Skupnost klepet:\n ITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nKlepet AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nKlepet za Pomoč in Suport: 'AYNI - HELP'\nhttps://t.me/joinchat/AL2qKE80rxDkgbeMGO-0bw\n1 - Postavi svoje vprašanje in prosi za asistenco.\n2 - KO si sprejel pomoč, izstopi iz klepeta.\n Vstopil boš lahko vedno, ko boš potreboval pomoč.",
|
||||||
'BENVENUTO': "Dobrodošel",
|
'BENVENUTO': "Dobrodošel",
|
||||||
'TUE_NAVI': "Tvoje programirane Ladje",
|
'TUE_NAVI': "Tvoje programirane Ladje",
|
||||||
'HAI_I_7_REQUISITI': 'PRVI KORAKI OK!\nIzpolnjuješ Prvih 7 Zahtev za vstop na Listo d\'Vkrcanje!',
|
'HAI_I_7_REQUISITI': 'PRVI KORAKI OK!\nIzpolnjuješ Prvih 7 Zahtev za vstop na Listo d\'Vkrcanje!',
|
||||||
@@ -163,7 +163,7 @@ textlang = {
|
|||||||
"Nuova Registrazione": "Nuevo Registro",
|
"Nuova Registrazione": "Nuevo Registro",
|
||||||
"Effettuata una Nuova Registrazione": "Se ha realizado un nuevo registro",
|
"Effettuata una Nuova Registrazione": "Se ha realizado un nuevo registro",
|
||||||
"partecipanti": "participantes",
|
"partecipanti": "participantes",
|
||||||
'TESTO_ASSISTENZA': "Para entrar en el sitio de AYNI:\nhttps://ayni.gifteconomy.app\n\n¿Olvidó su contraseña para acceder al sitio?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (este):\nhttps://t.me/notevoleaynibot\n\nChat AYNI - EMPOWER: Entra en ⛩ en nuestra comunidad de chat:\n ITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat de la AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat de ayuda y soporte: 'AYNI - HELP'\nDe lunes a sábado (8:00 - 21:00)\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Haga su pregunta y pida ayuda.\n2 - Después de que consigas ayuda, sal de la sala de chat.\nPuedes volver cuando necesites ayuda..",
|
'TESTO_ASSISTENZA': "Para entrar en el sitio de AYNI:\nhttps://ayni.gifteconomy.app\n\n¿Olvidó su contraseña para acceder al sitio?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (este):\nhttps://t.me/notevoleaynibot\n\nChat AYNI - EMPOWER: Entra en ⛩ en nuestra comunidad de chat:\n ITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat de la AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat de ayuda y soporte: 'AYNI - HELP'\nDe lunes a sábado (8:00 - 21:00)\nhttps://t.me/joinchat/AL2qKE80rxDkgbeMGO-0bw\n1 - Haga su pregunta y pida ayuda.\n2 - Después de que consigas ayuda, sal de la sala de chat.\nPuedes volver cuando necesites ayuda..",
|
||||||
'BENVENUTO': "Bienvenido",
|
'BENVENUTO': "Bienvenido",
|
||||||
'TUE_NAVI': "Aquí están sus naves programadas",
|
'TUE_NAVI': "Aquí están sus naves programadas",
|
||||||
'HAI_I_7_REQUISITI': '¡LOS PRIMEROS PASOS ESTÁN BIEN!\nTiene los primeros 7 requisitos para entrar en la lista de embarque!',
|
'HAI_I_7_REQUISITI': '¡LOS PRIMEROS PASOS ESTÁN BIEN!\nTiene los primeros 7 requisitos para entrar en la lista de embarque!',
|
||||||
@@ -216,7 +216,7 @@ textlang = {
|
|||||||
},
|
},
|
||||||
enUs: {
|
enUs: {
|
||||||
"partecipanti": "participants",
|
"partecipanti": "participants",
|
||||||
'TESTO_ASSISTENZA': "To enter the AYNI Site:\nhttps://ayni.gifteconomy.app\n\nForgot your password to access the site?\nhttps://ayni.gifteconomy.app/requestresetpwd\nChat AYNI BOT (this one):\nhttps://t.me/notevoleaynibot\n\nChat AYNI - EMPOWER: Enter ⛩ into our chat community:\nITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nHelp and Support Chat: 'AYNI - HELP'.\nMonday to Saturday (8:00 - 20:00)\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Ask your question and ask for assistance.\n2 - After receiving help, exit the chat.\nYou can come back whenever you need help.",
|
'TESTO_ASSISTENZA': "To enter the AYNI Site:\nhttps://ayni.gifteconomy.app\n\nForgot your password to access the site?\nhttps://ayni.gifteconomy.app/requestresetpwd\nChat AYNI BOT (this one):\nhttps://t.me/notevoleaynibot\n\nChat AYNI - EMPOWER: Enter ⛩ into our chat community:\nITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nHelp and Support Chat: 'AYNI - HELP'.\nMonday to Saturday (8:00 - 20:00)\nhttps://t.me/joinchat/AL2qKE80rxDkgbeMGO-0bw\n1 - Ask your question and ask for assistance.\n2 - After receiving help, exit the chat.\nYou can come back whenever you need help.",
|
||||||
'BENVENUTO': "Welcome",
|
'BENVENUTO': "Welcome",
|
||||||
'TUE_NAVI': "Here are your programmed ships",
|
'TUE_NAVI': "Here are your programmed ships",
|
||||||
'HAI_I_7_REQUISITI': 'FIRST STEPS OK!\nYou have the First 7 Requirements to Enter the Boarding List!',
|
'HAI_I_7_REQUISITI': 'FIRST STEPS OK!\nYou have the First 7 Requirements to Enter the Boarding List!',
|
||||||
@@ -272,7 +272,7 @@ textlang = {
|
|||||||
"Nuova Registrazione": "Nouvelle inscription",
|
"Nuova Registrazione": "Nouvelle inscription",
|
||||||
"Effettuata una Nuova Registrazione": "Un nouvel enregistrement a été effectué",
|
"Effettuata una Nuova Registrazione": "Un nouvel enregistrement a été effectué",
|
||||||
"partecipanti": "participants",
|
"partecipanti": "participants",
|
||||||
'TESTO_ASSISTENZA': "Pour entrer sur le site AYNI:\nhttps://ayni.gifteconomy.app\n\nVous avez oublié votre mot de passe pour accéder au site ?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (ce):\nhttps://t.me/notevoleaynibot\n\nChat AYNI - EMPOWER : Entrez ⛩ dans notre Community chat:\nITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat d’Aide et de Support: 'AYNI - HELP'\nDu lundi au samedi (8:00 - 20:00)\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Posez votre question et demandez d’être assisté.\n2 - Après avoir reçu l’aide, quittez le groupe .\\n Vous pourrez y entrer chaque fois qu’il vous sera nécessaire.",
|
'TESTO_ASSISTENZA': "Pour entrer sur le site AYNI:\nhttps://ayni.gifteconomy.app\n\nVous avez oublié votre mot de passe pour accéder au site ?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (ce):\nhttps://t.me/notevoleaynibot\n\nChat AYNI - EMPOWER : Entrez ⛩ dans notre Community chat:\nITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat d’Aide et de Support: 'AYNI - HELP'\nDu lundi au samedi (8:00 - 20:00)\nhttps://t.me/joinchat/AL2qKE80rxDkgbeMGO-0bw\n1 - Posez votre question et demandez d’être assisté.\n2 - Après avoir reçu l’aide, quittez le groupe .\\n Vous pourrez y entrer chaque fois qu’il vous sera nécessaire.",
|
||||||
'BENVENUTO': "Bienvenue",
|
'BENVENUTO': "Bienvenue",
|
||||||
'TUE_NAVI': "Voici vos navires programmés",
|
'TUE_NAVI': "Voici vos navires programmés",
|
||||||
'HAI_I_7_REQUISITI': 'PREMIÈRES ÉTAPES OK!\nvous avez les 7 premiers Requis pour Entrer dans la liste d\'embarquement!',
|
'HAI_I_7_REQUISITI': 'PREMIÈRES ÉTAPES OK!\nvous avez les 7 premiers Requis pour Entrer dans la liste d\'embarquement!',
|
||||||
@@ -325,46 +325,46 @@ textlang = {
|
|||||||
},
|
},
|
||||||
pt: {
|
pt: {
|
||||||
"L'Email è già stata Verificata": "",
|
"L'Email è già stata Verificata": "",
|
||||||
"Nuova Registrazione": "Nuova Registrazione",
|
"Nuova Registrazione": "Novo Registo",
|
||||||
"Effettuata una Nuova Registrazione": "Effettuata una Nuova Registrazione",
|
"Effettuata una Nuova Registrazione": "Foi efectuado um novo registo",
|
||||||
"partecipanti": "partecipanti",
|
"partecipanti": "participantes",
|
||||||
'TESTO_ASSISTENZA': "Per entrare nel Sito AYNI:\nhttps://ayni.gifteconomy.app\n\nHai dimenticato la Password per accedere al sito?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (questa):\nhttps://t.me/notevoleaynibot\n\nChat AYNI - EMPOWER: Entra ⛩ nella nostra Community chat:ITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat di Aiuto e Supporto: 'AYNI - HELP'\nDa Lunedì al Sabato (8:00 - 20:00)\nhttps://t.me/joinchat/C741mlVmB_RMcOUpNqWC8w\n1 - Fai la tua domanda e chiedi assistenza.\n2 - Dopo aver ricevuto aiuto esci dalla chat.\nPotrai rientrare ogni qualvolta ne avrai la necessità.",
|
'TESTO_ASSISTENZA': "Para entrar no site do AYNI:\nhttps://ayni.gifteconomy.app\n\nEsqueceu sua senha para acessar o site?\nhttps://ayni.gifteconomy.app/requestresetpwd\n\nChat AYNI BOT (isto):\nhttps://t.me/notevoleaynibot\n\nChat AYNI - EMPOWER: Entrar em ⛩ na nossa comunidade de chat:ITA 🇮🇹: https://t.me/joinchat/C741mkx5QYXu-kyYCYvA8g\n SLO 🇸🇮: https://t.me/aynislovenija\n ESP 🇪🇸 - PRT 🇵🇹: https://t.me/joinchat/AL2qKBqJRuIEuc2FivgAzg\n ENG 🇬🇧: https://t.me/joinchat/AL2qKBYX0yVvOJ6Ssf9hKg\n FRA 🇫🇷: https://t.me/joinchat/Kz0wtxieJjzoC3L_DsrdZw \n\nChat AYNI-BIBLIO: https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ \n\nChat de Ajuda e Suporte: 'AYNI - HELP'.\nDe segunda a sábado (8:00 - 20:00 ITALY)\nhttps://t.me/joinchat/AL2qKE80rxDkgbeMGO-0bw\n1 - Faça a sua pergunta e peça ajuda.\n2 - Depois de receber ajuda, saia do chat.\nPode voltar sempre que precisar de o fazer..",
|
||||||
'BENVENUTO': "Benvenuto",
|
'BENVENUTO': "Bem-vindo",
|
||||||
'TUE_NAVI': "Ecco le tue Navi programmate",
|
'TUE_NAVI': "Aqui estão os seus navios programados",
|
||||||
'HAI_I_7_REQUISITI': 'PRIMI PASSI OK!\nHai i Primi 7 Requisiti per Entrare nella Lista d\'Imbarco!',
|
'HAI_I_7_REQUISITI': 'PRIMEIROS PASSOS OK!\nVocê tem os 7 primeiros requisitos para entrar na lista de embarque!',
|
||||||
'NON_HAI_I_7_REQUISITI': 'Attenzione!\nAncora non hai i 7 Requisiti per Entrare nella Lista d\'Imbarco!',
|
'NON_HAI_I_7_REQUISITI': 'Atenção!\nVocê ainda não tem os 7 requisitos para entrar na lista de embarque!',
|
||||||
'HAI_I_9_REQUISITI': 'COMPLIMENTI!\nHai Completato TUTTI i 9 Passi della Guida! Grazie per Aiutare AYNI ad Espandersi!',
|
'HAI_I_9_REQUISITI': 'FELICITAÇÕES!\nVocê completou TODAS as 9 etapas da condução! Obrigado por ajudar a AYNI a expandir!',
|
||||||
'NON_HAI_I_9_REQUISITI': 'Ricorda che puoi Aiutare a far Crescere ed Espandere il Movimento, Condividendo con chiunque questo nostro viaggio!',
|
'NON_HAI_I_9_REQUISITI': 'Lembre-se que pode ajudar o Movimento a crescer e expandir-se, partilhando a nossa jornada com todos!',
|
||||||
'INFO_LA_MIA_LAVAGNA': '✨ Lista dei Passi: ✨ \n',
|
'INFO_LA_MIA_LAVAGNA': '✨ Lista de etapas: ✨ \n',
|
||||||
'INFO_LAVAGNA_SITO_COMPLETARE': 'Per completare tutti i requisiti vai sul sito:\n%s\nPer vedere lo stato della tua Nave e dei tuoi invitati, clicca sulle 3 linee in alto a sinistra ed accedi alla voce "Lavagna".\n',
|
'INFO_LAVAGNA_SITO_COMPLETARE': 'Para completar todos os requisitos ir para o sitio:\n%s\nPer vedere lo stato della tua Nave e dei tuoi invitati, clicca sulle 3 linee in alto a sinistra ed accedi alla voce "Lavagna".\n',
|
||||||
'INFO_LAVAGNA_SITO': 'Per vedere in dettaglio lo stato della tua Nave, sul sito AYNI, clicca sulle 3 linee in alto a sinistra ed accedi alla voce "Lavagna".\n',
|
'INFO_LAVAGNA_SITO': 'Para ver em detalhe o estado do seu navio, no site da AYNI, clique nas 3 linhas no canto superior esquerdo e vá para "DashBoard"..\n',
|
||||||
'INFO_LINK_DA_CONDIVIDERE': 'Link da condividere ai tuoi invitati per farli registrare al sito di Ayni:\n\n%s',
|
'INFO_LINK_DA_CONDIVIDERE': 'Links para partilhar com os seus convidados para que se registem no website da Ayni:\n\n%s',
|
||||||
'INFO_LINK_ZOOM': 'Link da condividere per partecipare allo Zoom (Conferenza OnLine):\n%s',
|
'INFO_LINK_ZOOM': 'Links para partilhar para participar na Zoom (Conferência Online):\n%s',
|
||||||
'ZOOM_CONFERENCE': 'Qui trovi le date di programmazione agli Zoom:',
|
'ZOOM_CONFERENCE': 'Aqui está o programa das Conferências (Zoom) aberto a TODOS:',
|
||||||
"NON_VERIF": "Non Verificata",
|
"NON_VERIF": "Não verificado",
|
||||||
"VERIF": "Verificata",
|
"VERIF": "Verificado",
|
||||||
'EMAIL': "Email",
|
'EMAIL': "Email",
|
||||||
'BOT': "AYNI BOT",
|
'BOT': "AYNI BOT",
|
||||||
'EMAIL_NON_VERIF': "Email Non Verificata\nleggi la tua casella email e trova **\"Confermare la Registrazione a Ayni\"**<br>e clicca sul bottone **\"Verifica Registrazione\"**",
|
'EMAIL_NON_VERIF': "Email Não verificado\nleia a sua caixa de correio e encontre **\"Confirmar o registo à Ayni\"**<br>e clique no botão **\"Verificação do registo\"**",
|
||||||
'TELEGRAM_NOT_CONNECTED': "Telegram non associato al tuo account!",
|
'TELEGRAM_NOT_CONNECTED': "Telegrama não associado à sua conta!",
|
||||||
'NESSUN_INVITATO': 'Non hai invitato nessuno',
|
'NESSUN_INVITATO': 'Você não convidou ninguém',
|
||||||
'ZOOM_PARTECIPATO': 'Partecipazione ad almeno 1 Conferenza (Zoom)',
|
'ZOOM_PARTECIPATO': 'Participação em pelo menos 1 Conferência (Zoom)',
|
||||||
'LINEE_GUIDA': 'Accettato le Linee Guida',
|
'LINEE_GUIDA': 'Directrizes Aceites',
|
||||||
'VIDEO_INTRO': 'Visto il Video di AYNI',
|
'VIDEO_INTRO': 'Ver o vídeo do AYNI',
|
||||||
'SCRITTO_SOGNO': 'Hai scritto il tuo Sogno',
|
'SCRITTO_SOGNO': 'Você escreveu o seu sonho',
|
||||||
'PAYMENTS': 'Modalità di Pagamento (Obbligatorio Paypal)',
|
'PAYMENTS': 'Formas de pagamento (Obrigatório Paypal)',
|
||||||
'INVITATI': 'persone registrate che hai invitato',
|
'INVITATI': 'pessoas registadas que convidou',
|
||||||
'INVITATI_ATTIVI': 'Invitati con i 7 Requisiti',
|
'INVITATI_ATTIVI': 'Convidado com os 7 Requisitos',
|
||||||
'NONREG': 'Invitati non Registrati',
|
'NONREG': 'Convidados não registados',
|
||||||
'CLICCA_PER_ZOOM': 'AL GIORNO E ORA INDICATA, PER ENTRARE NELLA VIDEO-CONFERENZA, CLICCA QUI',
|
'CLICCA_PER_ZOOM': 'PARA O DIA E HORA INDICADOS, PARA ENTRAR NA VÍDEO-CONFERÊNCIA, CLIQUE AQUI',
|
||||||
'CLICCA_ENTRA': 'CLICCA QUI PER ENTRARE !',
|
'CLICCA_ENTRA': 'CLIQUE AQUI PARA ENTRAR !',
|
||||||
'ZOOM_INIZIATO': 'QUESTA CONFERENZA E\' INIZIATA!',
|
'ZOOM_INIZIATO': 'ESTA CONFERÊNCIA JÁ COMEÇOU!',
|
||||||
'SCEGLI_VOCE': 'scegli una voce:',
|
'SCEGLI_VOCE': 'escolha uma voz:',
|
||||||
'INVITATI_LISTA': 'I Tuoi Invitati (in verde con almeno i primi 7 Requisiti)',
|
'INVITATI_LISTA': 'Os seus convidados (em verde com, pelo menos, os 7 primeiros requisitos)',
|
||||||
'CIAO': 'Ciao',
|
'CIAO': 'Olá',
|
||||||
'ADDED_TOLISTAINGRESSO': 'Sei stato aggiunto alla Lista delle persone che entreranno nella Lista D\'Imbarco !',
|
'ADDED_TOLISTAINGRESSO': 'Foi acrescentado à Lista de Embarque !',
|
||||||
'NO_PROG': 'Attualmente non sei ancora dentro alla Lista d\'Imbarco!',
|
'NO_PROG': 'Actualmente, ainda não consta da lista de embarque.!',
|
||||||
'SEND_LINK_CHAT_DONATORI': 'Ciao %s!\nLa tua NAVE sta finalmente Salpando!\nEntra nella Gift Chat cliccando qui: %s',
|
'SEND_LINK_CHAT_DONATORI': 'Olà %s!\nO seu SHIP está finalmente a zarpar.!\nEntre no Gift Chat, clicando aqui: %s',
|
||||||
'SOGNATORE': 'SONHEIROS',
|
'SOGNATORE': 'SONHEIROS',
|
||||||
'MEDIATORE': 'MEDIATOR',
|
'MEDIATORE': 'MEDIATOR',
|
||||||
'DONATORI': 'DONATORES',
|
'DONATORI': 'DONATORES',
|
||||||
@@ -1081,6 +1081,12 @@ module.exports = {
|
|||||||
mypos.riga = mypos.riga - mypos.numup;
|
mypos.riga = mypos.riga - mypos.numup;
|
||||||
mypos.col = Math.ceil(mypos.col * (Math.pow(2, -mypos.numup)));
|
mypos.col = Math.ceil(mypos.col * (Math.pow(2, -mypos.numup)));
|
||||||
}
|
}
|
||||||
|
if (mypos.riga < 1) {
|
||||||
|
mypos.riga = 1;
|
||||||
|
}
|
||||||
|
if (mypos.col < 1) {
|
||||||
|
mypos.col = 1;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
appendLeadingZeroes(n) {
|
appendLeadingZeroes(n) {
|
||||||
@@ -1090,6 +1096,25 @@ module.exports = {
|
|||||||
return n
|
return n
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getWeekDayByLang(date, lang) {
|
||||||
|
if (!lang)
|
||||||
|
lang = 'it';
|
||||||
|
|
||||||
|
const dayOfWeek = new Date(date).getDay();
|
||||||
|
|
||||||
|
const myday = {
|
||||||
|
it: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'],
|
||||||
|
enUs: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
||||||
|
fr: ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'],
|
||||||
|
es: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'iernes', 'Sábado'],
|
||||||
|
pt: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
|
||||||
|
de: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
|
||||||
|
si: ['Nedelja', 'Ponedeljek', 'Torek', 'Sreda', 'četrtek', 'Petek', 'Sobota'],
|
||||||
|
}
|
||||||
|
|
||||||
|
return isNaN(dayOfWeek) ? '' : myday[lang][dayOfWeek].substring(0, 3)
|
||||||
|
},
|
||||||
|
|
||||||
getWeekDay(date) {
|
getWeekDay(date) {
|
||||||
//Create an array containing each day, starting with Sunday.
|
//Create an array containing each day, starting with Sunday.
|
||||||
const weekdays = [
|
const weekdays = [
|
||||||
@@ -1101,28 +1126,28 @@ module.exports = {
|
|||||||
return weekdays[day];
|
return weekdays[day];
|
||||||
},
|
},
|
||||||
|
|
||||||
getstrDateTimeShort(mydate) {
|
getstrDateTimeShort(mydate, lang) {
|
||||||
if (mydate) {
|
if (mydate) {
|
||||||
// console.log('getstrDate', mytimestamp)
|
// console.log('getstrDate', mytimestamp)
|
||||||
return this.getWeekDay(mydate) + ' ' + this.appendLeadingZeroes(mydate.getDate()) + '/' + this.appendLeadingZeroes(mydate.getMonth() + 1) + ' ORE ' + this.appendLeadingZeroes(mydate.getHours()) + ':' + this.appendLeadingZeroes(mydate.getMinutes());
|
return this.getWeekDayByLang(mydate, lang) + ' ' + this.appendLeadingZeroes(mydate.getDate()) + '/' + this.appendLeadingZeroes(mydate.getMonth() + 1) + ' ORE ' + this.appendLeadingZeroes(mydate.getHours()) + ':' + this.appendLeadingZeroes(mydate.getMinutes());
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getstrDateShort(mydate) {
|
getstrDateShort(mydate, lang) {
|
||||||
if (mydate) {
|
if (mydate) {
|
||||||
// console.log('getstrDate', mytimestamp)
|
// console.log('getstrDate', mytimestamp)
|
||||||
return this.getWeekDay(mydate).substring(0, 3) + ' ' + this.appendLeadingZeroes(mydate.getDate()) + '/' + this.appendLeadingZeroes(mydate.getMonth() + 1);
|
return this.getWeekDayByLang(mydate, lang).substring(0, 3) + ' ' + this.appendLeadingZeroes(mydate.getDate()) + '/' + this.appendLeadingZeroes(mydate.getMonth() + 1);
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getstrDateLong(mydate) {
|
getstrDateLong(mydate, lang) {
|
||||||
if (mydate) {
|
if (mydate) {
|
||||||
// console.log('getstrDate', mytimestamp)
|
// console.log('getstrDate', mytimestamp)
|
||||||
return this.getWeekDay(mydate) + ' ' + this.appendLeadingZeroes(mydate.getDate()) + '/' + this.appendLeadingZeroes(mydate.getMonth() + 1) + '/' + mydate.getFullYear();
|
return this.getWeekDayByLang(mydate, lang) + ' ' + this.appendLeadingZeroes(mydate.getDate()) + '/' + this.appendLeadingZeroes(mydate.getMonth() + 1) + '/' + mydate.getFullYear();
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ module.exports = {
|
|||||||
Manager: 2,
|
Manager: 2,
|
||||||
Teacher: 4,
|
Teacher: 4,
|
||||||
Tutor: 8,
|
Tutor: 8,
|
||||||
|
Traduttrici: 16,
|
||||||
},
|
},
|
||||||
|
|
||||||
MessageOptions: {
|
MessageOptions: {
|
||||||
@@ -41,6 +42,12 @@ module.exports = {
|
|||||||
OPZ1_2: 2,
|
OPZ1_2: 2,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
CallFunz: {
|
||||||
|
SOSTITUISCI: 345,
|
||||||
|
AGGIUNGI_NUOVO_IMBARCO: 380,
|
||||||
|
CANCELLA_IMBARCO: 385,
|
||||||
|
},
|
||||||
|
|
||||||
fieldsUserToChange() {
|
fieldsUserToChange() {
|
||||||
return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'ipaddr', 'lasttimeonline', 'profile', 'calcstat', 'news_on', 'aportador_solidario', 'made_gift', 'ind_order', 'numinvitati', 'numinvitatiattivi', 'qualified']
|
return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'ipaddr', 'lasttimeonline', 'profile', 'calcstat', 'news_on', 'aportador_solidario', 'made_gift', 'ind_order', 'numinvitati', 'numinvitatiattivi', 'qualified']
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user