{{ visuValByType(col, props.row[col.name]) }}
diff --git a/src/model/Calendar.ts b/src/model/Calendar.ts
index 456e916..edccacd 100644
--- a/src/model/Calendar.ts
+++ b/src/model/Calendar.ts
@@ -5,7 +5,7 @@ export interface IEvents {
short_tit?: string
title?: string
details?: string
- time?: string
+ withtime?: boolean
dur?: number
dur2?: number
date?: string
@@ -18,8 +18,6 @@ export interface IEvents {
contribtype?: number
teacher?: string // teacherid
teacher2?: string // teacherid2
- avatar?: string
- avatar2?: string
infoextra?: string
linkpage?: string
linkpdf?: string
@@ -42,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
}
@@ -56,6 +69,7 @@ export interface ICalendarState {
editable: boolean
eventlist: IEvents[]
bookedevent: IBookedEvent[]
+ operators: IOperators[]
// ---------------
titlebarHeight: number
locale: string,
diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts
index ffd00a3..87cdc39 100644
--- a/src/model/GlobalStore.ts
+++ b/src/model/GlobalStore.ts
@@ -227,7 +227,7 @@ export interface IColGridTable {
icon?: string
action?: any
foredit?: boolean
- isdate?: boolean
+ fieldtype?: string
visuonlyEditVal?: boolean
}
@@ -237,3 +237,9 @@ export interface ITableRec {
columns: IColGridTable[]
colkey: string
}
+
+export interface IDataPass {
+ id: string
+ table: string
+ fieldsvalue: object
+}
diff --git a/src/statics/i18n.js b/src/statics/i18n.js
index 02332b2..e60d18a 100644
--- a/src/statics/i18n.js
+++ b/src/statics/i18n.js
@@ -32,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}?"
@@ -48,6 +48,8 @@ const msgglobal = {
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: {
@@ -221,6 +223,34 @@ const msgglobal = {
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?',
name: 'Il tuo Nome',
@@ -233,7 +263,7 @@ 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.'
@@ -269,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}?'
@@ -285,6 +315,8 @@ const msgglobal = {
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: {
@@ -452,6 +484,34 @@ const msgglobal = {
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?',
name: 'Tu Nombre',
@@ -500,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}?'
@@ -516,6 +576,8 @@ const msgglobal = {
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: {
@@ -682,6 +744,34 @@ const msgglobal = {
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?',
name: 'Ton nom',
@@ -730,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}?'
@@ -746,6 +836,8 @@ const msgglobal = {
deletetherecord: 'Delete the Record?',
deletedrecord: 'Record Deleted',
recdelfailed: 'Error during deletion of the Record',
+ duplicatedrecord: 'Duplicate Record',
+ recdupfailed: 'Error during record duplication',
},
components: {
authentication: {
@@ -911,6 +1003,34 @@ const msgglobal = {
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?',
name: 'Your name',
@@ -959,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}?'
@@ -975,6 +1095,8 @@ const msgglobal = {
deletetherecord: 'Delete the Record?',
deletedrecord: 'Record Deleted',
recdelfailed: 'Error during deletion of the Record',
+ duplicatedrecord: 'Duplicate Record',
+ recdupfailed: 'Error during record duplication',
},
components: {
authentication: {
@@ -1142,6 +1264,34 @@ const msgglobal = {
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?',
name: 'Your name',
diff --git a/src/store/Modules/GlobalStore.ts b/src/store/Modules/GlobalStore.ts
index 04c6b98..812a1ae 100644
--- a/src/store/Modules/GlobalStore.ts
+++ b/src/store/Modules/GlobalStore.ts
@@ -13,15 +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 { IParamsQuery } from '@src/model/GlobalStore'
+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'
@@ -268,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),
@@ -278,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)
}
}
@@ -533,14 +570,15 @@ namespace Actions {
})
}
- async function saveFieldValue(context, mydata: object) {
+ async function saveFieldValue(context, mydata: IDataPass) {
console.log('saveFieldValue', mydata)
return await Api.SendReq(`/chval`, 'PATCH', { data: mydata })
.then((res) => {
- if (res)
+ if (res) {
+ Mutations.mutations.UpdateValuesInMemory(mydata)
return (res.data.code === serv_constants.RIS_CODE_OK)
- else
+ } else
return false
})
.catch((error) => {
@@ -566,6 +604,24 @@ namespace Actions {
})
}
+ 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),
@@ -578,7 +634,8 @@ namespace Actions {
saveFieldValue: b.dispatch(saveFieldValue),
loadTable: b.dispatch(loadTable),
saveTable: b.dispatch(saveTable),
- DeleteRec: b.dispatch(DeleteRec)
+ DeleteRec: b.dispatch(DeleteRec),
+ DuplicateRec: b.dispatch(DuplicateRec)
}
}
diff --git a/src/store/Modules/Store/calendar/CalendarStore.ts b/src/store/Modules/Store/calendar/CalendarStore.ts
index 3da9a8f..4df845d 100644
--- a/src/store/Modules/Store/calendar/CalendarStore.ts
+++ b/src/store/Modules/Store/calendar/CalendarStore.ts
@@ -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) {
@@ -109,11 +110,10 @@ namespace Actions {
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)
diff --git a/src/store/Modules/lists.ts b/src/store/Modules/lists.ts
index 77c0bb2..5ff7d81 100644
--- a/src/store/Modules/lists.ts
+++ b/src/store/Modules/lists.ts
@@ -16,6 +16,7 @@ export const lists = {
THEMEBG: 211,
DELETE_RECTABLE: 300,
+ DUPLICATE_RECTABLE: 310,
CAN_EDIT_TABLE: 400,
SHOW_PREV_REC: 401,
diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts
index 618b254..1bf345b 100644
--- a/src/store/Modules/tools.ts
+++ b/src/store/Modules/tools.ts
@@ -45,6 +45,8 @@ export const tools = {
DUPLICATE_EMAIL_ID: 11000,
DUPLICATE_USERNAME_ID: 11100,
+ NOFIELD: 'nofield',
+
TYPE_AUDIO: 1,
NUMSEC_CHECKUPDATE: 20000,
@@ -1333,11 +1335,20 @@ export const tools = {
console.log('param1', par.param1)
GlobalStore.actions.DeleteRec({ table, id: par.param1 }).then((ris) => {
if (ris) {
- myself.ActionAfterYes(func, par.param2)
+ 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'))
+ })
}
},
@@ -1551,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)]
@@ -1561,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) {
@@ -1628,10 +1639,18 @@ export const tools = {
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')
+ return date.formatDate(mytimestamp, 'DD/MM/YYYY HH:mm')
else
return ''
},
@@ -1683,8 +1702,11 @@ export const tools = {
return ''
}
try {
- return value.substring(0, numchars) + '...'
- }catch (e) {
+ let mycar = value.substring(0, numchars)
+ if (value.length > numchars)
+ mycar += '...'
+ return mycar
+ } catch (e) {
return value
}
},
@@ -2121,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) {