Strutturato le Traduzioni del Sito Specifico
Inizio creazione di SalviamoIlPianeta.app
This commit is contained in:
38
emails/registration_sip/enUs/html.pug
Executable file
38
emails/registration_sip/enUs/html.pug
Executable file
@@ -0,0 +1,38 @@
|
|||||||
|
p Welcome #{name} to the portal #{nomeapp}!
|
||||||
|
p Your access data to remember are:
|
||||||
|
span Username:
|
||||||
|
strong #{username}<br>
|
||||||
|
span Forgot your Password? :
|
||||||
|
strong <a href=#{forgetpwd} target="_blank">Find it here</a><br>
|
||||||
|
span Email:
|
||||||
|
strong #{emailto}<br>
|
||||||
|
p To confirm the registration click on the button, or click here #{strlinkreg}:
|
||||||
|
div.divbtn <a href=#{strlinkreg} target="_blank">
|
||||||
|
button.btn.btn-lg Verify Registration</a>
|
||||||
|
|
||||||
|
|
||||||
|
p You could enter to the site and Login.
|
||||||
|
|
||||||
|
|
||||||
|
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/registration_sip/enUs/subject.pug
Executable file
1
emails/registration_sip/enUs/subject.pug
Executable file
@@ -0,0 +1 @@
|
|||||||
|
=`Confirm Registration to ${nomeapp}`
|
||||||
37
emails/registration_sip/esEs/html.pug
Executable file
37
emails/registration_sip/esEs/html.pug
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
p ¡Bienvenido #{name} al portal #{nomeapp}!
|
||||||
|
p Sus datos de acceso a recordar son:
|
||||||
|
Nombre Usuario:
|
||||||
|
strong #{username}<br>
|
||||||
|
span ¿Olvidaste tu contraseña? :
|
||||||
|
strong <a href=#{forgetpwd} target="_blank">Encuéntrelo aquí</a><br>
|
||||||
|
span Email:
|
||||||
|
strong #{emailto}<br>
|
||||||
|
p Para confirmar el registro haz clic en el botón:
|
||||||
|
div.divbtn <a href=#{strlinkreg} target="_blank">
|
||||||
|
button.btn.btn-lg Verificar registro</a>
|
||||||
|
|
||||||
|
p Así puedes entrar al sitio e iniciar la sesión.
|
||||||
|
|
||||||
|
|
||||||
|
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/registration_sip/esEs/subject.pug
Executable file
1
emails/registration_sip/esEs/subject.pug
Executable file
@@ -0,0 +1 @@
|
|||||||
|
=`Confirmar registro a ${nomeapp}`
|
||||||
37
emails/registration_sip/it/html.pug
Executable file
37
emails/registration_sip/it/html.pug
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
p Benvenuto #{name} nel portale di #{nomeapp}!
|
||||||
|
p I tuoi dati di accesso da ricordare sono:
|
||||||
|
span Username:
|
||||||
|
strong #{username}<br>
|
||||||
|
span hai dimenticato la Password? :
|
||||||
|
strong <a href=#{forgetpwd} target="_blank">Trovala qui</a><br>
|
||||||
|
span Email:
|
||||||
|
strong #{emailto}<br>
|
||||||
|
p Per confermare la registrazione clicca sul bottone, oppure qui: #{strlinkreg}:
|
||||||
|
div.divbtn <a href=#{strlinkreg} target="_blank">
|
||||||
|
button.btn.btn-lg Verifica Registrazione</a>
|
||||||
|
|
||||||
|
p Potrai cosi' accedere al sito digitando i tuoi dati di accesso.
|
||||||
|
|
||||||
|
|
||||||
|
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/registration_sip/it/subject.pug
Executable file
1
emails/registration_sip/it/subject.pug
Executable file
@@ -0,0 +1 @@
|
|||||||
|
=`Confermare la Registrazione a ${nomeapp}`
|
||||||
@@ -132,6 +132,22 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
pathreg_add:'',
|
pathreg_add:'',
|
||||||
abilitanave: false,
|
abilitanave: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
idapp: '9',
|
||||||
|
name: 'SalviamoIlPianeta',
|
||||||
|
adminemail: 'noisalviamoilpianeta@gmail.com',
|
||||||
|
manageremail: '',
|
||||||
|
replyTo: '',
|
||||||
|
host: 'https://salviamoilpianeta.app',
|
||||||
|
portapp: '0',
|
||||||
|
dir: '/var/www/salviamoilpianeta.app',
|
||||||
|
email_from: 'noisalviamoilpianeta@gmail.com',
|
||||||
|
email_pwd: '',
|
||||||
|
telegram_key:'1202788747:AAErwzIsD7k-3Yj5AX6ci3p7ELMuyASq4vA',
|
||||||
|
telegram_bot_name: 'SalviamoIlPianeta_bot',
|
||||||
|
pathreg_add:'_sip',
|
||||||
|
abilitanave: false,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
} else if (process.env.NODE_ENV === 'test') {
|
} else if (process.env.NODE_ENV === 'test') {
|
||||||
// ---------------- AMBIENTE DI TEST --------------------
|
// ---------------- AMBIENTE DI TEST --------------------
|
||||||
@@ -244,6 +260,22 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
pathreg_add:'',
|
pathreg_add:'',
|
||||||
abilitanave: false,
|
abilitanave: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
idapp: '9',
|
||||||
|
name: 'SalviamoIlPianeta (Server Test)',
|
||||||
|
adminemail: 'noisalviamoilpianeta@gmail.com',
|
||||||
|
manageremail: '',
|
||||||
|
replyTo: '',
|
||||||
|
host: 'https://test.salviamoilpianeta.app',
|
||||||
|
portapp: '0',
|
||||||
|
dir: '/var/www/test.salviamoilpianeta.app',
|
||||||
|
email_from: 'info.pianetalibero@gmail.com',
|
||||||
|
email_pwd: '2df135e2b6c02b2c68ec6bf6b103751fcb4dfc48c57d0acb302482358ee8141fmaDuooPabDvlThiBI2XMyA==',
|
||||||
|
telegram_key:'1049833543:AAE1RhGUJVdm0N_vrj0ijHZ04GCkKjl8TuQ',
|
||||||
|
telegram_bot_name: 'TestSalviamoIlPianeta_bot',
|
||||||
|
pathreg_add:'_sip',
|
||||||
|
abilitanave: false,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
// ---------------- AMBIENTE IN L O C A L E --------------------
|
// ---------------- AMBIENTE IN L O C A L E --------------------
|
||||||
@@ -354,6 +386,21 @@ if (process.env.NODE_ENV === 'production') {
|
|||||||
pathreg_add:'',
|
pathreg_add:'',
|
||||||
abilitanave: false,
|
abilitanave: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
idapp: '9',
|
||||||
|
name: 'SalviamoIlPianeta',
|
||||||
|
adminemail: 'paolo.arena77@gmail.com',
|
||||||
|
manageremail: '',
|
||||||
|
host: 'http://localhost',
|
||||||
|
portapp: '8087',
|
||||||
|
dir: '',
|
||||||
|
email_from: 'info.pianetalibero@gmail.com',
|
||||||
|
email_pwd: '66ffeb915e71fada64ad5c26947dd087c262be3b343734a0447c6dee534b888aZcfbjXEuMBWKxvbh60cniw==',
|
||||||
|
telegram_bot_name: 'paotestlocalebot',
|
||||||
|
telegram_key:'353996190:AAEcEbfrm_zTK6mBKf8ye9j-PXt958SDxew',
|
||||||
|
pathreg_add:'_sip',
|
||||||
|
abilitanave: false,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -790,7 +790,6 @@ UserSchema.statics.getLangByIndOrder = async function (idapp, ind_order) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UserSchema.statics.SetLang = async function (idapp, id, lang) {
|
UserSchema.statics.SetLang = async function (idapp, id, lang) {
|
||||||
const User = this;
|
const User = this;
|
||||||
|
|
||||||
@@ -969,15 +968,15 @@ UserSchema.statics.getUsersListByParams = function (params) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
UserSchema.statics.getFieldsForSearch = function () {
|
UserSchema.statics.getFieldsForSearch = function () {
|
||||||
return [{field: 'username', type: tools.FieldType.string},
|
return [{ field: 'username', type: tools.FieldType.string },
|
||||||
{field: 'name', type: tools.FieldType.string },
|
{ field: 'name', type: tools.FieldType.string },
|
||||||
{field: 'ind_order', type: tools.FieldType.number },
|
{ field: 'ind_order', type: tools.FieldType.number },
|
||||||
{field: 'surname', type: tools.FieldType.string },
|
{ field: 'surname', type: tools.FieldType.string },
|
||||||
{field: 'email', type: tools.FieldType.string },
|
{ field: 'email', type: tools.FieldType.string },
|
||||||
{field: 'profile.cell', type: tools.FieldType.string},
|
{ field: 'profile.cell', type: tools.FieldType.string },
|
||||||
{field: 'profile.email_paypal', type: tools.FieldType.string},
|
{ field: 'profile.email_paypal', type: tools.FieldType.string },
|
||||||
{field: 'profile.username_telegram', type: tools.FieldType.string},
|
{ field: 'profile.username_telegram', type: tools.FieldType.string },
|
||||||
{field: 'aportador_solidario', type: tools.FieldType.string}]
|
{ field: 'aportador_solidario', type: tools.FieldType.string }]
|
||||||
};
|
};
|
||||||
|
|
||||||
UserSchema.statics.executeQueryTable = function (idapp, params) {
|
UserSchema.statics.executeQueryTable = function (idapp, params) {
|
||||||
@@ -1139,6 +1138,96 @@ UserSchema.statics.getUsersQualified = async function (idapp, numinvitati) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
UserSchema.statics.visuUtentiNonInNavi = async function (idapp) {
|
||||||
|
const User = this;
|
||||||
|
|
||||||
|
const arrusers = await User.find({
|
||||||
|
idapp,
|
||||||
|
$or: [
|
||||||
|
{
|
||||||
|
'profile.special_req': true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
verified_email: true,
|
||||||
|
'profile.teleg_id': { $gt: 0 },
|
||||||
|
'profile.paymenttypes': { "$in": ['paypal'] },
|
||||||
|
'profile.saw_and_accepted': shared_consts.ALL_SAW_AND_ACCEPTED,
|
||||||
|
'profile.saw_zoom_presentation': true,
|
||||||
|
'profile.my_dream': { $exists: true },
|
||||||
|
$and: [
|
||||||
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.my_dream" }, 10] } },
|
||||||
|
{ "$expr": { "$gt": [{ "$strLenCP": "$profile.email_paypal" }, 6] } }
|
||||||
|
],
|
||||||
|
}]
|
||||||
|
|
||||||
|
}, {
|
||||||
|
name: 1,
|
||||||
|
surname: 1,
|
||||||
|
username: 1,
|
||||||
|
ind_order: 1,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
let num = 0;
|
||||||
|
let innave = 0;
|
||||||
|
let noninnave = 0;
|
||||||
|
let mystr = 'visuUtentiNonInNavi: ' + tools.ACAPO;
|
||||||
|
let reg = 0;
|
||||||
|
let num0inv = 0;
|
||||||
|
let num1inv = 0;
|
||||||
|
let num2inv = 0;
|
||||||
|
let numnoinlista = 0;
|
||||||
|
|
||||||
|
for (const user of arrusers) {
|
||||||
|
user.numinvitati = await User.getnumInvitati(idapp, user.username);
|
||||||
|
reg++;
|
||||||
|
let mianave = await Nave.findOne({ idapp, ind_order: user.ind_order });
|
||||||
|
let mialistaingresso = await ListaIngresso.findOne({ idapp, ind_order: user.ind_order });
|
||||||
|
let trovato = false;
|
||||||
|
if (!mianave) {
|
||||||
|
mystr += user.username + ' ' + user.name + ' ' + user.surname + ' [' + user.ind_order + '] [inv=' + user.numinvitati + ']'
|
||||||
|
noninnave++;
|
||||||
|
trovato = true;
|
||||||
|
} else {
|
||||||
|
innave++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mialistaingresso) {
|
||||||
|
mystr += ' NO IN LISTA INGRESSO!';
|
||||||
|
trovato = true;
|
||||||
|
numnoinlista++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trovato)
|
||||||
|
mystr += tools.ACAPO;
|
||||||
|
|
||||||
|
if (user.numinvitati === 0) {
|
||||||
|
num0inv++;
|
||||||
|
}
|
||||||
|
if (user.numinvitati === 1) {
|
||||||
|
num1inv++;
|
||||||
|
}
|
||||||
|
if (user.numinvitati >= 2) {
|
||||||
|
num2inv++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mystrstart = 'Registrati: ' + reg + tools.ACAPO;
|
||||||
|
mystrstart += '0 Invitati: ' + num0inv + tools.ACAPO;
|
||||||
|
mystrstart += '1 Invitato: ' + num1inv + tools.ACAPO;
|
||||||
|
mystrstart += '2 o più Invitati: ' + num2inv + tools.ACAPO;
|
||||||
|
mystrstart += 'Presente in Nave: ' + innave + tools.ACAPO;
|
||||||
|
mystrstart += 'Non in Nave: ' + noninnave + tools.ACAPO;
|
||||||
|
mystrstart += 'Non in Lista Imbarco: ' + numnoinlista + tools.ACAPO;
|
||||||
|
|
||||||
|
mystrstart += tools.ACAPO;
|
||||||
|
|
||||||
|
mystr = mystrstart + mystr;
|
||||||
|
|
||||||
|
return { num, mystr };
|
||||||
|
};
|
||||||
|
|
||||||
UserSchema.statics.getNumUsersQualified = async function (idapp, numinvitati) {
|
UserSchema.statics.getNumUsersQualified = async function (idapp, numinvitati) {
|
||||||
|
|
||||||
arrrec = await this.getUsersQualified(idapp, numinvitati);
|
arrrec = await this.getUsersQualified(idapp, numinvitati);
|
||||||
|
|||||||
@@ -370,7 +370,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)) && !(req.user._id.toString() === id) && !tools.ModificheConsentite(mydata.table, fieldsvalue)) {
|
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
|
// 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: '' });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -420,6 +420,8 @@ router.post('/dbop', authenticate, async (req, res) => {
|
|||||||
|
|
||||||
let ris = await User.DbOp(idapp, mydata);
|
let ris = await User.DbOp(idapp, mydata);
|
||||||
|
|
||||||
|
let mystr = '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (mydata.dbop === 'creaNavi') {
|
if (mydata.dbop === 'creaNavi') {
|
||||||
@@ -462,19 +464,21 @@ router.post('/dbop', authenticate, async (req, res) => {
|
|||||||
|
|
||||||
ris = { num };
|
ris = { num };
|
||||||
} else if (mydata.dbop === 'visuListaNave') {
|
} else if (mydata.dbop === 'visuListaNave') {
|
||||||
const mystr = await Nave.showListaOrd(idapp);
|
mystr = await Nave.showListaOrd(idapp);
|
||||||
ris = { mystr };
|
ris = { mystr };
|
||||||
|
} else if (mydata.dbop === 'visuUtentiNonInNavi') {
|
||||||
|
ris = await User.visuUtentiNonInNavi(idapp);
|
||||||
} else if (mydata.dbop === 'pulisciNonPresenzeInNave') {
|
} else if (mydata.dbop === 'pulisciNonPresenzeInNave') {
|
||||||
const mystr = await Nave.pulisciNonPresenzeInNave(idapp);
|
mystr = await Nave.pulisciNonPresenzeInNave(idapp);
|
||||||
ris = { mystr };
|
ris = { mystr };
|
||||||
} else if (mydata.dbop === 'checkInserimentiUtentiInNave') {
|
} else if (mydata.dbop === 'checkInserimentiUtentiInNave') {
|
||||||
const mystr = await Nave.checkIfDevoAggiungereInNave(idapp);
|
mystr = await Nave.checkIfDevoAggiungereInNave(idapp);
|
||||||
ris = { mystr };
|
ris = { mystr };
|
||||||
} else if (mydata.dbop === 'visuListaIngresso') {
|
} else if (mydata.dbop === 'visuListaIngresso') {
|
||||||
const mystr = await ListaIngresso.showListaOrd(idapp, false);
|
mystr = await ListaIngresso.showListaOrd(idapp, false);
|
||||||
ris = { mystr };
|
ris = { mystr };
|
||||||
} else if (mydata.dbop === 'visuListaIngressoNuovi') {
|
} else if (mydata.dbop === 'visuListaIngressoNuovi') {
|
||||||
const mystr = await ListaIngresso.showListaOrd(idapp, true);
|
mystr = await ListaIngresso.showListaOrd(idapp, true);
|
||||||
ris = { mystr };
|
ris = { mystr };
|
||||||
} else if (mydata.dbop === 'visuNaviUtentiEliminati') {
|
} else if (mydata.dbop === 'visuNaviUtentiEliminati') {
|
||||||
ris = await Nave.visuNaviUtentiEliminati(idapp);
|
ris = await Nave.visuNaviUtentiEliminati(idapp);
|
||||||
@@ -620,7 +624,7 @@ router.post('/dbop', authenticate, async (req, res) => {
|
|||||||
|
|
||||||
ris = { placca };
|
ris = { placca };
|
||||||
} else if (mydata.dbop === 'visuNave') {
|
} else if (mydata.dbop === 'visuNave') {
|
||||||
const mystr = await Nave.getNavePos(idapp, parseInt(mydata.riga), parseInt(mydata.col));
|
mystr = await Nave.getNavePos(idapp, parseInt(mydata.riga), parseInt(mydata.col));
|
||||||
|
|
||||||
const visu_nave_Bot = await Settings.getValDbSettings(idapp, 'VISU_NAVE_BOT');
|
const visu_nave_Bot = await Settings.getValDbSettings(idapp, 'VISU_NAVE_BOT');
|
||||||
if (visu_nave_Bot)
|
if (visu_nave_Bot)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const todos_router = require('./router/todos_router');
|
|||||||
const test_router = require('./router/test_router');
|
const test_router = require('./router/test_router');
|
||||||
const projects_router = require('./router/projects_router');
|
const projects_router = require('./router/projects_router');
|
||||||
const users_router = require('./router/users_router');
|
const users_router = require('./router/users_router');
|
||||||
const notevole_router = require('./router/notevole_router');
|
const site_router = require('./router/site_router');
|
||||||
const admin_router = require('./router/admin_router');
|
const admin_router = require('./router/admin_router');
|
||||||
|
|
||||||
const { MyEvent } = require('./models/myevent');
|
const { MyEvent } = require('./models/myevent');
|
||||||
@@ -121,7 +121,7 @@ app.use('/todos', todos_router);
|
|||||||
app.use('/test', test_router);
|
app.use('/test', test_router);
|
||||||
app.use('/projects', projects_router);
|
app.use('/projects', projects_router);
|
||||||
app.use('/users', users_router);
|
app.use('/users', users_router);
|
||||||
app.use('/ayni', notevole_router);
|
app.use('/site', site_router);
|
||||||
app.use('/admin', admin_router);
|
app.use('/admin', admin_router);
|
||||||
|
|
||||||
// catch 404 and forward to error handler
|
// catch 404 and forward to error handler
|
||||||
@@ -253,8 +253,9 @@ function testmsgwebpush() {
|
|||||||
// console.log('nomeapp 1: ' , tools.getNomeAppByIdApp(1));
|
// console.log('nomeapp 1: ' , tools.getNomeAppByIdApp(1));
|
||||||
// console.log('nomeapp 2: ' , tools.getNomeAppByIdApp(2));
|
// console.log('nomeapp 2: ' , tools.getNomeAppByIdApp(2));
|
||||||
|
|
||||||
User.findOne().then((user) => {
|
User.find({ username: 'paoloar77' }).then((arrusers) => {
|
||||||
if (user !== null) {
|
if (arrusers !== null) {
|
||||||
|
for (const user of arrusers) {
|
||||||
tools.sendNotificationToUser(user._id, 'Titolo msg Test', 'Test Messaggio', '/', 'msg')
|
tools.sendNotificationToUser(user._id, 'Titolo msg Test', 'Test Messaggio', '/', 'msg')
|
||||||
.then(ris => {
|
.then(ris => {
|
||||||
if (ris) {
|
if (ris) {
|
||||||
@@ -264,13 +265,14 @@ function testmsgwebpush() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cron every X minutes
|
// Cron every X minutes
|
||||||
cron.schedule('*/2 * * * *', () => {
|
cron.schedule('*/2 * * * *', () => {
|
||||||
console.log('Running Cron Job');
|
// console.log('Running Cron Job');
|
||||||
mycron();
|
mycron();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1040,7 +1040,17 @@ class Telegram {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
miomenu = Menu['it'][key];
|
miomenu = Menu['it'][key];
|
||||||
}
|
}
|
||||||
return (miomenu === menuselect);
|
let trovato = (miomenu === menuselect);
|
||||||
|
if (!trovato) {
|
||||||
|
try {
|
||||||
|
let miomenu2 = Menu['it'][key];
|
||||||
|
trovato = (miomenu2 === menuselect);
|
||||||
|
}catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return trovato;
|
||||||
}
|
}
|
||||||
|
|
||||||
async isMenu(rec, msg) {
|
async isMenu(rec, msg) {
|
||||||
|
|||||||
@@ -573,9 +573,12 @@ module.exports = {
|
|||||||
return Subscription.find({ userId }, (err, subscriptions) => {
|
return Subscription.find({ userId }, (err, subscriptions) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(`Error occurred while getting subscriptions`);
|
console.error(`Error occurred while getting subscriptions`);
|
||||||
res.status(500).json({
|
// res.status(500).json({
|
||||||
error: 'Technical error occurred'
|
// error: 'Technical error occurred'
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
//++ Rimuovi questo record !?
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
let conta = 0;
|
let conta = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user