-Poter entrare nel login anche con l'username Telegram !

- Se clicchi sulla foto, mi apre il profilo anzichè l'invio dei RIS
- ++ Filtro sulle ricerche: Scegliere un Circuito specifico.
- Nella lista iscritti compaiono anche i cancellati...
- n "Attività" si vede tutto allargato, non sta nella dimensione della pagina.
- Nelle notifiche della campanellina non si vede più il titolo... (è vuoto).
- Non funziona il Filtro per Settore (nella Home sugli Eventi)
- Filtri avanzati da mostrare solo se clicco sul bottone.
- I menu in basso non funzionano !
- Nel menu "Iscritti" del circuito, non compare più la ricerca ! Riattivarla
- Opzione di mandare una email quando uno si registra al Circuito
- ++ Opzione per il Circuito: Chiedi di entrare agli admin (e non in automatico).
This commit is contained in:
Surya Paolo
2025-01-09 15:17:03 +01:00
parent 9fb7df56e6
commit 836f7f572b
7 changed files with 137 additions and 62 deletions

View File

@@ -264,7 +264,7 @@ CircuitSchema.statics.findAllIdApp = async function (idapp) {
const whatToShow = this.getWhatToShow(idapp, '');
return await Circuit.find(myfind, whatToShow).sort({ status: -1, numMembers: -1, name: 1 });
return await Circuit.find(myfind, whatToShow).lean().sort({ name: 1 });
};
CircuitSchema.statics.isCircuitAdmin = async function (idrec, username) {
@@ -450,7 +450,7 @@ CircuitSchema.statics.getCircuitsByUsername = async function (idapp, username, u
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
}, whatToShow_Unknown).sort({ status: -1, numMembers: -1, name: 1 }).lean();
}, whatToShow_Unknown).sort({ name: 1 }).lean();
let asked_circuits = await Circuit.find({
idapp,
@@ -970,6 +970,15 @@ CircuitSchema.statics.getNameByCircuitId = async function (circuitId) {
return '';
};
CircuitSchema.statics.getPathByCircuitName = async function (idapp, circuitName) {
let circuit = await Circuit.findOne({ idapp, name: circuitName }).lean();
if (circuit)
return '/' + shared_consts.getDirectoryByTable('circuits') + '/' + circuit.path;
return '';
};
CircuitSchema.statics.getCircuitByCircuitId = async function (circuitId) {

View File

@@ -174,7 +174,7 @@ MyGroupSchema.statics.findAllGroups = async function (idapp) {
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
}, whatToShow);
}, whatToShow).lean();
};
// Rimuovo la Richiesta del Gruppo

View File

@@ -216,31 +216,33 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = async function (recnotif, us
const { User } = require('../models/user');
try {
let dovestr = '';
if (recnotif.myrectableorig) {
myidrec = recnotif.myrectableorig._id;
mydescr = recnotif.myrectableorig.descr ? tools.firstchars(recnotif.myrectableorig.descr, numchars) : '';
dovestr = tools.getDoveStrByAnnuncio(recnotif.myrectableorig);
}
if (recnotif.typedir === shared_consts.TypeNotifs.TYPEDIR_BACHECA) {
let tablerec = '';
if (recnotif.typeid === shared_consts.TypeNotifs.ID_BACHECA_NEW_GOOD) {
newdescr = i18n.__('NEW_GOOD', userorig, mydescr);
newdescr = i18n.__('NEW_GOOD', userorig, mydescr, dovestr);
recnotif.openUrl = shared_consts.getDirectoryByTable(shared_consts.TABLES_MYGOODS, true) + myidrec;
tag = 'newgood';
tablerec = 'mygoods';
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_BACHECA_NEW_SERVICE) {
newdescr = i18n.__('NEW_SERVICE', userorig, mydescr);
newdescr = i18n.__('NEW_SERVICE', userorig, mydescr, dovestr);
recnotif.openUrl = shared_consts.getDirectoryByTable(shared_consts.TABLES_MYSKILLS, true) + myidrec;
tag = 'newservice';
tablerec = 'myskills';
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_BACHECA_NEW_HOSP) {
newdescr = i18n.__('NEW_HOSP', userorig, mydescr);
newdescr = i18n.__('NEW_HOSP', userorig, mydescr, dovestr);
recnotif.openUrl = shared_consts.getDirectoryByTable(shared_consts.TABLES_MYHOSPS, true) + myidrec;
tag = 'newhosp';
tablerec = 'myhosps';
}
let eventobj = await tools.getAnnuncioForTelegram(recnotif.myrectableorig, tablerec, mydescr, userorig, true);
newdescr = eventobj.newdescr;
// newdescr = eventobj.descrperNotif;
recnotif.textcontent_Telegram = eventobj.newdescrtelegram;
recnotif.linkaddTelegram = '';
} else if (recnotif.typedir === shared_consts.TypeNotifs.TYPEDIR_EVENTS) {
@@ -249,7 +251,7 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = async function (recnotif, us
if (recnotif.typeid === shared_consts.TypeNotifs.ID_EVENTS_NEW_REC) {
// let eventobj = await tools.getEventForTelegram(recnotif.myrectableorig, mydescr, userorig);
let eventobj = await tools.getAnnuncioForTelegram(recnotif.myrectableorig, shared_consts.TABLES_MYBACHECAS, mydescr, userorig, true);
newdescr = eventobj.newdescr;
newdescr = eventobj.descrperNotif;
newdescrtelegram = eventobj.newdescrtelegram;
} else if (recnotif.typeid === shared_consts.TypeNotifs.ID_EVENTS_SEND_MSG) {
newdescr = i18n.__('EVENT_SEND_MSG', userorig, recnotif.title, recnotif.msg);
@@ -597,10 +599,11 @@ sendNotifSchema.statics.getDescrAndLinkByRecNotif = async function (recnotif, us
recnotif.tag = recnotif.tag ? recnotif.tag : tag;
if (!recnotif.descr) {
if (!recnotif.descr) {
recnotif.descr = newdescr;
}
return recnotif;
} catch (e) {
console.error(e);

View File

@@ -822,6 +822,19 @@ UserSchema.statics.findByCredentials = function (idapp, username, password, pwdc
} else {
return !user.deleted || (user.deleted && user.subaccount) ? user : null;
}
}).then((user) => {
if (!user) {
// Check with username telegram
return User.findOne({
idapp,
'profile.username_telegram': username.toLowerCase(),
$or: [
{ deleted: { $exists: false } },
{ deleted: { $exists: true, $eq: false } }],
});
} else {
return !user.deleted || (user.deleted && user.subaccount) ? user : null;
}
}).then(user => {
if (!user)
return null;