++ aggiunta la prenotazione negli eventi. con la lista degli utenti.
This commit is contained in:
@@ -1069,6 +1069,46 @@ export const tools = {
|
||||
label: '10',
|
||||
value: 10,
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
label: '11',
|
||||
value: 11,
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
label: '12',
|
||||
value: 12,
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
label: '13',
|
||||
value: 13,
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
label: '14',
|
||||
value: 14,
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
label: '15',
|
||||
value: 15,
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
label: '20',
|
||||
value: 20,
|
||||
},
|
||||
{
|
||||
id: 25,
|
||||
label: '25',
|
||||
value: 25,
|
||||
},
|
||||
{
|
||||
id: 30,
|
||||
label: '30',
|
||||
value: 30,
|
||||
},
|
||||
],
|
||||
|
||||
selectPhase: {
|
||||
@@ -3116,7 +3156,7 @@ export const tools = {
|
||||
}
|
||||
} else {
|
||||
if (withhtml) {
|
||||
mystr = `<span class="cal__where-content">${this.getstrDateLong(myevent.dateTimeStart)}</span>
|
||||
mystr = `<span class="cal__where-content">${this.getstrDateLong(myevent.dateTimeStart)}</span>
|
||||
<span class="cal__hours-content">${$t('cal.starttime')} ${this.getstrTime(myevent.dateTimeStart)} </span>
|
||||
${$t('cal.enddate')} ${this.getstrDateLong(myevent.dateTimeEnd)}
|
||||
<span class="cal__hours-content">${$t('cal.endtime')} ${this.getstrTime(myevent.dateTimeEnd)} </span>`
|
||||
@@ -3766,9 +3806,9 @@ export const tools = {
|
||||
return msg
|
||||
}
|
||||
,
|
||||
gettextevent(myevent: IEvents) {
|
||||
gettextevent(myevent: any) {
|
||||
// return '"' + myevent.title + '" (' + func_tools.getDateStr(myevent.date) + ') - ' + myevent.time
|
||||
return '"' + myevent.title + '" (' + this.getstrDateEmailTime(myevent.dateTimeStart) + ')'
|
||||
return '"' + (myevent.title ? myevent.title : (myevent.descr ? myevent.descr: '')) + '" (' + this.getstrDateEmailTime(myevent.dateTimeStart) + ')'
|
||||
},
|
||||
|
||||
getlangforQuasar(mylang: string) {
|
||||
@@ -6862,7 +6902,7 @@ export const tools = {
|
||||
return ris
|
||||
},
|
||||
|
||||
getdefaultnewrec_MySkill(): any {
|
||||
getdefaultnewrec_MySkill(groupname?: string): any {
|
||||
|
||||
return {
|
||||
idSector: tools.getSelectionByTable('sectors', 0, true),
|
||||
@@ -6878,6 +6918,7 @@ export const tools = {
|
||||
//**ADDFIELD_MYSKILL
|
||||
website: '',
|
||||
descr: '',
|
||||
groupname,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6944,7 +6985,7 @@ export const tools = {
|
||||
},
|
||||
|
||||
|
||||
getdefaultnewrec_MyBacheca(): any {
|
||||
getdefaultnewrec_MyBacheca(extrarec: any): any {
|
||||
return {
|
||||
idSector: tools.getSelectionByTable('sectors', 0, true),
|
||||
idSkill: tools.getSelectionByTable('skills', 0, true),
|
||||
@@ -6958,6 +6999,13 @@ export const tools = {
|
||||
pub_to_share: tools.getSelectionByTable('pub_to_share', shared_consts.PUBTOSHARE.ALL, true),
|
||||
photos: [],
|
||||
note: '',
|
||||
organisedBy: tools.getSelectionByTable('organisedBy', ''),
|
||||
address: tools.getSelectionByTable('address', ''),
|
||||
min_partecip: tools.getSelectionByTable('min_partecip', 0, true),
|
||||
max_partecip: tools.getSelectionByTable('max_partecip', 0, true),
|
||||
contribstr: tools.getSelectionByTable('contribstr', ''),
|
||||
groupname: extrarec && extrarec.groupname ? extrarec.groupname : '',
|
||||
|
||||
//**ADDFIELD_MYBACHECAS
|
||||
website: '',
|
||||
descr: '',
|
||||
@@ -7811,7 +7859,235 @@ export const tools = {
|
||||
return 0
|
||||
},
|
||||
|
||||
getdefaultnewrec(table: string, extrarec?: any): any {
|
||||
if (table === toolsext.TABMYSKILLS) {
|
||||
return tools.getdefaultnewrec_MySkill()
|
||||
} else if (table === toolsext.TABMYBACHECAS) {
|
||||
return tools.getdefaultnewrec_MyBacheca(extrarec)
|
||||
} else if (table === toolsext.TABMYHOSPS) {
|
||||
return tools.getdefaultnewrec_MyHosp()
|
||||
} else if (table === toolsext.TABMYGOODS) {
|
||||
return tools.getdefaultnewrec_MyGoods()
|
||||
} else if (table === toolsext.TABMYGROUPS) {
|
||||
return tools.getdefaultnewrec_MyGroup()
|
||||
} else if (table === toolsext.TABCIRCUITS) {
|
||||
return tools.getdefaultnewrec_Circuit()
|
||||
}
|
||||
return null
|
||||
},
|
||||
|
||||
extraparams(table: string, extra?: any) {
|
||||
if (table === toolsext.TABMYGROUPS) {
|
||||
|
||||
let lk_tab = 'mygroups'
|
||||
let lk_LF = 'userId'
|
||||
let lk_FF = '_id'
|
||||
let lk_as = 'group'
|
||||
let af_objId_tab = 'myId'
|
||||
|
||||
return {
|
||||
lookup1: {
|
||||
lk_tab,
|
||||
lk_LF,
|
||||
lk_FF,
|
||||
lk_as,
|
||||
af_objId_tab,
|
||||
lk_proj: shared_consts.getProjectByTable(table, {}),
|
||||
},
|
||||
lookup2: {
|
||||
lk_tab: 'catgrps',
|
||||
lk_LF: 'idCatGrp',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'recCatGrp',
|
||||
lk_proj: shared_consts.getProjectByTable(table, {}),
|
||||
},
|
||||
lookup3: {
|
||||
lk_tab: 'cities',
|
||||
lk_LF: 'idCity',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'comune',
|
||||
lk_proj: shared_consts.getProjectByTable(table, {}),
|
||||
},
|
||||
lookup4: {
|
||||
lk_tab: 'cities',
|
||||
lk_LF: 'idCity',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'mycities',
|
||||
af_objId_tab: '',
|
||||
},
|
||||
}
|
||||
|
||||
} else if (table === toolsext.TABCIRCUITS) {
|
||||
|
||||
let lk_tab = 'cities'
|
||||
let lk_LF = 'idCity'
|
||||
let lk_FF = '_id'
|
||||
let lk_as = 'mycities'
|
||||
let af_objId_tab = ''
|
||||
|
||||
return {
|
||||
lookup1: {
|
||||
lk_tab,
|
||||
lk_LF,
|
||||
lk_FF,
|
||||
lk_as,
|
||||
af_objId_tab,
|
||||
lk_proj: shared_consts.getProjectByTable(table, {}),
|
||||
},
|
||||
}
|
||||
|
||||
} else if (table === toolsext.TABMYGOODS) {
|
||||
return {
|
||||
lookup1: {
|
||||
lk_tab: 'users',
|
||||
lk_LF: 'userId',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
},
|
||||
lookup2: {
|
||||
lk_tab: 'goods',
|
||||
lk_LF: 'idGood',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'recGood',
|
||||
af_objId_tab: '',
|
||||
lk_proj: shared_consts.getProjectForAll({}, table),
|
||||
},
|
||||
lookup3: {
|
||||
lk_tab: 'sectorgoods',
|
||||
// lk_LF: 'recGood.idSectorGood',
|
||||
lk_LF: 'idSectorGood',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'sectorGood',
|
||||
af_objId_tab: '',
|
||||
},
|
||||
lookup4: {
|
||||
lk_tab: 'cities',
|
||||
lk_LF: 'idCity',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'mycities',
|
||||
af_objId_tab: '',
|
||||
},
|
||||
}
|
||||
} else if (table === toolsext.TABMYBACHECAS) {
|
||||
return {
|
||||
lookup1: {
|
||||
lk_tab: 'users',
|
||||
lk_LF: 'userId',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
},
|
||||
lookup2: {
|
||||
lk_tab: 'skills',
|
||||
lk_LF: 'idSkill',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'recSkill',
|
||||
af_objId_tab: '',
|
||||
lk_proj: shared_consts.getProjectForAll({}, table),
|
||||
},
|
||||
lookup3: {
|
||||
lk_tab: toolsext.TABSECTORS,
|
||||
// lk_LF: 'recSkill.idSector',
|
||||
lk_LF: 'idSector',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'sector',
|
||||
af_objId_tab: '',
|
||||
},
|
||||
lookup4: {
|
||||
lk_tab: 'cities',
|
||||
lk_LF: 'idCity',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'mycities',
|
||||
af_objId_tab: '',
|
||||
},
|
||||
lookup5: {
|
||||
lk_tab: 'mygroups',
|
||||
lk_LF: 'groupname',
|
||||
lk_FF: 'groupname',
|
||||
lk_as: 'mygrp',
|
||||
lk_proj: shared_consts.getProjectForAll({}, table),
|
||||
unwind: true,
|
||||
noarray: true,
|
||||
},
|
||||
}
|
||||
|
||||
} else if (table === toolsext.TABMYHOSPS) {
|
||||
let obj2: any = {}
|
||||
|
||||
if (extra && extra.myrecfiltertoggle.value === tools.FILTER_ALL) {
|
||||
obj2['visibile'] = true
|
||||
}
|
||||
|
||||
return {
|
||||
filtersearch2: [obj2],
|
||||
lookup1: {
|
||||
lk_tab: 'users',
|
||||
lk_LF: 'userId',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
},
|
||||
lookup2: {
|
||||
lk_tab: 'cities',
|
||||
lk_LF: 'idCity',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'mycities',
|
||||
af_objId_tab: '',
|
||||
lk_proj: shared_consts.getProjectForAll({}, table),
|
||||
},
|
||||
}
|
||||
|
||||
} else {
|
||||
return {
|
||||
// Servizi
|
||||
lookup1: {
|
||||
lk_tab: 'users',
|
||||
lk_LF: 'userId',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'user',
|
||||
af_objId_tab: 'myId',
|
||||
},
|
||||
lookup2: {
|
||||
lk_tab: 'skills',
|
||||
lk_LF: 'idSkill',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'recSkill',
|
||||
af_objId_tab: '',
|
||||
lk_proj: shared_consts.getProjectForAll({}, table),
|
||||
},
|
||||
lookup3: {
|
||||
lk_tab: toolsext.TABSECTORS,
|
||||
lk_LF: 'idSector',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'sector',
|
||||
af_objId_tab: '',
|
||||
},
|
||||
lookup5: {
|
||||
lk_tab: 'cities',
|
||||
lk_LF: 'idCity',
|
||||
lk_FF: '_id',
|
||||
lk_as: 'mycities',
|
||||
af_objId_tab: '',
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getNumPartecipantes(myrec: any) {
|
||||
if (myrec && myrec.mybookings && myrec.mybookings.length > 0) {
|
||||
return myrec.mybookings.reduce((accum: any, currval: any) => accum + (currval.booked ? 0 : currval.numpeople), 0)
|
||||
}
|
||||
return 0
|
||||
},
|
||||
isPartecipero(myrec: any) {
|
||||
const userStore = useUserStore()
|
||||
if (myrec && myrec.mybookings && myrec.mybookings.length > 0) {
|
||||
const isconfirmed = true
|
||||
return myrec.mybookings.find((bookedevent: any) => (bookedevent.id_bookedevent === myrec._id) && (bookedevent.userId === userStore.my._id) && ((isconfirmed && bookedevent.booked) || (!isconfirmed)))
|
||||
}
|
||||
return 0
|
||||
},
|
||||
|
||||
// FINE !
|
||||
|
||||
|
||||
Reference in New Issue
Block a user