- Import emails from a list to a DB
- Create Template Emails - Options Email
This commit is contained in:
@@ -61,7 +61,7 @@ export default class CDateTime extends Vue {
|
||||
public changevalueDate() {
|
||||
if (this.valueDate)
|
||||
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
|
||||
console.log('changevalueDate myvalue', this.myvalue)
|
||||
// console.log('changevalueDate myvalue', this.myvalue)
|
||||
}
|
||||
@Watch('value')
|
||||
public changevalue() {
|
||||
@@ -72,7 +72,7 @@ export default class CDateTime extends Vue {
|
||||
public savetoclose() {
|
||||
this.saveit = true
|
||||
this.showDateTimeScroller = false
|
||||
this.$emit('savetoclose', this.myvalue, this.valueprec)
|
||||
// this.$emit('savetoclose', this.myvalue, this.valueprec)
|
||||
}
|
||||
|
||||
get scrollerPopupStyle280() {
|
||||
|
||||
@@ -12,13 +12,14 @@ import { lists } from '../../store/Modules/lists'
|
||||
import { IParamsQuery } from '../../model/GlobalStore'
|
||||
import { fieldsTable } from '../../store/Modules/fieldsTable'
|
||||
import { CMyPopupEdit } from '../CMyPopupEdit'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
|
||||
@Component({
|
||||
components: { CMyPopupEdit }
|
||||
components: { CMyPopupEdit, CTitleBanner }
|
||||
})
|
||||
export default class CGridTableRec extends Vue {
|
||||
@Prop({ required: false }) public prop_mytable: string
|
||||
@Prop({ required: true }) public prop_mytitle: string
|
||||
@Prop({ required: false }) public prop_mytable: string
|
||||
@Prop({ required: false, default: null }) public prop_mycolumns: any[]
|
||||
@Prop({ required: false, default: '' }) public prop_colkey: string
|
||||
@Prop({ required: false, default: '' }) public nodataLabel: string
|
||||
@@ -52,7 +53,7 @@ export default class CGridTableRec extends Vue {
|
||||
public valPrec: string = ''
|
||||
|
||||
public separator: 'horizontal'
|
||||
public filter = undefined
|
||||
public myfilter = undefined
|
||||
public rowsel: any
|
||||
public dark: boolean = true
|
||||
public canEdit: boolean = false
|
||||
@@ -62,6 +63,11 @@ export default class CGridTableRec extends Vue {
|
||||
public colVisib: any[] = []
|
||||
public colExtra: any[] = []
|
||||
|
||||
public rowclicksel: any = null
|
||||
public colclicksel: any = null
|
||||
|
||||
public selected: any = []
|
||||
|
||||
get lists() {
|
||||
return lists
|
||||
}
|
||||
@@ -96,16 +102,36 @@ export default class CGridTableRec extends Vue {
|
||||
|
||||
}
|
||||
|
||||
public SaveValdb(newVal, valinitial) {
|
||||
// console.log('SaveValdb', newVal)
|
||||
// console.log('SaveValue', newVal, 'rowsel', this.rowsel)
|
||||
|
||||
this.colsel = this.colclicksel
|
||||
// console.log('this.colsel', this.colsel)
|
||||
this.SaveValue(newVal, valinitial)
|
||||
this.colsel = null
|
||||
}
|
||||
|
||||
public showandsel(row, col, newval, valinitial) {
|
||||
// console.log('showandsel', row, col, newval)
|
||||
this.rowsel = row
|
||||
this.colsel = col
|
||||
this.idsel = row._id
|
||||
this.SaveValue(newval, valinitial)
|
||||
}
|
||||
|
||||
public SaveValue(newVal, valinitial) {
|
||||
// console.log('SaveValue', newVal, 'rowsel', this.rowsel)
|
||||
|
||||
// Update value in table memory
|
||||
if (this.colsel.subfield !== '') {
|
||||
if (this.rowsel[this.colsel.field] === undefined)
|
||||
this.rowsel[this.colsel.field] = {}
|
||||
this.rowsel[this.colsel.field][this.colsel.subfield] = newVal
|
||||
} else {
|
||||
this.rowsel[this.colsel.field] = newVal
|
||||
if (this.colsel) {
|
||||
// Update value in table memory
|
||||
if (this.colsel.subfield !== '') {
|
||||
if (this.rowsel[this.colsel.field] === undefined)
|
||||
this.rowsel[this.colsel.field] = {}
|
||||
this.rowsel[this.colsel.field][this.colsel.subfield] = newVal
|
||||
} else {
|
||||
this.rowsel[this.colsel.field] = newVal
|
||||
}
|
||||
}
|
||||
|
||||
const mydata = {
|
||||
@@ -140,7 +166,7 @@ export default class CGridTableRec extends Vue {
|
||||
}
|
||||
|
||||
public updatedcol() {
|
||||
console.log('updatedcol')
|
||||
// console.log('updatedcol')
|
||||
if (this.mycolumns) {
|
||||
this.colVisib = []
|
||||
this.colExtra = []
|
||||
@@ -160,9 +186,9 @@ export default class CGridTableRec extends Vue {
|
||||
}
|
||||
|
||||
public onRequest(props) {
|
||||
console.log('onRequest', 'filter = ' , this.filter)
|
||||
console.log('onRequest', 'myfilter = ', this.myfilter)
|
||||
const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination
|
||||
const filter = this.filter
|
||||
const myfilter = this.myfilter
|
||||
|
||||
if (!this.mytable)
|
||||
return
|
||||
@@ -185,9 +211,9 @@ export default class CGridTableRec extends Vue {
|
||||
this.serverData = []
|
||||
|
||||
// fetch data from "server"
|
||||
this.fetchFromServer(startRow, endRow, filter, sortBy, descending).then((ris) => {
|
||||
this.fetchFromServer(startRow, endRow, myfilter, sortBy, descending).then((ris) => {
|
||||
|
||||
this.pagination.rowsNumber = this.getRowsNumberCount(filter)
|
||||
this.pagination.rowsNumber = this.getRowsNumberCount(myfilter)
|
||||
|
||||
// clear out existing data and add new
|
||||
if (this.returnedData === []) {
|
||||
@@ -215,7 +241,7 @@ export default class CGridTableRec extends Vue {
|
||||
|
||||
// emulate ajax call
|
||||
// SELECT * FROM ... WHERE...LIMIT...
|
||||
public async fetchFromServer(startRow, endRow, filter, sortBy, descending) {
|
||||
public async fetchFromServer(startRow, endRow, myfilter, sortBy, descending) {
|
||||
|
||||
let myobj = null
|
||||
if (sortBy) {
|
||||
@@ -230,7 +256,7 @@ export default class CGridTableRec extends Vue {
|
||||
table: this.mytable,
|
||||
startRow,
|
||||
endRow,
|
||||
filter,
|
||||
filter: myfilter,
|
||||
sortBy: myobj,
|
||||
descending
|
||||
}
|
||||
@@ -247,15 +273,15 @@ export default class CGridTableRec extends Vue {
|
||||
|
||||
return true
|
||||
|
||||
// if (!filter) {
|
||||
// if (!myfilter) {
|
||||
// data = this.original.slice(startRow, startRow + count)
|
||||
// }
|
||||
// else {
|
||||
// let found = 0
|
||||
// for (let index = startRow, items = 0; index < this.original.length && items < count; ++index) {
|
||||
// let row = this.original[index]
|
||||
// // match filter?
|
||||
// if (!row['name'].includes(filter)) {
|
||||
// // match myfilter?
|
||||
// if (!row['name'].includes(myfilter)) {
|
||||
// // get a different row, until one is found
|
||||
// continue
|
||||
// }
|
||||
@@ -285,14 +311,14 @@ export default class CGridTableRec extends Vue {
|
||||
}
|
||||
|
||||
// emulate 'SELECT count(*) FROM ...WHERE...'
|
||||
public getRowsNumberCount(filter) {
|
||||
public getRowsNumberCount(myfilter) {
|
||||
|
||||
// if (!filter) {
|
||||
// if (!myfilter) {
|
||||
// return this.original.length
|
||||
// }
|
||||
// let count = 0
|
||||
// this.original.forEach((treat) => {
|
||||
// if (treat['name'].includes(filter)) {
|
||||
// if (treat['name'].includes(myfilter)) {
|
||||
// ++count
|
||||
// }
|
||||
// })
|
||||
@@ -337,9 +363,11 @@ export default class CGridTableRec extends Vue {
|
||||
|
||||
public mounted() {
|
||||
|
||||
this.canEdit = tools.getCookie(tools.CAN_EDIT, this.canEdit) === 'true'
|
||||
if (!!this.tablesList) {
|
||||
this.canEdit = tools.getCookie(tools.CAN_EDIT, this.canEdit) === 'true'
|
||||
this.tablesel = tools.getCookie('tablesel', this.tablesel)
|
||||
}
|
||||
|
||||
this.tablesel = tools.getCookie('tablesel', this.tablesel)
|
||||
if (this.tablesel === '') {
|
||||
if (!!this.tablesList)
|
||||
this.tablesel = this.tablesList[0].value
|
||||
@@ -357,11 +385,11 @@ export default class CGridTableRec extends Vue {
|
||||
console.log('refresh')
|
||||
// console.log('this.search', this.search)
|
||||
if (!!this.search && this.search !== '')
|
||||
this.filter = this.search
|
||||
this.myfilter = this.search
|
||||
else
|
||||
this.filter = undefined
|
||||
this.myfilter = undefined
|
||||
|
||||
// console.log('this.filter', this.filter)
|
||||
// console.log('this.myfilter', this.myfilter)
|
||||
|
||||
this.refresh_table()
|
||||
}
|
||||
@@ -411,7 +439,9 @@ export default class CGridTableRec extends Vue {
|
||||
if (this.tablesel === undefined || this.tablesel === '')
|
||||
return
|
||||
|
||||
console.log('changeTable mysel=', mysel, 'tablesel', this.tablesel)
|
||||
// console.log('changeTable mysel=', mysel, 'tablesel', this.tablesel)
|
||||
// console.log('this.tablesList=')
|
||||
// console.table(this.tablesList)
|
||||
|
||||
let mytab = null
|
||||
if (this.tablesList) {
|
||||
@@ -457,6 +487,11 @@ export default class CGridTableRec extends Vue {
|
||||
const myselcol = tools.getCookie(this.mytable, '')
|
||||
if (!!myselcol && myselcol.length > 0) {
|
||||
this.colVisib = myselcol.split('|')
|
||||
} else {
|
||||
this.mycolumns.forEach((elem) => {
|
||||
if (elem.field !== tools.NOFIELD)
|
||||
this.colVisib.push(elem.field + elem.subfield)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,4 +514,21 @@ export default class CGridTableRec extends Vue {
|
||||
tools.setCookie(tools.CAN_EDIT, newval)
|
||||
}
|
||||
|
||||
public clickrowcol(row, col) {
|
||||
if (!this.canEdit) {
|
||||
if (this.rowclicksel) {
|
||||
this.rowclicksel = null
|
||||
} else {
|
||||
this.rowclicksel = row
|
||||
this.colclicksel = col
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public getclrow(myrow) {
|
||||
if (this.rowclicksel === myrow)
|
||||
return 'colsel'
|
||||
else
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<q-table
|
||||
:data="serverData"
|
||||
:columns="mycolumns"
|
||||
:filter="filter"
|
||||
:filter="myfilter"
|
||||
:pagination.sync="pagination"
|
||||
:row-key="colkey"
|
||||
:loading="loading"
|
||||
@@ -35,7 +35,8 @@
|
||||
|
||||
<!--<p style="color:red"> Rows: {{ getrows }}</p>-->
|
||||
|
||||
<q-input v-model="search" filled dense type="search" debounce="500" hint="Search" v-on:keyup.enter="doSearch">
|
||||
<q-input v-model="search" filled dense type="search" debounce="500" hint="Search"
|
||||
v-on:keyup.enter="doSearch">
|
||||
<template v-slot:after>
|
||||
<q-btn v-if="mytable" label="" color="primary" @click="refresh" icon="search"></q-btn>
|
||||
</template>
|
||||
@@ -91,16 +92,20 @@
|
||||
</template>
|
||||
|
||||
<q-tr v-if="mytable" slot="body" slot-scope="props" :props="props">
|
||||
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colVisib.includes(col.field + col.subfield)">
|
||||
<CMyPopupEdit :canEdit="canEdit"
|
||||
:col="col"
|
||||
:row.sync="props.row"
|
||||
:field="col.field"
|
||||
:subfield="col.subfield"
|
||||
@save="SaveValue"
|
||||
@show="selItem(props.row, col)">
|
||||
<q-td v-for="col in mycolumns" :key="col.name" :props="props"
|
||||
v-if="colVisib.includes(col.field + col.subfield)" @click="clickrowcol(props.row, col)">
|
||||
<div :class="getclrow(props.row)">
|
||||
<CMyPopupEdit :canEdit="canEdit"
|
||||
:col="col"
|
||||
:row.sync="props.row"
|
||||
:field="col.field"
|
||||
:subfield="col.subfield"
|
||||
@save="SaveValue"
|
||||
@show="selItem(props.row, col)"
|
||||
@showandsave="showandsel">
|
||||
|
||||
</CMyPopupEdit>
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colExtra.includes(col.name)">
|
||||
<div v-if="col.action && visCol(col)">
|
||||
@@ -119,6 +124,38 @@
|
||||
-->
|
||||
<!---->
|
||||
</q-table>
|
||||
|
||||
<div v-if="rowclicksel">
|
||||
<CTitleBanner title="Record:"></CTitleBanner>
|
||||
|
||||
<div class="q-ma-xs q-pa-xs text-center rounded-borders q-list--bordered"
|
||||
v-for="mycol in mycolumns" :key="mycol.name"
|
||||
v-if="colVisib.includes(mycol.field + mycol.subfield)">
|
||||
<div class="row items-center justify-center q-gutter-md q-ma-xs">
|
||||
<div class="q-ma-xs">
|
||||
<q-field rounded outlined bg-color="orange-3" dense>
|
||||
<template v-slot:control>
|
||||
<div class="self-center full-width no-outline" tabindex="0">{{mycol.label}}</div>
|
||||
</template>
|
||||
</q-field>
|
||||
</div>
|
||||
<div class="q-ma-sm q-pa-sm colmodif col-grow rounded-borders " style="border: 1px solid #bbb"
|
||||
@click="colclicksel = mycol">
|
||||
<CMyPopupEdit :canEdit="true"
|
||||
:col="mycol"
|
||||
:showall="true"
|
||||
:row="rowclicksel"
|
||||
:field="mycol.field"
|
||||
:subfield="mycol.subfield"
|
||||
@save="SaveValdb"
|
||||
@show="selItem(rowclicksel, mycol)"
|
||||
@showandsave="showandsel">
|
||||
|
||||
</CMyPopupEdit>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" src="./CGridTableRec.ts">
|
||||
|
||||
@@ -5,14 +5,17 @@ import { tools } from '../../store/Modules/tools'
|
||||
import { toolsext } from '@src/store/Modules/toolsext'
|
||||
|
||||
import { QEditor } from 'quasar'
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
|
||||
@Component({
|
||||
name: 'CMyEditor'
|
||||
name: 'CMyEditor',
|
||||
components: { CTitleBanner }
|
||||
})
|
||||
|
||||
export default class CMyEditor extends Vue {
|
||||
public $q
|
||||
public editor = null
|
||||
@Prop({ required: false, default: '' }) public title
|
||||
@Prop({ required: true }) public value
|
||||
@Prop({ required: false, default: '' }) public myclass
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<CTitleBanner :title="title"></CTitleBanner>
|
||||
<form
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
@@ -19,9 +20,11 @@
|
||||
toolbar-toggle-color="yellow-8"
|
||||
toolbar-bg="primary"
|
||||
:toolbar="toolbarcomp"
|
||||
debounce="500"
|
||||
:fonts="myfonts"
|
||||
@input="changeval"
|
||||
@paste.native="evt => pasteCapture(evt)"
|
||||
@keyup.enter.stop
|
||||
v-model="myvalue">
|
||||
</q-editor>
|
||||
</form>
|
||||
|
||||
@@ -9,10 +9,11 @@ import { CMyChipList } from '../CMyChipList'
|
||||
import { CDateTime } from '../CDateTime'
|
||||
import { CMyToggleList } from '../CMyToggleList'
|
||||
import { CMySelect } from '../CMySelect'
|
||||
import { CMyEditor } from '../CMyEditor'
|
||||
|
||||
@Component({
|
||||
name: 'CMyPopupEdit',
|
||||
components: {CMyChipList, CDateTime, CMyToggleList, CMySelect}
|
||||
components: {CMyChipList, CDateTime, CMyToggleList, CMySelect, CMyEditor}
|
||||
})
|
||||
|
||||
export default class CMyPopupEdit extends Vue {
|
||||
@@ -21,6 +22,7 @@ export default class CMyPopupEdit extends Vue {
|
||||
@Prop({ required: false, default: false }) public canEdit
|
||||
@Prop({ required: false, default: '' }) public field
|
||||
@Prop({ required: false, default: '' }) public subfield
|
||||
@Prop({ required: false, default: false }) public showall
|
||||
|
||||
public myvalue = ''
|
||||
|
||||
@@ -75,6 +77,13 @@ export default class CMyPopupEdit extends Vue {
|
||||
this.$emit('save', newVal, valinitial)
|
||||
}
|
||||
|
||||
public Savedb(newVal, valinitial) {
|
||||
|
||||
// console.log('Savedb', newVal)
|
||||
|
||||
this.$emit('showandsave', this.row, this.col, newVal, valinitial)
|
||||
}
|
||||
|
||||
public visuValByType(val, col: IColGridTable, row) {
|
||||
if (col === undefined || row === undefined)
|
||||
return
|
||||
@@ -118,7 +127,12 @@ export default class CMyPopupEdit extends Vue {
|
||||
else if (val === '') {
|
||||
return '[]'
|
||||
} else {
|
||||
let mystr = tools.firstchars(val, tools.MAX_CHARACTERS)
|
||||
let mystr = ''
|
||||
if (this.showall) {
|
||||
return val
|
||||
} else {
|
||||
mystr = tools.firstchars(val, tools.MAX_CHARACTERS)
|
||||
}
|
||||
if (val) {
|
||||
if (val.length > tools.MAX_CHARACTERS)
|
||||
mystr += '...'
|
||||
@@ -132,7 +146,7 @@ export default class CMyPopupEdit extends Vue {
|
||||
|
||||
public getclassCol(col) {
|
||||
if (col) {
|
||||
let mycl = (col.disable || !this.canEdit) ? '' : 'colmodif'
|
||||
let mycl = (col.disable) ? '' : 'colmodif'
|
||||
mycl += (col.fieldtype === tools.FieldType.date) ? ' coldate flex flex-container' : ''
|
||||
|
||||
return mycl
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
:optlab="db_fieldsTable.getLabelByTable(col.jointable)"
|
||||
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.boolean">
|
||||
<q-toggle dark color="green" v-model="myvalue" :label="col.title"
|
||||
@input="Savedb"></q-toggle>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ visuValByType(myvalue, col, row) }}
|
||||
</div>
|
||||
@@ -65,6 +69,15 @@
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.string">
|
||||
<q-input v-model="myvalue"
|
||||
autogrow
|
||||
@keyup.enter.stop
|
||||
autofocus>
|
||||
|
||||
</q-input>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.password">
|
||||
<q-input v-model="myvalue"
|
||||
type="password"
|
||||
@keyup.enter.stop
|
||||
autofocus>
|
||||
|
||||
</q-input>
|
||||
@@ -84,10 +97,13 @@
|
||||
</CMyToggleList>
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.html">
|
||||
<q-input v-model="myvalue"
|
||||
autofocus
|
||||
@keyup.enter.stop
|
||||
type="textarea"></q-input>
|
||||
<CMyEditor :value.sync="myvalue" :title="col.title" @keyup.enter.stop>
|
||||
|
||||
</CMyEditor>
|
||||
<!--<q-input v-model="myvalue"-->
|
||||
<!--autofocus-->
|
||||
<!--@keyup.enter.stop-->
|
||||
<!--type="textarea"></q-input>-->
|
||||
</div>
|
||||
<div v-else-if="col.fieldtype === tools.FieldType.select">
|
||||
<CMySelect :label="col.title"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="text-center">
|
||||
<div v-if="useinput">
|
||||
<q-select
|
||||
rounded
|
||||
@@ -33,6 +33,7 @@
|
||||
:label="label"
|
||||
emit-value
|
||||
map-options
|
||||
input-class="text-center"
|
||||
style="min-width: 170px; max-width: 400px;"
|
||||
>
|
||||
|
||||
|
||||
@@ -36,29 +36,29 @@ export default class Footer extends Vue {
|
||||
}
|
||||
|
||||
get TelegramSupport() {
|
||||
return GlobalStore.getters.getValueSettingsByKey('TELEGRAM_SUPPORT')
|
||||
return GlobalStore.getters.getValueSettingsByKey('TELEGRAM_SUPPORT', false)
|
||||
}
|
||||
|
||||
get Whatsapp_Cell() {
|
||||
return GlobalStore.getters.getValueSettingsByKey('WHATSAPP_CELL')
|
||||
return GlobalStore.getters.getValueSettingsByKey('WHATSAPP_CELL', false)
|
||||
}
|
||||
|
||||
get Telegram_UsernameHttp() {
|
||||
|
||||
return tools.getHttpForTelegram(GlobalStore.getters.getValueSettingsByKey('TELEGRAM_USERNAME'))
|
||||
return tools.getHttpForTelegram(GlobalStore.getters.getValueSettingsByKey('TELEGRAM_USERNAME', false))
|
||||
}
|
||||
|
||||
get FBPage() {
|
||||
const fb = GlobalStore.getters.getValueSettingsByKey('URL_FACEBOOK')
|
||||
const fb = GlobalStore.getters.getValueSettingsByKey('URL_FACEBOOK', false)
|
||||
return fb
|
||||
}
|
||||
|
||||
get InstagramPage() {
|
||||
return GlobalStore.getters.getValueSettingsByKey('URL_INSTAGRAM')
|
||||
return GlobalStore.getters.getValueSettingsByKey('URL_INSTAGRAM', false)
|
||||
}
|
||||
|
||||
get TwitterPage() {
|
||||
return GlobalStore.getters.getValueSettingsByKey('URL_TWITTER')
|
||||
return GlobalStore.getters.getValueSettingsByKey('URL_TWITTER', false)
|
||||
}
|
||||
|
||||
get static_data() {
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
<!--</span>-->
|
||||
|
||||
|
||||
<CFacebookFrame myclass="text-center" :fbimage="getValDb('FBPAGE_IMG')"
|
||||
:urlfbpage="getValDb('FBPAGE_FRAME')" title="getValDb('FBPAGE_TITLE')">
|
||||
<CFacebookFrame myclass="text-center" :fbimage="getValDb('FBPAGE_IMG', false)"
|
||||
:urlfbpage="getValDb('FBPAGE_FRAME')" :title="getValDb('FBPAGE_TITLE', false)">
|
||||
|
||||
</CFacebookFrame>
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<span v-html="getValDb('MAP_TITLE')"></span>
|
||||
<span v-html="getValDb('MAP_TITLE', false)"></span>
|
||||
<br>
|
||||
<a :href="getValDb('URLMAP')" target="_blank" class="footer_link">Apri Mappa</a>
|
||||
<a :href="getValDb('URLMAP', false)" target="_blank" class="footer_link">Apri Mappa</a>
|
||||
</div>
|
||||
|
||||
<!--<div class="q-mt-xs copyrights">-->
|
||||
@@ -63,12 +63,12 @@
|
||||
|
||||
|
||||
<div class="mycontacts_text">
|
||||
<i v-if="getValDb('MAIN_EMAIL')" aria-hidden="true"
|
||||
<i v-if="getValDb('MAIN_EMAIL', false)" aria-hidden="true"
|
||||
class="q-icon fas fa-envelope q-mx-sm"></i>
|
||||
<a :href="`mailto:` + getValDb('MAIN_EMAIL')" class="links">{{ getValDb('MAIN_EMAIL')
|
||||
<a :href="`mailto:` + getValDb('MAIN_EMAIL', false)" class="links">{{ getValDb('MAIN_EMAIL')
|
||||
}}</a><br>
|
||||
<div style="margin-bottom: 20px;"></div>
|
||||
<div v-for="rec in getarrValDb('CONTACTS_EMAIL_CELL')"
|
||||
<div v-for="rec in getarrValDb('CONTACTS_EMAIL_CELL', false)"
|
||||
class="mycontacts_text margin_buttons_footer"
|
||||
style="margin-bottom: 0px;">
|
||||
<div>
|
||||
@@ -102,8 +102,8 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<span v-if="getValDb('CALL_WORKING_DAYS')"><br>orari per chiamate:<br>
|
||||
<span v-html="getValDb('CALL_WORKING_DAYS')"></span></span>
|
||||
<span v-if="getValDb('CALL_WORKING_DAYS', false)"><br>orari per chiamate:<br>
|
||||
<span v-html="getValDb('CALL_WORKING_DAYS', false)"></span></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,12 +8,13 @@ import Quasar, { Screen } from 'quasar'
|
||||
import { Prop } from 'vue-property-decorator'
|
||||
import { Api } from '../../store'
|
||||
import { serv_constants } from '../../store/Modules/serv_constants'
|
||||
import MixinBase from '../../mixins/mixin-base'
|
||||
|
||||
@Component({
|
||||
name: 'FormNewsletter'
|
||||
})
|
||||
|
||||
export default class FormNewsletter extends Vue {
|
||||
export default class FormNewsletter extends MixinBase {
|
||||
public $t
|
||||
public $q
|
||||
public name: string = null
|
||||
@@ -24,10 +25,6 @@ export default class FormNewsletter extends Vue {
|
||||
@Prop() public idwebsite: string
|
||||
@Prop() public locale: string
|
||||
|
||||
get tools() {
|
||||
return tools
|
||||
}
|
||||
|
||||
public async onSubmit() {
|
||||
|
||||
if (this.accept !== true) {
|
||||
@@ -44,14 +41,16 @@ export default class FormNewsletter extends Vue {
|
||||
firstName: this.name,
|
||||
lastName: this.surname,
|
||||
idwebsite: this.idwebsite,
|
||||
locale: this.locale
|
||||
locale: this.locale,
|
||||
settomailchimp: this.getValDb('MAILCHIMP_ON', true, false)
|
||||
}
|
||||
console.log(usertosend)
|
||||
|
||||
return await Api.SendReq('/signup_news', 'POST', usertosend, false)
|
||||
return await Api.SendReq('/news/signup', 'POST', usertosend, false)
|
||||
.then((res) => {
|
||||
|
||||
if (res.data.result === serv_constants.RIS_SUBSCRIBED_OK) {
|
||||
console.log('res', res)
|
||||
if (res.data.code === serv_constants.RIS_SUBSCRIBED_OK) {
|
||||
this.$q.notify({
|
||||
color: 'green-4',
|
||||
textColor: 'white',
|
||||
@@ -59,7 +58,7 @@ export default class FormNewsletter extends Vue {
|
||||
// message: this.$t('newsletter.submitted')
|
||||
message: res.data.msg
|
||||
})
|
||||
} else if (res.data.result === serv_constants.RIS_SUBSCRIBED_ALREADYEXIST) {
|
||||
} else if (res.data.code === serv_constants.RIS_SUBSCRIBED_ALREADYEXIST) {
|
||||
this.$q.notify({
|
||||
color: 'orange-4',
|
||||
textColor: 'white',
|
||||
|
||||
@@ -14,6 +14,7 @@ export * from './CMyPopupEdit'
|
||||
export * from './CMyToggleList'
|
||||
export * from './CMyChipList'
|
||||
export * from './CMyEditor'
|
||||
export * from './CMyFieldDb'
|
||||
export * from './CMyTeacher'
|
||||
export * from './CImgText'
|
||||
export * from './CImgTitle'
|
||||
@@ -32,3 +33,4 @@ export * from './CFacebookFrame'
|
||||
export * from './Shen/CTesseraElettronica'
|
||||
export * from './CGoogleMap'
|
||||
export * from './COpenStreetMap'
|
||||
export * from './CTitleBanner'
|
||||
|
||||
@@ -5,6 +5,8 @@ import { func_tools } from '../store/Modules/toolsext'
|
||||
import { tools } from '../store/Modules/tools'
|
||||
import { toolsext } from '@src/store/Modules/toolsext'
|
||||
import { GlobalStore } from '../store/Modules'
|
||||
import { fieldsTable } from '@src/store/Modules/fieldsTable'
|
||||
import { CalendarStore } from '@store'
|
||||
|
||||
// You can declare a mixin as the same style as components.
|
||||
@Component
|
||||
@@ -17,6 +19,10 @@ export default class MixinBase extends Vue {
|
||||
return toolsext
|
||||
}
|
||||
|
||||
get db_fieldsTable() {
|
||||
return fieldsTable
|
||||
}
|
||||
|
||||
get func_tools() {
|
||||
return func_tools
|
||||
}
|
||||
@@ -25,15 +31,71 @@ export default class MixinBase extends Vue {
|
||||
return tools
|
||||
}
|
||||
|
||||
public getValDb(keystr, def?) {
|
||||
const ris = GlobalStore.getters.getValueSettingsByKey(keystr)
|
||||
public getValDb(keystr, serv, def?) {
|
||||
const ris = GlobalStore.getters.getValueSettingsByKey(keystr, serv)
|
||||
if (ris === '')
|
||||
return def
|
||||
else
|
||||
return ris
|
||||
}
|
||||
public getarrValDb(keystr) {
|
||||
const myval = GlobalStore.getters.getValueSettingsByKey(keystr)
|
||||
|
||||
public async setValDb(key, value, type, serv: boolean) {
|
||||
|
||||
console.log('setValDb', key, value, serv)
|
||||
GlobalStore.mutations.setValueSettingsByKey({ key, value, serv })
|
||||
|
||||
let myrec = GlobalStore.getters.getrecSettingsByKey(key, serv)
|
||||
if (myrec === undefined) {
|
||||
myrec = {
|
||||
idapp: process.env.APP_ID,
|
||||
key,
|
||||
type
|
||||
}
|
||||
myrec.serv = serv
|
||||
if (myrec.type === tools.FieldType.date)
|
||||
myrec.value_date = value
|
||||
else if (myrec.type === tools.FieldType.number)
|
||||
myrec.value_num = value
|
||||
else if (myrec.type === tools.FieldType.boolean)
|
||||
myrec.value_bool = value
|
||||
else
|
||||
myrec.value_str = value
|
||||
|
||||
myrec = await tools.createNewRecord(this, 'settings', myrec).then((myrecris) => {
|
||||
// console.log('myrec')
|
||||
let recsett = null
|
||||
if (serv)
|
||||
recsett = GlobalStore.state.serv_settings
|
||||
else
|
||||
recsett = GlobalStore.state.settings
|
||||
|
||||
recsett.push(myrecris)
|
||||
return recsett.find((rec) => rec.key === key)
|
||||
})
|
||||
}
|
||||
console.log('myrec', myrec)
|
||||
|
||||
const mydatatosave = {
|
||||
id: myrec._id,
|
||||
table: 'settings',
|
||||
fieldsvalue: myrec
|
||||
}
|
||||
|
||||
console.log('mydatatosave', mydatatosave)
|
||||
|
||||
GlobalStore.actions.saveFieldValue(mydatatosave).then((esito) => {
|
||||
if (esito) {
|
||||
tools.showPositiveNotif(this.$q, this.$t('db.recupdated'))
|
||||
} else {
|
||||
tools.showNegativeNotif(this.$q, this.$t('db.recfailed'))
|
||||
// Undo...
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
public getarrValDb(keystr, serv) {
|
||||
const myval = GlobalStore.getters.getValueSettingsByKey(keystr, serv)
|
||||
// console.log('myval', myval)
|
||||
try {
|
||||
if (myval) {
|
||||
@@ -44,8 +106,9 @@ export default class MixinBase extends Vue {
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
}catch (e) {
|
||||
} catch (e) {
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,12 +26,22 @@ export interface ICfgData {
|
||||
userId?: string
|
||||
}
|
||||
|
||||
export interface ITemplEmail {
|
||||
subject?: string
|
||||
content?: string
|
||||
options?: ISettings[]
|
||||
}
|
||||
|
||||
export interface ISettings {
|
||||
_id?: string
|
||||
idapp?: string
|
||||
key?: string
|
||||
type?: number
|
||||
value_str?: string
|
||||
value_date?: Date,
|
||||
value_num?: number
|
||||
value_bool?: boolean
|
||||
serv?: boolean
|
||||
}
|
||||
|
||||
export interface ITeachUname {
|
||||
@@ -116,9 +126,12 @@ export interface IGlobalState {
|
||||
listatodo: IMenuList[]
|
||||
arrConfig: IConfig[]
|
||||
lastaction: IAction
|
||||
serv_settings: ISettings[],
|
||||
settings: ISettings[],
|
||||
disciplines: IDiscipline[],
|
||||
newstosent: INewsToSent[],
|
||||
templemail: ITemplEmail[],
|
||||
opzemail: ISettings[],
|
||||
mailinglist: IMailinglist[],
|
||||
autoplaydisc: number
|
||||
}
|
||||
@@ -308,6 +321,7 @@ export interface ITableRec {
|
||||
colkey: string
|
||||
collabel: string
|
||||
colicon?: string
|
||||
onlyAdmin?: boolean
|
||||
}
|
||||
|
||||
export interface IDataPass {
|
||||
@@ -315,3 +329,21 @@ export interface IDataPass {
|
||||
table: string
|
||||
fieldsvalue: object
|
||||
}
|
||||
|
||||
export interface INewsState {
|
||||
lastnewstosent: INewsToSent
|
||||
nextnewstosent: INewsToSent
|
||||
totemail: number
|
||||
totsubscribed: number
|
||||
totunsubscribed: number
|
||||
totsentlastid: number
|
||||
}
|
||||
|
||||
export const DefaultNewsState: INewsState = {
|
||||
lastnewstosent: null,
|
||||
nextnewstosent: null,
|
||||
totemail: 0,
|
||||
totsubscribed: 0,
|
||||
totunsubscribed: 0,
|
||||
totsentlastid: 0,
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ const msgglobal = {
|
||||
usereventlist: 'Prenotazioni Utenti',
|
||||
userlist: 'Lista Utenti',
|
||||
tableslist: 'Lista Tabelle',
|
||||
newsletter: 'Newsletter',
|
||||
},
|
||||
manage: {
|
||||
menu: 'Gestione',
|
||||
@@ -76,7 +77,9 @@ const msgglobal = {
|
||||
verify_email: 'Verifica la tua email',
|
||||
go_login: 'Torna al Login',
|
||||
incorrect_input: 'Inserimento incorretto.',
|
||||
link_sent: 'Ora leggi la tua email e conferma la registrazione'
|
||||
link_sent: 'Ora leggi la tua email e conferma la registrazione',
|
||||
title_unsubscribe: 'Disiscrizione alla newsletter',
|
||||
title_unsubscribe_done: 'Disiscrizione completata correttamente',
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -89,6 +92,15 @@ const msgglobal = {
|
||||
notregistered: 'Devi registrarti al servizio prima di porter memorizzare i dati',
|
||||
loggati: 'Utente non loggato'
|
||||
},
|
||||
templemail: {
|
||||
subject: 'Oggetto Email',
|
||||
testoheadermail: 'Intestazione Email',
|
||||
content: 'Contenuto',
|
||||
img: 'Immagine 1',
|
||||
img2: 'Immagine 2',
|
||||
content2: 'Contenuto 2',
|
||||
options: 'Opzioni',
|
||||
},
|
||||
reg: {
|
||||
page_title: 'Registrazione',
|
||||
incorso: 'Registrazione in corso...',
|
||||
@@ -338,6 +350,7 @@ const msgglobal = {
|
||||
usereventlist: 'Reserva Usuarios',
|
||||
userlist: 'Lista de usuarios',
|
||||
tableslist: 'Listado de tablas',
|
||||
newsletter: 'Newsletter',
|
||||
},
|
||||
manage: {
|
||||
menu: 'Gestionar',
|
||||
@@ -396,7 +409,9 @@ const msgglobal = {
|
||||
verify_email: 'Revisa tu email',
|
||||
go_login: 'Vuelve al Login',
|
||||
incorrect_input: 'Entrada correcta.',
|
||||
link_sent: 'Ahora lea su correo electrónico y confirme el registro'
|
||||
link_sent: 'Ahora lea su correo electrónico y confirme el registro',
|
||||
title_unsubscribe: 'Anular suscripción al boletín',
|
||||
title_unsubscribe_done: 'Suscripción completada con éxito',
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -409,6 +424,15 @@ const msgglobal = {
|
||||
notregistered: 'Debe registrarse en el servicio antes de poder almacenar los datos',
|
||||
loggati: 'Usuario no ha iniciado sesión'
|
||||
},
|
||||
templemail: {
|
||||
subject: 'Objecto Email',
|
||||
testoheadermail: 'Encabezamiento Email',
|
||||
content: 'Contenido',
|
||||
img: 'Imagen 1',
|
||||
img2: 'Imagen 2',
|
||||
content2: 'Contenuto 2',
|
||||
options: 'Opciones',
|
||||
},
|
||||
reg: {
|
||||
page_title: 'Registro',
|
||||
incorso: 'Registro en curso...',
|
||||
@@ -649,6 +673,7 @@ const msgglobal = {
|
||||
usereventlist: 'Réservation Utilisateur',
|
||||
userlist: 'Liste d\'utilisateurs',
|
||||
tableslist: 'Liste des tables',
|
||||
newsletter: 'Newsletter',
|
||||
},
|
||||
manage: {
|
||||
menu: 'Gérer',
|
||||
@@ -707,7 +732,9 @@ const msgglobal = {
|
||||
verify_email: 'Vérifiez votre email',
|
||||
go_login: 'Retour à la connexion',
|
||||
incorrect_input: 'Entrée correcte.',
|
||||
link_sent: 'Maintenant, lisez votre email et confirmez votre inscription'
|
||||
link_sent: 'Maintenant, lisez votre email et confirmez votre inscription',
|
||||
title_unsubscribe: 'Se désabonner de la newsletter',
|
||||
title_unsubscribe_done: 'Abonnement terminé avec succès',
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -720,6 +747,15 @@ const msgglobal = {
|
||||
notregistered: 'Vous devez vous inscrire auprès du service avant de pouvoir stocker les données.',
|
||||
loggati: 'L\'utilisateur n\'est pas connecté'
|
||||
},
|
||||
templemail: {
|
||||
subject: 'Objet Email',
|
||||
testoheadermail: 'en-tête de courrier électronique',
|
||||
content: 'Contenu',
|
||||
img: 'Image 1',
|
||||
img2: 'Image 2',
|
||||
content2: 'Contenu 2',
|
||||
options: 'Options',
|
||||
},
|
||||
reg: {
|
||||
incorso: 'Inscription en cours...',
|
||||
richiesto: 'Champ obligatoire',
|
||||
@@ -959,6 +995,7 @@ const msgglobal = {
|
||||
usereventlist: 'Users Booking',
|
||||
userlist: 'Users List',
|
||||
tableslist: 'List of tables',
|
||||
newsletter: 'Newsletter',
|
||||
},
|
||||
manage: {
|
||||
menu: 'Manage',
|
||||
@@ -1017,7 +1054,9 @@ const msgglobal = {
|
||||
verify_email: 'Verify your email',
|
||||
go_login: 'Back to Login',
|
||||
incorrect_input: 'Incorrect input.',
|
||||
link_sent: 'Now read your email and confirm registration'
|
||||
link_sent: 'Now read your email and confirm registration',
|
||||
title_unsubscribe: 'Unsubscribe to the newsletter',
|
||||
title_unsubscribe_done: 'Subscription completed successfully',
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1030,6 +1069,15 @@ const msgglobal = {
|
||||
notregistered: 'You need first to SignUp before storing data',
|
||||
loggati: 'User not logged in'
|
||||
},
|
||||
templemail: {
|
||||
subject: 'Subject Email',
|
||||
testoheadermail: 'Header Email',
|
||||
content: 'Content',
|
||||
img: 'Image 1',
|
||||
img2: 'Image 2',
|
||||
content2: 'Content 2',
|
||||
options: 'Options',
|
||||
},
|
||||
reg: {
|
||||
incorso: 'Registration please wait...',
|
||||
richiesto: 'Field Required',
|
||||
@@ -1268,6 +1316,7 @@ const msgglobal = {
|
||||
usereventlist: 'Users Booking',
|
||||
userlist: 'Users List',
|
||||
tableslist: 'List of tables',
|
||||
newsletter: 'Newsletter',
|
||||
},
|
||||
manage: {
|
||||
menu: 'Manage',
|
||||
@@ -1326,7 +1375,9 @@ const msgglobal = {
|
||||
verify_email: 'Verify your email',
|
||||
go_login: 'Back to Login',
|
||||
incorrect_input: 'Incorrect input.',
|
||||
link_sent: 'Now read your email and confirm registration'
|
||||
link_sent: 'Now read your email and confirm registration',
|
||||
title_unsubscribe: 'Disiscrizione alla newsletter',
|
||||
title_unsubscribe_done: 'Disiscrizione completata correttamente',
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1339,6 +1390,15 @@ const msgglobal = {
|
||||
notregistered: 'You need first to SignUp before storing data',
|
||||
loggati: 'User not logged in'
|
||||
},
|
||||
templemail: {
|
||||
subject: 'Subject Email',
|
||||
testoheadermail: 'Header Email',
|
||||
content: 'Content',
|
||||
img: 'Image 1',
|
||||
img2: 'Image 2',
|
||||
content2: 'Content 2',
|
||||
options: 'Options',
|
||||
},
|
||||
reg: {
|
||||
page_title: 'Registration',
|
||||
incorso: 'Registration please wait...',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ICfgServer, IConfig, IGlobalState, IListRoutes, IMenuList, StateConnection } from 'model'
|
||||
import { ICfgServer, IConfig, IGlobalState, IListRoutes, IMenuList, ISettings, StateConnection } from 'model'
|
||||
import { storeBuilder } from './Store/Store'
|
||||
|
||||
import Vue from 'vue'
|
||||
@@ -68,6 +68,9 @@ const state: IGlobalState = {
|
||||
type: 0,
|
||||
_id: 0
|
||||
},
|
||||
serv_settings: [],
|
||||
templemail: [],
|
||||
opzemail: [],
|
||||
settings: [],
|
||||
disciplines: [],
|
||||
autoplaydisc: 8000,
|
||||
@@ -171,6 +174,10 @@ namespace Getters {
|
||||
return GlobalStore.state.disciplines
|
||||
else if (table === tools.TABNEWSLETTER)
|
||||
return GlobalStore.state.newstosent
|
||||
else if (table === tools.TABTEMPLEMAIL)
|
||||
return GlobalStore.state.templemail
|
||||
else if (table === tools.TABOPZEMAIL)
|
||||
return GlobalStore.state.opzemail
|
||||
else if (table === tools.TABMAILINGLIST)
|
||||
return GlobalStore.state.mailinglist
|
||||
else if (table === 'bookings')
|
||||
@@ -188,13 +195,24 @@ namespace Getters {
|
||||
|
||||
}, 'getListByTable')
|
||||
|
||||
const getValueSettingsByKey = b.read((mystate: IGlobalState) => (key): any => {
|
||||
const myrec = mystate.settings.find((rec) => rec.key === key)
|
||||
const getrecSettingsByKey = b.read((mystate: IGlobalState) => (key, serv): ISettings => {
|
||||
if (serv)
|
||||
return mystate.serv_settings.find((rec) => rec.key === key)
|
||||
else
|
||||
return mystate.settings.find((rec) => rec.key === key)
|
||||
}, 'getrecSettingsByKey')
|
||||
|
||||
const getValueSettingsByKey = b.read((mystate: IGlobalState) => (key, serv): any => {
|
||||
|
||||
const myrec = getters.getrecSettingsByKey(key, serv)
|
||||
|
||||
if (!!myrec) {
|
||||
if (myrec.type === tools.FieldType.date)
|
||||
return myrec.value_date
|
||||
if (myrec.type === tools.FieldType.number)
|
||||
else if (myrec.type === tools.FieldType.number)
|
||||
return myrec.value_num
|
||||
else if (myrec.type === tools.FieldType.boolean)
|
||||
return myrec.value_bool
|
||||
else
|
||||
return myrec.value_str
|
||||
} else {
|
||||
@@ -246,6 +264,10 @@ namespace Getters {
|
||||
return getValueSettingsByKey()
|
||||
},
|
||||
|
||||
get getrecSettingsByKey() {
|
||||
return getrecSettingsByKey()
|
||||
},
|
||||
|
||||
get t() {
|
||||
return t()
|
||||
},
|
||||
@@ -353,6 +375,31 @@ namespace Mutations {
|
||||
}
|
||||
}
|
||||
|
||||
function setValueSettingsByKey(mystate: IGlobalState, { key, value, serv }) {
|
||||
// Update the Server
|
||||
|
||||
// Update in Memory
|
||||
let myrec = null
|
||||
if (serv)
|
||||
myrec = mystate.serv_settings.find((rec) => rec.key === key)
|
||||
else
|
||||
myrec = mystate.settings.find((rec) => rec.key === key)
|
||||
|
||||
if (!!myrec) {
|
||||
if (myrec.type === tools.FieldType.date)
|
||||
myrec.value_date = value
|
||||
else if (myrec.type === tools.FieldType.number)
|
||||
myrec.value_num = value
|
||||
else if (myrec.type === tools.FieldType.boolean)
|
||||
myrec.value_bool = value
|
||||
else
|
||||
myrec.value_str = value
|
||||
|
||||
console.log('setValueSettingsByKey value', value, 'myrec', myrec)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const mutations = {
|
||||
setConta: b.commit(setConta),
|
||||
setleftDrawerOpen: b.commit(setleftDrawerOpen),
|
||||
@@ -364,7 +411,8 @@ namespace Mutations {
|
||||
setPaoArray_Delete: b.commit(setPaoArray_Delete),
|
||||
NewArray: b.commit(NewArray),
|
||||
setShowType: b.commit(setShowType),
|
||||
UpdateValuesInMemory: b.commit(UpdateValuesInMemory)
|
||||
UpdateValuesInMemory: b.commit(UpdateValuesInMemory),
|
||||
setValueSettingsByKey: b.commit(setValueSettingsByKey)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -717,13 +765,14 @@ namespace Actions {
|
||||
|
||||
}
|
||||
|
||||
async function sendEmailTest(context) {
|
||||
async function sendEmailTest(context, { previewonly }) {
|
||||
const usertosend = {
|
||||
locale: tools.getLocale()
|
||||
locale: tools.getLocale(),
|
||||
previewonly
|
||||
}
|
||||
console.log(usertosend)
|
||||
|
||||
return await Api.SendReq('/signup_news/testemail', 'POST', usertosend)
|
||||
return await Api.SendReq('/news/testemail', 'POST', usertosend)
|
||||
.then((res) => {
|
||||
return res
|
||||
})
|
||||
|
||||
@@ -419,6 +419,57 @@ namespace Actions {
|
||||
})
|
||||
}
|
||||
|
||||
async function unsubscribe(context, paramquery) {
|
||||
|
||||
return await Api.SendReq('/news/unsubscribe', 'POST', paramquery)
|
||||
.then((res) => {
|
||||
// console.log("RITORNO 2 ");
|
||||
// mutations.setServerCode(myres);
|
||||
if (res.data.code === serv_constants.RIS_UNSUBSCRIBED_OK) {
|
||||
console.log('DESOTTOSCRITTO ALLA NEWSLETTER !!')
|
||||
} else {
|
||||
console.log('Risultato di unsubscribe: ', res.data.code)
|
||||
}
|
||||
return { code: res.data.code, msg: res.data.msg }
|
||||
}).catch((error) => {
|
||||
return UserStore.getters.getServerCode
|
||||
})
|
||||
}
|
||||
|
||||
async function importemail(context, paramquery) {
|
||||
|
||||
return await Api.SendReq('/news/import', 'POST', paramquery)
|
||||
.then((res) => {
|
||||
// console.log("RITORNO 2 ");
|
||||
// mutations.setServerCode(myres);
|
||||
return res
|
||||
}).catch((error) => {
|
||||
return { numtot: 0, numadded: 0, numalreadyexisted: 0}
|
||||
})
|
||||
}
|
||||
|
||||
async function newsletterload(context, paramquery) {
|
||||
|
||||
return await Api.SendReq('/news/load', 'POST', paramquery)
|
||||
.then((res) => {
|
||||
console.log('res', res)
|
||||
return res.data
|
||||
}).catch((error) => {
|
||||
return null
|
||||
})
|
||||
}
|
||||
|
||||
async function newsletter_setactivate(context, paramquery) {
|
||||
|
||||
return await Api.SendReq('/news/setactivate', 'POST', paramquery)
|
||||
.then((res) => {
|
||||
console.log('res', res)
|
||||
return res.data
|
||||
}).catch((error) => {
|
||||
return null
|
||||
})
|
||||
}
|
||||
|
||||
async function signup(context, authData: ISignupOptions) {
|
||||
console.log('SIGNUP')
|
||||
|
||||
@@ -743,7 +794,11 @@ namespace Actions {
|
||||
resetpwd: b.dispatch(resetpwd),
|
||||
signin: b.dispatch(signin),
|
||||
signup: b.dispatch(signup),
|
||||
vreg: b.dispatch(vreg)
|
||||
vreg: b.dispatch(vreg),
|
||||
unsubscribe: b.dispatch(unsubscribe),
|
||||
importemail: b.dispatch(importemail),
|
||||
newsletterload: b.dispatch(newsletterload),
|
||||
newsletter_setactivate: b.dispatch(newsletter_setactivate),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { IColGridTable } from '../../model'
|
||||
import { lists } from './lists'
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
import { shared_consts } from '@src/common/shared_vuejs'
|
||||
import { GlobalStore } from '@store'
|
||||
import { GlobalStore, UserStore } from '@store'
|
||||
|
||||
const DeleteRec = {
|
||||
name: 'deleterec',
|
||||
@@ -17,6 +17,19 @@ const DeleteRec = {
|
||||
visuonlyEditVal: true
|
||||
}
|
||||
|
||||
const DuplicateRec = {
|
||||
name: 'copyrec',
|
||||
label_trans: 'event.duplicate',
|
||||
align: 'right',
|
||||
field: tools.NOFIELD,
|
||||
sortable: false,
|
||||
icon: 'fas fa-copy',
|
||||
action: lists.MenuAction.DUPLICATE_RECTABLE,
|
||||
askaction: 'db.duplicatedrecord',
|
||||
visuonlyEditVal: true,
|
||||
visible: true
|
||||
}
|
||||
|
||||
function AddCol(params: IColGridTable) {
|
||||
return {
|
||||
name: params.name,
|
||||
@@ -40,20 +53,31 @@ function AddCol(params: IColGridTable) {
|
||||
}
|
||||
}
|
||||
|
||||
const colTableWhere = [
|
||||
AddCol({ name: 'code', label_trans: 'where.code' }),
|
||||
AddCol({ name: 'placename', label_trans: 'cal.where' }),
|
||||
AddCol({ name: 'whereicon', label_trans: 'where.whereicon' }),
|
||||
AddCol(DeleteRec)
|
||||
export const colopzemail = [
|
||||
AddCol({ name: 'key', label_trans: 'col.key' }),
|
||||
AddCol({ name: 'label_it', label_trans: 'col.label' }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec)
|
||||
]
|
||||
|
||||
const colcontribtype = [
|
||||
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
|
||||
AddCol({ name: 'showprice', label_trans: 'event.showprice', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol(DeleteRec)
|
||||
export const coltemplemail = [
|
||||
AddCol({ name: 'subject', label_trans: 'templemail.subject' }),
|
||||
AddCol({ name: 'testoheadermail', label_trans: 'templemail.testoheadermail', fieldtype: tools.FieldType.html }),
|
||||
AddCol({ name: 'content', label_trans: 'templemail.content', fieldtype: tools.FieldType.html }),
|
||||
AddCol({ name: 'img', label_trans: 'templemail.img' }),
|
||||
AddCol({ name: 'content2', label_trans: 'templemail.content2', fieldtype: tools.FieldType.html }),
|
||||
AddCol({ name: 'img2', label_trans: 'templemail.img2' }),
|
||||
AddCol({
|
||||
name: 'options',
|
||||
label_trans: 'templemail.options',
|
||||
fieldtype: tools.FieldType.multiselect,
|
||||
jointable: 'opzemail'
|
||||
}),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec)
|
||||
]
|
||||
|
||||
const colnewstosent = [
|
||||
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 }),
|
||||
@@ -65,6 +89,20 @@ const colnewstosent = [
|
||||
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(DeleteRec),
|
||||
AddCol(DuplicateRec)
|
||||
]
|
||||
|
||||
const colTableWhere = [
|
||||
AddCol({ name: 'code', label_trans: 'where.code' }),
|
||||
AddCol({ name: 'placename', label_trans: 'cal.where' }),
|
||||
AddCol({ name: 'whereicon', label_trans: 'where.whereicon' }),
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
const colcontribtype = [
|
||||
AddCol({ name: 'label', label_trans: 'proj.longdescr' }),
|
||||
AddCol({ name: 'showprice', label_trans: 'event.showprice', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
@@ -86,16 +124,8 @@ const coldisciplines = [
|
||||
fieldtype: tools.FieldType.multiselect,
|
||||
jointable: 'operators'
|
||||
}),
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
const colsettings = [
|
||||
AddCol({ name: 'key', label_trans: 'col.label' }),
|
||||
AddCol({ name: 'type', label_trans: 'col.type', fieldtype: tools.FieldType.select, jointable: 'fieldstype' }),
|
||||
AddCol({ name: 'value_str', label_trans: 'col.value', fieldtype: tools.FieldType.string }),
|
||||
AddCol({ name: 'value_date', label_trans: 'cal.data', fieldtype: tools.FieldType.date }),
|
||||
AddCol({ name: 'value_num', label_trans: 'cal.num', fieldtype: tools.FieldType.number }),
|
||||
AddCol(DeleteRec)
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec)
|
||||
]
|
||||
|
||||
const colTablePermission = [
|
||||
@@ -108,7 +138,7 @@ 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({ name: 'lastid_newstosent', label_trans: 'reg.lastid_newstosent', fieldtype: tools.FieldType.string }),
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
@@ -128,7 +158,9 @@ const colTableOperator = [
|
||||
AddCol({ name: 'webpage', label_trans: 'op.webpage' }),
|
||||
AddCol({ name: 'days_working', label_trans: 'op.days_working' }),
|
||||
AddCol({ name: 'facebook', label_trans: 'op.facebook' }),
|
||||
AddCol(DeleteRec)]
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec)
|
||||
]
|
||||
|
||||
const colTableEvents = [
|
||||
AddCol({ name: '_id', label_trans: 'event._id' }),
|
||||
@@ -169,21 +201,24 @@ const colTableEvents = [
|
||||
AddCol({ name: 'dupId', label_trans: 'event.dupId' }),
|
||||
AddCol({ name: 'modified', label_trans: 'event.modified', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol({
|
||||
name: 'copyrec',
|
||||
label_trans: 'event.duplicate',
|
||||
align: 'right',
|
||||
field: tools.NOFIELD,
|
||||
sortable: false,
|
||||
icon: 'fas fa-copy',
|
||||
action: lists.MenuAction.DUPLICATE_RECTABLE,
|
||||
askaction: 'db.duplicatedrecord',
|
||||
visuonlyEditVal: true,
|
||||
required: true,
|
||||
visible: true
|
||||
})
|
||||
AddCol(DuplicateRec)
|
||||
]
|
||||
|
||||
export const fields = {
|
||||
colSettings: [
|
||||
AddCol({ name: 'key', label_trans: 'col.label' }),
|
||||
AddCol({ name: 'type', label_trans: 'col.type', fieldtype: tools.FieldType.select, jointable: 'fieldstype' }),
|
||||
AddCol({ name: 'value_str', label_trans: 'col.value', fieldtype: tools.FieldType.string }),
|
||||
AddCol({ name: 'value_date', label_trans: 'cal.data', fieldtype: tools.FieldType.date }),
|
||||
AddCol({ name: 'value_num', label_trans: 'cal.num', fieldtype: tools.FieldType.number }),
|
||||
AddCol({ name: 'value_bool', label_trans: 'cal.bool', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol({ name: 'serv', label_trans: 'cal.serv', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec)
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
export const fieldsTable = {
|
||||
getArrStrByValueBinary(mythis, col: IColGridTable, val) {
|
||||
const arr = this.getArrByValueBinary(mythis, col, val)
|
||||
@@ -299,6 +334,20 @@ export const fieldsTable = {
|
||||
else
|
||||
return ''
|
||||
},
|
||||
|
||||
// IColGridTable
|
||||
colTableUsers: [
|
||||
AddCol({ name: 'username', label_trans: 'reg.username' }),
|
||||
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
||||
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
|
||||
AddCol({ name: 'email', label_trans: 'reg.email' }),
|
||||
AddCol({ name: 'cell', label_trans: 'reg.cell' }),
|
||||
AddCol({ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false }),
|
||||
AddCol({ name: 'date_reg', label_trans: 'reg.date_reg', fieldtype: tools.FieldType.date }),
|
||||
AddCol({ name: 'perm', label_trans: 'reg.perm', fieldtype: tools.FieldType.binary, jointable: 'permissions' }),
|
||||
AddCol(DeleteRec)
|
||||
],
|
||||
|
||||
tablesList: [
|
||||
{
|
||||
value: 'operators',
|
||||
@@ -335,6 +384,7 @@ export const fieldsTable = {
|
||||
colkey: 'typol_code',
|
||||
collabel: 'label'
|
||||
},
|
||||
|
||||
{
|
||||
value: 'newstosent',
|
||||
label: 'Newsletter da Inviare',
|
||||
@@ -342,6 +392,21 @@ export const fieldsTable = {
|
||||
colkey: '_id',
|
||||
collabel: 'label'
|
||||
},
|
||||
{
|
||||
value: 'templemail',
|
||||
label: 'Template Email',
|
||||
columns: coltemplemail,
|
||||
colkey: '_id',
|
||||
collabel: 'subject'
|
||||
},
|
||||
{
|
||||
value: 'opzemail',
|
||||
label: 'Opzioni Email',
|
||||
columns: colopzemail,
|
||||
colkey: 'key',
|
||||
collabel: (rec) => rec.label_it,
|
||||
onlyAdmin: true
|
||||
},
|
||||
{
|
||||
value: 'mailinglist',
|
||||
label: 'MailingList',
|
||||
@@ -366,34 +431,15 @@ export const fieldsTable = {
|
||||
{
|
||||
value: 'settings',
|
||||
label: 'Impostazioni',
|
||||
columns: colsettings,
|
||||
columns: fields.colSettings,
|
||||
colkey: 'key',
|
||||
collabel: 'key'
|
||||
}
|
||||
],
|
||||
|
||||
// IColGridTable
|
||||
colTableUsers: [
|
||||
AddCol({ name: 'username', label_trans: 'reg.username' }),
|
||||
AddCol({ name: 'name', label_trans: 'reg.name' }),
|
||||
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
|
||||
AddCol({ name: 'email', label_trans: 'reg.email' }),
|
||||
AddCol({ name: 'cell', label_trans: 'reg.cell' }),
|
||||
AddCol({ name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false }),
|
||||
AddCol({ name: 'date_reg', label_trans: 'reg.date_reg', fieldtype: tools.FieldType.date }),
|
||||
AddCol({ name: 'perm', label_trans: 'reg.perm', fieldtype: tools.FieldType.binary, jointable: 'permissions' }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol({
|
||||
name: 'copyrec',
|
||||
label_trans: 'event.duplicate',
|
||||
align: 'right',
|
||||
field: tools.NOFIELD,
|
||||
sortable: false,
|
||||
icon: 'fas fa-copy',
|
||||
action: lists.MenuAction.DUPLICATE_RECTABLE,
|
||||
askaction: 'db.duplicatedrecord',
|
||||
visuonlyEditVal: true,
|
||||
visible: true
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
export const func = {
|
||||
gettablesList() {
|
||||
return fieldsTable.tablesList.filter((rec) => (rec.onlyAdmin === UserStore.state.isAdmin) || (!rec.onlyAdmin))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,22 @@ export const serv_constants = {
|
||||
RIS_CODE_ERR: -99,
|
||||
RIS_CODE_EMAIL_ALREADY_VERIFIED: -5,
|
||||
RIS_CODE_EMAIL_VERIFIED: 1,
|
||||
|
||||
RIS_CODE_ERR_UNAUTHORIZED: -30,
|
||||
RIS_CODE_LOGIN_ERR_GENERIC: -20,
|
||||
|
||||
RIS_CODE_LOGIN_ERR_GENERIC: -20,
|
||||
RIS_CODE_LOGIN_ERR: -10,
|
||||
|
||||
RIS_CODE_OK: 1,
|
||||
RIS_CODE_LOGIN_OK: 1,
|
||||
|
||||
RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN: 403,
|
||||
|
||||
RIS_SUBSCRIBED_OK: 1,
|
||||
RIS_SUBSCRIBED_ALREADYEXIST: 2,
|
||||
RIS_SUBSCRIBED_ERR: -1
|
||||
RIS_SUBSCRIBED_ERR: -1,
|
||||
RIS_SUBSCRIBED_STR: 'subscribed',
|
||||
|
||||
RIS_UNSUBSCRIBED_OK: 5,
|
||||
RIS_UNSUBSCRIBED_STR: 'unsubscribed',
|
||||
RIS_UNSUBSCRIBED_NOT_EXIST: -5,
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,8 @@ export const tools = {
|
||||
TABEVENTS: 'myevents',
|
||||
TABNEWSLETTER: 'newstosent',
|
||||
TABMAILINGLIST: 'mailinglist',
|
||||
TABTEMPLEMAIL: 'templemail',
|
||||
TABOPZEMAIL: 'opzemail',
|
||||
|
||||
MAX_CHARACTERS: 60,
|
||||
projects: 'projects',
|
||||
@@ -135,6 +137,7 @@ export const tools = {
|
||||
number: 64,
|
||||
typeinrec: 128,
|
||||
multiselect: 256,
|
||||
password: 512,
|
||||
},
|
||||
|
||||
FieldTypeArr: [
|
||||
@@ -1380,7 +1383,6 @@ export const tools = {
|
||||
|| ((!elem.onlyAdmin) && (!elem.onlyManager))
|
||||
},
|
||||
|
||||
|
||||
executefunc(myself: any, table, func: number, par: IParamDialog) {
|
||||
if (func === lists.MenuAction.DELETE) {
|
||||
console.log('param1', par.param1)
|
||||
@@ -1856,6 +1858,22 @@ export const tools = {
|
||||
return ''
|
||||
},
|
||||
|
||||
getstrDateTimeAll(mytimestamp) {
|
||||
// console.log('getstrDate', mytimestamp)
|
||||
if (!!mytimestamp)
|
||||
return date.formatDate(mytimestamp, 'DD/MM/YYYY HH:mm:ss')
|
||||
else
|
||||
return ''
|
||||
},
|
||||
|
||||
getstrTimeAll(mytimestamp) {
|
||||
// console.log('getstrDate', mytimestamp)
|
||||
if (!!mytimestamp)
|
||||
return date.formatDate(mytimestamp, 'HH:mm:ss')
|
||||
else
|
||||
return ''
|
||||
},
|
||||
|
||||
getstrDateTimeShort(mytimestamp) {
|
||||
// console.log('getstrDate', mytimestamp)
|
||||
if (!!mytimestamp)
|
||||
@@ -2615,7 +2633,7 @@ export const tools = {
|
||||
|
||||
const mydata = {
|
||||
table,
|
||||
data
|
||||
data,
|
||||
}
|
||||
|
||||
return await
|
||||
@@ -2719,13 +2737,13 @@ export const tools = {
|
||||
else
|
||||
return 'primary'
|
||||
},
|
||||
getCookie(mytok, oldval?) {
|
||||
getCookie(mytok, def?) {
|
||||
const ris = Cookies.get(mytok)
|
||||
console.log('getCookie', ris)
|
||||
if (!!ris) {
|
||||
return ris
|
||||
} else {
|
||||
return oldval
|
||||
return def
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2766,7 +2784,7 @@ export const tools = {
|
||||
if (!numbercell)
|
||||
return ''
|
||||
let mynum = numbercell.replace(/\-/g, '')
|
||||
const intcode = GlobalStore.getters.getValueSettingsByKey('INT_CODE')
|
||||
const intcode = GlobalStore.getters.getValueSettingsByKey('INT_CODE', false)
|
||||
if (numbercell.substring(0, 1) !== '+')
|
||||
mynum = intcode + mynum
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user