@@ -68,7 +68,8 @@ const state: IGlobalState = {
|
||||
type: 0,
|
||||
_id: 0
|
||||
},
|
||||
settings: []
|
||||
settings: [],
|
||||
disciplines: []
|
||||
}
|
||||
|
||||
async function getConfig(id) {
|
||||
@@ -163,6 +164,8 @@ namespace Getters {
|
||||
return CalendarStore.state.wheres
|
||||
else if (table === 'contribtype')
|
||||
return CalendarStore.state.contribtype
|
||||
else if (table === 'disciplines')
|
||||
return GlobalStore.state.disciplines
|
||||
else if (table === 'bookings')
|
||||
return CalendarStore.state.bookedevent
|
||||
else if (table === 'users')
|
||||
@@ -690,6 +693,7 @@ namespace Actions {
|
||||
CalendarStore.state.wheres = (res.data.wheres) ? res.data.wheres : []
|
||||
CalendarStore.state.contribtype = (res.data.contribtype) ? res.data.contribtype : []
|
||||
GlobalStore.state.settings = (res.data.settings) ? [...res.data.settings] : []
|
||||
GlobalStore.state.disciplines = (res.data.disciplines) ? [...res.data.disciplines] : []
|
||||
|
||||
CalendarStore.state.editable = UserStore.state.isAdmin || UserStore.state.isManager
|
||||
|
||||
|
||||
@@ -53,6 +53,22 @@ const colcontribtype = [
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
const coldisciplines = [
|
||||
AddCol({ name: 'typol_code', label_trans: 'disc.typol_code' }),
|
||||
AddCol({ name: 'order', label_trans: 'disc.order', fieldtype: tools.FieldType.number }),
|
||||
AddCol({ name: 'label', label_trans: 'event.title' }),
|
||||
AddCol({ name: 'description', label_trans: 'proj.longdescr' }),
|
||||
AddCol({ name: 'linkpage', label_trans: 'event.linkpage' }),
|
||||
AddCol({ name: 'color', label_trans: 'event.color' }),
|
||||
AddCol({ name: 'icon', label_trans: 'event.icon' }),
|
||||
AddCol({ name: 'img', label_trans: 'event.img' }),
|
||||
AddCol({ name: 'img_small', label_trans: 'event.img_small' }),
|
||||
AddCol({ name: 'showinhome', label_trans: 'event.showinhome', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol({ name: 'showinnewsletter', label_trans: 'event.showinnewsletter', fieldtype: tools.FieldType.boolean }),
|
||||
AddCol({ name: 'teachers', label_trans: 'event.teacher', fieldtype: tools.FieldType.multiselect, jointable: 'operators' }),
|
||||
AddCol(DeleteRec)
|
||||
]
|
||||
|
||||
const colsettings = [
|
||||
AddCol({ name: 'key', label_trans: 'col.label' }),
|
||||
AddCol({ name: 'type', label_trans: 'col.type', fieldtype: tools.FieldType.select, jointable: 'fieldstype' }),
|
||||
@@ -88,7 +104,7 @@ const colTableOperator = [
|
||||
|
||||
const colTableEvents = [
|
||||
AddCol({ name: '_id', label_trans: 'event._id' }),
|
||||
AddCol({ name: 'typol', label_trans: 'event.typol' }),
|
||||
AddCol({ name: 'typol', label_trans: 'event.typol', fieldtype: tools.FieldType.select, jointable: 'disciplines' }),
|
||||
AddCol({ name: 'short_tit', label_trans: 'event.short_tit' }),
|
||||
AddCol({ name: 'title', label_trans: 'event.title' }),
|
||||
AddCol({ name: 'details', label_trans: 'event.details', fieldtype: tools.FieldType.html }),
|
||||
@@ -244,6 +260,13 @@ export const fieldsTable = {
|
||||
colkey: '_id',
|
||||
collabel: 'label'
|
||||
},
|
||||
{
|
||||
value: 'disciplines',
|
||||
label: 'Discipline',
|
||||
columns: coldisciplines,
|
||||
colkey: '_id',
|
||||
collabel: 'label'
|
||||
},
|
||||
{
|
||||
value: 'permissions',
|
||||
label: 'Permessi',
|
||||
@@ -264,7 +287,7 @@ export const fieldsTable = {
|
||||
columns: colsettings,
|
||||
colkey: 'key',
|
||||
collabel: 'key'
|
||||
},
|
||||
}
|
||||
],
|
||||
|
||||
// IColGridTable
|
||||
|
||||
@@ -132,6 +132,7 @@ export const tools = {
|
||||
select: 32,
|
||||
number: 64,
|
||||
typeinrec: 128,
|
||||
multiselect: 256,
|
||||
},
|
||||
|
||||
FieldTypeArr: [
|
||||
@@ -2526,6 +2527,35 @@ export const tools = {
|
||||
return mythis.$q.screen.width
|
||||
},
|
||||
|
||||
getwidthscale(mythis, mywidth, maxwidth) {
|
||||
if (this.isMobile()) {
|
||||
return mywidth
|
||||
} else {
|
||||
let myw = mywidth + ((this.getwidth(mythis) - mywidth - 300) * 0.4)
|
||||
if (myw > maxwidth)
|
||||
myw = maxwidth
|
||||
|
||||
return myw
|
||||
}
|
||||
},
|
||||
|
||||
getheightbywidth(mythis, mywidth, myheight, maxwidth) {
|
||||
const myw = this.getwidthscale(mythis, mywidth, maxwidth)
|
||||
return myw * (myheight / mywidth)
|
||||
},
|
||||
|
||||
getheightscale(mythis, myheight, maxheight) {
|
||||
if (this.isMobile()) {
|
||||
return myheight
|
||||
} else {
|
||||
let myh = myheight + ((this.getheight(mythis) - myheight) * 0.3)
|
||||
if (myh > maxheight)
|
||||
myh = maxheight
|
||||
|
||||
return myh
|
||||
}
|
||||
},
|
||||
|
||||
isIsoDate(str) {
|
||||
if (!/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(str)) return false
|
||||
const d = new Date(str)
|
||||
|
||||
Reference in New Issue
Block a user