Riattivato il Calendario (ma ancora non lo rendo visibile)
aggiunto campi: DateTimeStart e DateTimeEnd negli Eventi Aggiunto Filtro Data
This commit is contained in:
@@ -37,6 +37,9 @@ You will need to download the root certificate (root.pem) and an intermediate ce
|
|||||||
See this article:
|
See this article:
|
||||||
https://www.psclistens.com/insight/blog/enabling-a-nodejs-ssl-webserver-using-let-s-encrypt-pem-certificates/
|
https://www.psclistens.com/insight/blog/enabling-a-nodejs-ssl-webserver-using-let-s-encrypt-pem-certificates/
|
||||||
|
|
||||||
|
and this, for the client:
|
||||||
|
https://smallstep.com/hello-mtls/doc/combined/nodejs/axios
|
||||||
|
|
||||||
|
|
||||||
To see if all the certificates are OK, see this page check and enter the correct host and port:
|
To see if all the certificates are OK, see this page check and enter the correct host and port:
|
||||||
https://decoder.link/sslchecker
|
https://decoder.link/sslchecker
|
||||||
|
|||||||
@@ -41,6 +41,12 @@ const MyBachecaSchema = new Schema({
|
|||||||
{
|
{
|
||||||
type: Number,
|
type: Number,
|
||||||
}],
|
}],
|
||||||
|
dateTimeStart: {
|
||||||
|
type: Date,
|
||||||
|
},
|
||||||
|
dateTimeEnd: {
|
||||||
|
type: Date,
|
||||||
|
},
|
||||||
numLevel: {
|
numLevel: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
@@ -145,6 +151,8 @@ MyBachecaSchema.statics.executeQueryTable = function(idapp, params) {
|
|||||||
MyBacheca: 1,
|
MyBacheca: 1,
|
||||||
idStatusSkill: 1,
|
idStatusSkill: 1,
|
||||||
idContribType: 1,
|
idContribType: 1,
|
||||||
|
dateTimeStart: 1,
|
||||||
|
dateTimeEnd: 1,
|
||||||
idCity: 1,
|
idCity: 1,
|
||||||
numLevel: 1,
|
numLevel: 1,
|
||||||
adType: 1,
|
adType: 1,
|
||||||
@@ -232,6 +240,8 @@ MyBachecaSchema.statics.getMyRecById = function(idapp, id) {
|
|||||||
'idSubSkill': 1,
|
'idSubSkill': 1,
|
||||||
'idStatusSkill': 1,
|
'idStatusSkill': 1,
|
||||||
'idContribType': 1,
|
'idContribType': 1,
|
||||||
|
dateTimeStart: 1,
|
||||||
|
dateTimeEnd: 1,
|
||||||
'idCity': 1,
|
'idCity': 1,
|
||||||
'numLevel': 1,
|
'numLevel': 1,
|
||||||
adType: 1,
|
adType: 1,
|
||||||
@@ -284,6 +294,8 @@ MyBachecaSchema.statics.getMyRecById = function(idapp, id) {
|
|||||||
'idSubSkill': 1,
|
'idSubSkill': 1,
|
||||||
'idStatusSkill': 1,
|
'idStatusSkill': 1,
|
||||||
'idContribType': 1,
|
'idContribType': 1,
|
||||||
|
dateTimeStart: 1,
|
||||||
|
dateTimeEnd: 1,
|
||||||
'idCity': 1,
|
'idCity': 1,
|
||||||
'numLevel': 1,
|
'numLevel': 1,
|
||||||
adType: 1,
|
adType: 1,
|
||||||
@@ -336,6 +348,8 @@ MyBachecaSchema.statics.getMyRecById = function(idapp, id) {
|
|||||||
'idSubSkill': 1,
|
'idSubSkill': 1,
|
||||||
'idStatusSkill': 1,
|
'idStatusSkill': 1,
|
||||||
'idContribType': 1,
|
'idContribType': 1,
|
||||||
|
dateTimeStart: 1,
|
||||||
|
dateTimeEnd: 1,
|
||||||
'idCity': 1,
|
'idCity': 1,
|
||||||
'numLevel': 1,
|
'numLevel': 1,
|
||||||
adType: 1,
|
adType: 1,
|
||||||
@@ -388,6 +402,8 @@ MyBachecaSchema.statics.getMyRecById = function(idapp, id) {
|
|||||||
// 'idSubSkill': 1,
|
// 'idSubSkill': 1,
|
||||||
'idStatusSkill': 1,
|
'idStatusSkill': 1,
|
||||||
'idContribType': 1,
|
'idContribType': 1,
|
||||||
|
dateTimeStart: 1,
|
||||||
|
dateTimeEnd: 1,
|
||||||
'idCity': 1,
|
'idCity': 1,
|
||||||
'numLevel': 1,
|
'numLevel': 1,
|
||||||
adType: 1,
|
adType: 1,
|
||||||
@@ -440,6 +456,8 @@ MyBachecaSchema.statics.getMyRecById = function(idapp, id) {
|
|||||||
// 'idSubSkill': 1,
|
// 'idSubSkill': 1,
|
||||||
'idStatusSkill': 1,
|
'idStatusSkill': 1,
|
||||||
'idContribType': 1,
|
'idContribType': 1,
|
||||||
|
dateTimeStart: 1,
|
||||||
|
dateTimeEnd: 1,
|
||||||
'idCity': 1,
|
'idCity': 1,
|
||||||
'numLevel': 1,
|
'numLevel': 1,
|
||||||
adType: 1,
|
adType: 1,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module.exports = {
|
|||||||
{_id: 15, idSector: [3], descr: 'Autoproduzione alimenti e bevande'},
|
{_id: 15, idSector: [3], descr: 'Autoproduzione alimenti e bevande'},
|
||||||
{_id: 16, idSector: [4], descr: 'Servizi per Cani'},
|
{_id: 16, idSector: [4], descr: 'Servizi per Cani'},
|
||||||
{_id: 17, idSector: [4], descr: 'Servizi per Gatti'},
|
{_id: 17, idSector: [4], descr: 'Servizi per Gatti'},
|
||||||
{_id: 18, idSector: [4], descr: 'Servizi per Anumali da allevamento'},
|
{_id: 18, idSector: [4], descr: 'Servizi per Animali da allevamento'},
|
||||||
{_id: 19, idSector: [4], descr: 'Veterinario'},
|
{_id: 19, idSector: [4], descr: 'Veterinario'},
|
||||||
{_id: 20, idSector: [5], descr: 'Riparazioni Auto'},
|
{_id: 20, idSector: [5], descr: 'Riparazioni Auto'},
|
||||||
{_id: 21, idSector: [5], descr: 'Riparazioni Moto'},
|
{_id: 21, idSector: [5], descr: 'Riparazioni Moto'},
|
||||||
@@ -102,5 +102,10 @@ module.exports = {
|
|||||||
{_id: 100, idSector: [13], descr: 'Realizzazione Siti web'},
|
{_id: 100, idSector: [13], descr: 'Realizzazione Siti web'},
|
||||||
{_id: 101, idSector: [13], descr: 'Realizzazione App / Piattaforme'},
|
{_id: 101, idSector: [13], descr: 'Realizzazione App / Piattaforme'},
|
||||||
{_id: 102, idSector: [13], descr: 'Corsi d\'Informatica'},
|
{_id: 102, idSector: [13], descr: 'Corsi d\'Informatica'},
|
||||||
{_id: 103, idSector: [13], descr: 'Riparazione Elettrodomestici'}],
|
{_id: 103, idSector: [13], descr: 'Riparazione Elettrodomestici'},
|
||||||
|
{_id: 104, idSector: [12], descr: 'Infermiera'},
|
||||||
|
{_id: 105, idSector: [12], descr: 'OSS'},
|
||||||
|
{_id: 106, idSector: [10], descr: 'Badante'},
|
||||||
|
{_id: 107, idSector: [6], descr: 'Massaggi'},
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -783,7 +783,7 @@ module.exports = {
|
|||||||
console.error('err Push', err.body);
|
console.error('err Push', err.body);
|
||||||
|
|
||||||
// Cancella dal DB la notifica Push, visto che da errore! (sarà scaduto)
|
// Cancella dal DB la notifica Push, visto che da errore! (sarà scaduto)
|
||||||
const ris = await Subscription.deleteOne({_id: subscription._id });
|
const ris = await Subscription.deleteOne({_id: subscription._id});
|
||||||
|
|
||||||
reject({
|
reject({
|
||||||
status: false,
|
status: false,
|
||||||
@@ -807,7 +807,8 @@ module.exports = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
sendNotificationByUsername: async function(idapp, username, cmd, telegram, usernameOrig) {
|
sendNotificationByUsername: async function(
|
||||||
|
idapp, username, cmd, telegram, usernameOrig) {
|
||||||
|
|
||||||
var {User} = require('../models/user');
|
var {User} = require('../models/user');
|
||||||
|
|
||||||
@@ -1211,7 +1212,7 @@ module.exports = {
|
|||||||
let query = [];
|
let query = [];
|
||||||
|
|
||||||
const myfilters = [];
|
const myfilters = [];
|
||||||
for (const rec of fieldsearch){
|
for (const rec of fieldsearch) {
|
||||||
let data = {};
|
let data = {};
|
||||||
if (rec.type === this.FieldType.exact) {
|
if (rec.type === this.FieldType.exact) {
|
||||||
data[rec.field] = filter.trim();
|
data[rec.field] = filter.trim();
|
||||||
@@ -1248,8 +1249,8 @@ module.exports = {
|
|||||||
|
|
||||||
if (params.filter && params.fieldsearch) {
|
if (params.filter && params.fieldsearch) {
|
||||||
const querytemp = this.getFilterParam(params.filter, params.fieldsearch);
|
const querytemp = this.getFilterParam(params.filter, params.fieldsearch);
|
||||||
if (querytemp){
|
if (querytemp) {
|
||||||
query = [...query, ...querytemp]
|
query = [...query, ...querytemp];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1384,6 +1385,16 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
if (myfilter['_idOBJ']) {
|
if (myfilter['_idOBJ']) {
|
||||||
filtriadded.push({_id: ObjectID(myfilter['_idOBJ'])});
|
filtriadded.push({_id: ObjectID(myfilter['_idOBJ'])});
|
||||||
|
} else if (myfilter['dateTimeStart']) {
|
||||||
|
const gte = myfilter['dateTimeStart'].$gte;
|
||||||
|
const lte = myfilter['dateTimeStart'].$lte;
|
||||||
|
let condition = {
|
||||||
|
dateTimeStart: {
|
||||||
|
$gte: new Date(gte),
|
||||||
|
$lte: new Date(lte),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
filtriadded.push(condition);
|
||||||
} else {
|
} else {
|
||||||
filtriadded.push(myfilter);
|
filtriadded.push(myfilter);
|
||||||
}
|
}
|
||||||
@@ -1524,9 +1535,10 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (params.filter && params.fieldsearch_last) {
|
if (params.filter && params.fieldsearch_last) {
|
||||||
const querytemp = this.getFilterParam(params.filter, params.fieldsearch_last);
|
const querytemp = this.getFilterParam(params.filter,
|
||||||
if (querytemp){
|
params.fieldsearch_last);
|
||||||
query = [...query, ...querytemp]
|
if (querytemp) {
|
||||||
|
query = [...query, ...querytemp];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1609,7 +1621,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}catch (e) {
|
} catch (e) {
|
||||||
console.error('e', e);
|
console.error('e', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2167,7 +2179,7 @@ module.exports = {
|
|||||||
let img_small = path.dirname(mypath) + '/' +
|
let img_small = path.dirname(mypath) + '/' +
|
||||||
server_constants.PREFIX_IMG_SMALL + path.basename(mypath);
|
server_constants.PREFIX_IMG_SMALL + path.basename(mypath);
|
||||||
fs.unlink(img_small, () => {});
|
fs.unlink(img_small, () => {});
|
||||||
console.log('delete file', mypath)
|
console.log('delete file', mypath);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
@@ -2357,7 +2369,14 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
blockwords(mystr) {
|
blockwords(mystr) {
|
||||||
const arrwords = ['http', 'Http', 'Asasfasfas', '://', 'mrbit', 'admin', 'superuser'];
|
const arrwords = [
|
||||||
|
'http',
|
||||||
|
'Http',
|
||||||
|
'Asasfasfas',
|
||||||
|
'://',
|
||||||
|
'mrbit',
|
||||||
|
'admin',
|
||||||
|
'superuser'];
|
||||||
try {
|
try {
|
||||||
for (const myword of arrwords) {
|
for (const myword of arrwords) {
|
||||||
if (mystr) {
|
if (mystr) {
|
||||||
@@ -2498,7 +2517,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getNomeCognomeEUserNameByUser(user) {
|
getNomeCognomeEUserNameByUser(user) {
|
||||||
let nome = `${user.name} ${user.surname} (${user.username})`
|
let nome = `${user.name} ${user.surname} (${user.username})`;
|
||||||
if (!user.name) {
|
if (!user.name) {
|
||||||
nome = user.username;
|
nome = user.username;
|
||||||
}
|
}
|
||||||
@@ -2507,8 +2526,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
sulServer() {
|
sulServer() {
|
||||||
return process.env.LOCALE !== '1'
|
return process.env.LOCALE !== '1';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user