Merge pull request #29 from paoloar77/Booking_Events

Booking events
This commit is contained in:
Paolo Arena
2019-10-20 22:45:57 +02:00
committed by GitHub
42 changed files with 1365 additions and 379 deletions

View File

@@ -65,7 +65,7 @@ module.exports = function (ctx) {
store: 'src/store/index.ts'
},
// app plugins (/src/plugins)
boot: ['vue-i18n', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'vue-idb', 'dragula', 'guard'],
boot: ['vue-i18n', 'vue-meta', 'axios', 'vee-validate', 'myconfig', 'local-storage', 'error-handler', 'globalroutines', 'vue-idb', 'dragula', 'guard'],
css: [
'app.styl'
],

View File

@@ -27,12 +27,10 @@ export default class App extends Vue {
public meta() {
return {
keywords: { name: 'keywords', content: 'WebSite' },
// meta tags
meta: {
keywords: { name: 'keywords', content: 'MyKeywords' },
mykey: { name: 'mykey', content: 'Key 1' }
}
title: this.$t('msg.myAppName'),
keywords: [{ name: 'keywords', content: 'associazione shen, centro olistico lugo' },
{ name: 'description', content: this.$t('msg.myAppDescription') }]
// equiv: { 'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8' }
}
}

6
src/boot/vue-meta.ts Normal file
View File

@@ -0,0 +1,6 @@
import Component from 'vue-class-component'
// Register the meta hook
Component.registerHooks([
'meta'
])

View File

@@ -4,16 +4,16 @@ export class Patterns {
/**
* Alphanumeric, spaces and dashes allowed. Min 2 characters length.
*/
public static DisplayName: RegExp = /^[0-9a-zA-Z\s\-]{2,}/i;
public static DisplayName: RegExp = /^[0-9a-zA-Z\s\-]{2,}/i
/**
* Same pattern used by JQuery userName validation
* Same pattern used by JQuery userName validation
*/
public static Email: RegExp = /^((“[\w-\s]+”)|([\w-]+(?:\.[\w-]+)*)|(“[\w-\s]+”)([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}[0-9];{1,2})\]?$)/i;
public static Email: RegExp = /^((“[\w-\s]+”)|([\w-]+(?:\.[\w-]+)*)|(“[\w-\s]+”)([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}[0-9];{1,2})\]?$)/i
/**
* 6 to 20 characters string with at least one digit, one upper case letter, one lower case letter and one special symbol
*/
public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})/i;
public static Password: RegExp = /^((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%!\-]).{6,20})/i
}
}

View File

@@ -1,7 +1,13 @@
export const shared_consts = {
Permissions: {
Normal: 0,
Admin: 1,
Manager: 2,
},
fieldsUserToChange() {
return ['username', 'email', 'name', 'surname', 'perm', 'date_reg']
return ['username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email']
}
}

View File

@@ -26,6 +26,7 @@ import router from '@router'
import { static_data } from '@src/db/static_data'
import translate from '@src/globalroutines/util'
import { lists } from '../../store/Modules/lists'
import { GlobalStore } from '../../store/Modules'
@Component({
name: 'CEventsCalendar',
@@ -348,8 +349,8 @@ export default class CEventsCalendar extends Vue {
}
public getEndTime(eventparam) {
let endTime = new Date(eventparam.date + ' ' + eventparam.time + ':00')
endTime = date.addToDate(endTime, { minutes: eventparam.duration })
let endTime = new Date(eventparam.date)
endTime = date.addToDate(endTime, { minutes: eventparam.dur })
endTime = date.formatDate(endTime, 'HH:mm')
return endTime
}
@@ -394,7 +395,9 @@ export default class CEventsCalendar extends Vue {
public addBookEventMenu(eventparam) {
if (!UserStore.state.isLogged || !UserStore.state.verified_email) {
this.$router.push('/signin')
// Visu right Toolbar to make SignIn
GlobalStore.state.RightDrawerOpen = true
// this.$router.push('/signin')
} else {
console.log('addBookEventMenu')
this.resetForm()
@@ -418,17 +421,17 @@ export default class CEventsCalendar extends Vue {
this.resetForm()
this.contextDay = { ...eventparam }
let timestamp
if (eventparam.time) {
timestamp = eventparam.date + ' ' + eventparam.time
if (eventparam.withtime) {
timestamp = eventparam.date
const startTime = new Date(timestamp)
const endTime = date.addToDate(startTime, { minutes: eventparam.duration })
const endTime = date.addToDate(startTime, { minutes: eventparam.dur })
this.eventForm.dateTimeStart = this.formatDate(startTime) + ' ' + this.formatTime(startTime) // endTime.toString()
this.eventForm.dateTimeEnd = this.formatDate(endTime) + ' ' + this.formatTime(endTime) // endTime.toString()
} else {
timestamp = eventparam.date
this.eventForm.dateTimeStart = timestamp
}
this.eventForm.allDay = !eventparam.time
this.eventForm.allDay = !eventparam.withtime
this.eventForm.bgcolor = eventparam.bgcolor
this.eventForm.icon = eventparam.icon
this.eventForm.title = eventparam.title
@@ -512,9 +515,9 @@ export default class CEventsCalendar extends Vue {
// an add
}
const data: IEvents = {
time: '',
duration: 0,
duration2: 0,
withtime: false,
dur: 0,
dur2: 0,
title: form.title,
details: form.details,
icon: form.icon,
@@ -523,8 +526,8 @@ export default class CEventsCalendar extends Vue {
}
if (form.allDay === false) {
// get time into separate var
data.time = String(form.dateTimeStart).slice(11, 16)
data.duration = self.getDuration(form.dateTimeStart, form.dateTimeEnd, 'minutes')
// data.time = String(form.dateTimeStart).slice(11, 16)
data.dur = self.getDuration(form.dateTimeStart, form.dateTimeEnd, 'minutes')
}
if (update === true) {
const index = self.findEventIndex(self.contextDay)
@@ -648,7 +651,7 @@ export default class CEventsCalendar extends Vue {
public handleSwipe({ evt, ...info }) {
if (this.dragging === false) {
if (info.duration >= 30 && this.ignoreNextSwipe === false) {
if (info.dur >= 30 && this.ignoreNextSwipe === false) {
if (info.direction === 'right') {
this.calendarPrev()
} else if (info.direction === 'left') {
@@ -682,7 +685,8 @@ export default class CEventsCalendar extends Vue {
return this.draggedEvent.date !== day.date
} else if (type === 'interval') {
stopAndPrevent(ev)
return this.draggedEvent.date !== day.date && this.draggedEvent.time !== day.time
// return this.draggedEvent.date !== day.date && this.draggedEvent.time !== day.time
return this.draggedEvent.date !== day.date
}
}
@@ -694,7 +698,7 @@ export default class CEventsCalendar extends Vue {
this.draggedEvent.side = void 0
} else if (type === 'interval') {
this.draggedEvent.date = day.date
this.draggedEvent.time = day.time
// this.draggedEvent.time = day.time
this.draggedEvent.side = void 0
}
}
@@ -721,6 +725,16 @@ export default class CEventsCalendar extends Vue {
return this.dateFormatter.format(mydate)
}
public getTeacherName(teacherusername) {
const op = CalendarStore.state.operators.find((myop) => myop.username === teacherusername)
return (op) ? `${op.name} ${op.surname}` : ''
}
public getTeacherImg(teacherusername) {
const op = CalendarStore.state.operators.find((myop) => myop.username === teacherusername)
return (op) ? op.img : 'avatar/noimage.png'
}
public badgeClasses(eventparam, type) {
const cssColor = tools.isCssColor(eventparam.bgcolor)
const isHeader = type === 'header'
@@ -740,10 +754,10 @@ export default class CEventsCalendar extends Vue {
s.color = colors.luminosity(eventparam.bgcolor) > 0.5 ? 'black' : 'white'
}
if (timeStartPos) {
s.top = timeStartPos(eventparam.time) + 'px'
s.top = timeStartPos(tools.getstrTime(eventparam.date)) + 'px'
}
if (timeDurationHeight) {
s.height = timeDurationHeight(eventparam.duration) + 'px'
s.height = timeDurationHeight(eventparam.dur) + 'px'
}
s['align-items'] = 'flex-start'
return s
@@ -783,7 +797,8 @@ export default class CEventsCalendar extends Vue {
for (let i = 0; i < CalendarStore.state.eventlist.length; ++i) {
// console.log(' ciclo i = ', i, CalendarStore.state.eventlist[i])
const dateEvent = new Date(CalendarStore.state.eventlist[i].date + ' 00:00:00')
// const dateEvent = new Date(CalendarStore.state.eventlist[i].date + ' 00:00:00')
const dateEvent = new Date(CalendarStore.state.eventlist[i].date)
if (dateEvent >= datenow) {
eventsloc.push(CalendarStore.state.eventlist[i])
@@ -799,15 +814,16 @@ export default class CEventsCalendar extends Vue {
for (let i = 0; i < CalendarStore.state.eventlist.length; ++i) {
let added = false
// console.log(' ciclo i = ', i, CalendarStore.state.eventlist[i])
if (CalendarStore.state.eventlist[i].date === dt) {
if (CalendarStore.state.eventlist[i].time) {
if (tools.getstrYYMMDDDate(CalendarStore.state.eventlist[i].date) === dt) {
// if (CalendarStore.state.eventlist[i].time) {
if (eventsloc.length > 0) {
// check for overlapping times
const startTime = new Date(CalendarStore.state.eventlist[i].date + ' ' + CalendarStore.state.eventlist[i].time)
const endTime = date.addToDate(startTime, { minutes: CalendarStore.state.eventlist[i].duration })
// const startTime = new Date(CalendarStore.state.eventlist[i].date + ' ' + CalendarStore.state.eventlist[i].time)
const startTime = new Date(CalendarStore.state.eventlist[i].date)
const endTime = date.addToDate(startTime, { minutes: CalendarStore.state.eventlist[i].dur })
for (let j = 0; j < eventsloc.length; ++j) {
const startTime2 = new Date(eventsloc[j].date + ' ' + eventsloc[j].time)
const endTime2 = date.addToDate(startTime2, { minutes: eventsloc[j].duration2 })
const startTime2 = new Date(eventsloc[j].date)
const endTime2 = date.addToDate(startTime2, { minutes: eventsloc[j].dur2 })
if (date.isBetweenDates(startTime, startTime2, endTime2) || date.isBetweenDates(endTime, startTime2, endTime2)) {
eventsloc[j].side = 'left'
// CalendarStore.state.eventlist[i].side = 'right'
@@ -817,14 +833,15 @@ export default class CEventsCalendar extends Vue {
}
}
}
}
// }
if (!added) {
// CalendarStore.state.eventlist[i].side = void 0
eventsloc.push(CalendarStore.state.eventlist[i])
}
} else if (CalendarStore.state.eventlist[i].days) {
// check for overlapping dates
const startDate = new Date(CalendarStore.state.eventlist[i].date + ' 00:00:00')
// const startDate = new Date(CalendarStore.state.eventlist[i].date + ' 00:00:00')
const startDate = new Date(CalendarStore.state.eventlist[i].date)
const endDate = date.addToDate(startDate, { days: CalendarStore.state.eventlist[i].days })
if (date.isBetweenDates(dt, startDate, endDate)) {
eventsloc.push(CalendarStore.state.eventlist[i])
@@ -858,4 +875,18 @@ export default class CEventsCalendar extends Vue {
get mythis() {
return this
}
public isEventEnabled(myevent) {
// check if event is in the past
const datenow = tools.addDays(tools.getDateNow(), -1)
// let dateEvent = new Date(myevent.date + ' 00:00:00')
let dateEvent = new Date(myevent.date)
if (myevent.days) {
dateEvent = tools.addDays(dateEvent, myevent.days)
}
return (dateEvent >= datenow)
}
}

View File

@@ -1,10 +1,5 @@
$t('
<template>
<div class="landing">
<CTitle imgbackground="../../statics/images/calendario_eventi.jpg"
headtitle="Calendario Eventi" sizes="max-height: 120px"></CTitle>
<q-page class="column">
<!-- display an myevent -->
<q-dialog v-model="displayEvent">
@@ -37,16 +32,16 @@ $t('
<span class="cal__teacher-content">
<q-chip>
<q-avatar>
<img :src="`../../statics/images/avatar/` + myevent.avatar">
<img :src="`../../statics/images/` + getTeacherImg(myevent.teacher)">
</q-avatar>
<span class="cal__teacher-content">{{myevent.teacher}}</span>
<span class="cal__teacher-content">{{getTeacherName(myevent.teacher)}}</span>
</q-chip>
<span v-if="myevent.avatar2 && myevent.teacher2" class="margin_avatar2"></span>
<q-chip v-if="myevent.avatar2 && myevent.teacher2">
<span v-if="getTeacherImg(myevent.teacher2) && myevent.teacher2" class="margin_avatar2"></span>
<q-chip v-if="getTeacherImg(myevent.teacher2) && myevent.teacher2">
<q-avatar>
<img :src="`../../statics/images/avatar/` + myevent.avatar2">
<img :src="`../../statics/images/` + getTeacherImg(myevent.teacher2)">
</q-avatar>
<span class="cal__teacher-content">{{myevent.teacher2}}</span>
<span class="cal__teacher-content">{{getTeacherName(myevent.teacher2)}}</span>
</q-chip>
</span>
</div>
@@ -73,10 +68,10 @@ $t('
<span class="cal__hours-content">{{ myevent.infoextra }} </span>
</span>
<span v-else>
<span v-if="myevent.time" class="cal__hours">
<span v-if="myevent.withtime" class="cal__hours">
-
<span class="cal__hours-title">{{$t('cal.hours')}}: </span>
<span class="cal__hours-content">{{$t('cal.starttime')}} {{ myevent.time }} {{$t('cal.endtime')}}: {{
<span class="cal__hours-content">{{$t('cal.starttime')}} {{ tools.getstrTime(myevent.date) }} {{$t('cal.endtime')}}: {{
getEndTime(myevent) }}</span>
</span>
</span>
@@ -90,7 +85,7 @@ $t('
</q-card-section>
<q-card-actions align="right">
<q-btn rounded v-if="!myevent.nobookable && static_data.functionality.BOOKING_EVENTS"
color="primary" @click="addBookEventMenu(myevent)"
color="primary" @click="addBookEventMenu(myevent)" :disable="!isEventEnabled(myevent)"
:label="$t('cal.booking')">
</q-btn>
<q-btn v-else :label="$t('dialog.ok')" color="primary" v-close-popup></q-btn>
@@ -247,10 +242,10 @@ $t('
<span class="cal__hours-content">{{ myevent.infoextra }} </span>
</span>
<span v-else>
<span v-if="myevent.time" class="cal__hours">
<span v-if="myevent.withtime" class="cal__hours">
-
<span class="cal__hours-title">{{$t('cal.hours')}}: </span>
<span class="cal__hours-content"><span v-if="!tools.isMobile()">{{$t('cal.starttime')}} </span>{{ myevent.time }} <span v-if="!tools.isMobile()">{{$t('cal.endtime')}} </span><span v-else> - </span> {{
<span class="cal__hours-content"><span v-if="!tools.isMobile()">{{$t('cal.starttime')}} </span>{{ tools.getstrTime(myevent.date) }} <span v-if="!tools.isMobile()">{{$t('cal.endtime')}} </span><span v-else> - </span> {{
getEndTime(myevent) }}</span>
</span>
</span>
@@ -258,7 +253,7 @@ $t('
<div class="q-pa-xs">
<q-card class="text-white windowcol">
<q-card-section>
<q-checkbox :disable="(bookEventpage.bookedevent && bookEventpage.bookedevent.booked) || (bookEventpage.bookedevent === undefined)" style="color: black;" v-model="bookEventForm.booked" :label="$t('cal.bookingtextdefault')" color="green">
<q-checkbox :disable="((bookEventpage.bookedevent && bookEventpage.bookedevent.booked) || (bookEventpage.bookedevent === undefined)) || !isEventEnabled(myevent)" style="color: black;" v-model="bookEventForm.booked" :label="$t('cal.bookingtextdefault')" color="green">
</q-checkbox>
<div v-if="bookEventForm.booked" class="q-gutter-md centermydiv" style="max-width: 150px; margin-top:10px;">
@@ -391,7 +386,7 @@ $t('
<div class="row justify-center">
<template v-for="(event, index) in eventsMap[date]">
<q-badge
v-if="!event.time"
v-if="!event.withtime"
:key="index"
style="width: 100%; cursor: pointer;"
class="ellipsis"
@@ -421,7 +416,7 @@ $t('
<template #day-body="{ date, timeStartPos, timeDurationHeight }">
<template v-for="(event, index) in getEvents(date)">
<q-badge
v-if="event.time"
v-if="event.withtime"
:key="index"
class="my-event justify-center ellipsis"
:class="badgeClasses(event, 'body')"
@@ -468,8 +463,8 @@ $t('
<div v-else>
<div v-if="event.date" class="listaev__date">
{{func_tools.getDateStr(event.date)}}
<span v-if="event.time" class="cal__hours-content"> - {{ event.time }} <span
v-if="event.duration">- {{ getEndTime(event) }}</span></span>
<span v-if="event.withtime" class="cal__hours-content"> - {{ tools.getstrTime(event.date) }} <span
v-if="event.dur">- {{ getEndTime(event) }}</span></span>
<span v-if="event.days > 1"><br/>{{func_tools.getDateStr(tools.addDays(event.date, event.days - 1))}}</span>
</div>
</div>
@@ -511,16 +506,16 @@ $t('
<q-chip>
<q-avatar>
<img :src="`../../statics/images/avatar/` + event.avatar">
<img :src="`../../statics/images/` + getTeacherImg(event.teacher)">
</q-avatar>
<span class="cal__teacher-content">{{event.teacher}}</span>
<span class="cal__teacher-content">{{getTeacherName(event.teacher)}}</span>
</q-chip>
<span v-if="event.avatar2" class="margin_avatar2"></span>
<q-chip v-if="event.avatar2 && event.teacher2">
<span v-if="getTeacherImg(event.teacher2)" class="margin_avatar2"></span>
<q-chip v-if="getTeacherImg(event.teacher2) && event.teacher2">
<q-avatar>
<img :src="`../../statics/images/avatar/` + event.avatar2">
<img :src="`../../statics/images/` + getTeacherImg(event.teacher2)">
</q-avatar>
<span class="cal__teacher-content">{{event.teacher2}}</span>
<span class="cal__teacher-content">{{getTeacherName(event.teacher2)}}</span>
</q-chip>
<span v-if="event.where" class="">
@@ -550,7 +545,7 @@ $t('
<q-btn rounded outline
v-if="!event.nobookable && !isAlreadyBooked(event) && static_data.functionality.BOOKING_EVENTS"
color="primary" @click="addBookEventMenu(event)"
:label="$t('cal.booking')">
:label="$t('cal.booking')" :disable="!isEventEnabled(event)">
</q-btn>
<q-btn rounded outline
v-if="!event.nobookable && isAlreadyBooked(event) && static_data.functionality.BOOKING_EVENTS"

View File

@@ -0,0 +1,3 @@
.colmodif {
cursor: pointer;
}

View File

@@ -1,37 +1,68 @@
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import { UserStore } from '../../store/Modules/index'
import { GlobalStore, UserStore } from '../../store/Modules/index'
import { tools } from '../../store/Modules/tools'
import { shared_consts } from '../../common/shared_vuejs'
import { ICategory } from '../../model'
import { ICategory, IColGridTable, ITableRec } from '../../model'
import { CTodo } from '../todos/CTodo'
import { SingleProject } from '../projects/SingleProject'
import { lists } from '../../store/Modules/lists'
@Component({
})
@Component({})
export default class CGridTableRec extends Vue {
@Prop({required: true}) public mytitle: string
@Prop({required: true}) public mylist: any[]
@Prop({required: true}) public mycolumns: any[]
@Prop({required: true}) public colkey: string
@Prop({ required: false }) public prop_mytable: string
@Prop({ required: true }) public prop_mytitle: string
@Prop({ required: false, default: [] }) public prop_mycolumns: any[]
@Prop({ required: false, default: '' }) public prop_colkey: string
@Prop({ required: false, default: '' }) public nodataLabel: string
@Prop({ required: false, default: '' }) public noresultLabel: string
@Prop({ required: false, default: null }) public tablesList: ITableRec[]
public mytable: string
public mytitle: string
public mycolumns: any[]
public colkey: string
public tablesel: string = ''
public $q
public $t
public loading: boolean = false
public paginationControl: {
public pagination: {
sortBy: string,
descending: boolean
rowsNumber: number
page: number,
rowsPerPage: number // specifying this determines pagination is server-side
} = { page: 1, rowsPerPage: 10 }
} = { sortBy: '', descending: false, page: 1, rowsNumber: 10, rowsPerPage: 10 }
public serverData: any [] = []
public spinner_visible: boolean = false
public idsel: string = ''
public colsel: string = ''
public valPrec: string = ''
public separator: 'horizontal'
public filter: string = ''
public selected: any[] = []
public selected: any
public dark: boolean = true
public funcActivated = []
public returnedData
public returnedCount
public colVisib: any[] = []
public colExtra: any[] = []
get canEdit() {
return this.funcActivated.includes(lists.MenuAction.CAN_EDIT_TABLE)
}
get lists() {
return lists
}
get tableClass() {
if (this.dark) {
@@ -40,28 +71,329 @@ export default class CGridTableRec extends Vue {
}
public selItem(item, colsel) {
console.log('item', item)
// console.log('item', item)
this.selected = item
this.idsel = item._id
this.colsel = colsel
console.log('this.idsel', this.idsel)
// console.log('this.idsel', this.idsel)
}
public undoVal() {
console.log('undoVal', 'colsel', this.colsel, 'valprec', this.valPrec, 'this.colkey', this.colkey, 'this.selected', this.selected)
console.table(this.serverData)
if (this.colsel)
this.selected[this.colsel] = this.valPrec
// this.serverData[this.colsel] = this.valPrec
}
public SaveValue(newVal, valinitial) {
console.log('SaveValue', newVal, 'selected', this.selected)
const mydata = {}
const mydata = {
// colkey: this.colkey,
id: this.idsel,
table: this.mytable,
fieldsvalue: {}
}
mydata[this.colsel] = newVal
mydata[this.colkey] = this.idsel
mydata.fieldsvalue[this.colsel] = newVal
console.log('this.idsel', this.idsel, 'this.colsel', this.colsel)
console.table(mydata)
this.$emit('save', mydata)
this.valPrec = valinitial
// console.log('this.idsel', this.idsel, 'this.colsel', this.colsel)
// console.table(mydata)
this.saveFieldValue(mydata)
}
public created() {
// this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }]
this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }]
this.mytable = this.prop_mytable
this.mytitle = this.prop_mytitle
this.mycolumns = this.prop_mycolumns
this.colkey = this.prop_colkey
this.changeTable(false)
}
public updatedcol() {
if (this.mycolumns) {
this.colVisib = []
this.colExtra = []
this.mycolumns.forEach((elem) => {
if (elem.field !== tools.NOFIELD)
this.colVisib.push(elem.field)
if (elem.visible && elem.field === tools.NOFIELD)
this.colExtra.push(elem.name)
})
}
}
get getrows() {
return this.pagination.rowsNumber
}
public onRequest(props) {
const { page, rowsPerPage, rowsNumber, sortBy, descending } = props.pagination
const filter = props.filter
if (!this.mytable)
return
this.loading = true
this.spinner_visible = true
// update rowsCount with appropriate value
// get all rows if "All" (0) is selected
const fetchCount = rowsPerPage === 0 ? rowsNumber : rowsPerPage
// calculate starting row of data
const startRow = (page - 1) * rowsPerPage
const endRow = startRow + fetchCount
// fetch data from "server"
this.fetchFromServer(startRow, endRow, filter, sortBy, descending).then((ris) => {
this.pagination.rowsNumber = this.getRowsNumberCount(filter)
// clear out existing data and add new
if (this.returnedData === []) {
this.serverData = []
} else {
if (this.serverData.length > 0)
this.serverData.splice(0, this.serverData.length, ...this.returnedData)
else
this.serverData = [...this.returnedData]
}
// don't forget to update local pagination object
this.pagination.page = page
this.pagination.rowsPerPage = rowsPerPage
this.pagination.sortBy = sortBy
this.pagination.descending = descending
// ...and turn of loading indicator
this.loading = false
this.spinner_visible = false
})
}
// emulate ajax call
// SELECT * FROM ... WHERE...LIMIT...
public async fetchFromServer(startRow, endRow, filter, sortBy, descending) {
let myobj = null
if (sortBy) {
myobj = {}
if (descending)
myobj[sortBy] = -1
else
myobj[sortBy] = 1
}
const params = {
table: this.mytable,
startRow,
endRow,
filter,
sortBy: myobj,
descending
}
const data = await GlobalStore.actions.loadTable(params)
if (data) {
this.returnedData = data.rows
this.returnedCount = data.count
} else {
this.returnedData = []
this.returnedCount = 0
}
return true
// if (!filter) {
// 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)) {
// // get a different row, until one is found
// continue
// }
// ++found
// if (found >= startRow) {
// data.push(row)
// ++items
// }
// }
// }
// handle sortBy
// if (sortBy) {
// data.sort((a, b) => {
// let x = descending ? b : a
// let y = descending ? a : b
// if (sortBy === 'desc') {
// // string sort
// return x[sortBy] > y[sortBy] ? 1 : x[sortBy] < y[sortBy] ? -1 : 0
// }
// else {
// // numeric sort
// return parseFloat(x[sortBy]) - parseFloat(y[sortBy])
// }
// })
// }
}
// emulate 'SELECT count(*) FROM ...WHERE...'
public getRowsNumberCount(filter) {
// if (!filter) {
// return this.original.length
// }
// let count = 0
// this.original.forEach((treat) => {
// if (treat['name'].includes(filter)) {
// ++count
// }
// })
// return count
return this.returnedCount
}
public getclassCol(col) {
return (col.disable || !this.canEdit) ? '' : 'colmodif'
}
public async createNewRecord() {
this.loading = true
const mydata = {
table: this.mytable,
data: {}
}
const data = await GlobalStore.actions.saveTable(mydata)
this.serverData.push(data)
this.pagination.rowsNumber++
this.loading = false
}
public saveFieldValue(mydata) {
console.log('saveFieldValue', mydata)
// Save on Server
GlobalStore.actions.saveFieldValue(mydata).then((esito) => {
if (esito) {
tools.showPositiveNotif(this.$q, this.$t('db.recupdated'))
} else {
tools.showNegativeNotif(this.$q, this.$t('db.recfailed'))
this.undoVal()
}
})
}
public mounted() {
this.changeTable(false)
}
public refresh() {
this.onRequest({
pagination: this.pagination,
filter: undefined
})
}
public clickFunz(item, col: IColGridTable) {
if (col.action) {
tools.ActionRecTable(this, col.action, this.mytable, item._id, item)
}
}
public ActionAfterYes(action, item, data) {
if (action === lists.MenuAction.DELETE_RECTABLE) {
if (this.serverData.length > 0)
this.serverData.splice(this.serverData.indexOf(item), 1)
} else if (action === lists.MenuAction.DUPLICATE_RECTABLE) {
// Add record duplicated
this.serverData.push(data)
}
}
public visCol(col) {
if (col.visuonlyEditVal) {
if (this.canEdit) {
return col.visuonlyEditVal
} else {
return false
}
} else {
return true
}
}
public visuValByType(col, val) {
if (col.fieldtype === 'date') {
if (val === undefined) {
return '[]'
} else {
return tools.getstrDateTime(val)
}
} else {
if (val === undefined) {
return '[]'
} else {
let mystr = tools.firstchars(val, tools.MAX_CHARACTERS)
if (val.length > tools.MAX_CHARACTERS)
mystr += '...'
return mystr
}
}
}
public changeTable(mysel) {
// console.log('changeTable')
let mytab = null
if (this.tablesList) {
if (!this.tablesel) {
this.tablesel = this.tablesList[1].value
}
mytab = this.tablesList.find((rec) => rec.value === this.tablesel)
}
if (mytab) {
this.mytitle = mytab.label
this.colkey = mytab.colkey
this.mycolumns = [...mytab.columns]
}
this.mycolumns.forEach((rec: IColGridTable) => {
if (rec.label_trans)
rec.label = this.$t(rec.label_trans)
})
if (mytab) {
this.mytable = mytab.value
}
this.updatedcol()
this.refresh()
}
}

View File

@@ -1,32 +1,142 @@
<template>
<div class="q-pa-sm">
<q-table
:title="mytitle"
:data="serverData"
:columns="mycolumns"
:filter="filter"
:pagination.sync="paginationControl"
:row-key="colkey">
:pagination.sync="pagination"
:row-key="colkey"
:loading="loading"
@request="onRequest"
binary-state-sort
:visible-columns="colVisib"
:no-data-label="nodataLabel"
:no-results-label="noresultLabel"
>
<!--<template v-slot:top="props">-->
<div class="col-2 q-table__title">{{ mytitle }}</div>
<q-space/>
<template v-slot:header="props">
<q-tr :props="props">
<q-th
v-for="col in props.cols"
v-if="colVisib.includes(col.field)"
:key="col.name"
:props="props"
class="text-italic text-weight-bold"
>
{{ col.label }}
</q-th>
</q-tr>
</template>
<q-tr slot="body" slot-scope="props" :props="props">
<template v-slot:top="props">
<div class="col-2 q-table__title">{{ mytitle }}</div>
<q-td v-for="col in mycolumns" :key="col.name" :props="props">
<div v-if="col.action">
<q-btn flat round color="red" icon="fas fa-trash-alt"
@click="col.clickfunz"></q-btn>
<!--<p style="color:red"> Rows: {{ getrows }}</p>-->
<q-toggle v-if="mytable" v-model="funcActivated" :val="lists.MenuAction.CAN_EDIT_TABLE" class="q-mx-sm"
:label="$t('grid.editvalues')"></q-toggle>
<q-btn v-if="mytable" label="Refresh" color="primary" @click="refresh" class="q-mx-sm"></q-btn>
<q-btn v-if="mytable" flat dense color="primary" :disable="loading" label="Add Record"
@click="createNewRecord"></q-btn>
<q-space/>
<!--<q-toggle v-for="(mycol, index) in mycolumns" v-model="colVisib" :val="rec.field" :label="mycol.label"></q-toggle>-->
<q-select
v-if="mytable"
v-model="colVisib"
multiple
borderless
dense
options-dense
:display-value="$t('grid.columns')"
emit-value
map-options
:options="mycolumns"
option-value="name"
style="min-width: 150px">
</q-select>
<q-select v-if="tablesList"
v-model="tablesel"
rounded
outlined
dense
:options="tablesList"
:display-value="mytitle"
emit-value
@input="changeTable"
>
</q-select>
<q-inner-loading :showing="spinner_visible">
<q-spinner-gears size="50px" color="primary"/>
</q-inner-loading>
</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)">
<div v-if="col.fieldtype === 'date'">
<div style="max-width: 250px; min-width: 200px">
<q-input dense v-model="props.row[col.name]">
<template v-slot:prepend>
<q-icon name="event" class="cursor-pointer">
<q-popup-edit transition-show="scale" transition-hide="scale" v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col.field)">
<q-date v-model="props.row[col.name]" mask="YYYY-MM-DD HH:mm" />
</q-popup-edit>
<!--<q-popup-proxy transition-show="scale" transition-hide="scale">-->
<!--<q-date v-model="props.row[col.name]" mask="YYYY-MM-DD HH:mm" />-->
<!--</q-popup-proxy>-->
</q-icon>
</template>
<template v-slot:append>
<q-icon name="access_time" class="cursor-pointer">
<q-popup-edit transition-show="scale" transition-hide="scale" v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col.field)">
<q-time v-model="props.row[col.name]" mask="YYYY-MM-DD HH:mm" format24h />
</q-popup-edit>
<!--<q-popup-proxy transition-show="scale" transition-hide="scale">-->
<!--<q-time v-model="props.row[col.name]" mask="YYYY-MM-DD HH:mm" format24h />-->
<!--</q-popup-proxy>-->
</q-icon>
</template>
</q-input>
</div>
</div>
<div v-if="col.fieldtype === 'boolean'">
<q-checkbox v-model="props.row[col.name])" label="" />
</div>
<div v-else>
{{ props.row[col.name] }}
<q-popup-edit v-model="props.row[col.name]" :disable="col.disable" :title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col.field)">
<q-input v-model="props.row[col.name]"/>
<div :class="getclassCol(col)">
{{ visuValByType(col, props.row[col.name]) }}
<q-popup-edit v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col.field)">
<q-input v-model="props.row[col.name]"/>
</q-popup-edit>
</q-popup-edit>
</div>
</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)">
<q-btn flat round color="red" :icon="col.icon" size="sm"
@click="clickFunz(props.row, col)"></q-btn>
</div>
</q-td>
</q-tr>
@@ -38,7 +148,7 @@
class="q-ml-md">
</q-btn>
-->
<!--</template>-->
<!---->
</q-table>
</div>
</template>

View File

@@ -31,31 +31,8 @@
}
}
@media (max-width: 1600px) {
.myclimg {
max-height: 550px !important;
width: 100%;
}
}
@media (max-width: 1000px) {
.myclimg {
max-height: 450px !important;
width: 100%;
}
}
@media (max-width: 800px) {
.myclimg {
max-height: 400px !important;
}
}
@media (max-width: 400px) {
.myclimg {
// height: inherit !important;
}
// PER VERSIONE MOBILE
.landing > section.padding_testo {

View File

@@ -31,30 +31,6 @@
}
}
@media (max-width: 2500px) {
.myclimg {
height: 550px !important;
}
}
@media (max-width: 1600px) {
.myclimg {
height: 550px !important;
}
}
@media (max-width: 1000px) {
.myclimg {
height: 450px !important;
}
}
@media (max-width: 800px) {
.myclimg {
height: 400px !important;
}
}
@media (max-width: 718px) {
// PER VERSIONE MOBILE

View File

@@ -0,0 +1,57 @@
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import { GlobalStore, UserStore } from '@store'
import { Footer } from '../../components/Footer'
// import VueScrollReveal from 'vue-scroll-reveal'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { Screen } from 'quasar'
import { CImgTitle } from '../../components/CImgTitle/index'
import { CTitle } from '../../components/CTitle/index'
// Vue.use(VueScrollReveal, {
// class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides.
// duration: 1200,
// scale: 0.95,
// distance: '10px',
// rotate: {
// x: 0,
// y: 0,
// z: 0
// }
// // mobile: true
// })
@Component({
name: 'CMyPage',
components: { Footer, CImgTitle, CTitle }
})
export default class CMyPage extends Vue {
@Prop({ required: true, default: '' }) public title: string
@Prop({ required: true, default: '' }) public keywords: string
@Prop({ required: true, default: '' }) public description: string
@Prop({ required: false, default: '' }) public img: string
@Prop({ required: false, default: '' }) public imgbackground: string
@Prop({ required: false, default: '' }) public sizes: string
public $t
public $q
public meta() {
return {
title: this.$t('msg.myAppName'),
titleTemplate: (title) => `${this.title} - ${this.$t('msg.myAppName')}`,
meta: {
keywords: { name: 'keywords', content: this.keywords },
description: { name: 'description', content: this.description },
equiv: { 'http-equiv': 'Content-Type', 'content': 'text/html; charset=UTF-8' }
}
}
}
public mounted() {
// console.log('CMYPage title=', this.title)
// console.table(this.meta)
}
}

View File

@@ -0,0 +1,19 @@
<template>
<div>
<CTitle v-if="imgbackground" :imgbackground="imgbackground"
:headtitle="title" :sizes="sizes"></CTitle>
<div v-if="!imgbackground">
<CImgTitle v-if="img" :src="img" :title="title">
</CImgTitle>
</div>
<slot></slot>
<Footer></Footer>
</div>
</template>
<script lang="ts" src="./CMyPage.ts">
</script>
<style lang="scss" scoped>
@import './CMyPage.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CMyPage} from './CMyPage.vue'

View File

@@ -1,36 +0,0 @@
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import { GlobalStore, UserStore } from '@store'
import { Logo } from '../../components/logo'
import { Footer } from '../../components/Footer'
import VueScrollReveal from 'vue-scroll-reveal'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import { Screen } from 'quasar'
Vue.use(VueScrollReveal, {
class: 'v-scroll-reveal', // A CSS class applied to elements with the v-scroll-reveal directive; useful for animation overrides.
duration: 1200,
scale: 0.95,
distance: '10px',
rotate: {
x: 0,
y: 0,
z: 0
}
// mobile: true
})
@Component({
name: 'CPage',
components: { Logo, Footer }
})
export default class CPage extends Vue {
@Prop({ required: true }) public imghead: string = ''
@Prop({ required: true }) public headtitle: string = ''
@Prop({ required: true }) public img1: string = ''
@Prop({ required: true }) public text1: string = ''
}

View File

@@ -1,28 +0,0 @@
<template>
<q-page class="text-white">
<div class="landing">
<CTitle :src="imghead" :title="headtitle">
</CTitle>
<section class="padding_testo bg-white text-grey-10 text-center" v-scroll-reveal.reset>
<div class="landing__features row items-start q-col-gutter-xs intro">
<div class="intro__associazione">
<!--<img src="../../statics/images/scuolaopbenessere/16427623_404497389905092_1266178961781563443_n.jpg">-->
<img :src="img1">
{{text1}}
</div>
</div>
</section>
<Footer></Footer>
</div>
</q-page>
</template>
<script lang="ts" src="./CPage.ts">
</script>
<style lang="scss" scoped>
@import './CPage.scss';
</style>

View File

@@ -1 +0,0 @@
export {default as CPage} from './CPage.vue'

View File

@@ -12,7 +12,7 @@
<q-input
v-model="signin.username"
rounded outlined
rounded outlined dense
@blur="$v.signin.username.$touch"
:error="$v.signin.username.$error"
:error-message="`${errorMsg('username', $v.signin.username)}`"
@@ -27,7 +27,7 @@
<q-input
v-model="signin.password"
type="password"
rounded outlined
rounded outlined dense
@blur="$v.signin.password.$touch"
:error="$v.signin.password.$error"
:error-message="`${errorMsg('password', $v.signin.password)}`"
@@ -37,27 +37,26 @@
</template>
</q-input>
<div>
<a :href="getlinkforgetpwd">{{$t('reg.forgetpassword')}}</a>
<div class="text-center" style="margin-bottom: 10px;">
<a :href="getlinkforgetpwd" style="color:gray;">{{$t('reg.forgetpassword')}}</a>
</div>
<br>
<q-card class="flex flex-center">
<!--<q-btn v-if="$myconfig.socialLogin.facebook" :loading="loading" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>-->
<!--
<q-btn v-if="$myconfig.socialLogin.facebook" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>
<q-btn v-if="$myconfig.socialLogin.google" class="q-mb-md q-mr-md" rounded icon="fab fa-google" size="sm" color="deep-orange-14" text-color="white" @click="google" :label="$t('components.authentication.login.google')"/>
-->
</q-card>
<!--<q-card class="flex flex-center">-->
<!--&lt;!&ndash;<q-btn v-if="$myconfig.socialLogin.facebook" :loading="loading" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>&ndash;&gt;-->
<!--&lt;!&ndash;-->
<!--<q-btn v-if="$myconfig.socialLogin.facebook" class="q-mb-md q-mr-md" rounded icon="fab fa-facebook-f" size="sm" color="blue-10" text-color="white" @click="facebook" :label="$t('components.authentication.login.facebook')"/>-->
<!--<q-btn v-if="$myconfig.socialLogin.google" class="q-mb-md q-mr-md" rounded icon="fab fa-google" size="sm" color="deep-orange-14" text-color="white" @click="google" :label="$t('components.authentication.login.google')"/>-->
<!--&ndash;&gt;-->
<!--</q-card>-->
<div align="center">
<q-btn rounded size="lg" color="primary" @click="submit"
<q-btn rounded size="md" color="primary" @click="submit"
:disable="$v.$error || iswaitingforRes">{{$t('login.enter')}}
</q-btn>
</div>
<div align="center" style="margin-top:10px;">
<q-btn flat rounded size="lg" color="primary" to="/signup">{{$t('reg.submit')}}
<q-btn flat rounded size="md" color="primary" to="/signup">{{$t('reg.submit')}}
</q-btn>
</div>

View File

@@ -7,7 +7,7 @@ import { CSignIn } from '../../components/CSignIn'
import { GlobalStore, UserStore } from '@modules'
// import { StateConnection } from '../../model'
import { Watch } from 'vue-property-decorator'
import { Prop, Watch } from 'vue-property-decorator'
import { tools } from '../../store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
@@ -24,6 +24,7 @@ import globalroutines from '../../globalroutines'
})
export default class Header extends Vue {
@Prop({ required: false, default: '' }) public extraContent: string
public $t
public $v
public $q
@@ -36,16 +37,11 @@ export default class Header extends Vue {
public clCloudDownload: string = ''
public clCloudUp_Indexeddb: string = ''
public clCloudDown_Indexeddb: string = 'clIndexeddbsend'
public right: boolean = false
public photo = ''
public visuimg: boolean = true
get getappname(){
if (Screen.width < 400) {
return this.$t('msg.myAppNameShort')
} else {
return this.$t('msg.myAppName')
}
get tools() {
return tools
}
get conn_changed() {
@@ -60,6 +56,10 @@ export default class Header extends Vue {
return UserStore.state.isAdmin
}
get isManager() {
return UserStore.state.isManager
}
get conndata_changed() {
return GlobalStore.state.connData
}
@@ -105,6 +105,14 @@ export default class Header extends Vue {
localStorage.setItem(tools.localStorage.leftDrawerOpen, value.toString())
}
get rightDrawerOpen() {
return GlobalStore.state.RightDrawerOpen
}
set rightDrawerOpen(value) {
GlobalStore.state.RightDrawerOpen = value
}
get lang() {
return this.$q.lang.isoName
}
@@ -375,7 +383,7 @@ export default class Header extends Vue {
}
public clickregister() {
this.right = false
this.rightDrawerOpen = false
this.$router.replace('/signup')
}
}

View File

@@ -39,7 +39,7 @@
<q-avatar>
<img :src="imglogo" height="27">
</q-avatar>
{{getappname}}
{{tools.getappname()}}
<div slot="subtitle">{{$t('msg.myDescriz')}} {{ getAppVersion() }}</div>
</q-toolbar-title>
@@ -105,10 +105,10 @@
<!-- BUTTON USER BAR -->
<q-btn v-if="static_data.functionality.SHOW_USER_MENU && !isLogged" dense flat round icon="menu"
@click="right = !right">
@click="rightDrawerOpen = !rightDrawerOpen">
</q-btn>
<q-btn v-if="static_data.functionality.SHOW_USER_MENU && isLogged" dense flat round
icon="img:statics/images/avatar-1.svg" @click="right = !right">
icon="img:statics/images/avatar/avatar3_small.png" @click="rightDrawerOpen = !rightDrawerOpen">
</q-btn>
</q-toolbar>
@@ -128,7 +128,7 @@
</q-drawer>
<!-- USER BAR -->
<q-drawer v-if="static_data.functionality.SHOW_USER_MENU" v-model="right" side="right" elevated>
<q-drawer v-if="static_data.functionality.SHOW_USER_MENU" v-model="rightDrawerOpen" side="right" elevated>
<div id="profile">
<q-img class="absolute-top" src="../../statics/images/landing_first_section.png"
style="height: 150px">
@@ -136,12 +136,13 @@
<div class="absolute-top bg-transparent text-black center_img" style="margin-top: 10px;">
<q-avatar class="q-mb-sm center_img">
<img src="../../statics/images/avatar-1.svg">
<img src="../../statics/images/avatar/avatar3_small.png">
</q-avatar>
<q-btn class="absolute-top-right" style="margin-right: 10px; color: white;"
dense flat round icon="close" @click="right = !right">
dense flat round icon="close" @click="rightDrawerOpen = !rightDrawerOpen">
</q-btn>
<div v-if="isLogged" class="text-weight-bold text-user">{{ Username }} - {{ myName }} <span v-if="isAdmin"> [Admin]</span></div>
<div v-if="isLogged" class="text-weight-bold text-user">{{ Username }} - {{ myName }} <span
v-if="isAdmin"> [Admin]</span><span v-if="isManager"> [Manager]</span></div>
<div v-else class="text-user text-italic bg-red">
{{ $t('user.loggati') }}
</div>
@@ -172,8 +173,11 @@
</div>
</div>
</div>
<div v-if="isLogged" class="q-mt-lg"><br><br></div>
<slot></slot>
</q-drawer>
</div>
</template>

View File

@@ -4,7 +4,7 @@ export * from './logo'
export * from './CProgress'
export * from './CCard'
export * from './CBook'
export * from './CPage'
export * from './CMyPage'
export * from './CTitle'
export * from './CImgText'
export * from './CImgTitle'
@@ -17,3 +17,4 @@ export * from './BannerCookies'
export * from './PagePolicy'
export * from './FormNewsletter'
export * from './CGridTableRec'
export * from './Shen/CTesseraElettronica'

View File

@@ -12,6 +12,6 @@ export default class Logo extends Vue {
}
get logoalt() {
return process.env.APP_NAME
return this.$t('msg.myAppName')
}
}

View File

@@ -23,6 +23,7 @@ const msg_website = {
msg: {
hello: 'Buongiorno',
myAppName: 'FreePlanet',
myAppDescription: 'Il primo Vero Social Libero, Equo e Solidale, dove Vive Consapevolezza e Aiuto Comunitario. Gratuito e senza Pubblicità',
underconstruction: 'App in costruzione...',
myDescriz: '',
sottoTitoloApp: 'Il primo Vero Social',
@@ -144,6 +145,7 @@ const msg_website = {
msg: {
hello: 'Buenos Días',
myAppName: 'FreePlanet',
myAppDescription: 'El primer Verdadero Social Libre, justo y Solidario Donde vive Conciencia y Ayuda comunitaria, Gratis y sin publicidad',
underconstruction: 'App en construcción...',
myDescriz: '',
sottoTitoloApp: 'El primer Verdadero Social',
@@ -266,6 +268,7 @@ const msg_website = {
msg: {
hello: 'Hello!',
myAppName: 'FreePlanet',
myAppDescription: 'The first Real Social Free, Fair and Equitable Where the conscience and community help live. Free and without advertising',
underconstruction: 'App in construction...',
myDescriz: '',
sottoTitoloApp: 'The first Real Social',

View File

@@ -1,8 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<title><%= htmlWebpackPlugin.options.appName %></title>
<meta charset="utf-8">
<meta name="description" content="<%= htmlWebpackPlugin.options.appDescription %>">
<meta name="format-detection" content="telephone=no">

View File

@@ -57,6 +57,14 @@
font-size: 1rem;
}
.isAdmin {
color: red;
}
.isManager {
color: green;
}
.my-menu-icon{
min-width: 26px;
font-size: 1rem;

View File

@@ -33,7 +33,8 @@ export default class MenuOne extends Vue {
}
public visumenu(elem) { // : IListRoutes
return (elem.onlyAdmin && UserStore.state.isAdmin) || (!elem.onlyAdmin)
return (elem.onlyAdmin && UserStore.state.isAdmin) || (elem.onlyManager && UserStore.state.isManager)
|| ((!elem.onlyAdmin) && (!elem.onlyManager))
}
public setParentVisibilityBasedOnRoute(parent) {
@@ -64,4 +65,15 @@ export default class MenuOne extends Vue {
}
}
public getmymenuclass(elem: IListRoutes) {
let menu = 'my-menu'
if (elem.onlyAdmin)
menu += ' isAdmin'
if (elem.onlyManager)
menu += ' isManager'
return menu
}
}

View File

@@ -11,7 +11,7 @@
:label="tools.getLabelByItem(myitemmenu, mythis)"
:icon="myitemmenu.materialIcon"
expand-icon-class="my-menu-separat"
header-class="my-menu"
:header-class="getmymenuclass(myitemmenu)"
active-class="my-menu-active">
<q-expansion-item v-for="(child2, index) in myitemmenu.routes2"

View File

@@ -1,11 +1,13 @@
export interface IEvents {
_id?: any
time?: string
duration?: number
duration2?: number
typol?: string
short_tit?: string
title?: string
details?: string
withtime?: boolean
dur?: number
dur2?: number
date?: string
side?: string
bgcolor?: string
@@ -13,13 +15,17 @@ export interface IEvents {
icon?: string
img?: string
where?: string
teacher?: string
teacher2?: string
avatar?: string
avatar2?: string
contribtype?: number
teacher?: string // teacherid
teacher2?: string // teacherid2
infoextra?: string
linkpage?: string
linkpdf?: string
nobookable?: boolean
news?: boolean
dupId?: any
canceled?: boolean
deleted?: boolean
}
export interface IBookedEvent {
@@ -34,6 +40,21 @@ export interface IBookedEvent {
booked: boolean
}
export interface IOperators {
username: string
name: string
surname: string
email: string
cell: string
webpage?: string
img: string
skype?: string
days_working?: string
facebook?: string
disciplines?: string
offers?: string
}
export enum EState {
None, Creating, Modifying
}
@@ -48,6 +69,7 @@ export interface ICalendarState {
editable: boolean
eventlist: IEvents[]
bookedevent: IBookedEvent[]
operators: IOperators[]
// ---------------
titlebarHeight: number
locale: string,

View File

@@ -1,5 +1,6 @@
import { IAction } from '@src/model/Projects'
import { Component } from 'vue-router/types/router'
import { lists } from '@src/store/Modules/lists'
export interface IPost {
title: string
@@ -47,6 +48,7 @@ export interface IGlobalState {
mobileMode: boolean
menuCollapse: boolean
leftDrawerOpen: boolean
RightDrawerOpen: boolean
category: string
stateConnection: string
networkDataReceived: boolean
@@ -83,6 +85,7 @@ export interface IListRoutes {
infooter?: boolean
submenu?: boolean
onlyAdmin?: boolean
onlyManager?: boolean
meta?: any
idelem?: string
urlroute?: string
@@ -201,3 +204,42 @@ export interface IFunctionality {
BOOKING_EVENTS?: boolean
}
export interface IParamsQuery {
table: string
startRow: number
endRow: number
filter: string
sortBy: any
descending: number
}
export interface IColGridTable {
name: string
required?: boolean
label?: string
label_trans?: string
align?: string
field?: string
sortable?: boolean
disable?: boolean
titlepopupedit?: string
visible?: boolean
icon?: string
action?: any
foredit?: boolean
fieldtype?: string
visuonlyEditVal?: boolean
}
export interface ITableRec {
label: string
value: string
columns: IColGridTable[]
colkey: string
}
export interface IDataPass {
id: string
table: string
fieldsvalue: object
}

View File

@@ -17,6 +17,8 @@ export interface IUserState {
surname?: string
password?: string
lang?: string
ipaddr?: string
perm?: number
repeatPassword?: string
tokens?: IToken[]
@@ -31,7 +33,9 @@ export interface IUserState {
x_auth_token?: string
isLogged?: boolean
isAdmin?: boolean
isManager?: boolean
usersList?: IUserList[]
countusers?: number
}
export interface IUserList {

View File

@@ -60,7 +60,7 @@ export default class Home extends Vue {
}
get appname() {
return process.env.APP_NAME
return this.$t('msg.myAppName')
}
public beforeDestroy() {

View File

@@ -201,7 +201,7 @@
</div>
<div class="flex justify-end">
<div class="q-gutter-xs testo-banda clgutter">
<div class="text-h1 shadow-max">{{getenv('APP_NAME')}}</div>
<div class="text-h1 shadow-max">{{$t('msg.myAppName')}}</div>
<div class="text-subtitle1 shadow text-italic q-pl-sm">
{{$t('msg.sottoTitoloApp')}}
</div>

View File

@@ -2,13 +2,23 @@ import msg_website from '../db/i18n_website'
const msgglobal = {
it: {
grid: {
editvalues: 'Modifica Valori',
showprevedit: 'Mostra Eventi Passati',
columns: 'Colonne',
tableslist: 'Tabelle',
},
otherpages: {
admin : {
menu: 'Amministrazione',
eventlist: 'Prenotazioni',
eventlist: 'Le tue Prenotazioni',
usereventlist: 'Prenotazioni Utenti',
userlist: 'Lista Utenti',
tableslist: 'Lista Tabelle',
},
manage: {
menu: 'Gestione'
}
},
sendmsg: {
write: 'scrive'
@@ -22,7 +32,7 @@ const msgglobal = {
update: 'Aggiorna',
today: 'Oggi',
book: 'Prenota',
sendmsg: 'Invia Msg',
sendmsg: 'Invia solo un Msg',
msg: {
titledeleteTask: 'Elimina Task',
deleteTask: "Vuoi Eliminare {mytodo}?"
@@ -33,7 +43,13 @@ const msgglobal = {
},
db: {
recupdated: 'Record Aggiornato',
recfailed: 'Errore durante aggiornamento Record'
recfailed: 'Errore durante aggiornamento Record',
deleterecord: 'Elimina Record',
deletetherecord: 'Eliminare il Record?',
deletedrecord: 'Record Cancellato',
recdelfailed: 'Errore durante la cancellazione del Record',
duplicatedrecord: 'Record Duplicato',
recdupfailed: 'Errore durante la duplicazione del Record',
},
components: {
authentication: {
@@ -48,7 +64,7 @@ const msgglobal = {
verify_email: 'Verifica la tua email',
go_login: 'Torna al Login',
incorrect_input: 'Inserimento incorretto.',
link_sent: 'Per confermare la Registrazione, leggi la tua casella di posta e Clicca su "Verifica Email".\nSe non la trovi, cerca nella cartella Spam.'
link_sent: 'Ora leggi la tua email e conferma la registrazione'
}
}
},
@@ -66,6 +82,8 @@ const msgglobal = {
incorso: 'Registrazione in corso...',
richiesto: 'Campo Richiesto',
email: 'Email',
cell: 'Móvil',
img: 'Imagen de archivo',
date_reg: 'Data Reg.',
perm: 'Permessi',
username: 'Nome Utente',
@@ -85,7 +103,7 @@ const msgglobal = {
email: 'inserire una email valida',
errore_generico: 'Si prega di compilare correttamente i campi',
atleast: 'dev\'essere lungo almeno di',
complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola e 1 cifra',
complexity: 'deve contenere almeno 1 minuscola, 1 maiuscola, 1 cifra e 1 carattere speciale (!,$,#,%,-) ',
notmore: 'non dev\'essere lungo più di',
char: 'caratteri',
terms: 'Devi accettare le condizioni, per continuare.',
@@ -149,7 +167,7 @@ const msgglobal = {
titledenied: 'Permesso Notifiche Disabilitato!',
title_subscribed: 'Sottoscrizione a FreePlanet.app!',
subscribed: 'Ora potrai ricevere i messaggi e le notifiche.',
newVersionAvailable: 'Aggiorna'
newVersionAvailable: 'Aggiorna',
},
connection: 'Connessione',
proj: {
@@ -203,6 +221,35 @@ const msgglobal = {
bookingtextdefault_of: 'di',
data: 'Data',
teachertitle: 'Insegnante',
peoplebooked: 'Prenotaz.',
},
event: {
_id: 'id',
typol: 'Typology',
short_tit: 'Titolo Breve',
title: 'Titolo',
details: 'Dettagli',
withtime: 'Con Tempo',
dur: 'durata (min)',
dur2: 'durata2 (min)',
date: 'Data',
bgcolor: 'Colore Sfondo',
days: 'Giorni',
icon: 'Icona',
img: 'Nomefile Immagine',
where: 'Dove',
contribtype: 'Tipo Contributo',
teacher: 'Insegnante', // teacherid
teacher2: 'Insegnante2', // teacherid2
infoextra: 'InfoExtra',
linkpage: 'WebSite',
linkpdf: 'Link ad un PDF',
nobookable: 'No Prenotabile',
news: 'Novità',
dupId: 'Id Duplicato',
canceled: 'Cancellato',
deleted: 'Eliminato',
duplicate: 'Duplica'
},
newsletter: {
title: 'Desideri ricevere la nostra Newsletter?',
@@ -216,19 +263,29 @@ const msgglobal = {
typesomething: 'Compilare correttamente il campo',
acceptlicense: 'Accetto la licenza e i termini',
license: 'Devi prima accettare la licenza e i termini',
submitted: 'Iscritto'
submitted: 'Iscritto',
},
privacy_policy:'Privacy Policy',
cookies: 'Usiamo i Cookie per una migliore prestazione web.'
},
es: {
grid: {
editvalues: 'Cambiar valores',
showprevedit: 'Mostrar eventos pasados',
columns: 'Columnas',
tableslist: 'Tablas'
},
otherpages: {
admin : {
menu: 'Administración',
eventlist: 'Reserva',
eventlist: 'Sus Reservas',
usereventlist: 'Reserva Usuarios',
userlist: 'Lista de usuarios',
tableslist: 'Listado de tablas',
},
manage: {
menu: 'Gestionar'
}
},
sendmsg: {
write: 'escribe'
@@ -242,7 +299,7 @@ const msgglobal = {
update: 'Actualiza',
today: 'Hoy',
book: 'Reserva',
sendmsg: 'Envia Mensaje',
sendmsg: 'Envia solo Mensaje',
msg: {
titledeleteTask: 'Borrar Tarea',
deleteTask: 'Quieres borrar {mytodo}?'
@@ -253,7 +310,13 @@ const msgglobal = {
},
db: {
recupdated: 'Registro Actualizado',
recfailed: 'Error durante el registro de actualización'
recfailed: 'Error durante el registro de actualización',
deleterecord: 'Eliminar registro',
deletetherecord: '¿Eliminar el registro?',
deletedrecord: 'Registro cancelado',
recdelfailed: 'Error durante la eliminación del registro',
duplicatedrecord: 'Registro Duplicado',
recdupfailed: 'Error durante la duplicación de registros',
},
components: {
authentication: {
@@ -268,7 +331,7 @@ const msgglobal = {
verify_email: 'Revisa tu email',
go_login: 'Vuelve al Login',
incorrect_input: 'Entrada correcta.',
link_sent: 'Para confirmar el registro, lea su buzón y haga clic en "Verificar correo electrónico".\n' + 'Si no lo encuentras, busca en la carpeta Spam.'
link_sent: 'Ahora lea su correo electrónico y confirme el registro'
}
}
},
@@ -286,6 +349,8 @@ const msgglobal = {
incorso: 'Registro en curso...',
richiesto: 'Campo requerido',
email: 'Email',
cell: 'Telefono',
img: 'File image',
date_reg: 'Fecha Reg.',
perm: 'Permisos',
username: 'Nombre usuario',
@@ -305,7 +370,7 @@ const msgglobal = {
email: 'Debe ser una email válida.',
errore_generico: 'Por favor, rellene los campos correctamente',
atleast: 'debe ser al menos largo',
complexity: 'debe contener al menos 1 minúscula, 1 mayúscula y 1 dígito',
complexity: 'debe contener al menos 1 minúscula, 1 mayúscula, 1 dígito y 1 caractér especial (!,$,#,%,-)',
notmore: 'no tiene que ser más largo que',
char: 'caracteres',
terms: 'Debes aceptar las condiciones, para continuar..',
@@ -362,7 +427,7 @@ const msgglobal = {
titledenied: 'Notificaciones permitidas deshabilitadas!',
title_subscribed: 'Suscripción a FreePlanet.app!',
subscribed: 'Ahora puedes recibir mensajes y notificaciones.',
newVersionAvailable: 'Actualiza'
newVersionAvailable: 'Actualiza',
},
connection: 'Connection',
proj: {
@@ -417,6 +482,35 @@ const msgglobal = {
bookingtextdefault_of: 'de',
data: 'Fecha',
teachertitle: 'Maestro',
peoplebooked: 'Reserv.',
},
event: {
_id: 'id',
typol: 'Typology',
short_tit: 'Título Corto',
title: 'Título',
details: 'Detalles',
withtime: 'Con Tiempo',
dur: 'duración (min)',
dur2: 'duración2 (min)',
date: 'Fecha',
bgcolor: 'Color de fondo',
days: 'Días',
icon: 'Icono',
img: 'Nombre Imagen',
where: 'Dónde',
contribtype: 'Tipo de Contribución',
teacher: 'Profesor', // teacherid
teacher2: 'Profesor2', // teacherid2
infoextra: 'InfoExtra',
linkpage: 'Sitio WEb',
linkpdf: 'Enlace ad un PDF',
nobookable: 'No Reservable',
news: 'Novedad',
dupId: 'Id Duplicado',
canceled: 'Cancelado',
deleted: 'Eliminado',
duplicate: 'Duplica',
},
newsletter: {
title: '¿Desea recibir nuestro boletín informativo?',
@@ -436,13 +530,23 @@ const msgglobal = {
cookies: 'Utilizamos cookies para un mejor rendimiento web.'
},
fr: {
grid: {
editvalues: 'Changer les valeurs',
showprevedit: 'Afficher les événements passés',
columns: 'Colonnes',
tableslist: 'Tables',
},
otherpages: {
admin : {
menu: 'Administration',
eventlist: 'Réservation',
eventlist: 'Vos réservations',
usereventlist: 'Réservation Utilisateur',
userlist: 'Liste d\'utilisateurs',
tableslist: 'Liste des tables',
},
manage: {
menu: 'Gérer'
}
},
sendmsg: {
write: 'écrit'
@@ -456,7 +560,7 @@ const msgglobal = {
cancel: 'annuler',
today: 'Aujourd\'hui',
book: 'Réserve',
sendmsg: 'Envoyer Msg',
sendmsg: 'envoyer seul un msg',
msg: {
titledeleteTask: 'Supprimer la tâche',
deleteTask: 'Voulez-vous supprimer {mytodo}?'
@@ -467,7 +571,13 @@ const msgglobal = {
},
db: {
recupdated: 'Enregistrement mis à jour',
recfailed: 'Erreur lors de la mise à jour'
recfailed: 'Erreur lors de la mise à jour',
deleterecord: 'Supprimer l\'enregistrement',
deletetherecord: 'Supprimer l\'enregistrement?',
deletedrecord: 'Enregistrement annulé',
recdelfailed: 'Erreur lors de la suppression de l\'enregistrement',
duplicatedrecord: 'Enregistrement en double',
recdupfailed: 'Erreur lors de la duplication des enregistrements',
},
components: {
authentication: {
@@ -482,7 +592,7 @@ const msgglobal = {
verify_email: 'Vérifiez votre email',
go_login: 'Retour à la connexion',
incorrect_input: 'Entrée correcte.',
link_sent: 'Pour confirmer lenregistrement, lisez votre boîte aux lettres et cliquez sur "Vérifier le courrier électronique".".\n' + 'Si vous ne le trouvez pas, regardez dans le dossier Spam.'
link_sent: 'Maintenant, lisez votre email et confirmez votre inscription'
}
}
},
@@ -499,6 +609,8 @@ const msgglobal = {
incorso: 'Inscription en cours...',
richiesto: 'Champ obligatoire',
email: 'Email',
cell: 'Téléphone',
img: 'Fichier image',
date_reg: 'Date Inscript.',
perm: 'Autorisations',
username: 'Nom d\'utilisateur',
@@ -518,7 +630,7 @@ const msgglobal = {
email: 'Ce doit être un email valide.',
errore_generico: 'S\'il vous plaît remplir les champs correctement',
atleast: 'ça doit être au moins long',
complexity: 'doit contenir au moins 1 minuscule, 1 majuscule et 1 chiffre',
complexity: 'doit contenir au moins 1 minuscule, 1 majuscule, 1 chiffre et 1 caractère spécial (!,$,#,%,-)',
notmore: 'il ne doit pas être plus long que',
char: 'caractères',
terms: 'Vous devez accepter les conditions, pour continuer..',
@@ -575,7 +687,7 @@ const msgglobal = {
titledenied: 'Notifications autorisées désactivées!',
title_subscribed: 'Abonnement au Site Web!',
subscribed: 'Maintenant, vous pouvez recevoir des messages et des notifications.',
newVersionAvailable: 'Mise à jour'
newVersionAvailable: 'Mise à jour',
},
connection: 'Connexion',
proj: {
@@ -630,6 +742,35 @@ const msgglobal = {
bookingtextdefault_of: 'du',
data: 'Date',
teachertitle: 'Professeur',
peoplebooked: 'Réserv.',
},
event: {
_id: 'id',
typol: 'Typologie',
short_tit: 'Titre abrégé\'',
title: 'Titre',
details: 'Détails',
withtime: 'avec le temps',
dur: 'durée (min)',
dur2: 'durée2 (min)',
date: 'Date',
bgcolor: 'Couleur de fond',
days: 'Journées',
icon: 'Icône',
img: 'Image du nom de fichier',
where: 'Où',
contribtype: 'Type de contribution',
teacher: 'Enseignant', // teacherid
teacher2: 'Enseignant2', // teacherid2
infoextra: 'Extra Info',
linkpage: 'Site Web',
linkpdf: 'Lien vers un PDF',
nobookable: 'non réservable',
news: 'Nouvelles',
dupId: 'Id Double',
canceled: 'Annulé',
deleted: 'Supprimé',
duplicate: 'Duplique'
},
newsletter: {
title: 'Souhaitez-vous recevoir notre newsletter?',
@@ -649,13 +790,23 @@ const msgglobal = {
cookies: 'Nous utilisons des cookies pour améliorer les performances Web.'
},
enUs: {
grid: {
editvalues: 'Edit Values',
showprevedit: 'Show Past Events',
columns: 'Columns',
tableslist: 'Tables',
},
otherpages: {
admin : {
menu: 'Administration',
eventlist: 'Booking',
eventlist: 'Your Booking',
usereventlist: 'Users Booking',
userlist: 'Users List',
tableslist: 'List of tables',
},
manage: {
menu: 'Manage'
}
},
sendmsg: {
write: 'write'
@@ -669,7 +820,7 @@ const msgglobal = {
cancel: 'Cancel',
today: 'Today',
book: 'Book',
sendmsg: 'Send Msg',
sendmsg: 'Send only a Msg',
msg: {
titledeleteTask: 'Delete Task',
deleteTask: 'Delete Task {mytodo}?'
@@ -680,7 +831,13 @@ const msgglobal = {
},
db: {
recupdated: 'Record Updated',
recfailed: 'Error during update Record'
recfailed: 'Error during update Record',
deleterecord: 'Delete Record',
deletetherecord: 'Delete the Record?',
deletedrecord: 'Record Deleted',
recdelfailed: 'Error during deletion of the Record',
duplicatedrecord: 'Duplicate Record',
recdupfailed: 'Error during record duplication',
},
components: {
authentication: {
@@ -695,7 +852,7 @@ const msgglobal = {
verify_email: 'Verify your email',
go_login: 'Back to Login',
incorrect_input: 'Incorrect input.',
link_sent: 'To confirm the Registration, read your mailbox and click on "Verify email".\nIf you can not find it check your junk mail or spam.'
link_sent: 'Now read your email and confirm registration'
}
}
},
@@ -712,6 +869,8 @@ const msgglobal = {
incorso: 'Registration please wait...',
richiesto: 'Field Required',
email: 'Email',
cell: 'Phone',
img: 'File Image',
date_reg: 'Reg. Date',
perm: 'Permissions',
username_login: 'Username or email',
@@ -731,7 +890,7 @@ const msgglobal = {
email: 'must be a valid email',
errore_generico: 'Please review fields again',
atleast: 'must be at least',
complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, and 1 digit',
complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol (!,$,#,%,-)',
notmore: 'must not be more than',
char: 'characters long',
terms: 'You need to agree with the terms & conditions.',
@@ -787,7 +946,7 @@ const msgglobal = {
titledenied: 'Notification Permission Denied!',
title_subscribed: 'Subscribed to FreePlanet.app!',
subscribed: 'You can now receive Notification and Messages.',
newVersionAvailable: 'Upgrade'
newVersionAvailable: 'Upgrade',
},
connection: 'Conexión',
proj: {
@@ -842,6 +1001,35 @@ const msgglobal = {
bookingtextdefault_of: 'of',
data: 'Date',
teachertitle: 'Teacher',
peoplebooked: 'Booked',
},
event: {
_id: 'id',
typol: 'Typology',
short_tit: 'Short Title',
title: 'Title',
details: 'Details',
withtime: 'With Time',
dur: 'Duration (min)',
dur2: 'Duration2 (min)',
date: 'Date',
bgcolor: 'Background color',
days: 'Days',
icon: 'Icon',
img: 'Nomefile Img',
where: 'Qhere',
contribtype: 'Contribute Type',
teacher: 'Teacher', // teacherid
teacher2: 'Teacher2', // teacherid2
infoextra: 'Extra Info',
linkpage: 'WebSite',
linkpdf: 'PDF Link',
nobookable: 'No Bookable',
news: 'News',
dupId: 'Id Duplicate',
canceled: 'Canceled',
deleted: 'Deleted',
duplicate: 'Duplicate'
},
newsletter: {
title: 'Would you like to receive our Newsletter?',
@@ -861,13 +1049,23 @@ const msgglobal = {
cookies: 'We use cookies for better web performance.'
},
de: {
grid: {
editvalues: 'Edit Values',
showprevedit: 'Show Past Events',
columns: 'Columns',
tableslist: 'Tables',
},
otherpages: {
admin : {
menu: 'Administration',
eventlist: 'Booking',
eventlist: 'Your Booking',
usereventlist: 'Users Booking',
userlist: 'Users List',
tableslist: 'List of tables',
},
manage: {
menu: 'Manage'
}
},
sendmsg: {
write: 'write'
@@ -881,7 +1079,7 @@ const msgglobal = {
cancel: 'Cancel',
today: 'Today',
book: 'Book',
sendmsg: 'Send Msg',
sendmsg: 'Send only a Msg',
msg: {
titledeleteTask: 'Delete Task',
deleteTask: 'Delete Task {mytodo}?'
@@ -892,7 +1090,13 @@ const msgglobal = {
},
db: {
recupdated: 'Record Updated',
recfailed: 'Error during update Record'
recfailed: 'Error during update Record',
deleterecord: 'Delete Record',
deletetherecord: 'Delete the Record?',
deletedrecord: 'Record Deleted',
recdelfailed: 'Error during deletion of the Record',
duplicatedrecord: 'Duplicate Record',
recdupfailed: 'Error during record duplication',
},
components: {
authentication: {
@@ -907,7 +1111,7 @@ const msgglobal = {
verify_email: 'Verify your email',
go_login: 'Back to Login',
incorrect_input: 'Incorrect input.',
link_sent: 'To confirm the Registration, read your mailbox and click on "Verify email".\nIf you can not find it check your junk mail or spam.'
link_sent: 'Now read your email and confirm registration'
}
}
},
@@ -925,6 +1129,8 @@ const msgglobal = {
incorso: 'Registration please wait...',
richiesto: 'Field Required',
email: 'Email',
cell: 'Phone',
img: 'File Image',
date_reg: 'Reg. Date',
perm: 'Permissions',
username_login: 'Username or email',
@@ -944,7 +1150,7 @@ const msgglobal = {
email: 'must be a valid email',
errore_generico: 'Please review fields again',
atleast: 'must be at least',
complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, and 1 digit',
complexity: 'must contains at least 1 lowercase letter, 1 uppercase letter, 1 digit and one special symbol (!,$,#,%,-)',
notmore: 'must not be more than',
char: 'characters long',
terms: 'You need to agree with the terms & conditions.',
@@ -1001,7 +1207,7 @@ const msgglobal = {
titledenied: 'Notification Permission Denied!',
title_subscribed: 'Subscribed to FreePlanet.app!',
subscribed: 'You can now receive Notification and Messages.',
newVersionAvailable: 'Upgrade'
newVersionAvailable: 'Upgrade',
},
connection: 'Conexión',
proj: {
@@ -1056,6 +1262,35 @@ const msgglobal = {
bookingtextdefault_of: 'of',
data: 'Date',
teachertitle: 'Teacher',
peoplebooked: 'Booked',
},
event: {
_id: 'id',
typol: 'Typology',
short_tit: 'Short Title',
title: 'Title',
details: 'Details',
withtime: 'With Time',
dur: 'Duration (min)',
dur2: 'Duration2 (min)',
date: 'Date',
bgcolor: 'Background color',
days: 'Days',
icon: 'Icon',
img: 'Nomefile Img',
where: 'Qhere',
contribtype: 'Contribute Type',
teacher: 'Teacher', // teacherid
teacher2: 'Teacher2', // teacherid2
infoextra: 'Extra Info',
linkpage: 'WebSite',
linkpdf: 'PDF Link',
nobookable: 'No Bookable',
news: 'News',
dupId: 'Id Duplicate',
canceled: 'Canceled',
deleted: 'Deleted',
duplicate: 'Duplicate'
},
newsletter: {
title: 'Would you like to receive our Newsletter?',

View File

@@ -13,13 +13,16 @@ import { costanti } from '@src/store/Modules/costanti'
import { tools } from '@src/store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext'
import * as ApiTables from '@src/store/Modules/ApiTables'
import { GlobalStore, Projects, Todos, UserStore } from '@store'
import { CalendarStore, GlobalStore, Projects, Todos, UserStore } from '@store'
import messages from '../../statics/i18n'
import globalroutines from './../../globalroutines/index'
import { cfgrouter } from '../../router/route-config'
import { static_data } from '@src/db/static_data'
import { IDataPass, IParamsQuery } from '@src/model/GlobalStore'
import { serv_constants } from '@src/store/Modules/serv_constants'
import { IUserState } from '@src/model'
import { Calendar } from 'element-ui'
// import { static_data } from '@src/db/static_data'
let stateConnDefault = 'online'
@@ -38,6 +41,7 @@ const state: IGlobalState = {
mobileMode: false,
menuCollapse: true,
leftDrawerOpen: true,
RightDrawerOpen: false,
stateConnection: stateConnDefault,
networkDataReceived: false,
cfgServer: [],
@@ -265,6 +269,41 @@ namespace Mutations {
}
function getListByTable(table): any[] {
if (table === 'events')
return CalendarStore.state.eventlist
else if (table === 'operators')
return CalendarStore.state.operators
else if (table === 'bookings')
return CalendarStore.state.bookedevent
else if (table === 'users')
return UserStore.state.usersList
else
return null
}
function UpdateValuesInMemory(mystate: IGlobalState, mydata: IDataPass) {
const id = mydata.id
const table = mydata.table
try {
const mylist = getListByTable(table)
const myrec = mylist.find((event) => event._id === 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) {
console.error(e)
}
}
export const mutations = {
setConta: b.commit(setConta),
setleftDrawerOpen: b.commit(setleftDrawerOpen),
@@ -275,7 +314,8 @@ namespace Mutations {
setPaoArray: b.commit(setPaoArray),
setPaoArray_Delete: b.commit(setPaoArray_Delete),
NewArray: b.commit(NewArray),
setShowType: b.commit(setShowType)
setShowType: b.commit(setShowType),
UpdateValuesInMemory: b.commit(UpdateValuesInMemory)
}
}
@@ -294,10 +334,6 @@ namespace Actions {
// return
// }
// if (!static_data.functionality.PWA) {
// return
// }
if (!static_data.functionality.PWA)
return
@@ -504,6 +540,88 @@ namespace Actions {
}
async function loadTable(context, params: IParamsQuery) {
// console.log('loadTable', params)
return await Api.SendReq('/gettable', 'POST', params)
.then((res) => {
// console.table(res)
return res.data
})
.catch((error) => {
console.log('error loadTable', error)
UserStore.mutations.setErrorCatch(error)
return null
})
}
async function saveTable(context, mydata: object) {
// console.log('saveTable', mydata)
return await Api.SendReq('/settable', 'POST', mydata)
.then((res) => {
// console.table(res)
return res.data
})
.catch((error) => {
console.log('error saveTable', error)
UserStore.mutations.setErrorCatch(error)
return null
})
}
async function saveFieldValue(context, mydata: IDataPass) {
console.log('saveFieldValue', mydata)
return await Api.SendReq(`/chval`, 'PATCH', { data: mydata })
.then((res) => {
if (res) {
Mutations.mutations.UpdateValuesInMemory(mydata)
return (res.data.code === serv_constants.RIS_CODE_OK)
} else
return false
})
.catch((error) => {
return false
})
}
async function DeleteRec(context, { table, id }) {
console.log('DeleteRec', id)
return await Api.SendReq('/delrec/' + table + '/' + id, 'DELETE', null)
.then((res) => {
if (res.status === 200) {
if (res.data.code === serv_constants.RIS_CODE_OK) {
return true
}
}
return false
})
.catch((error) => {
console.error(error)
return false
})
}
async function DuplicateRec(context, { table, id }) {
console.log('DuplicateRec', id)
return await Api.SendReq('/duprec/' + table + '/' + id, 'POST', null)
.then((res) => {
if (res.status === 200) {
if (res.data.code === serv_constants.RIS_CODE_OK) {
return res.data.record
}
}
return null
})
.catch((error) => {
console.error(error)
return null
})
}
export const actions = {
setConta: b.dispatch(setConta),
createPushSubscription: b.dispatch(createPushSubscription),
@@ -512,7 +630,12 @@ namespace Actions {
clearDataAfterLoginOnlyIfActiveConnection: b.dispatch(clearDataAfterLoginOnlyIfActiveConnection),
prova: b.dispatch(prova),
saveCfgServerKey: b.dispatch(saveCfgServerKey),
checkUpdates: b.dispatch(checkUpdates)
checkUpdates: b.dispatch(checkUpdates),
saveFieldValue: b.dispatch(saveFieldValue),
loadTable: b.dispatch(loadTable),
saveTable: b.dispatch(saveTable),
DeleteRec: b.dispatch(DeleteRec),
DuplicateRec: b.dispatch(DuplicateRec)
}
}

View File

@@ -17,6 +17,7 @@ const state: ICalendarState = {
editable: false,
eventlist: [],
bookedevent: [],
operators: [],
// ---------------
titlebarHeight: 0,
locale: 'it-IT',
@@ -92,7 +93,7 @@ namespace Actions {
// console.log('CalendarStore: loadAfterLogin')
// Load local data
state.editable = db_data.userdata.calendar_editable
state.eventlist = db_data.events
// state.eventlist = db_data.events
// state.bookedevent = db_data.userdata.bookedevent
if (UserStore.getters.isUserInvalid) {
@@ -105,15 +106,14 @@ namespace Actions {
let ris = null
const showall = UserStore.state.isAdmin ? '1' : '0'
const showall = UserStore.state.isAdmin || UserStore.state.isManager ? '1' : '0'
ris = await Api.SendReq('/booking/' + UserStore.state.userId + '/' + process.env.APP_ID + '/' + showall, 'GET', null)
.then((res) => {
if (res.data.bookedevent) {
state.bookedevent = res.data.bookedevent
} else {
state.bookedevent = []
}
state.bookedevent = (res.data.bookedevent) ? res.data.bookedevent : []
state.eventlist = (res.data.eventlist) ? res.data.eventlist : []
state.operators = (res.data.operators) ? res.data.operators : []
})
.catch((error) => {
console.log('error dbLoad', error)

View File

@@ -16,6 +16,7 @@ import { db_data } from '@src/db/db_data'
import translate from './../../globalroutines/util'
import * as Types from '@src/store/Api/ApiTypes'
import { ICfgServer } from '@src/model'
import { shared_consts } from '../../common/shared_vuejs'
const bcrypt = require('bcryptjs')
@@ -36,7 +37,9 @@ const state: IUserState = {
x_auth_token: '',
isLogged: false,
isAdmin: false,
usersList: []
isManager: false,
usersList: [],
countusers: 0
}
const b = storeBuilder.module<IUserState>('UserModule', state)
@@ -109,6 +112,10 @@ namespace Getters {
}, 'IsMyGroup')
const getUserByUserId = b.read((mystate: IUserState) => (userId): IUserState => {
// Check if is this User!
if (state.userId === userId)
return state
return mystate.usersList.find((item) => item._id === userId)
}, 'getUserByUserId')
@@ -149,28 +156,28 @@ namespace Getters {
}
namespace Mutations {
function authUser(state: IUserState, data: IUserState) {
state.userId = data.userId
state.username = data.username
state.name = data.name
state.surname = data.surname
function authUser(mystate: IUserState, data: IUserState) {
mystate.userId = data.userId
mystate.username = data.username
mystate.name = data.name
mystate.surname = data.surname
mystate.perm = data.perm
mystate.isAdmin = tools.isBitActive(mystate.perm, shared_consts.Permissions.Admin)
mystate.isManager = tools.isBitActive(mystate.perm, shared_consts.Permissions.Manager)
// console.log('authUser', 'state.isAdmin', mystate.isAdmin)
console.table(mystate)
console.table(data)
if (data.verified_email) {
state.verified_email = data.verified_email
mystate.verified_email = data.verified_email
}
if (data.categorySel) {
state.categorySel = data.categorySel
mystate.categorySel = data.categorySel
} // ??
resetArrToken(state.tokens)
state.tokens.push({ access: 'auth', token: state.x_auth_token, data_login: tools.getDateNow() })
// ++Todo: Settings Users Admin
if (db_data.adminUsers.includes(state.username)) {
state.isAdmin = true
} else {
state.isAdmin = false
}
resetArrToken(mystate.tokens)
mystate.tokens.push({ access: 'auth', token: mystate.x_auth_token, data_login: tools.getDateNow() })
// console.log('state.tokens', state.tokens)
}
@@ -239,15 +246,18 @@ namespace Mutations {
state.servercode = 0
state.resStatus = 0
state.isLogged = false
state.isAdmin = false
state.x_auth_token = ''
}
function setErrorCatch(state: IUserState, axerr: Types.AxiosError) {
if (state.servercode !== tools.ERR_SERVERFETCH) {
state.servercode = axerr.getCode()
try {
if (state.servercode !== tools.ERR_SERVERFETCH) {
state.servercode = axerr.getCode()
}
console.log('Err catch: (servercode:', axerr.getCode(), axerr.getMsgError(), ')')
} catch (e) {
console.log('Err catch:', axerr)
}
console.log('Err catch: (servercode:', axerr.getCode(), axerr.getMsgError(), ')')
}
function getMsgError(state: IUserState, err: number) {
@@ -281,7 +291,7 @@ namespace Mutations {
clearAuthData: b.commit(clearAuthData),
setErrorCatch: b.commit(setErrorCatch),
getMsgError: b.commit(getMsgError),
setusersList: b.commit(setusersList)
setusersList: b.commit(setusersList),
}
}
@@ -320,14 +330,6 @@ namespace Actions {
}
async function saveUserChange(context, user: IUserState) {
console.log('saveUserChange', user)
return await Api.SendReq(`/users/${user.userId}`, 'PATCH', { user })
.then((res) => {
return (res.data.code === serv_constants.RIS_CODE_OK)
})
}
async function requestpwd(context, paramquery: IUserState) {
@@ -524,12 +526,15 @@ namespace Actions {
const surname = myuser.surname
const verified_email = myuser.verified_email
console.table(myuser)
Mutations.mutations.authUser({
userId,
username,
name,
surname,
verified_email
verified_email,
perm: myuser.perm
})
const now = tools.getDateNow()
@@ -540,6 +545,7 @@ namespace Actions {
localStorage.setItem(tools.localStorage.username, username)
localStorage.setItem(tools.localStorage.name, name)
localStorage.setItem(tools.localStorage.surname, surname)
localStorage.setItem(tools.localStorage.perm, String(myuser.perm) || '')
localStorage.setItem(tools.localStorage.token, state.x_auth_token)
localStorage.setItem(tools.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(tools.localStorage.isLogged, String(true))
@@ -576,6 +582,7 @@ namespace Actions {
localStorage.removeItem(tools.localStorage.username)
localStorage.removeItem(tools.localStorage.name)
localStorage.removeItem(tools.localStorage.surname)
localStorage.removeItem(tools.localStorage.perm)
localStorage.removeItem(tools.localStorage.isLogged)
// localStorage.removeItem(rescodes.localStorage.leftDrawerOpen)
localStorage.removeItem(tools.localStorage.verified_email)
@@ -647,6 +654,7 @@ namespace Actions {
const name = String(localStorage.getItem(tools.localStorage.name))
const surname = String(localStorage.getItem(tools.localStorage.surname))
const verified_email = localStorage.getItem(tools.localStorage.verified_email) === 'true'
const perm = parseInt(localStorage.getItem(tools.localStorage.perm), 10)
GlobalStore.state.wasAlreadySubOnDb = localStorage.getItem(tools.localStorage.wasAlreadySubOnDb) === 'true'
@@ -659,7 +667,8 @@ namespace Actions {
username,
name,
surname,
verified_email
verified_email,
perm
})
isLogged = true
@@ -693,16 +702,17 @@ namespace Actions {
}
*/
export const actions = {
autologin_FromLocalStorage: b.dispatch(autologin_FromLocalStorage),
logout: b.dispatch(logout),
requestpwd: b.dispatch(requestpwd),
resetpwd: b.dispatch(resetpwd),
saveUserChange: b.dispatch(saveUserChange),
signin: b.dispatch(signin),
signup: b.dispatch(signup),
vreg: b.dispatch(vreg)
}
}
const stateGetter = b.state()

View File

@@ -13,7 +13,13 @@ export const lists = {
EDIT: 160,
ADD_PROJECT: 200,
THEME: 210,
THEMEBG: 211
THEMEBG: 211,
DELETE_RECTABLE: 300,
DUPLICATE_RECTABLE: 310,
CAN_EDIT_TABLE: 400,
SHOW_PREV_REC: 401,
},
selectTheme: [

View File

@@ -5,6 +5,7 @@ export const serv_constants = {
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: -10,

View File

@@ -1,4 +1,4 @@
import { Todos, Projects, UserStore, CalendarStore } from '@store'
import { Todos, Projects, UserStore, CalendarStore, GlobalStore } from '@store'
import globalroutines from './../../globalroutines/index'
import { costanti } from './costanti'
import { toolsext } from './toolsext'
@@ -24,6 +24,7 @@ import { static_data } from '@src/db/static_data'
import { IColl, ITimeLineEntry, ITimeLineMain } from '@src/model/GlobalStore'
import { func_tools } from '@src/store/Modules/toolsext'
import { serv_constants } from '@src/store/Modules/serv_constants'
import { shared_consts } from '@src/common/shared_vuejs'
export interface INotify {
color?: string | 'primary'
@@ -32,6 +33,7 @@ export interface INotify {
}
export const tools = {
MAX_CHARACTERS: 60,
projects: 'projects',
todos: 'todos',
EMPTY: 0,
@@ -43,6 +45,8 @@ export const tools = {
DUPLICATE_EMAIL_ID: 11000,
DUPLICATE_USERNAME_ID: 11100,
NOFIELD: 'nofield',
TYPE_AUDIO: 1,
NUMSEC_CHECKUPDATE: 20000,
@@ -69,6 +73,7 @@ export const tools = {
username: 'uname',
name: 'nm',
surname: 'sn',
perm: 'pm',
lang: 'lg'
},
@@ -1312,10 +1317,13 @@ export const tools = {
return result
},
executefunc(myself: any, func: number, par: IParamDialog) {
executefunc(myself: any, table, func: number, par: IParamDialog) {
if (func === lists.MenuAction.DELETE) {
console.log('param1', par.param1)
CalendarStore.actions.CancelBookingEvent({ideventbook: par.param1, notify: par.param2 === true ? '1' : '0'}).then((ris) => {
CalendarStore.actions.CancelBookingEvent({
ideventbook: par.param1,
notify: par.param2 === true ? '1' : '0'
}).then((ris) => {
if (ris) {
tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param1.title + '"')
if (myself.bookEventpage)
@@ -1323,10 +1331,28 @@ export const tools = {
} else
tools.showNegativeNotif(myself.$q, myself.$t('cal.cancelederrorbooking'))
})
} else if (func === lists.MenuAction.DELETE_RECTABLE) {
console.log('param1', par.param1)
GlobalStore.actions.DeleteRec({ table, id: par.param1 }).then((ris) => {
if (ris) {
myself.ActionAfterYes(func, par.param2, null)
tools.showPositiveNotif(myself.$q, myself.$t('db.deletedrecord'))
} else
tools.showNegativeNotif(myself.$q, myself.$t('db.recdelfailed'))
})
} else if (func === lists.MenuAction.DUPLICATE_RECTABLE) {
console.log('param1', par.param1)
GlobalStore.actions.DuplicateRec({ table, id: par.param1 }).then((ris) => {
if (ris) {
myself.ActionAfterYes(func, par.param2, ris.data)
tools.showPositiveNotif(myself.$q, myself.$t('db.duplicatedrecord'))
} else
tools.showNegativeNotif(myself.$q, myself.$t('db.recdupfailed'))
})
}
},
async askConfirm($q: any, mytitle, mytext, ok, cancel, myself: any, funcok: number, funccancel: number, par: IParamDialog) {
async askConfirm($q: any, mytitle, mytext, ok, cancel, myself: any, table, funcok: number, funccancel: number, par: IParamDialog) {
return $q.dialog({
message: mytext,
ok: {
@@ -1338,11 +1364,11 @@ export const tools = {
persistent: false
}).onOk(() => {
console.log('OK')
tools.executefunc(myself, funcok, par)
tools.executefunc(myself, table, funcok, par)
return true
}).onCancel(() => {
console.log('CANCEL')
tools.executefunc(myself, funccancel, par)
tools.executefunc(myself, table, funccancel, par)
return false
})
},
@@ -1536,7 +1562,7 @@ export const tools = {
}
}
let i = 0
// let i2 = 0
while (sortedList.length < linkedList.length) {
// get the item with a previous item ID referencing the current item
const nextItem = linkedList[map.get(currentId)]
@@ -1546,7 +1572,7 @@ export const tools = {
sortedList.push(nextItem)
// tools.logelemprj('FATTO:' + i, nextItem)
currentId = String(nextItem._id)
i++
// i2++
}
if (sortedList.length < linkedList.length) {
@@ -1611,8 +1637,23 @@ export const tools = {
return date.formatDate(mytimestamp, 'DD/MM/YYYY')
else
return ''
}
,
},
getstrTime(mytimestamp) {
// console.log('getstrDate', mytimestamp)
if (!!mytimestamp)
return date.formatDate(mytimestamp, 'HH:mm')
else
return ''
},
getstrDateTime(mytimestamp) {
// console.log('getstrDate', mytimestamp)
if (!!mytimestamp)
return date.formatDate(mytimestamp, 'DD/MM/YYYY HH:mm')
else
return ''
},
getstrMMMDate(mytimestamp) {
// console.log('getstrDate', mytimestamp)
if (!!mytimestamp)
@@ -1660,7 +1701,14 @@ export const tools = {
if (!value) {
return ''
}
return value.substring(0, numchars) + '...'
try {
let mycar = value.substring(0, numchars)
if (value.length > numchars)
mycar += '...'
return mycar
} catch (e) {
return value
}
},
getDateNow() {
@@ -1814,13 +1862,29 @@ export const tools = {
},
heightgallery() {
return tools.heightGallVal().toString() + 'px'
},
heightGallVal() {
let maxh2 = 0
if (Screen.width < 400) {
return '200px'
maxh2 = 350
} else if (Screen.width < 600) {
return '300px'
maxh2 = 400
} else if (Screen.width < 700) {
maxh2 = 450
} else if (Screen.width < 800) {
maxh2 = 550
} else if (Screen.width < 1000) {
maxh2 = 650
} else if (Screen.width < 1200) {
maxh2 = 700
} else {
return '500px'
maxh2 = 750
}
return maxh2
},
myheight_imgtitle(myheight?, myheightmobile?) {
@@ -1838,21 +1902,10 @@ export const tools = {
maxheight = 500
}
let maxh2 = 0
if (Screen.width < 400) {
maxh2 = 350
} else if (Screen.width < 600) {
maxh2 = 400
} else if (Screen.width < 800) {
maxh2 = 450
} else if (Screen.width < 1000) {
maxh2 = 500
} else {
maxh2 = 500
}
const maxh2 = this.heightGallVal()
console.log('maxh2', maxh2)
console.log('maxheight', maxheight)
// console.log('maxh2', maxh2)
// console.log('maxheight', maxheight)
let ris = 0
@@ -1866,7 +1919,7 @@ export const tools = {
ris = parseInt(myheightmobile, 10)
}
console.log('ris', ris)
// console.log('ris', ris)
return ris
},
@@ -2090,7 +2143,8 @@ export const tools = {
return msg
},
gettextevent(myevent: IEvents) {
return '"' + myevent.title + '" (' + func_tools.getDateStr(myevent.date) + ') - ' + myevent.time
// return '"' + myevent.title + '" (' + func_tools.getDateStr(myevent.date) + ') - ' + myevent.time
return '"' + myevent.title + '" (' + tools.getstrDateTime(myevent.date)
},
setLangAtt(mylang) {
@@ -2173,7 +2227,8 @@ export const tools = {
tools.showNotif(mythis.$q, mythis.$t('login.errato'), { color: 'negative', icon: 'notifications' })
mythis.iswaitingforRes = false
if (ispageLogin) {
mythis.$router.push('/signin')
GlobalStore.state.RightDrawerOpen = true
// mythis.$router.push('/signin')
}
})
@@ -2212,7 +2267,7 @@ export const tools = {
} else if (riscode === tools.OK) {
mythis.$router.push('/signin')
tools.showNotif(mythis.$q, mythis.$t('components.authentication.email_verification.link_sent'), {
color: 'warning',
color: 'info',
textColor: 'black'
})
} else {
@@ -2239,11 +2294,20 @@ export const tools = {
},
CancelBookingEvent(mythis, eventparam: IEvents, bookeventid: string, notify: boolean) {
console.log('CancelBookingEvent ', eventparam)
tools.askConfirm(mythis.$q, translate('cal.titlebooking'), translate('cal.cancelbooking') + ' ' + tools.gettextevent(eventparam) + '?', translate('dialog.yes'), translate('dialog.no'), mythis, lists.MenuAction.DELETE, 0, { param1: bookeventid, param2: notify })
tools.askConfirm(mythis.$q, translate('cal.titlebooking'), translate('cal.cancelbooking') + ' ' + tools.gettextevent(eventparam) + '?', translate('dialog.yes'), translate('dialog.no'), mythis, '', lists.MenuAction.DELETE, 0, {
param1: bookeventid,
param2: notify
})
},
CancelUserRec(mythis, id) {
console.log('CancelUserRec', id)
tools.askConfirm(mythis.$q, translate('cal.titlebooking'), translate('cal.canceluser') + '?', translate('dialog.yes'), translate('dialog.no'), mythis, lists.MenuAction.DELETE, 0, { param1: id })
ActionRecTable(mythis, action, table, id, item?) {
console.log('CancelRecTable', id)
return tools.askConfirm(mythis.$q, translate('db.deleterecord'), translate('db.deletetherecord'), translate('dialog.yes'), translate('dialog.no'), mythis, table, action, 0, {
param1: id,
param2: item
})
},
isBitActive(bit, whattofind) {
return ((bit & whattofind) === whattofind)
}
// getLocale() {

View File

@@ -29,7 +29,7 @@ export default class CfgServer extends Vue {
{ name: 'valore', label: 'Valore', field: 'valore', sortable: false }
]
public visibleColumns: ['chiave', 'userid', 'valore']
public colVisib: ['chiave', 'userid', 'valore']
public separator: 'horizontal'
public filter: string = ''
public selected: any[] = []