From 4dddff5df13388dedf08e192b4488880c2f33ed4 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Wed, 4 Dec 2019 18:21:17 +0100 Subject: [PATCH] - Sending Newsletter, others settings. --- src/components/Footer/Footer.vue | 4 +- src/layouts/menuone/menuOne.vue | 101 ++++++++++++-------- src/mixins/mixin-base.ts | 5 +- src/model/GlobalStore.ts | 2 + src/statics/i18n.js | 158 +++++++++++++++++++++++++++++-- src/store/Api/Instance.ts | 3 +- src/store/Modules/GlobalStore.ts | 9 ++ src/store/Modules/UserStore.ts | 3 +- src/store/Modules/fieldsTable.ts | 39 ++++---- src/store/Modules/tools.ts | 20 ++-- 10 files changed, 257 insertions(+), 87 deletions(-) diff --git a/src/components/Footer/Footer.vue b/src/components/Footer/Footer.vue index df95dcb..a7b5e60 100644 --- a/src/components/Footer/Footer.vue +++ b/src/components/Footer/Footer.vue @@ -8,7 +8,7 @@ + :urlfbpage="getValDb('FBPAGE_FRAME', false)" :title="getValDb('FBPAGE_TITLE', false)"> @@ -65,7 +65,7 @@
- {{ getValDb('MAIN_EMAIL') + {{ getValDb('MAIN_EMAIL', false) }}
- - +
+ + + + - - - + +
+ + + + +
+
+
@@ -55,24 +90,6 @@ header-class="my-menu" active-class="my-menu-active"> - - -
diff --git a/src/mixins/mixin-base.ts b/src/mixins/mixin-base.ts index 4e77d90..93f728e 100644 --- a/src/mixins/mixin-base.ts +++ b/src/mixins/mixin-base.ts @@ -34,7 +34,10 @@ export default class MixinBase extends Vue { public getValDb(keystr, serv, def?) { const ris = GlobalStore.getters.getValueSettingsByKey(keystr, serv) if (ris === '') - return def + if (def !== undefined) + return def + else + return '' else return ris } diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index 9e6877f..1a32a6d 100644 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -27,6 +27,7 @@ export interface ICfgData { } export interface ITemplEmail { + _id?: string subject?: string content?: string options?: ISettings[] @@ -52,6 +53,7 @@ export interface INewsToSent { _id: string idapp?: string label?: string + templemail_str?: string numemail_tot?: number numemail_sent?: number datetoSent?: Date diff --git a/src/statics/i18n.js b/src/statics/i18n.js index b09fa8c..1a695e3 100644 --- a/src/statics/i18n.js +++ b/src/statics/i18n.js @@ -316,7 +316,14 @@ const msgglobal = { deleted: 'Eliminato', duplicate: 'Duplica', notempty: 'Il campo non può essere vuoto', - modified: 'Modificato' + modified: 'Modificato', + showinhome: 'Mostra nella Home', + showinnewsletter: 'Mostra nella Newsletter', + color: 'Colore del titolo', + }, + disc: { + typol_code: 'Codice Tipologia', + order: 'Ordinamento', }, newsletter: { title: 'Desideri ricevere la nostra Newsletter?', @@ -331,6 +338,27 @@ const msgglobal = { acceptlicense: 'Accetto la licenza e i termini', license: 'Devi prima accettare la licenza e i termini', submitted: 'Iscritto', + menu: 'Newsletter1', + template: 'Modelli Email', + sendemail: 'Invia', + check: 'Controlla', + sent: 'Già Inviate', + mailinglist: 'Lista Contatti', + settings: 'Impostazioni', + serversettings: 'Server', + others: 'Altro', + templemail: 'Modello Email', + datetoSent: 'DataOra Invio', + activate: 'Attivato', + numemail_tot: 'Email Totali', + numemail_sent: 'Email Inviate', + datestartJob: 'Inizio Invio', + datefinishJob: 'Fine Invio', + lastemailsent_Job: 'Ultima Inviata', + starting_job: 'Invio Iniziato', + finish_job: 'Invio Terminato', + error_job: 'Info Errori', + statesub: 'Sottoscritto', }, privacy_policy:'Privacy Policy', cookies: 'Usiamo i Cookie per una migliore prestazione web.' @@ -639,7 +667,14 @@ const msgglobal = { deleted: 'Eliminado', duplicate: 'Duplica', notempty: 'El campo no puede estar vacío.', - modified: 'Modificado' + modified: 'Modificado', + showinhome: 'Mostrar en la Home', + showinnewsletter: 'Mostrar en el boletín', + color: 'Titulo Color', + }, + disc: { + typol_code: 'Código Tipologìa', + order: 'Clasificación', }, newsletter: { title: '¿Desea recibir nuestro boletín informativo?', @@ -653,7 +688,28 @@ const msgglobal = { typesomething: 'Llenar el campo', acceptlicense: 'Acepto la licencia y los términos', license: 'Necesitas aceptar la licencia y los términos primero', - submitted: 'Subscrito' + submitted: 'Subscrito', + menu: 'Newsletter1', + template: 'Plantillas de Email', + sendemail: 'Enviar', + check: 'Verificar', + sent: 'Ya eniado', + mailinglist: 'Lista de contactos', + settings: 'Configuración', + serversettings: 'Servidor', + others: 'Otro', + templemail: 'Plantilla de Email', + datetoSent: 'Fecha y Ora de Envio', + activate: 'Activado', + numemail_tot: 'Email Total', + numemail_sent: 'Email Enviados', + datestartJob: 'Inicio Envio', + datefinishJob: 'Fin Envio', + lastemailsent_Job: 'Ùltimo enviado', + starting_job: 'Comenzó a enviar', + finish_job: 'Envio terminado', + error_job: 'Info Error', + statesub: 'Subscribir', }, privacy_policy:'Política de privacidad', cookies: 'Utilizamos cookies para un mejor rendimiento web.' @@ -961,7 +1017,14 @@ const msgglobal = { deleted: 'Supprimé', duplicate: 'Duplique', notempty: 'Le champ ne peut pas être vide', - modified: 'modifié' + modified: 'modifié', + showinhome: 'Montrer à la Home', + showinnewsletter: 'Afficher dans la Newsletter', + color: 'Couleur du titre', + }, + disc: { + typol_code: 'Type de code', + order: 'Ordre', }, newsletter: { title: 'Souhaitez-vous recevoir notre newsletter?', @@ -975,7 +1038,28 @@ const msgglobal = { typesomething: 'Remplir le champ', acceptlicense: 'J\'accepte la licence et les termes', license: 'Vous devez d\'abord accepter la licence et les termes', - submitted: 'Abonné' + submitted: 'Abonné', + menu: 'Newsletter1', + template: 'Modeles Email', + sendemail: 'Envoyer', + check: 'Chèque', + sent: 'Dèjà envoyé', + mailinglist: 'Leste de contacts', + settings: 'Paramèters', + serversettings: 'Serveur', + others: 'Autres', + templemail: 'Model Email', + datetoSent: 'Date et heure d\'envoi', + activate: 'Activé', + numemail_tot: 'Total Email', + numemail_sent: 'Emails envoyés', + datestartJob: 'Inizio Invio', + datefinishJob: 'Fin envoi', + lastemailsent_Job: 'Dernier envoyé', + starting_job: 'Envoyé', + finish_job: 'Envoy Terminé', + error_job: 'info d\'erreur', + statesub: 'Abonné', }, privacy_policy:'Politique de confidentialité', cookies: 'Nous utilisons des cookies pour améliorer les performances Web.' @@ -1282,7 +1366,14 @@ const msgglobal = { deleted: 'Deleted', duplicate: 'Duplicate', notempty: 'Field cannot be empty', - modified: 'Modified' + modified: 'Modified', + showinhome: 'Show in Home', + showinnewsletter: 'Show in the Newsletter', + color: 'Title Color', + }, + disc: { + typol_code: 'Tipology Code', + order: 'Order', }, newsletter: { title: 'Would you like to receive our Newsletter?', @@ -1296,7 +1387,28 @@ const msgglobal = { typesomething: 'Please type something', acceptlicense: 'I accept the license and terms', license: 'You need to accept the license and terms first', - submitted: 'Subscribed' + submitted: 'Subscribed', + menu: 'Newsletter1', + template: 'Template Email', + sendemail: 'Send', + check: 'Check', + sent: 'Already Sent', + mailinglist: 'Mailing List', + settings: 'Settings', + serversettings: 'Server', + others: 'Others', + templemail: 'Templates Email', + datetoSent: 'DateTime Send', + activate: 'Activate', + numemail_tot: 'Email Total', + numemail_sent: 'Email Sent', + datestartJob: 'Start Job', + datefinishJob: 'End Job', + lastemailsent_Job: 'Last Sent', + starting_job: 'Job started', + finish_job: 'Sent terminated', + error_job: 'Info Error', + statesub: 'Subscribed', }, privacy_policy:'Privacy Policy', cookies: 'We use cookies for better web performance.' @@ -1605,7 +1717,14 @@ const msgglobal = { deleted: 'Deleted', duplicate: 'Duplicate', notempty: 'Field cannot be empty', - modified: 'Modified' + modified: 'Modified', + showinhome: 'Show in Home', + showinnewsletter: 'Show in the Newsletter', + color: 'Title Color', + }, + disc: { + typol_code: 'Tipology Code', + order: 'Order', }, newsletter: { title: 'Would you like to receive our Newsletter?', @@ -1619,7 +1738,28 @@ const msgglobal = { typesomething: 'Please type something', acceptlicense: 'I accept the license and terms', license: 'You need to accept the license and terms first', - submitted: 'Subscribed' + submitted: 'Subscribed', + menu: 'Newsletter1', + template: 'Template Email', + sendemail: 'Send', + check: 'Check', + sent: 'Already Sent', + mailinglist: 'Mailing List', + settings: 'Settings', + serversettings: 'Server', + others: 'Others', + templemail: 'Templates Email', + datetoSent: 'DateTime Send', + activate: 'Activate', + numemail_tot: 'Email Total', + numemail_sent: 'Email Sent', + datestartJob: 'Start Job', + datefinishJob: 'End Job', + lastemailsent_Job: 'Last Sent', + starting_job: 'Job started', + finish_job: 'Sent terminated', + error_job: 'Info Error', + statesub: 'Subscribed', }, privacy_policy:'Privacy Policy', cookies: 'Wir verwenden Cookies für eine bessere Webleistung.' diff --git a/src/store/Api/Instance.ts b/src/store/Api/Instance.ts index cec05e5..9a77ba0 100644 --- a/src/store/Api/Instance.ts +++ b/src/store/Api/Instance.ts @@ -51,7 +51,8 @@ export const removeAuthHeaders = () => { async function Request(type: string, path: string, payload: any): Promise { let ricevuto = false try { - console.log('Axios Request', path, type, tools.notshowPwd(payload)) + if (tools.isDebug()) + console.log('Axios Request', path, type, tools.notshowPwd(payload)) let response: AxiosResponse if (type === 'post' || type === 'put' || type === 'patch') { response = await axiosInstance[type](path, payload, { diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts index baf7a89..e84ccfb 100644 --- a/src/store/Modules/GlobalStore.ts +++ b/src/store/Modules/GlobalStore.ts @@ -221,6 +221,11 @@ namespace Getters { }, 'getValueSettingsByKey') + const gettemplemailbyId = b.read((mystate: IGlobalState) => (templid): string => { + const myrec = mystate.templemail.find((rec) => rec._id === templid) + return (!!myrec) ? myrec.subject : '' + }, 'gettemplemailbyId') + export const getters = { get testpao1_getter_contatore() { return testpao1_getter_contatore() @@ -268,6 +273,10 @@ namespace Getters { return getrecSettingsByKey() }, + get gettemplemailbyId() { + return gettemplemailbyId() + }, + get t() { return t() }, diff --git a/src/store/Modules/UserStore.ts b/src/store/Modules/UserStore.ts index 1e55fec..20514db 100644 --- a/src/store/Modules/UserStore.ts +++ b/src/store/Modules/UserStore.ts @@ -709,7 +709,8 @@ namespace Actions { await Projects.actions.dbLoad({ checkPending: true, onlyiffirsttime: true }) GlobalStore.state.finishLoading = true - console.log('finishLoading', GlobalStore.state.finishLoading) + if (tools.isDebug()) + console.log('finishLoading', GlobalStore.state.finishLoading) // document.dispatchEvent(new Event('custom-post-render-event')) diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index 02f9bac..1bb139e 100644 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -53,6 +53,15 @@ function AddCol(params: IColGridTable) { } } +export const colmailinglist = [ + AddCol({ name: 'name', label_trans: 'reg.name' }), + AddCol({ name: 'surname', label_trans: 'reg.surname' }), + AddCol({ name: 'email', label_trans: 'reg.email' }), + AddCol({ name: 'statesub', label_trans: 'newsletter.statesub', fieldtype: tools.FieldType.boolean }), + AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: tools.FieldType.string }), + AddCol(DeleteRec) +] + export const colopzemail = [ AddCol({ name: 'key', label_trans: 'col.key' }), AddCol({ name: 'label_it', label_trans: 'col.label' }), @@ -76,19 +85,20 @@ export const coltemplemail = [ AddCol(DeleteRec), AddCol(DuplicateRec) ] - +// SHOW_LAST_N_EV export const colnewstosent = [ AddCol({ name: 'label', label_trans: 'event.title' }), - AddCol({ name: 'datetoSent', label_trans: 'news.datetoSent', fieldtype: tools.FieldType.date }), - AddCol({ name: 'activate', label_trans: 'news.activate', fieldtype: tools.FieldType.boolean }), - AddCol({ name: 'numemail_tot', label_trans: 'news.numemail_tot', fieldtype: tools.FieldType.number }), - AddCol({ name: 'numemail_sent', label_trans: 'news.numemail_sent', fieldtype: tools.FieldType.number }), - AddCol({ name: 'datestartJob', label_trans: 'news.datestartJob', fieldtype: tools.FieldType.date }), - AddCol({ name: 'datefinishJob', label_trans: 'news.datefinishJob', fieldtype: tools.FieldType.date }), - AddCol({ name: 'lastemailsent_Job', label_trans: 'news.lastemailsent_Job', fieldtype: tools.FieldType.date }), - AddCol({ name: 'starting_job', label_trans: 'news.starting_job', fieldtype: tools.FieldType.boolean }), - AddCol({ name: 'finish_job', label_trans: 'news.finish_job', fieldtype: tools.FieldType.boolean }), - AddCol({ name: 'error_job', label_trans: 'news.error_job', fieldtype: tools.FieldType.string }), + AddCol({ name: 'templemail_str', label_trans: 'newsletter.templemail' }), + AddCol({ name: 'datetoSent', label_trans: 'newsletter.datetoSent', fieldtype: tools.FieldType.date }), + AddCol({ name: 'activate', label_trans: 'newsletter.activate', fieldtype: tools.FieldType.boolean }), + AddCol({ name: 'numemail_tot', label_trans: 'newsletter.numemail_tot', fieldtype: tools.FieldType.number }), + AddCol({ name: 'numemail_sent', label_trans: 'newsletter.numemail_sent', fieldtype: tools.FieldType.number }), + AddCol({ name: 'datestartJob', label_trans: 'newsletter.datestartJob', fieldtype: tools.FieldType.date }), + AddCol({ name: 'datefinishJob', label_trans: 'newsletter.datefinishJob', fieldtype: tools.FieldType.date }), + AddCol({ name: 'lastemailsent_Job', label_trans: 'newsletter.lastemailsent_Job', fieldtype: tools.FieldType.date }), + AddCol({ name: 'starting_job', label_trans: 'newsletter.starting_job', fieldtype: tools.FieldType.boolean }), + AddCol({ name: 'finish_job', label_trans: 'newsletter.finish_job', fieldtype: tools.FieldType.boolean }), + AddCol({ name: 'error_job', label_trans: 'newsletter.error_job', fieldtype: tools.FieldType.string }), AddCol(DeleteRec), AddCol(DuplicateRec) ] @@ -134,13 +144,6 @@ const colTablePermission = [ AddCol(DeleteRec) ] -const colmailinglist = [ - AddCol({ name: 'name', label_trans: 'reg.name' }), - AddCol({ name: 'surname', label_trans: 'reg.surname' }), - AddCol({ name: 'email', label_trans: 'reg.email' }), - AddCol({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: tools.FieldType.string }), - AddCol(DeleteRec) -] const colTableOperator = [ AddCol({ name: 'username', label_trans: 'reg.username' }), diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 9b35809..a70e87c 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -2669,12 +2669,15 @@ export const tools = { return mywidth } else { - let myw = mywidth + ((this.getwidth(mythis) - mywidth) * 0.4) + console.log('this.getwidth(mythis) = ', this.getwidth(mythis)) + let myw = mywidth + ((this.getwidth(mythis) - mywidth) * 0.6) + console.log('myw1 = ', myw) if (myw > maxwidth) myw = maxwidth if (myw > this.getwidth(mythis) - 20) myw = this.getwidth(mythis) - 20 + console.log('myw = ', myw) return myw } }, @@ -2684,18 +2687,6 @@ export const tools = { return myw * (myheight / mywidth) }, - getheightscale(mythis, myheight, maxheight) { - if (this.isMobile()) { - return myheight - } else { - let myh = myheight + ((this.getheight(mythis) - myheight) * 0.3) - if (myh > maxheight) - myh = maxheight - - return myh - } - }, - isIsoDate(str) { if (!/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(str)) return false const d = new Date(str) @@ -2829,6 +2820,9 @@ export const tools = { isObject(anything) { //Object.create(null) instanceof Object → false return Object(anything) === anything + }, + isDebug() { + return process.env.DEV } // getLocale() {