diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts
index d0658d3..969af30 100644
--- a/src/common/shared_vuejs.ts
+++ b/src/common/shared_vuejs.ts
@@ -27,7 +27,7 @@ export const shared_consts = {
},
fieldsUserToChange() {
- return ['username', 'email', 'cell', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'img', 'ipaddr', 'lasttimeonline', 'profile']
+ return ['_id', 'username', 'email', 'cell', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'img', 'ipaddr', 'lasttimeonline', 'profile']
}
}
diff --git a/src/components/CCard/CCard.vue b/src/components/CCard/CCard.vue
index bbf18b6..d8d5422 100644
--- a/src/components/CCard/CCard.vue
+++ b/src/components/CCard/CCard.vue
@@ -20,7 +20,15 @@
{{myop.certifications}}
- {{myop.cell}}
+ {{myop.cell}}
+
+
+
+
diff --git a/src/components/CMyAvatar/CMyAvatar.scss b/src/components/CMyAvatar/CMyAvatar.scss
new file mode 100644
index 0000000..b892863
--- /dev/null
+++ b/src/components/CMyAvatar/CMyAvatar.scss
@@ -0,0 +1,4 @@
+.myflex{
+ display: flex;
+ flex: 1;
+}
diff --git a/src/components/CMyAvatar/CMyAvatar.ts b/src/components/CMyAvatar/CMyAvatar.ts
new file mode 100644
index 0000000..a8cba3c
--- /dev/null
+++ b/src/components/CMyAvatar/CMyAvatar.ts
@@ -0,0 +1,48 @@
+import Vue from 'vue'
+import { Component, Prop, Watch } from 'vue-property-decorator'
+
+import { tools } from '../../store/Modules/tools'
+import { UserStore } from '../../store/Modules'
+
+@Component({
+ name: 'CMyAvatar'
+})
+
+export default class CMyAvatar extends Vue {
+ @Prop({ required: false, default: '' }) public myimg
+ @Prop({ required: false, default: '40px' }) public size
+
+ public myicon: string = ''
+ public myimgint: string = ''
+
+ get tools() {
+ return tools
+ }
+
+ @Watch('GlobalStore.state.my.profile.img')
+ public imgChanged() {
+ // console.log('imgChanged')
+ this.refresh()
+ }
+
+ @Watch('myimg')
+ public imglocalChanged() {
+ this.myimgint = ''
+ // console.log('myimg')
+
+ this.refresh()
+ }
+
+ public refresh() {
+ if (!this.myimg) {
+ this.myicon = 'fas fa-user-circle'
+ } else {
+ this.myimgint = this.myimg
+ }
+ // console.log('myimgint', this.myimgint)
+ }
+
+ public mounted() {
+ this.refresh()
+ }
+}
diff --git a/src/components/CMyAvatar/CMyAvatar.vue b/src/components/CMyAvatar/CMyAvatar.vue
new file mode 100644
index 0000000..5f55649
--- /dev/null
+++ b/src/components/CMyAvatar/CMyAvatar.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/CMyAvatar/index.ts b/src/components/CMyAvatar/index.ts
new file mode 100644
index 0000000..e261b6d
--- /dev/null
+++ b/src/components/CMyAvatar/index.ts
@@ -0,0 +1 @@
+export {default as CMyAvatar} from './CMyAvatar.vue'
diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.scss b/src/components/CMyPopupEdit/CMyPopupEdit.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.ts b/src/components/CMyPopupEdit/CMyPopupEdit.ts
new file mode 100644
index 0000000..00f2408
--- /dev/null
+++ b/src/components/CMyPopupEdit/CMyPopupEdit.ts
@@ -0,0 +1,138 @@
+import Vue from 'vue'
+import { Component, Prop } from 'vue-property-decorator'
+
+import { tools } from '../../store/Modules/tools'
+import { toolsext } from '@src/store/Modules/toolsext'
+import { IColGridTable } from '../../model'
+import { fieldsTable } from '../../store/Modules/fieldsTable'
+import { CMyChipList } from '../CMyChipList'
+import { CDateTime } from '../CDateTime'
+import { CMyToggleList } from '../CMyToggleList'
+import { CMySelect } from '../CMySelect'
+
+@Component({
+ name: 'CMyPopupEdit',
+ components: {CMyChipList, CDateTime, CMyToggleList, CMySelect}
+})
+
+export default class CMyPopupEdit extends Vue {
+ @Prop({ required: true }) public row
+ @Prop({ required: true }) public col
+ @Prop({ required: false, default: false }) public canEdit
+ @Prop({ required: false, default: '' }) public field
+ @Prop({ required: false, default: '' }) public subfield
+
+ public myvalue = ''
+
+ get tools() {
+ return tools
+ }
+
+ get db_fieldsTable() {
+ return fieldsTable
+ }
+ public changeval(newval) {
+ this.$emit('update:row', newval)
+ }
+
+ public mounted() {
+ if ((this.subfield !== '') && (this.subfield !== '')) {
+ if (this.row[this.field] === undefined) {
+ this.row[this.field] = {}
+ this.myvalue = ''
+ } else {
+ this.myvalue = this.row[this.field][this.subfield]
+ }
+ } else {
+ if (this.field !== '')
+ this.myvalue = this.row[this.field]
+ else
+ this.myvalue = this.row
+ }
+ }
+
+ public OpenEdit() {
+ console.log('OpenEdit')
+ this.$emit('show')
+ }
+
+ public SaveValueInt(newVal, valinitial) {
+
+ console.log('SaveValueInt', newVal)
+
+ // Update value in table memory
+ if (this.subfield !== '') {
+ if (this.row[this.field] === undefined)
+ this.row[this.field] = {}
+ this.row[this.field][this.subfield] = newVal
+ } else {
+ if (this.field !== '')
+ this.row[this.field] = newVal
+ else
+ this.row = newVal
+ }
+
+ this.$emit('save', newVal, valinitial)
+ }
+
+ public visuValByType(val, col: IColGridTable, row) {
+ if (col === undefined || row === undefined)
+ return
+
+ // let val = ''
+ // if (col.subfield !== '') {
+ // if (row[col.field] === undefined)
+ // row[col.field] = {}
+ //
+ // val = row[col.field][col.subfield]
+ // } else {
+ // val = row[col.field]
+ // }
+ //
+ if (col.fieldtype === tools.FieldType.date) {
+ if (val === undefined) {
+ return '[]'
+ } else {
+ return tools.getstrDateTime(val)
+ }
+ } else if (col.fieldtype === tools.FieldType.boolean) {
+ return (val) ? this.$t('dialog.yes') : this.$t('dialog.no')
+ } else if (col.fieldtype === tools.FieldType.binary) {
+ if (val === undefined)
+ return '[---]'
+ else
+ return fieldsTable.getArrStrByValueBinary(this, col, val)
+ } else if (col.fieldtype === tools.FieldType.select) {
+ if (val === undefined)
+ return '[---]'
+ else
+ return fieldsTable.getValueByTable(col, val)
+ } else {
+ if (val === undefined)
+ return '[]'
+ else if (val === '') {
+ return '[]'
+ } else {
+ let mystr = tools.firstchars(val, tools.MAX_CHARACTERS)
+ if (val) {
+ if (val.length > tools.MAX_CHARACTERS)
+ mystr += '...'
+ } else {
+ return val
+ }
+ return mystr
+ }
+ }
+ }
+
+ public getclassCol(col) {
+ if (col) {
+ let mycl = (col.disable || !this.canEdit) ? '' : 'colmodif'
+ mycl += (col.fieldtype === tools.FieldType.date) ? ' coldate flex flex-container' : ''
+
+ return mycl
+ } else {
+ return ''
+ }
+ }
+}
diff --git a/src/components/CMyPopupEdit/CMyPopupEdit.vue b/src/components/CMyPopupEdit/CMyPopupEdit.vue
new file mode 100644
index 0000000..587bc8b
--- /dev/null
+++ b/src/components/CMyPopupEdit/CMyPopupEdit.vue
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ visuValByType(myvalue, col, row) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ visuValByType(myvalue, col, row) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/CMyPopupEdit/index.ts b/src/components/CMyPopupEdit/index.ts
new file mode 100644
index 0000000..be462fe
--- /dev/null
+++ b/src/components/CMyPopupEdit/index.ts
@@ -0,0 +1 @@
+export {default as CMyPopupEdit} from './CMyPopupEdit.vue'
diff --git a/src/components/Footer/Footer.ts b/src/components/Footer/Footer.ts
index e809394..efcd5a7 100644
--- a/src/components/Footer/Footer.ts
+++ b/src/components/Footer/Footer.ts
@@ -13,8 +13,10 @@ import { static_data } from '@src/db/static_data'
import Quasar from 'quasar'
import { FormNewsletter } from '../FormNewsletter'
import { IUserState } from '../../model'
+import MixinBase from '../../mixins/mixin-base'
@Component({
+ mixins: [MixinBase],
name: 'Footer',
components: { Logo, FormNewsletter }
})
@@ -54,4 +56,8 @@ export default class Footer extends Vue {
return static_data
}
+ get ChatWhatsapp() {
+ return tools.getHttpForWhatsapp(this.Whatsapp_Cell)
+ }
+
}
diff --git a/src/components/Footer/Footer.vue b/src/components/Footer/Footer.vue
index 0bac19f..b893f9c 100644
--- a/src/components/Footer/Footer.vue
+++ b/src/components/Footer/Footer.vue
@@ -26,7 +26,34 @@
{{$t('homepage.titlecontatti')}}
-
+
+
+ {{ getValDb('MAIN_EMAIL')
+ }}
+
+
+ {{ rec.name }}: {{ rec.phone }}
+
+
+
+ {{rec.email}}
+
+
+
orari per chiamate:
+
+
+
+
-
+
@@ -77,11 +108,12 @@
-
+
-
-
+
+
diff --git a/src/mixins/mixin-base.ts b/src/mixins/mixin-base.ts
new file mode 100644
index 0000000..72975e3
--- /dev/null
+++ b/src/mixins/mixin-base.ts
@@ -0,0 +1,43 @@
+import Vue from 'vue'
+
+import Component from 'vue-class-component'
+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'
+
+// You can declare a mixin as the same style as components.
+@Component
+export default class MixinBase extends Vue {
+ public mythis() {
+ return this
+ }
+
+ get toolsext() {
+ return toolsext
+ }
+
+ get func_tools() {
+ return func_tools
+ }
+
+ get tools() {
+ return tools
+ }
+
+ public getValDb(keystr) {
+ return GlobalStore.getters.getValueSettingsByKey(keystr)
+ }
+ public getarrValDb(keystr) {
+ const myval = GlobalStore.getters.getValueSettingsByKey(keystr)
+ // console.log('myval', myval)
+ if (myval) {
+ const myrec = JSON.parse(myval)
+ // console.log('*************** getarrValDb')
+ // console.table(myrec)
+ return myrec
+ } else {
+ return []
+ }
+ }
+}
diff --git a/src/mixins/mixin-operator.ts b/src/mixins/mixin-operator.ts
new file mode 100644
index 0000000..7aa741c
--- /dev/null
+++ b/src/mixins/mixin-operator.ts
@@ -0,0 +1,30 @@
+import Vue from 'vue'
+
+import Component from 'vue-class-component'
+import { CalendarStore } from '../store/Modules'
+import { UserStore } from '@modules'
+
+@Component
+export default class MixinOperator extends Vue {
+ public getOperators() {
+ return CalendarStore.state.operators
+ }
+
+ public getOperatorByUsername(username) {
+ return CalendarStore.getters.getOperatorByUsername(username)
+ }
+
+ public getImgTeacherByUsername(username) {
+ return `statics/images/` + CalendarStore.getters.getImgTeacherByUsername(username)
+ }
+
+ public getTeacherByUsername(username) {
+ const op = this.getOperatorByUsername(username)
+ if (!!op) {
+ return op.name + ' ' + op.surname
+ } else {
+ return ''
+ }
+ }
+
+}
diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts
index 5164271..1bafb88 100644
--- a/src/store/Modules/GlobalStore.ts
+++ b/src/store/Modules/GlobalStore.ts
@@ -328,12 +328,14 @@ namespace Mutations {
const mylist = Getters.getters.getListByTable(table)
const mykey = fieldsTable.getKeyByTable(table)
- const myrec = mylist.find((event) => event[mykey] === id)
- // console.log('myrec', myrec)
- if (myrec) {
- for (const [key, value] of Object.entries(mydata.fieldsvalue)) {
- console.log('key', value, myrec[key])
- myrec[key] = value
+ if (!!mylist) {
+ const myrec = mylist.find((event) => event[mykey] === id)
+ // console.log('myrec', myrec)
+ if (myrec) {
+ for (const [key, value] of Object.entries(mydata.fieldsvalue)) {
+ console.log('key', value, myrec[key])
+ myrec[key] = value
+ }
}
}
} catch (e) {
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index 4fbd5a9..3e7e1e7 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -1379,7 +1379,7 @@ export const tools = {
notify: par.param2 === true ? '1' : '0'
}).then((ris) => {
if (ris) {
- tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param1.title + '"')
+ tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param3 + '"')
if (myself.bookEventpage)
myself.bookEventpage.show = false
} else
@@ -2476,7 +2476,8 @@ export const tools = {
console.log('CancelBookingEvent ', eventparam)
tools.askConfirm(mythis.$q, translate('cal.titlebooking'), translate('cal.cancelbooking') + ' ' + tools.gettextevent(mythis, eventparam) + '?', translate('dialog.yes'), translate('dialog.no'), mythis, '', lists.MenuAction.DELETE, 0, {
param1: bookeventid,
- param2: notify
+ param2: notify,
+ param3: eventparam.title
})
}
,
@@ -2607,8 +2608,25 @@ export const tools = {
const duration = 500
console.log('target', target, 'offset', offset, 'duration', duration)
setScrollPosition(target, offset, duration)
- }
+ },
+ getCellForWhatsapp(numbercell) {
+ let mynum = numbercell.replace(/\-/g, '')
+ const intcode = GlobalStore.getters.getValueSettingsByKey('INT_CODE')
+ if (numbercell.substring(0, 1) !== '+')
+ mynum = intcode + mynum
+ else
+ mynum = mynum.substring(1)
+ return mynum
+ },
+
+ getHttpForWhatsapp(numbercell) {
+ const mynum = this.getCellForWhatsapp(numbercell)
+ if (mynum)
+ return 'https://wa.me/' + mynum
+ else
+ return ''
+ }
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {