- fix: Invio RIS (non si vedevano i circuiti !)

- se si usava l'username telegram per registrarsi non faceva il controllo delle minuscole.
- bottone "Invia RIS" era scomparso
This commit is contained in:
Surya Paolo
2024-11-03 19:15:35 +01:00
parent f89281e316
commit 73cf977754
10 changed files with 297 additions and 34 deletions

View File

@@ -4943,7 +4943,7 @@ module.exports = {
},
addRowTelegram(icon, title, content, acapo, islink) {
addRowTelegram(icon, title, content, acapo, acapofine, islink) {
let mystr = '';
let descrcontent = content;
@@ -4952,11 +4952,16 @@ module.exports = {
descrcontent = '';
}
mystr += `${icon} <strong>${title}</strong>\n`;
mystr += `${icon} <strong>${title}</strong>`;
if (acapo) {
mystr += `\n`;
} else {
mystr += `: `;
}
if (descrcontent) {
mystr += `${descrcontent}\n`;
if (acapo) {
if (acapofine) {
mystr += `\n`;
}
}
@@ -5273,7 +5278,7 @@ module.exports = {
if (myrec.website) {
sitoweb = myrec.website
}
contact_phone = myrec.contact_phone || '';
contact_email = myrec.contact_email || '';
@@ -5289,25 +5294,25 @@ module.exports = {
if ((myrec.contact_telegram && myrec.contact_telegram.toLowerCase() !== contatto_telegram.toLowerCase()) || !contatto) {
contatto += '\n' + myrec.contact_telegram;
}
if (myrec.contact_phone) {
contatto += ' - ' + this.get__('TELEFONO', lang) + ': ' + myrec.contact_phone;
}
/*if (myrec.contact_phone) {
contatto += ' 📞 ' + myrec.contact_phone;
}*/
}
// let out = i18n.__('NEW_ANNUNCIO_TELEGRAM', mydescr, dovestr, descrestesa, userorig);
if (tiposcambio)
out += this.addRowTelegram(iconascambio, tiposcambio + status, '', false);
out += this.addRowTelegram(iconascambio, tiposcambio + status, '', true, false);
const url = this.getHostByIdApp(myrec.idapp) + shared_consts.getDirectoryByTable(tablerec, true) + myrec._id;
out += `<strong>${myrec.descr}</strong>\n\n`;
if (datastr)
out += this.addRowTelegram('✨', 'Data Evento', datastr, true);
out += this.addRowTelegram('✨', 'Data Evento', datastr, true, true);
if (cat)
out += this.addRowTelegram('⭐️', 'Categoria', cat, true);
out += this.addRowTelegram('⭐️', 'Categoria', cat, true, true);
let descrcontent = this.convertAndTruncateHTMLForTelegram(myrec.note, 500, url)
@@ -5318,39 +5323,44 @@ module.exports = {
// descrcontent = '<span size="3"><b>Prova Pao</b> Ciaooo</span>';
if (descrcontent)
out += this.addRowTelegram('📝', 'Descrizione ' + newdescr, descrcontent, true);
out += this.addRowTelegram('📝', 'Descrizione ' + newdescr, descrcontent, true, true);
const localita = this.getComuniEProvinceByRec(myrec);
if (!solo_online)
out += this.addRowTelegram('🏠', 'Località', localita, true);
out += this.addRowTelegram('🏠', 'Località', localita, false, true);
const incambiodi = await this.getInCambioDiByRec(myrec);
if (incambiodi)
out += this.addRowTelegram('⚖️', 'In cambio di', incambiodi, true);
out += this.addRowTelegram('⚖️', 'In cambio di', incambiodi, false, true);
if (organizedBy) {
out += this.addRowTelegram('🏠', 'Organizzato da', organizedBy, true);
out += this.addRowTelegram('🏠', 'Organizzato da', organizedBy, false, true);
} else {
out += this.addRowTelegram('👤', 'Contatto', contatto, true);
out += this.addRowTelegram('👤', 'Contatto', contatto, false, true);
}
if (contributo)
out += this.addRowTelegram('💰', 'Contributo Richiesto', contributo, true);
out += this.addRowTelegram('💰', 'Contributo Richiesto', contributo, false, true);
if (contact_phone || contact_email || sitoweb) {
out += this.addRowTelegram('', 'Info',
out += this.addRowTelegram('', 'Per Info:',
(contact_phone ? ('📞 ' + contact_phone + ' ') : '')
+ (contact_email ? (' 📨 ' + contact_email + ' ') : '')
+ (sitoweb ? (' 🌐 ' + sitoweb + ' ') : '')
, true);
, true, true);
}
if (writtenby && organizedBy) {
out += this.addRowTelegram('✍️', 'Redatto da', '@' + writtenby, true);
out += this.addRowTelegram('✍️', 'Redatto da', '@' + writtenby, false, true);
}
out += this.addRowTelegram('', `👉🏻 Vedi Annuncio completo su RISO`, url, true, true);
let cosastr = 'Annuncio';
if (tablerec === shared_consts.TABLES_MYBACHECAS) {
cosastr = 'Evento';
}
out += this.addRowTelegram('', `👉🏻 Vedi ${cosastr} completo su RISO`, url, true, true, true);
if (myrec.photos && myrec.photos.length > 0) {
// prende la prima foto ! ;