diff --git a/emails/admin/iscrizione_conacreis/it/html.pug b/emails/admin/iscrizione_conacreis/it/html.pug index e03e9ce..c009ec7 100755 --- a/emails/admin/iscrizione_conacreis/it/html.pug +++ b/emails/admin/iscrizione_conacreis/it/html.pug @@ -32,6 +32,18 @@ span Abilita le Newsletter? :  strong #{iscritto.newsletter_on}
span Metodo di Pagamento :  strong #{metodo_pagamento}
+span Motivazioni sul perchè intendi iscriverti alla CNM:  + strong #{iscritto.motivazioni}
+span Descrivi le tue competenze e professionalità:  + strong #{iscritto.competenze_professionalita}
+span Cosa potresti offrire?:  + strong #{iscritto.cosa_potrei_offrire}
+span Cosa vorresti ricevere? (cosa ti aspetti?):  + strong #{iscritto.cosa_vorrei_ricevere}
+span Scrivi altre eventuali informazioni o comunicazioni:  + strong #{iscritto.altre_comunicazioni}
+span Come ci hai conosciuto?:  + strong #{iscritto.come_ci_hai_conosciuto}
p
Saluti style(type="text/css"). diff --git a/src/server/models/myevent.js b/src/server/models/myevent.js index 902abdb..afeed79 100755 --- a/src/server/models/myevent.js +++ b/src/server/models/myevent.js @@ -2,17 +2,17 @@ const mongoose = require('mongoose'); const Schema = mongoose.Schema; mongoose.Promise = global.Promise; -mongoose.level = "F"; +mongoose.level = 'F'; const tools = require('../tools/general'); -const { ObjectID } = require('mongodb'); +const {ObjectID} = require('mongodb'); -const { Settings } = require('./settings'); +const {Settings} = require('./settings'); // Resolving error Unknown modifier: $pushAll mongoose.plugin(schema => { - schema.options.usePushEach = true + schema.options.usePushEach = true; }); const MyEventSchema = new Schema({ @@ -121,9 +121,10 @@ const MyEventSchema = new Schema({ note: { type: String, }, - pagefooter: [{ - type: String, - }], + pagefooter: [ + { + type: String, + }], deleted: { type: Boolean, }, @@ -138,115 +139,132 @@ const MyEventSchema = new Schema({ }, }); -MyEventSchema.statics.findAllIdApp = function (socioresidente, idapp) { +MyEventSchema.statics.findAllIdApp = function(socioresidente, idapp) { const Event = this; - let query = [] + let query = []; if (socioresidente) { query = [ { $match: { idapp, - } - } - ] + $or: [ + {deleted: {$exists: false}}, + {deleted: {$exists: true, $eq: false}}], + }, + }, + ]; } else { query = [ { $match: { idapp, - $or: [ - { $or: [{ internal: { $exists: false } }, { internal: { $exists: true, $eq: false } }] }, + $and: [ + { + $or: [ + {deleted: {$exists: false}}, + {deleted: {$exists: true, $eq: false}}, + ], + }, + { + $or: [ + {internal: {$exists: false}}, + {internal: {$exists: true, $eq: false}}], + }, ], - } - } - ] + }, + }, + ]; } - query.push({ $sort: { dateTimeStart: 1 } }) + query.push({$sort: {dateTimeStart: 1}}); - return Event - .aggregate(query) - .then((arrrec) => { - return arrrec - }) + return Event.aggregate(query).then((arrrec) => { + return arrrec; + }); }; -MyEventSchema.statics.getLastEvents = async function (idapp) { +MyEventSchema.statics.getLastEvents = async function(idapp) { const Event = this; const lastn = await Settings.getValDbSettings(idapp, 'SHOW_LAST_N_EV', 1); const query = [ - { $match: { idapp, dateTimeStart: { $gte: tools.IncDateNow(-1000 * 60 * 60 * 24) } } }, + { + $match: { + idapp, + dateTimeStart: {$gte: tools.IncDateNow(-1000 * 60 * 60 * 24)}, + $or: [ + {deleted: {$exists: false}}, + {deleted: {$exists: true, $eq: false}}], + }, + }, { $lookup: { from: 'operators', localField: 'teacher', foreignField: 'username', - as: 'op1' - } + as: 'op1', + }, }, { $lookup: { from: 'operators', localField: 'teacher2', foreignField: 'username', - as: 'op2' - } + as: 'op2', + }, }, { $lookup: { from: 'operators', localField: 'teacher3', foreignField: 'username', - as: 'op3' - } + as: 'op3', + }, }, { $lookup: { from: 'operators', localField: 'teacher4', foreignField: 'username', - as: 'op4' - } + as: 'op4', + }, }, - { "$addFields": { "contribtype": { "$toObjectId": "$contribtype" } } }, + {'$addFields': {'contribtype': {'$toObjectId': '$contribtype'}}}, { $lookup: { from: 'contribtypes', localField: 'contribtype', foreignField: '_id', - as: 'contrib' - } + as: 'contrib', + }, }, - { $sort: { dateTimeStart: 1 } } + {$sort: {dateTimeStart: 1}}, ]; - return Event - .aggregate(query) - .then((arrrec) => { - // console.table(arrrec); - if (lastn > 0) { - return arrrec.slice(0, lastn); - } else { - return arrrec - } - }) + return Event.aggregate(query).then((arrrec) => { + // console.table(arrrec); + if (lastn > 0) { + return arrrec.slice(0, lastn); + } else { + return arrrec; + } + }); }; - -MyEventSchema.statics.getFieldsForSearch = function () { - return [{ field: 'short_tit', type: tools.FieldType.string }, - { field: 'title', type: tools.FieldType.string }, - { field: 'teacher', type: tools.FieldType.string }, - { field: 'details', type: tools.FieldType.string }] +MyEventSchema.statics.getFieldsForSearch = function() { + return [ + {field: 'short_tit', type: tools.FieldType.string}, + {field: 'title', type: tools.FieldType.string}, + {field: 'teacher', type: tools.FieldType.string}, + {field: 'details', type: tools.FieldType.string}]; }; -MyEventSchema.statics.executeQueryTable = function (idapp, params) { +MyEventSchema.statics.executeQueryTable = function(idapp, params) { params.fieldsearch = this.getFieldsForSearch(); return tools.executeQueryTable(this, idapp, params); }; @@ -256,7 +274,6 @@ if (tools.INITDB_FIRSTIME) { // MyEventSchema.index({ short_tit: 'text', title: 'text', teacher: 'text', details: 'text' }); } - const MyEvent = mongoose.model('MyEvent', MyEventSchema); -module.exports = { MyEvent }; +module.exports = {MyEvent}; diff --git a/src/server/sendemail.js b/src/server/sendemail.js index 76de740..5577bdc 100755 --- a/src/server/sendemail.js +++ b/src/server/sendemail.js @@ -203,9 +203,9 @@ module.exports = { tools.sendNotifToAdmin('Nuova Registrazione Utente: ' + mylocalsconf.name + ' ' + mylocalsconf.surname + ' (' + mylocalsconf.username + ')'); - if (tools.isManagAndAdminDifferent(idapp)) { - this.sendEmail_base('admin/registration/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, ''); - } + // if (tools.isManagAndAdminDifferent(idapp)) { + // this.sendEmail_base('admin/registration/' + tools.LANGADMIN, tools.getManagerEmailByIdApp(idapp), mylocalsconf, ''); + // } }, sendEmail_IscrizioneConacreis: async function (lang, emailto, iscritto, idapp) {