- Non funziona l'ammetti il nuovo registrato, sulla App.
- All'interno di una Organizzazione, mostrare se non si è ancora entrati in un Circuito, mettere bottone per Entrare.
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
DATABASE=test_PiuCheBuono
|
DATABASE=test_FreePlanet
|
||||||
UDB=paofreeplanet
|
UDB=paofreeplanet
|
||||||
PDB=mypassword@1A
|
PDB=mypassword@1A
|
||||||
SEND_EMAIL=0
|
SEND_EMAIL=0
|
||||||
SEND_EMAIL_ORDERS=1
|
SEND_EMAIL_ORDERS=1
|
||||||
PORT=3000
|
PORT=3000
|
||||||
appTelegram_TEST=["1","17"]
|
appTelegram_TEST=["1","13"]
|
||||||
appTelegram=["1","17"]
|
appTelegram=["1","13"]
|
||||||
appTelegram_DEVELOP=["17"]
|
appTelegram_DEVELOP=["13"]
|
||||||
DOMAIN=mongodb://localhost:27017/
|
DOMAIN=mongodb://localhost:27017/
|
||||||
AUTH_MONGODB=0
|
AUTH_MONGODB=0
|
||||||
ENABLE_PUSHNOTIFICATION=1
|
ENABLE_PUSHNOTIFICATION=1
|
||||||
@@ -29,7 +29,7 @@ GCM_API_KEY=""
|
|||||||
PROD=0
|
PROD=0
|
||||||
PROJECT_DESCR_MAIN='__PROJECTS'
|
PROJECT_DESCR_MAIN='__PROJECTS'
|
||||||
SECRK=Askb38v23jjDFaoskBOWj92axXCQ
|
SECRK=Askb38v23jjDFaoskBOWj92axXCQ
|
||||||
TOKEN_LIFE=2h
|
TOKEN_LIFE=1m
|
||||||
REFRESH_TOKEN_LIFE=14d
|
REFRESH_TOKEN_LIFE=14d
|
||||||
FTPSERVER_HOST=139.162.166.31
|
FTPSERVER_HOST=139.162.166.31
|
||||||
FTPSERVER_PORT=21
|
FTPSERVER_PORT=21
|
||||||
@@ -38,9 +38,4 @@ FTPSERVER_PWD=ftpmypwd@1A_
|
|||||||
AUTH_NEW_SITES=123123123
|
AUTH_NEW_SITES=123123123
|
||||||
SCRIPTS_DIR=admin_scripts
|
SCRIPTS_DIR=admin_scripts
|
||||||
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
|
CLOUDFLARE_TOKENS=[{"label":"Paolo.arena77@gmail.com","value":"M9EM309v8WFquJKpYgZCw-TViM2wX6vB3wlK6GD0"},{"label":"gruppomacro.com","value":"bqmzGShoX7WqOBzkXocoECyBkPq3GfqcM5t6VFd8"}]
|
||||||
MIAB_HOST=box.lamiaposta.org
|
|
||||||
MIAB_ADMIN_EMAIL=admin@lamiaposta.org
|
|
||||||
MIAB_ADMIN_PASSWORD=passpao1pabox@1A
|
|
||||||
DS_API_KEY="sk-222e3addb3d8455d8b0516d93906eec7"
|
DS_API_KEY="sk-222e3addb3d8455d8b0516d93906eec7"
|
||||||
SERVER_A_URL="http://51.77.156.69:3000"
|
|
||||||
API_KEY_MSSQL="m68yADSr123MIVIDA@154$DSAGVOK"
|
|
||||||
@@ -4,3 +4,5 @@ Dom 02/03 ORE 16:32: USER [surya1977]: ciao
|
|||||||
Lun 10/03 ORE 15:52: USER [surya1977]: ciao
|
Lun 10/03 ORE 15:52: USER [surya1977]: ciao
|
||||||
|
|
||||||
Lun 10/03 ORE 15:56: USER [surya1977]: ciao
|
Lun 10/03 ORE 15:56: USER [surya1977]: ciao
|
||||||
|
|
||||||
|
Lun 07/07 ORE 10:45: USER [surya1977]: ciao
|
||||||
|
|||||||
@@ -835,4 +835,6 @@ https://t.me/riso_canale/739
|
|||||||
In attesa di riscontri, salutiamo! 🍚💚
|
In attesa di riscontri, salutiamo! 🍚💚
|
||||||
Il gruppo dei Facilitatori Territoriali RISO
|
Il gruppo dei Facilitatori Territoriali RISO
|
||||||
Mer 24/04 ORE 22:02: 🤖: Da Sùrya (Paolo) (paoloar77):
|
Mer 24/04 ORE 22:02: 🤖: Da Sùrya (Paolo) (paoloar77):
|
||||||
✅ la regolarizzazione può avv
|
✅ la regolarizzazione può avv
|
||||||
|
Lun 07/07 ORE 10:50: 🤖: Da Sùrya undefined (surya1977):
|
||||||
|
✅ provatest7 è stato Ammesso correttamente (da surya1977)!
|
||||||
@@ -11,7 +11,7 @@ mongoose.level = 'F';
|
|||||||
const { ObjectId } = require('mongodb');
|
const { ObjectId } = require('mongodb');
|
||||||
|
|
||||||
// Resolving error Unknown modifier: $pushAll
|
// Resolving error Unknown modifier: $pushAll
|
||||||
mongoose.plugin(schema => {
|
mongoose.plugin((schema) => {
|
||||||
schema.options.usePushEach = true;
|
schema.options.usePushEach = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -34,9 +34,11 @@ const MyGroupSchema = new Schema({
|
|||||||
descr: {
|
descr: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
idCatGrp: [{
|
idCatGrp: [
|
||||||
type: Number,
|
{
|
||||||
}],
|
type: Number,
|
||||||
|
},
|
||||||
|
],
|
||||||
userId: {
|
userId: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
@@ -51,11 +53,13 @@ const MyGroupSchema = new Schema({
|
|||||||
description: {
|
description: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
}],
|
},
|
||||||
|
],
|
||||||
idCity: [
|
idCity: [
|
||||||
{
|
{
|
||||||
type: Number,
|
type: Number,
|
||||||
}],
|
},
|
||||||
|
],
|
||||||
website: {
|
website: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
@@ -104,13 +108,15 @@ const MyGroupSchema = new Schema({
|
|||||||
_id: false,
|
_id: false,
|
||||||
username: { type: String },
|
username: { type: String },
|
||||||
date: { type: Date },
|
date: { type: Date },
|
||||||
}], // username
|
},
|
||||||
|
], // username
|
||||||
refused_users: [
|
refused_users: [
|
||||||
{
|
{
|
||||||
_id: false,
|
_id: false,
|
||||||
username: { type: String },
|
username: { type: String },
|
||||||
date: { type: Date },
|
date: { type: Date },
|
||||||
}], // username
|
},
|
||||||
|
], // username
|
||||||
deleted: {
|
deleted: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
@@ -120,14 +126,14 @@ const MyGroupSchema = new Schema({
|
|||||||
_id: false,
|
_id: false,
|
||||||
circuitname: { type: String },
|
circuitname: { type: String },
|
||||||
date: { type: Date },
|
date: { type: Date },
|
||||||
}],
|
},
|
||||||
|
],
|
||||||
lastdate_reqRisGroup: {
|
lastdate_reqRisGroup: {
|
||||||
type: Date,
|
type: Date,
|
||||||
},
|
},
|
||||||
//**ADDFIELD_MYGROUPS
|
//**ADDFIELD_MYGROUPS
|
||||||
|
|
||||||
...tools.getFieldsForAnnunci(),
|
...tools.getFieldsForAnnunci(),
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
MyGroupSchema.statics.getFieldsForSearch = function () {
|
MyGroupSchema.statics.getFieldsForSearch = function () {
|
||||||
@@ -152,8 +158,7 @@ MyGroupSchema.statics.executeQueryTable = function (idapp, params, user) {
|
|||||||
|
|
||||||
MyGroupSchema.pre('save', async function (next) {
|
MyGroupSchema.pre('save', async function (next) {
|
||||||
if (this.isNew) {
|
if (this.isNew) {
|
||||||
if (!this.date_created)
|
if (!this.date_created) this.date_created = new Date();
|
||||||
this.date_created = new Date();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
next();
|
next();
|
||||||
@@ -166,75 +171,74 @@ MyGroupSchema.statics.findAllIdApp = async function (idapp) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.findAllGroups = async function (idapp) {
|
MyGroupSchema.statics.findAllGroups = async function (idapp) {
|
||||||
|
|
||||||
const whatToShow = this.getWhatToShow(idapp, '');
|
const whatToShow = this.getWhatToShow(idapp, '');
|
||||||
|
|
||||||
return await MyGroup.find({
|
return await MyGroup.find(
|
||||||
idapp,
|
{
|
||||||
$or: [
|
idapp,
|
||||||
{ deleted: { $exists: false } },
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
{ deleted: { $exists: true, $eq: false } }],
|
},
|
||||||
}, whatToShow).lean();
|
whatToShow
|
||||||
|
).lean();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Rimuovo la Richiesta del Gruppo
|
// Rimuovo la Richiesta del Gruppo
|
||||||
MyGroupSchema.statics.removeReqGroup = async function (idapp, username, groupnameDest) {
|
MyGroupSchema.statics.removeReqGroup = async function (idapp, username, groupnameDest) {
|
||||||
|
return await MyGroup.updateOne(
|
||||||
return await MyGroup.updateOne({ idapp, groupname: groupnameDest },
|
{ idapp, groupname: groupnameDest },
|
||||||
{ $pull: { req_users: { username: { $in: [username] } } } });
|
{ $pull: { req_users: { username: { $in: [username] } } } }
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Aggiungi agli utenti Rifiutati del Gruppo
|
// Aggiungi agli utenti Rifiutati del Gruppo
|
||||||
MyGroupSchema.statics.refuseReqGroup = async function (idapp, username, groupnameDest) {
|
MyGroupSchema.statics.refuseReqGroup = async function (idapp, username, groupnameDest) {
|
||||||
|
return await MyGroup.updateOne(
|
||||||
return await MyGroup.updateOne({ idapp, groupname: groupnameDest },
|
{ idapp, groupname: groupnameDest },
|
||||||
{
|
{
|
||||||
$push:
|
$push: {
|
||||||
{
|
|
||||||
refused_users: {
|
refused_users: {
|
||||||
username,
|
username,
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Aggiungi agli Admin del Gruppo
|
// Aggiungi agli Admin del Gruppo
|
||||||
MyGroupSchema.statics.addToAdminOfMyGroup = async function (idapp, username, groupnameDest) {
|
MyGroupSchema.statics.addToAdminOfMyGroup = async function (idapp, username, groupnameDest) {
|
||||||
|
return await MyGroup.updateOne(
|
||||||
return await MyGroup.updateOne({ idapp, groupname: groupnameDest },
|
{ idapp, groupname: groupnameDest },
|
||||||
{
|
{
|
||||||
$push:
|
$push: {
|
||||||
{
|
|
||||||
admins: {
|
admins: {
|
||||||
username,
|
username,
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Rimuovi dagli Admin del Gruppo
|
// Rimuovi dagli Admin del Gruppo
|
||||||
MyGroupSchema.statics.removeAdminOfMyGroup = async function (idapp, username, groupnameDest) {
|
MyGroupSchema.statics.removeAdminOfMyGroup = async function (idapp, username, groupnameDest) {
|
||||||
|
return await MyGroup.updateOne(
|
||||||
return await MyGroup.updateOne({ idapp, groupname: groupnameDest },
|
{ idapp, groupname: groupnameDest },
|
||||||
{ $pull: { admins: { username: { $in: [username] } } } });
|
{ $pull: { admins: { username: { $in: [username] } } } }
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.getListAdminsByGroupName = async function (idapp, groupname) {
|
MyGroupSchema.statics.getListAdminsByGroupName = async function (idapp, groupname) {
|
||||||
|
let arr = await MyGroup.findOne(
|
||||||
let arr = await MyGroup.findOne({
|
{
|
||||||
idapp,
|
idapp,
|
||||||
groupname,
|
groupname,
|
||||||
$or: [
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
{ deleted: { $exists: false } },
|
},
|
||||||
{ deleted: { $exists: true, $eq: false } }],
|
{ admins: 1 }
|
||||||
}, { admins: 1 }).lean();
|
).lean();
|
||||||
|
|
||||||
return arr && arr.admins ? arr.admins : [];
|
return arr && arr.admins ? arr.admins : [];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.getWhatToShow = function (idapp, username) {
|
MyGroupSchema.statics.getWhatToShow = function (idapp, username) {
|
||||||
@@ -267,7 +271,6 @@ MyGroupSchema.statics.getWhatToShow = function (idapp, username) {
|
|||||||
whatToShow = { ...whatToShow, ...shared_consts.ANNUNCI_FIELDS };
|
whatToShow = { ...whatToShow, ...shared_consts.ANNUNCI_FIELDS };
|
||||||
|
|
||||||
return whatToShow;
|
return whatToShow;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.getWhatToShow_Unknown = function (idapp, username) {
|
MyGroupSchema.statics.getWhatToShow_Unknown = function (idapp, username) {
|
||||||
@@ -289,32 +292,30 @@ MyGroupSchema.statics.getWhatToShow_Unknown = function (idapp, username) {
|
|||||||
whatToShow = { ...whatToShow, ...shared_consts.ANNUNCI_FIELDS };
|
whatToShow = { ...whatToShow, ...shared_consts.ANNUNCI_FIELDS };
|
||||||
|
|
||||||
return whatToShow;
|
return whatToShow;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.getArrUsernameFromFieldByGroupname = async function (
|
MyGroupSchema.statics.getArrUsernameFromFieldByGroupname = async function (idapp, groupname, field) {
|
||||||
idapp, groupname, field) {
|
|
||||||
|
|
||||||
const { User } = require('../models/user');
|
const { User } = require('../models/user');
|
||||||
|
|
||||||
const myobj = {};
|
const myobj = {};
|
||||||
myobj[field] = 1;
|
myobj[field] = 1;
|
||||||
|
|
||||||
const ris = await User.findOne({
|
const ris = await User.findOne(
|
||||||
idapp,
|
{
|
||||||
groupname,
|
idapp,
|
||||||
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
groupname,
|
||||||
}, myobj);
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
|
},
|
||||||
|
myobj
|
||||||
|
);
|
||||||
|
|
||||||
if (ris) {
|
if (ris) {
|
||||||
return ris[field].map(m => m.username);
|
return ris[field].map((m) => m.username);
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname) {
|
MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname) {
|
||||||
|
|
||||||
const whatToShow = this.getWhatToShow(idapp, groupname);
|
const whatToShow = this.getWhatToShow(idapp, groupname);
|
||||||
|
|
||||||
const myfind = {
|
const myfind = {
|
||||||
@@ -333,14 +334,11 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'$replaceRoot': {
|
$replaceRoot: {
|
||||||
'newRoot': {
|
newRoot: {
|
||||||
'$mergeObjects': [
|
$mergeObjects: [
|
||||||
{
|
{
|
||||||
'$arrayElemAt': [
|
$arrayElemAt: ['$mycircuits', 0],
|
||||||
'$mycircuits',
|
|
||||||
0,
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
'$$ROOT',
|
'$$ROOT',
|
||||||
],
|
],
|
||||||
@@ -359,21 +357,17 @@ MyGroupSchema.statics.getInfoGroupByGroupname = async function (idapp, groupname
|
|||||||
{
|
{
|
||||||
$project: shared_consts.getProjectByTable(shared_consts.TABLES_MYGROUPS, {}),
|
$project: shared_consts.getProjectByTable(shared_consts.TABLES_MYGROUPS, {}),
|
||||||
},
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const ris = await MyGroup.aggregate(query);
|
const ris = await MyGroup.aggregate(query);
|
||||||
|
|
||||||
if (ris && ris.length > 0)
|
if (ris && ris.length > 0) return ris[0];
|
||||||
return ris[0];
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.deleteGroup = async function (idapp, usernameOrig, groupname) {
|
MyGroupSchema.statics.deleteGroup = async function (idapp, usernameOrig, groupname) {
|
||||||
@@ -382,7 +376,6 @@ MyGroupSchema.statics.deleteGroup = async function (idapp, usernameOrig, groupna
|
|||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.getGroupsByUsername = async function (idapp, username, req) {
|
MyGroupSchema.statics.getGroupsByUsername = async function (idapp, username, req) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { User } = require('../models/user');
|
const { User } = require('../models/user');
|
||||||
|
|
||||||
@@ -391,20 +384,22 @@ MyGroupSchema.statics.getGroupsByUsername = async function (idapp, username, req
|
|||||||
const arrUsernameGroups = await User.getUsernameGroupsByUsername(idapp, username);
|
const arrUsernameGroups = await User.getUsernameGroupsByUsername(idapp, username);
|
||||||
// const arrUsernameReqGroups = await MyGroup.getUsernameReqGroupsByGroupname(idapp, username);
|
// const arrUsernameReqGroups = await MyGroup.getUsernameReqGroupsByGroupname(idapp, username);
|
||||||
|
|
||||||
let listUsersGroup = await User.find({
|
let listUsersGroup = await User.find(
|
||||||
idapp,
|
{
|
||||||
username: { $in: arrUsernameGroups },
|
idapp,
|
||||||
$or: [
|
username: { $in: arrUsernameGroups },
|
||||||
{ deleted: { $exists: false } },
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
{ deleted: { $exists: true, $eq: false } }],
|
},
|
||||||
}, whatToShow);
|
whatToShow
|
||||||
|
);
|
||||||
|
|
||||||
let listgroups = await MyGroup.find({
|
let listgroups = await MyGroup.find(
|
||||||
idapp,
|
{
|
||||||
$or: [
|
idapp,
|
||||||
{ deleted: { $exists: false } },
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
{ deleted: { $exists: true, $eq: false } }],
|
},
|
||||||
}, whatToShow_Unknown);
|
whatToShow_Unknown
|
||||||
|
);
|
||||||
|
|
||||||
/*let listRequestUsersGroup = await User.find({
|
/*let listRequestUsersGroup = await User.find({
|
||||||
idapp,
|
idapp,
|
||||||
@@ -416,25 +411,27 @@ MyGroupSchema.statics.getGroupsByUsername = async function (idapp, username, req
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let listSentRequestGroups = await MyGroup.find({
|
let listSentRequestGroups = await MyGroup.find(
|
||||||
idapp,
|
{
|
||||||
'req_users': {
|
idapp,
|
||||||
$elemMatch: { username: { $eq: username } },
|
req_users: {
|
||||||
|
$elemMatch: { username: { $eq: username } },
|
||||||
|
},
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
},
|
},
|
||||||
$or: [
|
whatToShow_Unknown
|
||||||
{ deleted: { $exists: false } },
|
);
|
||||||
{ deleted: { $exists: true, $eq: false } }],
|
|
||||||
}, whatToShow_Unknown);
|
|
||||||
|
|
||||||
let listRefusedGroups = await MyGroup.find({
|
let listRefusedGroups = await MyGroup.find(
|
||||||
idapp,
|
{
|
||||||
'refused_users': {
|
idapp,
|
||||||
$elemMatch: { username: { $eq: username } },
|
refused_users: {
|
||||||
|
$elemMatch: { username: { $eq: username } },
|
||||||
|
},
|
||||||
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
},
|
},
|
||||||
$or: [
|
whatToShow_Unknown
|
||||||
{ deleted: { $exists: false } },
|
);
|
||||||
{ deleted: { $exists: true, $eq: false } }],
|
|
||||||
}, whatToShow_Unknown);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
listUsersGroup,
|
listUsersGroup,
|
||||||
@@ -443,7 +440,6 @@ MyGroupSchema.statics.getGroupsByUsername = async function (idapp, username, req
|
|||||||
listRefusedGroups,
|
listRefusedGroups,
|
||||||
mygroups: await User.getMyGroupsById(req.user._id),
|
mygroups: await User.getMyGroupsById(req.user._id),
|
||||||
};
|
};
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('Error', e);
|
console.log('Error', e);
|
||||||
}
|
}
|
||||||
@@ -454,12 +450,10 @@ MyGroupSchema.statics.getGroupsByUsername = async function (idapp, username, req
|
|||||||
listTrusted: [],
|
listTrusted: [],
|
||||||
listSentRequestGroups: [],
|
listSentRequestGroups: [],
|
||||||
listRefusedGroups: [],
|
listRefusedGroups: [],
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.extractCitiesName = async function (idapp, id) {
|
MyGroupSchema.statics.extractCitiesName = async function (idapp, id) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let aggr1 = [
|
let aggr1 = [
|
||||||
{
|
{
|
||||||
@@ -474,14 +468,11 @@ MyGroupSchema.statics.extractCitiesName = async function (idapp, id) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'$replaceRoot': {
|
$replaceRoot: {
|
||||||
'newRoot': {
|
newRoot: {
|
||||||
'$mergeObjects': [
|
$mergeObjects: [
|
||||||
{
|
{
|
||||||
'$arrayElemAt': [
|
$arrayElemAt: ['$mycities', 0],
|
||||||
'$mycities',
|
|
||||||
0,
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
'$$ROOT',
|
'$$ROOT',
|
||||||
],
|
],
|
||||||
@@ -490,8 +481,8 @@ MyGroupSchema.statics.extractCitiesName = async function (idapp, id) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
$project: {
|
$project: {
|
||||||
"mycities.comune": 1,
|
'mycities.comune': 1,
|
||||||
"mycities.prov": 1
|
'mycities.prov': 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -502,16 +493,14 @@ MyGroupSchema.statics.extractCitiesName = async function (idapp, id) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('e', e);
|
console.error('e', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.ifCircuitAlreadyInGroup = async function (idapp, groupname, circuitname) {
|
MyGroupSchema.statics.ifCircuitAlreadyInGroup = async function (idapp, groupname, circuitname) {
|
||||||
|
|
||||||
// Controllo se è stato già inserito il circuito sul gruppo
|
// Controllo se è stato già inserito il circuito sul gruppo
|
||||||
return await this.findOne({
|
return await this.findOne({
|
||||||
idapp,
|
idapp,
|
||||||
groupname,
|
groupname,
|
||||||
'mycircuits': {
|
mycircuits: {
|
||||||
$elemMatch: { circuitname: { $eq: circuitname } },
|
$elemMatch: { circuitname: { $eq: circuitname } },
|
||||||
},
|
},
|
||||||
}).lean();
|
}).lean();
|
||||||
@@ -519,70 +508,78 @@ MyGroupSchema.statics.ifCircuitAlreadyInGroup = async function (idapp, groupname
|
|||||||
|
|
||||||
// aggiungo il Circuito all'interno del Gruppo
|
// aggiungo il Circuito all'interno del Gruppo
|
||||||
MyGroupSchema.statics.addCircuitFromGroup = async function (idapp, groupname, circuitname) {
|
MyGroupSchema.statics.addCircuitFromGroup = async function (idapp, groupname, circuitname) {
|
||||||
return await this.updateOne({ idapp, groupname },
|
return await this.updateOne(
|
||||||
|
{ idapp, groupname },
|
||||||
{
|
{
|
||||||
$push: {
|
$push: {
|
||||||
'mycircuits': {
|
mycircuits: {
|
||||||
circuitname,
|
circuitname,
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Rimuovo il Circuito all'interno del Gruppo
|
// Rimuovo il Circuito all'interno del Gruppo
|
||||||
MyGroupSchema.statics.removeCircuitFromGroup = async function (idapp, groupname, circuitname) {
|
MyGroupSchema.statics.removeCircuitFromGroup = async function (idapp, groupname, circuitname) {
|
||||||
|
const { Circuit } = require('../models/circuit');
|
||||||
|
|
||||||
|
const { Account } = require('../models/account');
|
||||||
|
|
||||||
const ris = await this.updateOne({ idapp, groupname },
|
const ris = await this.updateOne(
|
||||||
{ $pull: { 'mycircuits': { circuitname: { $in: [circuitname] } } } });
|
{ idapp, groupname },
|
||||||
|
{ $pull: { mycircuits: { circuitname: { $in: [circuitname] } } } }
|
||||||
|
);
|
||||||
|
|
||||||
const circuitId = await Circuit.getCircuitIdByName(idapp, circuitname);
|
const circuitId = await Circuit.getCircuitIdByName(idapp, circuitname);
|
||||||
let remove = false;
|
let remove = false;
|
||||||
|
|
||||||
// Se il mio account non è stato utilizzato, allora lo cancello anche questo
|
// Se il mio account non è stato utilizzato, allora lo cancello anche questo
|
||||||
const myaccount = await Account.getAccountByUsernameAndCircuitId(idapp, username, circuitId, false, false, groupname, '');
|
const myaccount = await Account.getAccountByUsernameAndCircuitId(
|
||||||
|
idapp,
|
||||||
|
'',
|
||||||
|
circuitId,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
groupname,
|
||||||
|
''
|
||||||
|
);
|
||||||
if (myaccount && myaccount.totTransato === 0) {
|
if (myaccount && myaccount.totTransato === 0) {
|
||||||
remove = true;
|
remove = true;
|
||||||
} else {
|
} else {
|
||||||
remove = true;
|
remove = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (remove) {
|
if (remove && myaccount) {
|
||||||
await Account.removeAccount(myaccount._id);
|
await Account.removeAccount(myaccount._id);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MyGroupSchema.statics.getQueryReceiveRISGroups = function (idapp, hours) {
|
MyGroupSchema.statics.getQueryReceiveRISGroups = function (idapp, hours) {
|
||||||
|
|
||||||
const query = [
|
const query = [
|
||||||
{
|
{
|
||||||
$match: {
|
$match: {
|
||||||
idapp,
|
idapp,
|
||||||
'lastdate_reqRisGroup': { $gte: tools.IncDateNow(-(1000 * 60 * 60 * hours)) },
|
lastdate_reqRisGroup: { $gte: tools.IncDateNow(-(1000 * 60 * 60 * hours)) },
|
||||||
$or: [
|
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||||
{ deleted: { $exists: false } },
|
|
||||||
{ deleted: { $exists: true, $eq: false } }],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
$group:
|
$group: {
|
||||||
{
|
_id: '$groupname',
|
||||||
_id: "$groupname",
|
|
||||||
count: {
|
count: {
|
||||||
$sum: 1,
|
$sum: 1,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{ $sort: { 'lastdate_reqRisGroup': -1 } },
|
{ $sort: { lastdate_reqRisGroup: -1 } },
|
||||||
{ $limit: 30 },
|
{ $limit: 30 },
|
||||||
{
|
{
|
||||||
$lookup: {
|
$lookup: {
|
||||||
from: "mygroups",
|
from: 'mygroups',
|
||||||
let: {
|
let: {
|
||||||
groupname: "$_id",
|
groupname: '$_id',
|
||||||
idapp,
|
idapp,
|
||||||
},
|
},
|
||||||
pipeline: [
|
pipeline: [
|
||||||
@@ -591,30 +588,24 @@ MyGroupSchema.statics.getQueryReceiveRISGroups = function (idapp, hours) {
|
|||||||
$expr: {
|
$expr: {
|
||||||
$and: [
|
$and: [
|
||||||
{
|
{
|
||||||
$eq: [
|
$eq: ['$$groupname', '$groupname'],
|
||||||
"$$groupname",
|
|
||||||
"$groupname",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
$eq: [
|
$eq: ['$$idapp', '$idapp'],
|
||||||
"$$idapp",
|
|
||||||
"$idapp",
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
as: "mygroup",
|
as: 'mygroup',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ $unwind: "$mygroup" },
|
{ $unwind: '$mygroup' },
|
||||||
{
|
{
|
||||||
$replaceRoot: {
|
$replaceRoot: {
|
||||||
newRoot: {
|
newRoot: {
|
||||||
$mergeObjects: ["$mygroup", "$$ROOT"],
|
$mergeObjects: ['$mygroup', '$$ROOT'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -645,27 +636,23 @@ MyGroupSchema.statics.getQueryReceiveRISGroups = function (idapp, hours) {
|
|||||||
return query;
|
return query;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
MyGroupSchema.statics.getReceiveRISGroups = async function (idapp) {
|
MyGroupSchema.statics.getReceiveRISGroups = async function (idapp) {
|
||||||
|
return await this.aggregate(this.getQueryReceiveRISGroups(idapp, 8)).then((ris) => {
|
||||||
return await this.aggregate(this.getQueryReceiveRISGroups(idapp, 8)).then(ris => {
|
|
||||||
return ris;
|
return ris;
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
MyGroupSchema.statics.renameCircuitName = async function (idapp, oldcircuitname, newcircuitname) {
|
MyGroupSchema.statics.renameCircuitName = async function (idapp, oldcircuitname, newcircuitname) {
|
||||||
|
return await this.updateMany(
|
||||||
return await this.updateMany({ idapp, 'mycircuits.circuitname': oldcircuitname }, { $set: { 'profile.mycircuits.$.circuitname': newcircuitname } });
|
{ idapp, 'mycircuits.circuitname': oldcircuitname },
|
||||||
|
{ $set: { 'profile.mycircuits.$.circuitname': newcircuitname } }
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
MyGroupSchema.statics.setReceiveRisGroup = async function (idapp, groupname) {
|
MyGroupSchema.statics.setReceiveRisGroup = async function (idapp, groupname) {
|
||||||
|
|
||||||
const record = await this.findOneAndUpdate(
|
const record = await this.findOneAndUpdate(
|
||||||
{ idapp, groupname },
|
{ idapp, groupname },
|
||||||
{ $set: { 'lastdate_reqRisGroup': new Date() } },
|
{ $set: { lastdate_reqRisGroup: new Date() } },
|
||||||
{ new: false }
|
{ new: false }
|
||||||
).lean();
|
).lean();
|
||||||
|
|
||||||
@@ -675,8 +662,9 @@ MyGroupSchema.statics.setReceiveRisGroup = async function (idapp, groupname) {
|
|||||||
const MyGroup = mongoose.model('MyGroup', MyGroupSchema);
|
const MyGroup = mongoose.model('MyGroup', MyGroupSchema);
|
||||||
|
|
||||||
MyGroup.createIndexes()
|
MyGroup.createIndexes()
|
||||||
.then(() => { })
|
.then(() => {})
|
||||||
.catch((err) => { throw err; });
|
.catch((err) => {
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = { MyGroup };
|
module.exports = { MyGroup };
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ router.post('/', async (req, res) => {
|
|||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e.message);
|
console.error('Error: /users REG: ' + e.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -42,19 +42,19 @@ function checkifSendEmail() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
sendEmail_base_e_manager: function (idapp, template, to, mylocalsconf, replyTo, transport, previewonly) {
|
sendEmail_base_e_manager: async function (idapp, template, to, mylocalsconf, replyTo, transport, previewonly) {
|
||||||
this.sendEmail_base(template, to, mylocalsconf, replyTo, transport, previewonly);
|
await this.sendEmail_base(template, to, mylocalsconf, replyTo, transport, previewonly);
|
||||||
|
|
||||||
this.sendEmail_base(template, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '', transport, previewonly);
|
await this.sendEmail_base(template, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '', transport, previewonly);
|
||||||
|
|
||||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||||
const email = tools.getManagerEmailByIdApp(idapp);
|
const email = tools.getManagerEmailByIdApp(idapp);
|
||||||
this.sendEmail_base(template, email, mylocalsconf, '', transport, previewonly);
|
await this.sendEmail_base(template, email, mylocalsconf, '', transport, previewonly);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
sendEmail_base: function (template, to, mylocalsconf, replyTo, transport, previewonly) {
|
sendEmail_base: async function (template, to, mylocalsconf, replyTo, transport, previewonly) {
|
||||||
|
|
||||||
if (to === '')
|
if (to === '')
|
||||||
return false;
|
return false;
|
||||||
@@ -199,10 +199,10 @@ module.exports = {
|
|||||||
|
|
||||||
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
||||||
|
|
||||||
this.sendEmail_base(tools.getpathregByIdApp(idapp, lang), emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
await this.sendEmail_base(tools.getpathregByIdApp(idapp, lang), emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||||
|
|
||||||
// Send to the Admin an Email
|
// Send to the Admin an Email
|
||||||
this.sendEmail_base('admin/registration/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/registration/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
|
|
||||||
await telegrambot.notifyToTelegram(telegrambot.phase.REGISTRATION, mylocalsconf);
|
await telegrambot.notifyToTelegram(telegrambot.phase.REGISTRATION, mylocalsconf);
|
||||||
|
|
||||||
@@ -242,17 +242,17 @@ module.exports = {
|
|||||||
|
|
||||||
mylocalsconf = this.setParamsForTemplate(iscritto, mylocalsconf);
|
mylocalsconf = this.setParamsForTemplate(iscritto, mylocalsconf);
|
||||||
|
|
||||||
this.sendEmail_base('iscrizione_conacreis/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
await this.sendEmail_base('iscrizione_conacreis/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||||
|
|
||||||
// Send to the Admin an Email
|
// Send to the Admin an Email
|
||||||
this.sendEmail_base('admin/iscrizione_conacreis/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/iscrizione_conacreis/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
|
|
||||||
await telegrambot.notifyIscrizioneToTelegram(telegrambot.phase.ISCRIZIONE_CONACREIS, mylocalsconf, 'MSG_ISCRITTO_CONACREIS');
|
await telegrambot.notifyIscrizioneToTelegram(telegrambot.phase.ISCRIZIONE_CONACREIS, mylocalsconf, 'MSG_ISCRITTO_CONACREIS');
|
||||||
|
|
||||||
tools.sendNotifToAdmin(idapp, true, 'Iscrizione Conacreis : ' + mylocalsconf.name + ' ' + mylocalsconf.surname + ' (' + mylocalsconf.username + ')');
|
tools.sendNotifToAdmin(idapp, true, 'Iscrizione Conacreis : ' + mylocalsconf.name + ' ' + mylocalsconf.surname + ' (' + mylocalsconf.username + ')');
|
||||||
|
|
||||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||||
this.sendEmail_base('admin/iscrizione_conacreis/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/iscrizione_conacreis/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -275,17 +275,17 @@ module.exports = {
|
|||||||
|
|
||||||
mylocalsconf = this.setParamsForTemplate(iscritto, mylocalsconf);
|
mylocalsconf = this.setParamsForTemplate(iscritto, mylocalsconf);
|
||||||
|
|
||||||
this.sendEmail_base('iscrizione_arcadei/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
await this.sendEmail_base('iscrizione_arcadei/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||||
|
|
||||||
// Send to the Admin an Email
|
// Send to the Admin an Email
|
||||||
this.sendEmail_base('admin/iscrizione_arcadei/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/iscrizione_arcadei/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
|
|
||||||
await telegrambot.notifyIscrizioneToTelegram(telegrambot.phase.ISCRIZIONE_ARCADEI, mylocalsconf, 'MSG_ISCRITTO_ARCADEI');
|
await telegrambot.notifyIscrizioneToTelegram(telegrambot.phase.ISCRIZIONE_ARCADEI, mylocalsconf, 'MSG_ISCRITTO_ARCADEI');
|
||||||
|
|
||||||
tools.sendNotifToAdmin(idapp, true, 'Iscrizione Arcadei : ' + mylocalsconf.name + ' ' + mylocalsconf.surname + ' (' + mylocalsconf.username + ')');
|
tools.sendNotifToAdmin(idapp, true, 'Iscrizione Arcadei : ' + mylocalsconf.name + ' ' + mylocalsconf.surname + ' (' + mylocalsconf.username + ')');
|
||||||
|
|
||||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||||
this.sendEmail_base('admin/iscrizione_arcadei/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/iscrizione_arcadei/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Err', e);
|
console.error('Err', e);
|
||||||
@@ -307,7 +307,7 @@ module.exports = {
|
|||||||
|
|
||||||
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
||||||
|
|
||||||
this.sendEmail_base('resetpwd/' + lang, emailto, mylocalsconf, '');
|
await this.sendEmail_base('resetpwd/' + lang, emailto, mylocalsconf, '');
|
||||||
},
|
},
|
||||||
|
|
||||||
sendEmail_RisRicevuti: async function (lang, userDest, emailto, idapp, myrec) {
|
sendEmail_RisRicevuti: async function (lang, userDest, emailto, idapp, myrec) {
|
||||||
@@ -332,7 +332,7 @@ module.exports = {
|
|||||||
|
|
||||||
mylocalsconf = this.setParamsForTemplate(userDest, mylocalsconf);
|
mylocalsconf = this.setParamsForTemplate(userDest, mylocalsconf);
|
||||||
|
|
||||||
this.sendEmail_base('risricevuti/' + lang, emailto, mylocalsconf, '');
|
await this.sendEmail_base('risricevuti/' + lang, emailto, mylocalsconf, '');
|
||||||
},
|
},
|
||||||
|
|
||||||
sendEmail_Booking: async function (res, lang, emailto, user, idapp, recbooking) {
|
sendEmail_Booking: async function (res, lang, emailto, user, idapp, recbooking) {
|
||||||
@@ -370,13 +370,13 @@ module.exports = {
|
|||||||
texthtml = 'makebooking';
|
texthtml = 'makebooking';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sendEmail_base('booking/' + texthtml + '/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
await this.sendEmail_base('booking/' + texthtml + '/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||||
|
|
||||||
// Send Email also to the Admin
|
// Send Email also to the Admin
|
||||||
this.sendEmail_base('admin/' + texthtml + '/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/' + texthtml + '/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
|
|
||||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||||
this.sendEmail_base('admin/' + texthtml + '/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/' + texthtml + '/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -459,13 +459,13 @@ module.exports = {
|
|||||||
|
|
||||||
telegrambot.sendMsgTelegramToTheManagers(idapp, msgtelegram);
|
telegrambot.sendMsgTelegramToTheManagers(idapp, msgtelegram);
|
||||||
|
|
||||||
this.sendEmail_base('booking/cancelbooking/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
await this.sendEmail_base('booking/cancelbooking/' + lang, emailto, mylocalsconf, tools.getreplyToEmailByIdApp(idapp));
|
||||||
|
|
||||||
// Send Email also to the Admin
|
// Send Email also to the Admin
|
||||||
this.sendEmail_base('admin/cancelbooking/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/cancelbooking/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
|
|
||||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||||
this.sendEmail_base('admin/cancelbooking/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/cancelbooking/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -607,10 +607,10 @@ module.exports = {
|
|||||||
|
|
||||||
if (sendnews) {
|
if (sendnews) {
|
||||||
// Send to the Admin an Email
|
// Send to the Admin an Email
|
||||||
this.sendEmail_base('admin/added_to_newsletter/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/added_to_newsletter/' + tools.LANGADMIN, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
|
|
||||||
if (tools.isManagAndAdminDifferent(idapp)) {
|
if (tools.isManagAndAdminDifferent(idapp)) {
|
||||||
this.sendEmail_base('admin/added_to_newsletter/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
await this.sendEmail_base('admin/added_to_newsletter/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -845,7 +845,7 @@ module.exports = {
|
|||||||
|
|
||||||
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
||||||
|
|
||||||
this.sendEmail_base_e_manager(idapp, 'ecommerce/makeorder/' + lang, mylocalsconf.emailto, mylocalsconf,
|
await this.sendEmail_base_e_manager(idapp, 'ecommerce/makeorder/' + lang, mylocalsconf.emailto, mylocalsconf,
|
||||||
mylocalsconf.dataemail.email_reply);
|
mylocalsconf.dataemail.email_reply);
|
||||||
} else {
|
} else {
|
||||||
console.log('Invio Email non eseguito perchè sei in TEST !');
|
console.log('Invio Email non eseguito perchè sei in TEST !');
|
||||||
@@ -881,7 +881,7 @@ module.exports = {
|
|||||||
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
mylocalsconf = this.setParamsForTemplate(user, mylocalsconf);
|
||||||
|
|
||||||
if ((status !== shared_consts.OrderStatus.CANCELED) && (status !== shared_consts.OrderStatus.COMPLETED)) {
|
if ((status !== shared_consts.OrderStatus.CANCELED) && (status !== shared_consts.OrderStatus.COMPLETED)) {
|
||||||
const esito = this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, mylocalsconf.emailto, mylocalsconf,
|
const esito = await this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, mylocalsconf.emailto, mylocalsconf,
|
||||||
mylocalsconf.dataemail.email_reply);
|
mylocalsconf.dataemail.email_reply);
|
||||||
|
|
||||||
// this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
// this.sendEmail_base('ecommerce/' + ordertype + '/' + lang, tools.getAdminEmailByIdApp(idapp), mylocalsconf, '');
|
||||||
@@ -980,7 +980,7 @@ module.exports = {
|
|||||||
|
|
||||||
// Send Email to the User
|
// Send Email to the User
|
||||||
// console.log('-> Invio Email (', mynewsrec.numemail_sent, '/', mynewsrec.numemail_tot, ')');
|
// console.log('-> Invio Email (', mynewsrec.numemail_sent, '/', mynewsrec.numemail_tot, ')');
|
||||||
const esito = this.sendEmail_base('newsletter/' + lang, mylocalsconf.emailto, mylocalsconf,
|
const esito = await this.sendEmail_base('newsletter/' + lang, mylocalsconf.emailto, mylocalsconf,
|
||||||
mylocalsconf.dataemail.email_reply, smtpTransport);
|
mylocalsconf.dataemail.email_reply, smtpTransport);
|
||||||
|
|
||||||
if ((mynewsrec.numemail_sent % 100) === 0) {
|
if ((mynewsrec.numemail_sent % 100) === 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user