- Import emails from a list to a DB

- Create Template Emails
- Options Email
This commit is contained in:
Paolo Arena
2019-12-04 02:04:54 +01:00
parent 895df43074
commit 8268a09897
20 changed files with 619 additions and 165 deletions

View File

@@ -61,7 +61,7 @@ export default class CDateTime extends Vue {
public changevalueDate() { public changevalueDate() {
if (this.valueDate) if (this.valueDate)
this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate) this.myvalue = tools.getstrYYMMDDDateTime(this.valueDate)
console.log('changevalueDate myvalue', this.myvalue) // console.log('changevalueDate myvalue', this.myvalue)
} }
@Watch('value') @Watch('value')
public changevalue() { public changevalue() {
@@ -72,7 +72,7 @@ export default class CDateTime extends Vue {
public savetoclose() { public savetoclose() {
this.saveit = true this.saveit = true
this.showDateTimeScroller = false this.showDateTimeScroller = false
this.$emit('savetoclose', this.myvalue, this.valueprec) // this.$emit('savetoclose', this.myvalue, this.valueprec)
} }
get scrollerPopupStyle280() { get scrollerPopupStyle280() {

View File

@@ -12,13 +12,14 @@ import { lists } from '../../store/Modules/lists'
import { IParamsQuery } from '../../model/GlobalStore' import { IParamsQuery } from '../../model/GlobalStore'
import { fieldsTable } from '../../store/Modules/fieldsTable' import { fieldsTable } from '../../store/Modules/fieldsTable'
import { CMyPopupEdit } from '../CMyPopupEdit' import { CMyPopupEdit } from '../CMyPopupEdit'
import { CTitleBanner } from '../CTitleBanner'
@Component({ @Component({
components: { CMyPopupEdit } components: { CMyPopupEdit, CTitleBanner }
}) })
export default class CGridTableRec extends Vue { export default class CGridTableRec extends Vue {
@Prop({ required: false }) public prop_mytable: string
@Prop({ required: true }) public prop_mytitle: 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: null }) public prop_mycolumns: any[]
@Prop({ required: false, default: '' }) public prop_colkey: string @Prop({ required: false, default: '' }) public prop_colkey: string
@Prop({ required: false, default: '' }) public nodataLabel: string @Prop({ required: false, default: '' }) public nodataLabel: string
@@ -52,7 +53,7 @@ export default class CGridTableRec extends Vue {
public valPrec: string = '' public valPrec: string = ''
public separator: 'horizontal' public separator: 'horizontal'
public filter = undefined public myfilter = undefined
public rowsel: any public rowsel: any
public dark: boolean = true public dark: boolean = true
public canEdit: boolean = false public canEdit: boolean = false
@@ -62,6 +63,11 @@ export default class CGridTableRec extends Vue {
public colVisib: any[] = [] public colVisib: any[] = []
public colExtra: any[] = [] public colExtra: any[] = []
public rowclicksel: any = null
public colclicksel: any = null
public selected: any = []
get lists() { get lists() {
return lists return lists
} }
@@ -96,9 +102,28 @@ 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) { public SaveValue(newVal, valinitial) {
// console.log('SaveValue', newVal, 'rowsel', this.rowsel) // console.log('SaveValue', newVal, 'rowsel', this.rowsel)
if (this.colsel) {
// Update value in table memory // Update value in table memory
if (this.colsel.subfield !== '') { if (this.colsel.subfield !== '') {
if (this.rowsel[this.colsel.field] === undefined) if (this.rowsel[this.colsel.field] === undefined)
@@ -107,6 +132,7 @@ export default class CGridTableRec extends Vue {
} else { } else {
this.rowsel[this.colsel.field] = newVal this.rowsel[this.colsel.field] = newVal
} }
}
const mydata = { const mydata = {
id: this.idsel, id: this.idsel,
@@ -140,7 +166,7 @@ export default class CGridTableRec extends Vue {
} }
public updatedcol() { public updatedcol() {
console.log('updatedcol') // console.log('updatedcol')
if (this.mycolumns) { if (this.mycolumns) {
this.colVisib = [] this.colVisib = []
this.colExtra = [] this.colExtra = []
@@ -160,9 +186,9 @@ export default class CGridTableRec extends Vue {
} }
public onRequest(props) { public onRequest(props) {
console.log('onRequest', 'filter = ' , this.filter) console.log('onRequest', 'myfilter = ', this.myfilter)
const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination
const filter = this.filter const myfilter = this.myfilter
if (!this.mytable) if (!this.mytable)
return return
@@ -185,9 +211,9 @@ export default class CGridTableRec extends Vue {
this.serverData = [] this.serverData = []
// fetch data from "server" // 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 // clear out existing data and add new
if (this.returnedData === []) { if (this.returnedData === []) {
@@ -215,7 +241,7 @@ export default class CGridTableRec extends Vue {
// emulate ajax call // emulate ajax call
// SELECT * FROM ... WHERE...LIMIT... // SELECT * FROM ... WHERE...LIMIT...
public async fetchFromServer(startRow, endRow, filter, sortBy, descending) { public async fetchFromServer(startRow, endRow, myfilter, sortBy, descending) {
let myobj = null let myobj = null
if (sortBy) { if (sortBy) {
@@ -230,7 +256,7 @@ export default class CGridTableRec extends Vue {
table: this.mytable, table: this.mytable,
startRow, startRow,
endRow, endRow,
filter, filter: myfilter,
sortBy: myobj, sortBy: myobj,
descending descending
} }
@@ -247,15 +273,15 @@ export default class CGridTableRec extends Vue {
return true return true
// if (!filter) { // if (!myfilter) {
// data = this.original.slice(startRow, startRow + count) // data = this.original.slice(startRow, startRow + count)
// } // }
// else { // else {
// let found = 0 // let found = 0
// for (let index = startRow, items = 0; index < this.original.length && items < count; ++index) { // for (let index = startRow, items = 0; index < this.original.length && items < count; ++index) {
// let row = this.original[index] // let row = this.original[index]
// // match filter? // // match myfilter?
// if (!row['name'].includes(filter)) { // if (!row['name'].includes(myfilter)) {
// // get a different row, until one is found // // get a different row, until one is found
// continue // continue
// } // }
@@ -285,14 +311,14 @@ export default class CGridTableRec extends Vue {
} }
// emulate 'SELECT count(*) FROM ...WHERE...' // emulate 'SELECT count(*) FROM ...WHERE...'
public getRowsNumberCount(filter) { public getRowsNumberCount(myfilter) {
// if (!filter) { // if (!myfilter) {
// return this.original.length // return this.original.length
// } // }
// let count = 0 // let count = 0
// this.original.forEach((treat) => { // this.original.forEach((treat) => {
// if (treat['name'].includes(filter)) { // if (treat['name'].includes(myfilter)) {
// ++count // ++count
// } // }
// }) // })
@@ -337,9 +363,11 @@ export default class CGridTableRec extends Vue {
public mounted() { public mounted() {
if (!!this.tablesList) {
this.canEdit = tools.getCookie(tools.CAN_EDIT, this.canEdit) === 'true' 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.tablesel === '') {
if (!!this.tablesList) if (!!this.tablesList)
this.tablesel = this.tablesList[0].value this.tablesel = this.tablesList[0].value
@@ -357,11 +385,11 @@ export default class CGridTableRec extends Vue {
console.log('refresh') console.log('refresh')
// console.log('this.search', this.search) // console.log('this.search', this.search)
if (!!this.search && this.search !== '') if (!!this.search && this.search !== '')
this.filter = this.search this.myfilter = this.search
else else
this.filter = undefined this.myfilter = undefined
// console.log('this.filter', this.filter) // console.log('this.myfilter', this.myfilter)
this.refresh_table() this.refresh_table()
} }
@@ -411,7 +439,9 @@ export default class CGridTableRec extends Vue {
if (this.tablesel === undefined || this.tablesel === '') if (this.tablesel === undefined || this.tablesel === '')
return 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 let mytab = null
if (this.tablesList) { if (this.tablesList) {
@@ -457,6 +487,11 @@ export default class CGridTableRec extends Vue {
const myselcol = tools.getCookie(this.mytable, '') const myselcol = tools.getCookie(this.mytable, '')
if (!!myselcol && myselcol.length > 0) { if (!!myselcol && myselcol.length > 0) {
this.colVisib = myselcol.split('|') 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) 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 ''
}
} }

View File

@@ -4,7 +4,7 @@
<q-table <q-table
:data="serverData" :data="serverData"
:columns="mycolumns" :columns="mycolumns"
:filter="filter" :filter="myfilter"
:pagination.sync="pagination" :pagination.sync="pagination"
:row-key="colkey" :row-key="colkey"
:loading="loading" :loading="loading"
@@ -35,7 +35,8 @@
<!--<p style="color:red"> Rows: {{ getrows }}</p>--> <!--<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> <template v-slot:after>
<q-btn v-if="mytable" label="" color="primary" @click="refresh" icon="search"></q-btn> <q-btn v-if="mytable" label="" color="primary" @click="refresh" icon="search"></q-btn>
</template> </template>
@@ -91,16 +92,20 @@
</template> </template>
<q-tr v-if="mytable" slot="body" slot-scope="props" :props="props"> <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)"> <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" <CMyPopupEdit :canEdit="canEdit"
:col="col" :col="col"
:row.sync="props.row" :row.sync="props.row"
:field="col.field" :field="col.field"
:subfield="col.subfield" :subfield="col.subfield"
@save="SaveValue" @save="SaveValue"
@show="selItem(props.row, col)"> @show="selItem(props.row, col)"
@showandsave="showandsel">
</CMyPopupEdit> </CMyPopupEdit>
</div>
</q-td> </q-td>
<q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colExtra.includes(col.name)"> <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)"> <div v-if="col.action && visCol(col)">
@@ -119,6 +124,38 @@
--> -->
<!----> <!---->
</q-table> </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> </div>
</template> </template>
<script lang="ts" src="./CGridTableRec.ts"> <script lang="ts" src="./CGridTableRec.ts">

View File

@@ -5,14 +5,17 @@ import { tools } from '../../store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext' import { toolsext } from '@src/store/Modules/toolsext'
import { QEditor } from 'quasar' import { QEditor } from 'quasar'
import { CTitleBanner } from '../CTitleBanner'
@Component({ @Component({
name: 'CMyEditor' name: 'CMyEditor',
components: { CTitleBanner }
}) })
export default class CMyEditor extends Vue { export default class CMyEditor extends Vue {
public $q public $q
public editor = null public editor = null
@Prop({ required: false, default: '' }) public title
@Prop({ required: true }) public value @Prop({ required: true }) public value
@Prop({ required: false, default: '' }) public myclass @Prop({ required: false, default: '' }) public myclass

View File

@@ -1,5 +1,6 @@
<template> <template>
<div> <div>
<CTitleBanner :title="title"></CTitleBanner>
<form <form
autocorrect="off" autocorrect="off"
autocapitalize="off" autocapitalize="off"
@@ -19,9 +20,11 @@
toolbar-toggle-color="yellow-8" toolbar-toggle-color="yellow-8"
toolbar-bg="primary" toolbar-bg="primary"
:toolbar="toolbarcomp" :toolbar="toolbarcomp"
debounce="500"
:fonts="myfonts" :fonts="myfonts"
@input="changeval" @input="changeval"
@paste.native="evt => pasteCapture(evt)" @paste.native="evt => pasteCapture(evt)"
@keyup.enter.stop
v-model="myvalue"> v-model="myvalue">
</q-editor> </q-editor>
</form> </form>

View File

@@ -9,10 +9,11 @@ import { CMyChipList } from '../CMyChipList'
import { CDateTime } from '../CDateTime' import { CDateTime } from '../CDateTime'
import { CMyToggleList } from '../CMyToggleList' import { CMyToggleList } from '../CMyToggleList'
import { CMySelect } from '../CMySelect' import { CMySelect } from '../CMySelect'
import { CMyEditor } from '../CMyEditor'
@Component({ @Component({
name: 'CMyPopupEdit', name: 'CMyPopupEdit',
components: {CMyChipList, CDateTime, CMyToggleList, CMySelect} components: {CMyChipList, CDateTime, CMyToggleList, CMySelect, CMyEditor}
}) })
export default class CMyPopupEdit extends Vue { 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: false }) public canEdit
@Prop({ required: false, default: '' }) public field @Prop({ required: false, default: '' }) public field
@Prop({ required: false, default: '' }) public subfield @Prop({ required: false, default: '' }) public subfield
@Prop({ required: false, default: false }) public showall
public myvalue = '' public myvalue = ''
@@ -75,6 +77,13 @@ export default class CMyPopupEdit extends Vue {
this.$emit('save', newVal, valinitial) 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) { public visuValByType(val, col: IColGridTable, row) {
if (col === undefined || row === undefined) if (col === undefined || row === undefined)
return return
@@ -118,7 +127,12 @@ export default class CMyPopupEdit extends Vue {
else if (val === '') { else if (val === '') {
return '[]' return '[]'
} else { } 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) {
if (val.length > tools.MAX_CHARACTERS) if (val.length > tools.MAX_CHARACTERS)
mystr += '...' mystr += '...'
@@ -132,7 +146,7 @@ export default class CMyPopupEdit extends Vue {
public getclassCol(col) { public getclassCol(col) {
if (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' : '' mycl += (col.fieldtype === tools.FieldType.date) ? ' coldate flex flex-container' : ''
return mycl return mycl

View File

@@ -32,6 +32,10 @@
:optlab="db_fieldsTable.getLabelByTable(col.jointable)" :optlab="db_fieldsTable.getLabelByTable(col.jointable)"
:opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList> :opticon="db_fieldsTable.getIconByTable(col.jointable)"></CMyChipList>
</div> </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> <div v-else>
{{ visuValByType(myvalue, col, row) }} {{ visuValByType(myvalue, col, row) }}
</div> </div>
@@ -65,6 +69,15 @@
<div v-else-if="col.fieldtype === tools.FieldType.string"> <div v-else-if="col.fieldtype === tools.FieldType.string">
<q-input v-model="myvalue" <q-input v-model="myvalue"
autogrow 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> autofocus>
</q-input> </q-input>
@@ -84,10 +97,13 @@
</CMyToggleList> </CMyToggleList>
</div> </div>
<div v-else-if="col.fieldtype === tools.FieldType.html"> <div v-else-if="col.fieldtype === tools.FieldType.html">
<q-input v-model="myvalue" <CMyEditor :value.sync="myvalue" :title="col.title" @keyup.enter.stop>
autofocus
@keyup.enter.stop </CMyEditor>
type="textarea"></q-input> <!--<q-input v-model="myvalue"-->
<!--autofocus-->
<!--@keyup.enter.stop-->
<!--type="textarea"></q-input>-->
</div> </div>
<div v-else-if="col.fieldtype === tools.FieldType.select"> <div v-else-if="col.fieldtype === tools.FieldType.select">
<CMySelect :label="col.title" <CMySelect :label="col.title"

View File

@@ -1,5 +1,5 @@
<template> <template>
<div> <div class="text-center">
<div v-if="useinput"> <div v-if="useinput">
<q-select <q-select
rounded rounded
@@ -33,6 +33,7 @@
:label="label" :label="label"
emit-value emit-value
map-options map-options
input-class="text-center"
style="min-width: 170px; max-width: 400px;" style="min-width: 170px; max-width: 400px;"
> >

View File

@@ -36,29 +36,29 @@ export default class Footer extends Vue {
} }
get TelegramSupport() { get TelegramSupport() {
return GlobalStore.getters.getValueSettingsByKey('TELEGRAM_SUPPORT') return GlobalStore.getters.getValueSettingsByKey('TELEGRAM_SUPPORT', false)
} }
get Whatsapp_Cell() { get Whatsapp_Cell() {
return GlobalStore.getters.getValueSettingsByKey('WHATSAPP_CELL') return GlobalStore.getters.getValueSettingsByKey('WHATSAPP_CELL', false)
} }
get Telegram_UsernameHttp() { get Telegram_UsernameHttp() {
return tools.getHttpForTelegram(GlobalStore.getters.getValueSettingsByKey('TELEGRAM_USERNAME')) return tools.getHttpForTelegram(GlobalStore.getters.getValueSettingsByKey('TELEGRAM_USERNAME', false))
} }
get FBPage() { get FBPage() {
const fb = GlobalStore.getters.getValueSettingsByKey('URL_FACEBOOK') const fb = GlobalStore.getters.getValueSettingsByKey('URL_FACEBOOK', false)
return fb return fb
} }
get InstagramPage() { get InstagramPage() {
return GlobalStore.getters.getValueSettingsByKey('URL_INSTAGRAM') return GlobalStore.getters.getValueSettingsByKey('URL_INSTAGRAM', false)
} }
get TwitterPage() { get TwitterPage() {
return GlobalStore.getters.getValueSettingsByKey('URL_TWITTER') return GlobalStore.getters.getValueSettingsByKey('URL_TWITTER', false)
} }
get static_data() { get static_data() {

View File

@@ -7,8 +7,8 @@
<!--</span>--> <!--</span>-->
<CFacebookFrame myclass="text-center" :fbimage="getValDb('FBPAGE_IMG')" <CFacebookFrame myclass="text-center" :fbimage="getValDb('FBPAGE_IMG', false)"
:urlfbpage="getValDb('FBPAGE_FRAME')" title="getValDb('FBPAGE_TITLE')"> :urlfbpage="getValDb('FBPAGE_FRAME')" :title="getValDb('FBPAGE_TITLE', false)">
</CFacebookFrame> </CFacebookFrame>
@@ -45,9 +45,9 @@
</div> </div>
<div class="text-center"> <div class="text-center">
<span v-html="getValDb('MAP_TITLE')"></span> <span v-html="getValDb('MAP_TITLE', false)"></span>
<br> <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>
<!--<div class="q-mt-xs copyrights">--> <!--<div class="q-mt-xs copyrights">-->
@@ -63,12 +63,12 @@
<div class="mycontacts_text"> <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> 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> }}</a><br>
<div style="margin-bottom: 20px;"></div> <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" class="mycontacts_text margin_buttons_footer"
style="margin-bottom: 0px;"> style="margin-bottom: 0px;">
<div> <div>
@@ -102,8 +102,8 @@
</div> </div>
</div> </div>
<span v-if="getValDb('CALL_WORKING_DAYS')"><br>orari per chiamate:<br> <span v-if="getValDb('CALL_WORKING_DAYS', false)"><br>orari per chiamate:<br>
<span v-html="getValDb('CALL_WORKING_DAYS')"></span></span> <span v-html="getValDb('CALL_WORKING_DAYS', false)"></span></span>
</div> </div>
</div> </div>

View File

@@ -8,12 +8,13 @@ import Quasar, { Screen } from 'quasar'
import { Prop } from 'vue-property-decorator' import { Prop } from 'vue-property-decorator'
import { Api } from '../../store' import { Api } from '../../store'
import { serv_constants } from '../../store/Modules/serv_constants' import { serv_constants } from '../../store/Modules/serv_constants'
import MixinBase from '../../mixins/mixin-base'
@Component({ @Component({
name: 'FormNewsletter' name: 'FormNewsletter'
}) })
export default class FormNewsletter extends Vue { export default class FormNewsletter extends MixinBase {
public $t public $t
public $q public $q
public name: string = null public name: string = null
@@ -24,10 +25,6 @@ export default class FormNewsletter extends Vue {
@Prop() public idwebsite: string @Prop() public idwebsite: string
@Prop() public locale: string @Prop() public locale: string
get tools() {
return tools
}
public async onSubmit() { public async onSubmit() {
if (this.accept !== true) { if (this.accept !== true) {
@@ -44,14 +41,16 @@ export default class FormNewsletter extends Vue {
firstName: this.name, firstName: this.name,
lastName: this.surname, lastName: this.surname,
idwebsite: this.idwebsite, idwebsite: this.idwebsite,
locale: this.locale locale: this.locale,
settomailchimp: this.getValDb('MAILCHIMP_ON', true, false)
} }
console.log(usertosend) console.log(usertosend)
return await Api.SendReq('/signup_news', 'POST', usertosend, false) return await Api.SendReq('/news/signup', 'POST', usertosend, false)
.then((res) => { .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({ this.$q.notify({
color: 'green-4', color: 'green-4',
textColor: 'white', textColor: 'white',
@@ -59,7 +58,7 @@ export default class FormNewsletter extends Vue {
// message: this.$t('newsletter.submitted') // message: this.$t('newsletter.submitted')
message: res.data.msg 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({ this.$q.notify({
color: 'orange-4', color: 'orange-4',
textColor: 'white', textColor: 'white',

View File

@@ -14,6 +14,7 @@ export * from './CMyPopupEdit'
export * from './CMyToggleList' export * from './CMyToggleList'
export * from './CMyChipList' export * from './CMyChipList'
export * from './CMyEditor' export * from './CMyEditor'
export * from './CMyFieldDb'
export * from './CMyTeacher' export * from './CMyTeacher'
export * from './CImgText' export * from './CImgText'
export * from './CImgTitle' export * from './CImgTitle'
@@ -32,3 +33,4 @@ export * from './CFacebookFrame'
export * from './Shen/CTesseraElettronica' export * from './Shen/CTesseraElettronica'
export * from './CGoogleMap' export * from './CGoogleMap'
export * from './COpenStreetMap' export * from './COpenStreetMap'
export * from './CTitleBanner'

View File

@@ -5,6 +5,8 @@ import { func_tools } from '../store/Modules/toolsext'
import { tools } from '../store/Modules/tools' import { tools } from '../store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext' import { toolsext } from '@src/store/Modules/toolsext'
import { GlobalStore } from '../store/Modules' 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. // You can declare a mixin as the same style as components.
@Component @Component
@@ -17,6 +19,10 @@ export default class MixinBase extends Vue {
return toolsext return toolsext
} }
get db_fieldsTable() {
return fieldsTable
}
get func_tools() { get func_tools() {
return func_tools return func_tools
} }
@@ -25,15 +31,71 @@ export default class MixinBase extends Vue {
return tools return tools
} }
public getValDb(keystr, def?) { public getValDb(keystr, serv, def?) {
const ris = GlobalStore.getters.getValueSettingsByKey(keystr) const ris = GlobalStore.getters.getValueSettingsByKey(keystr, serv)
if (ris === '') if (ris === '')
return def return def
else else
return ris 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) // console.log('myval', myval)
try { try {
if (myval) { if (myval) {
@@ -48,4 +110,5 @@ export default class MixinBase extends Vue {
return [] return []
} }
} }
} }

View File

@@ -26,12 +26,22 @@ export interface ICfgData {
userId?: string userId?: string
} }
export interface ITemplEmail {
subject?: string
content?: string
options?: ISettings[]
}
export interface ISettings { export interface ISettings {
_id?: string
idapp?: string
key?: string key?: string
type?: number type?: number
value_str?: string value_str?: string
value_date?: Date, value_date?: Date,
value_num?: number value_num?: number
value_bool?: boolean
serv?: boolean
} }
export interface ITeachUname { export interface ITeachUname {
@@ -116,9 +126,12 @@ export interface IGlobalState {
listatodo: IMenuList[] listatodo: IMenuList[]
arrConfig: IConfig[] arrConfig: IConfig[]
lastaction: IAction lastaction: IAction
serv_settings: ISettings[],
settings: ISettings[], settings: ISettings[],
disciplines: IDiscipline[], disciplines: IDiscipline[],
newstosent: INewsToSent[], newstosent: INewsToSent[],
templemail: ITemplEmail[],
opzemail: ISettings[],
mailinglist: IMailinglist[], mailinglist: IMailinglist[],
autoplaydisc: number autoplaydisc: number
} }
@@ -308,6 +321,7 @@ export interface ITableRec {
colkey: string colkey: string
collabel: string collabel: string
colicon?: string colicon?: string
onlyAdmin?: boolean
} }
export interface IDataPass { export interface IDataPass {
@@ -315,3 +329,21 @@ export interface IDataPass {
table: string table: string
fieldsvalue: object 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,
}

View File

@@ -18,6 +18,7 @@ const msgglobal = {
usereventlist: 'Prenotazioni Utenti', usereventlist: 'Prenotazioni Utenti',
userlist: 'Lista Utenti', userlist: 'Lista Utenti',
tableslist: 'Lista Tabelle', tableslist: 'Lista Tabelle',
newsletter: 'Newsletter',
}, },
manage: { manage: {
menu: 'Gestione', menu: 'Gestione',
@@ -76,7 +77,9 @@ const msgglobal = {
verify_email: 'Verifica la tua email', verify_email: 'Verifica la tua email',
go_login: 'Torna al Login', go_login: 'Torna al Login',
incorrect_input: 'Inserimento incorretto.', 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', notregistered: 'Devi registrarti al servizio prima di porter memorizzare i dati',
loggati: 'Utente non loggato' 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: { reg: {
page_title: 'Registrazione', page_title: 'Registrazione',
incorso: 'Registrazione in corso...', incorso: 'Registrazione in corso...',
@@ -338,6 +350,7 @@ const msgglobal = {
usereventlist: 'Reserva Usuarios', usereventlist: 'Reserva Usuarios',
userlist: 'Lista de usuarios', userlist: 'Lista de usuarios',
tableslist: 'Listado de tablas', tableslist: 'Listado de tablas',
newsletter: 'Newsletter',
}, },
manage: { manage: {
menu: 'Gestionar', menu: 'Gestionar',
@@ -396,7 +409,9 @@ const msgglobal = {
verify_email: 'Revisa tu email', verify_email: 'Revisa tu email',
go_login: 'Vuelve al Login', go_login: 'Vuelve al Login',
incorrect_input: 'Entrada correcta.', 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', notregistered: 'Debe registrarse en el servicio antes de poder almacenar los datos',
loggati: 'Usuario no ha iniciado sesión' 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: { reg: {
page_title: 'Registro', page_title: 'Registro',
incorso: 'Registro en curso...', incorso: 'Registro en curso...',
@@ -649,6 +673,7 @@ const msgglobal = {
usereventlist: 'Réservation Utilisateur', usereventlist: 'Réservation Utilisateur',
userlist: 'Liste d\'utilisateurs', userlist: 'Liste d\'utilisateurs',
tableslist: 'Liste des tables', tableslist: 'Liste des tables',
newsletter: 'Newsletter',
}, },
manage: { manage: {
menu: 'Gérer', menu: 'Gérer',
@@ -707,7 +732,9 @@ const msgglobal = {
verify_email: 'Vérifiez votre email', verify_email: 'Vérifiez votre email',
go_login: 'Retour à la connexion', go_login: 'Retour à la connexion',
incorrect_input: 'Entrée correcte.', 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.', notregistered: 'Vous devez vous inscrire auprès du service avant de pouvoir stocker les données.',
loggati: 'L\'utilisateur n\'est pas connecté' 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: { reg: {
incorso: 'Inscription en cours...', incorso: 'Inscription en cours...',
richiesto: 'Champ obligatoire', richiesto: 'Champ obligatoire',
@@ -959,6 +995,7 @@ const msgglobal = {
usereventlist: 'Users Booking', usereventlist: 'Users Booking',
userlist: 'Users List', userlist: 'Users List',
tableslist: 'List of tables', tableslist: 'List of tables',
newsletter: 'Newsletter',
}, },
manage: { manage: {
menu: 'Manage', menu: 'Manage',
@@ -1017,7 +1054,9 @@ const msgglobal = {
verify_email: 'Verify your email', verify_email: 'Verify your email',
go_login: 'Back to Login', go_login: 'Back to Login',
incorrect_input: 'Incorrect input.', 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', notregistered: 'You need first to SignUp before storing data',
loggati: 'User not logged in' 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: { reg: {
incorso: 'Registration please wait...', incorso: 'Registration please wait...',
richiesto: 'Field Required', richiesto: 'Field Required',
@@ -1268,6 +1316,7 @@ const msgglobal = {
usereventlist: 'Users Booking', usereventlist: 'Users Booking',
userlist: 'Users List', userlist: 'Users List',
tableslist: 'List of tables', tableslist: 'List of tables',
newsletter: 'Newsletter',
}, },
manage: { manage: {
menu: 'Manage', menu: 'Manage',
@@ -1326,7 +1375,9 @@ const msgglobal = {
verify_email: 'Verify your email', verify_email: 'Verify your email',
go_login: 'Back to Login', go_login: 'Back to Login',
incorrect_input: 'Incorrect input.', 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', notregistered: 'You need first to SignUp before storing data',
loggati: 'User not logged in' 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: { reg: {
page_title: 'Registration', page_title: 'Registration',
incorso: 'Registration please wait...', incorso: 'Registration please wait...',

View File

@@ -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 { storeBuilder } from './Store/Store'
import Vue from 'vue' import Vue from 'vue'
@@ -68,6 +68,9 @@ const state: IGlobalState = {
type: 0, type: 0,
_id: 0 _id: 0
}, },
serv_settings: [],
templemail: [],
opzemail: [],
settings: [], settings: [],
disciplines: [], disciplines: [],
autoplaydisc: 8000, autoplaydisc: 8000,
@@ -171,6 +174,10 @@ namespace Getters {
return GlobalStore.state.disciplines return GlobalStore.state.disciplines
else if (table === tools.TABNEWSLETTER) else if (table === tools.TABNEWSLETTER)
return GlobalStore.state.newstosent 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) else if (table === tools.TABMAILINGLIST)
return GlobalStore.state.mailinglist return GlobalStore.state.mailinglist
else if (table === 'bookings') else if (table === 'bookings')
@@ -188,13 +195,24 @@ namespace Getters {
}, 'getListByTable') }, 'getListByTable')
const getValueSettingsByKey = b.read((mystate: IGlobalState) => (key): any => { const getrecSettingsByKey = b.read((mystate: IGlobalState) => (key, serv): ISettings => {
const myrec = mystate.settings.find((rec) => rec.key === key) 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) {
if (myrec.type === tools.FieldType.date) if (myrec.type === tools.FieldType.date)
return myrec.value_date return myrec.value_date
if (myrec.type === tools.FieldType.number) else if (myrec.type === tools.FieldType.number)
return myrec.value_num return myrec.value_num
else if (myrec.type === tools.FieldType.boolean)
return myrec.value_bool
else else
return myrec.value_str return myrec.value_str
} else { } else {
@@ -246,6 +264,10 @@ namespace Getters {
return getValueSettingsByKey() return getValueSettingsByKey()
}, },
get getrecSettingsByKey() {
return getrecSettingsByKey()
},
get t() { get t() {
return 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 = { export const mutations = {
setConta: b.commit(setConta), setConta: b.commit(setConta),
setleftDrawerOpen: b.commit(setleftDrawerOpen), setleftDrawerOpen: b.commit(setleftDrawerOpen),
@@ -364,7 +411,8 @@ namespace Mutations {
setPaoArray_Delete: b.commit(setPaoArray_Delete), setPaoArray_Delete: b.commit(setPaoArray_Delete),
NewArray: b.commit(NewArray), NewArray: b.commit(NewArray),
setShowType: b.commit(setShowType), 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 = { const usertosend = {
locale: tools.getLocale() locale: tools.getLocale(),
previewonly
} }
console.log(usertosend) console.log(usertosend)
return await Api.SendReq('/signup_news/testemail', 'POST', usertosend) return await Api.SendReq('/news/testemail', 'POST', usertosend)
.then((res) => { .then((res) => {
return res return res
}) })

View File

@@ -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) { async function signup(context, authData: ISignupOptions) {
console.log('SIGNUP') console.log('SIGNUP')
@@ -743,7 +794,11 @@ namespace Actions {
resetpwd: b.dispatch(resetpwd), resetpwd: b.dispatch(resetpwd),
signin: b.dispatch(signin), signin: b.dispatch(signin),
signup: b.dispatch(signup), 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),
} }
} }

View File

@@ -2,7 +2,7 @@ import { IColGridTable } from '../../model'
import { lists } from './lists' import { lists } from './lists'
import { tools } from '@src/store/Modules/tools' import { tools } from '@src/store/Modules/tools'
import { shared_consts } from '@src/common/shared_vuejs' import { shared_consts } from '@src/common/shared_vuejs'
import { GlobalStore } from '@store' import { GlobalStore, UserStore } from '@store'
const DeleteRec = { const DeleteRec = {
name: 'deleterec', name: 'deleterec',
@@ -17,6 +17,19 @@ const DeleteRec = {
visuonlyEditVal: true 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) { function AddCol(params: IColGridTable) {
return { return {
name: params.name, name: params.name,
@@ -40,20 +53,31 @@ function AddCol(params: IColGridTable) {
} }
} }
const colTableWhere = [ export const colopzemail = [
AddCol({ name: 'code', label_trans: 'where.code' }), AddCol({ name: 'key', label_trans: 'col.key' }),
AddCol({ name: 'placename', label_trans: 'cal.where' }), AddCol({ name: 'label_it', label_trans: 'col.label' }),
AddCol({ name: 'whereicon', label_trans: 'where.whereicon' }), AddCol(DeleteRec),
AddCol(DeleteRec) AddCol(DuplicateRec)
] ]
const colcontribtype = [ export const coltemplemail = [
AddCol({ name: 'label', label_trans: 'proj.longdescr' }), AddCol({ name: 'subject', label_trans: 'templemail.subject' }),
AddCol({ name: 'showprice', label_trans: 'event.showprice', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'testoheadermail', label_trans: 'templemail.testoheadermail', fieldtype: tools.FieldType.html }),
AddCol(DeleteRec) 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: 'label', label_trans: 'event.title' }),
AddCol({ name: 'datetoSent', label_trans: 'news.datetoSent', fieldtype: tools.FieldType.date }), AddCol({ name: 'datetoSent', label_trans: 'news.datetoSent', fieldtype: tools.FieldType.date }),
AddCol({ name: 'activate', label_trans: 'news.activate', fieldtype: tools.FieldType.boolean }), 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: '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: '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: '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) AddCol(DeleteRec)
] ]
@@ -86,16 +124,8 @@ const coldisciplines = [
fieldtype: tools.FieldType.multiselect, fieldtype: tools.FieldType.multiselect,
jointable: 'operators' jointable: 'operators'
}), }),
AddCol(DeleteRec) AddCol(DeleteRec),
] AddCol(DuplicateRec)
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)
] ]
const colTablePermission = [ const colTablePermission = [
@@ -128,7 +158,9 @@ const colTableOperator = [
AddCol({ name: 'webpage', label_trans: 'op.webpage' }), AddCol({ name: 'webpage', label_trans: 'op.webpage' }),
AddCol({ name: 'days_working', label_trans: 'op.days_working' }), AddCol({ name: 'days_working', label_trans: 'op.days_working' }),
AddCol({ name: 'facebook', label_trans: 'op.facebook' }), AddCol({ name: 'facebook', label_trans: 'op.facebook' }),
AddCol(DeleteRec)] AddCol(DeleteRec),
AddCol(DuplicateRec)
]
const colTableEvents = [ const colTableEvents = [
AddCol({ name: '_id', label_trans: 'event._id' }), AddCol({ name: '_id', label_trans: 'event._id' }),
@@ -169,21 +201,24 @@ const colTableEvents = [
AddCol({ name: 'dupId', label_trans: 'event.dupId' }), AddCol({ name: 'dupId', label_trans: 'event.dupId' }),
AddCol({ name: 'modified', label_trans: 'event.modified', fieldtype: tools.FieldType.boolean }), AddCol({ name: 'modified', label_trans: 'event.modified', fieldtype: tools.FieldType.boolean }),
AddCol(DeleteRec), AddCol(DeleteRec),
AddCol({ AddCol(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,
required: true,
visible: true
})
] ]
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 = { export const fieldsTable = {
getArrStrByValueBinary(mythis, col: IColGridTable, val) { getArrStrByValueBinary(mythis, col: IColGridTable, val) {
const arr = this.getArrByValueBinary(mythis, col, val) const arr = this.getArrByValueBinary(mythis, col, val)
@@ -299,6 +334,20 @@ export const fieldsTable = {
else else
return '' 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: [ tablesList: [
{ {
value: 'operators', value: 'operators',
@@ -335,6 +384,7 @@ export const fieldsTable = {
colkey: 'typol_code', colkey: 'typol_code',
collabel: 'label' collabel: 'label'
}, },
{ {
value: 'newstosent', value: 'newstosent',
label: 'Newsletter da Inviare', label: 'Newsletter da Inviare',
@@ -342,6 +392,21 @@ export const fieldsTable = {
colkey: '_id', colkey: '_id',
collabel: 'label' 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', value: 'mailinglist',
label: 'MailingList', label: 'MailingList',
@@ -366,34 +431,15 @@ export const fieldsTable = {
{ {
value: 'settings', value: 'settings',
label: 'Impostazioni', label: 'Impostazioni',
columns: colsettings, columns: fields.colSettings,
colkey: 'key', colkey: 'key',
collabel: '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))
}
}

View File

@@ -5,18 +5,22 @@ export const serv_constants = {
RIS_CODE_ERR: -99, RIS_CODE_ERR: -99,
RIS_CODE_EMAIL_ALREADY_VERIFIED: -5, RIS_CODE_EMAIL_ALREADY_VERIFIED: -5,
RIS_CODE_EMAIL_VERIFIED: 1, RIS_CODE_EMAIL_VERIFIED: 1,
RIS_CODE_ERR_UNAUTHORIZED: -30, RIS_CODE_ERR_UNAUTHORIZED: -30,
RIS_CODE_LOGIN_ERR_GENERIC: -20,
RIS_CODE_LOGIN_ERR_GENERIC: -20,
RIS_CODE_LOGIN_ERR: -10, RIS_CODE_LOGIN_ERR: -10,
RIS_CODE_OK: 1, RIS_CODE_OK: 1,
RIS_CODE_LOGIN_OK: 1, RIS_CODE_LOGIN_OK: 1,
RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN: 403, RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN: 403,
RIS_SUBSCRIBED_OK: 1, RIS_SUBSCRIBED_OK: 1,
RIS_SUBSCRIBED_ALREADYEXIST: 2, 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,
} }

View File

@@ -67,6 +67,8 @@ export const tools = {
TABEVENTS: 'myevents', TABEVENTS: 'myevents',
TABNEWSLETTER: 'newstosent', TABNEWSLETTER: 'newstosent',
TABMAILINGLIST: 'mailinglist', TABMAILINGLIST: 'mailinglist',
TABTEMPLEMAIL: 'templemail',
TABOPZEMAIL: 'opzemail',
MAX_CHARACTERS: 60, MAX_CHARACTERS: 60,
projects: 'projects', projects: 'projects',
@@ -135,6 +137,7 @@ export const tools = {
number: 64, number: 64,
typeinrec: 128, typeinrec: 128,
multiselect: 256, multiselect: 256,
password: 512,
}, },
FieldTypeArr: [ FieldTypeArr: [
@@ -1380,7 +1383,6 @@ export const tools = {
|| ((!elem.onlyAdmin) && (!elem.onlyManager)) || ((!elem.onlyAdmin) && (!elem.onlyManager))
}, },
executefunc(myself: any, table, func: number, par: IParamDialog) { executefunc(myself: any, table, func: number, par: IParamDialog) {
if (func === lists.MenuAction.DELETE) { if (func === lists.MenuAction.DELETE) {
console.log('param1', par.param1) console.log('param1', par.param1)
@@ -1856,6 +1858,22 @@ export const tools = {
return '' 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) { getstrDateTimeShort(mytimestamp) {
// console.log('getstrDate', mytimestamp) // console.log('getstrDate', mytimestamp)
if (!!mytimestamp) if (!!mytimestamp)
@@ -2615,7 +2633,7 @@ export const tools = {
const mydata = { const mydata = {
table, table,
data data,
} }
return await return await
@@ -2719,13 +2737,13 @@ export const tools = {
else else
return 'primary' return 'primary'
}, },
getCookie(mytok, oldval?) { getCookie(mytok, def?) {
const ris = Cookies.get(mytok) const ris = Cookies.get(mytok)
console.log('getCookie', ris) console.log('getCookie', ris)
if (!!ris) { if (!!ris) {
return ris return ris
} else { } else {
return oldval return def
} }
}, },
@@ -2766,7 +2784,7 @@ export const tools = {
if (!numbercell) if (!numbercell)
return '' return ''
let mynum = numbercell.replace(/\-/g, '') 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) !== '+') if (numbercell.substring(0, 1) !== '+')
mynum = intcode + mynum mynum = intcode + mynum
else else