++ aggiunta la prenotazione negli eventi. con la lista degli utenti.

This commit is contained in:
Surya Paolo
2023-04-17 00:11:45 +02:00
parent 6f1f962c0a
commit 3cf4562285
38 changed files with 2016 additions and 1278 deletions

View File

@@ -5,9 +5,11 @@ import { CTitleBanner } from '@/components/CTitleBanner'
import { CProfile } from '@/components/CProfile'
import { CDateTime } from '@/components/CDateTime'
import { CMyPage } from '@/components/CMyPage'
import { CMyGroup } from '@/components/CMyGroup'
import { CMyChipList } from '@/components/CMyChipList'
import { CMyFieldRec } from '@/components/CMyFieldRec'
import { CMyUser } from '@/components/CMyUser'
import { CLabel } from '@/components/CLabel'
import { CGalleryImages } from '@/components/CGalleryImages'
import { CAccomodation } from '@/components/CAccomodation'
import { tools } from '@store/Modules/tools'
@@ -18,18 +20,22 @@ import { useI18n } from '@/boot/i18n'
import { toolsext } from '@store/Modules/toolsext'
import { useQuasar } from 'quasar'
import { costanti } from '@costanti'
import { IColGridTable, IImgGallery, IUserFields } from 'model'
import { EState, IBookedEventPage, IColGridTable, IBookedEvent, IEvents, IMessage, IMessagePage, IParamDialog } from '@model'
import { shared_consts } from '@/common/shared_vuejs'
import { colCitys, fieldsTable } from '@store/Modules/fieldsTable'
import { useRoute, useRouter } from 'vue-router'
import { useNotifStore } from '@store/NotifStore'
import { lists } from '@store/Modules/lists'
import translate from '@/globalroutines/util'
import { useMessageStore } from '@src/store/MessageStore'
import mixinEvents from '@src/mixins/mixin-events'
export default defineComponent({
name: 'CMyCardService',
components: {
CProfile, CTitleBanner,
CMyFieldDb, CDateTime, CMyPage, CMyFieldRec, CAccomodation,
CMyUser, CGalleryImages, CMyChipList
CMyUser, CGalleryImages, CMyChipList, CLabel, CMyGroup
},
props: {
table: {
@@ -56,22 +62,81 @@ export default defineComponent({
const userStore = useUserStore()
const calendarStore = useCalendarStore()
const messageStore = useMessageStore()
const notifStore = useNotifStore()
const globalStore = useGlobalStore()
const $q = useQuasar()
const $route = useRoute()
const { t } = useI18n()
const showPic = ref(false)
const loading = ref(false)
const $router = useRouter()
const contextDay = ref(<any>null)
const usersList = ref({ show: false, title: '', list: [] })
const bookedList = ref(<any>{ show: false, title: '', list: [] })
const formbookEventDefault = ref(<IBookedEvent>{
userId: '',
username: '',
msgbooking: '',
infoevent: '',
tableType: shared_consts.TABLETYPE.MyBachecas,
numpeople: 1,
numpeopleLunch: 0,
numpeopleDinner: 0,
numpeopleDinnerShared: 0,
datebooked: tools.getDateNow(),
booked: false,
modified: false
})
const formAskForDefault = ref(<IMessage>{
dest: '',
origin: '',
message: '',
})
const bookEventForm = ref({ ...formbookEventDefault.value })
const askInfoForm = ref(<IMessage>{
dest: '',
origin: '',
message: '',
})
const askInfopage = ref(<IMessagePage>{
show: false,
msg: {
message: ''
},
state: EState.None
})
const bookEventpage = ref(<IBookedEventPage>{
show: false,
bookedevent: {
userId: '',
username: '',
tableType: shared_consts.TABLETYPE.MyBachecas,
numpeople: 0,
infoevent: '',
msgbooking: '',
modified: false,
booked: false
},
state: EState.Creating,
})
const myrec = ref(<any>{})
const col = ref(<IColGridTable>{})
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
const arrbookings = computed(() => calendarStore.findAllBookedByIdEvent(myrec.value._id))
function profile() {
return userStore.my.profile
@@ -139,23 +204,47 @@ export default defineComponent({
return null
}
function clicca(tipo: any, myset: any, title: string) {
async function clicca(tipo: any, myset: any, title: string) {
let mylist = null
if (tipo === costanti.TIPOFAVBOOK.FAVORITE) {
if (myset) {
userStore.setFavorite($q, t, myrec.value._id, props.table, myrec.value);
await userStore.setFavorite($q, t, myrec.value._id, props.table, myrec.value);
}
mylist = myrec.value.myfav
} else if (tipo === costanti.TIPOFAVBOOK.BOOKMARK) {
if (myset) {
userStore.setBookmark($q, t, myrec.value._id, props.table, myrec.value);
await userStore.setBookmark($q, t, myrec.value._id, props.table, myrec.value);
}
mylist = myrec.value.mybook
} else if (tipo === costanti.TIPOFAVBOOK.SEEN) {
if (myset) {
userStore.setSeen($q, t, myrec.value._id, props.table, myrec.value);
loading.value = true
const risrecord = await userStore.setSeen($q, t, myrec.value._id, props.table, myrec.value)
if (risrecord) {
myrec.value = risrecord
calendarStore.updatearrBookingEvent(myrec.value._id, risrecord.mybookings)
bookEventpage.value.state = EState.None
const findev = calendarStore.findEventBooked(myrec.value._id, false)
EditBookEvent(false)
}
loading.value = false
}
mylist = myrec.value.myseen
} else if (tipo === costanti.TIPOFAVBOOK.ATTEND) {
if (myset) {
// userStore.setAttend($q, t, myrec.value._id, props.table, bookEventpage.value.bookedevent.numpeople, myrec.value);
}
mylist = arrbookings.value
if (!myset && mylist && mylist.length > 0) {
bookedList.value.show = true;
bookedList.value.title = title;
bookedList.value.list = mylist;
}
return true;
}
if (!myset && mylist && mylist.length > 0) {
@@ -180,6 +269,180 @@ export default defineComponent({
return obj
}
function hasModifiedBooking() {
return (bookEventpage.value.bookedevent.numpeople !== bookEventForm.value.numpeople) ||
(bookEventpage.value.bookedevent.numpeopleLunch !== bookEventForm.value.numpeopleLunch) ||
(bookEventpage.value.bookedevent.numpeopleDinner !== bookEventForm.value.numpeopleDinner) ||
(bookEventpage.value.bookedevent.numpeopleDinnerShared !== bookEventForm.value.numpeopleDinnerShared) ||
(bookEventpage.value.bookedevent.msgbooking !== bookEventForm.value.msgbooking) ||
(bookEventpage.value.bookedevent.booked !== bookEventForm.value.booked)
}
function checkseinviaMsg() {
return (bookEventpage.value.state === EState.Creating) && (!bookEventForm.value.booked)
}
function getTitleBtnBooking() {
if (bookEventpage.value.state === EState.Creating) {
return t('dialog.book')
} else {
return t('dialog.update')
}
}
function EditBookEvent(show: boolean) {
// const bookedevent: any = calendarStore.findEventBooked(myrec.value._id, false)
const bookedevent: any = arrbookings.value.find((recbook: IBookedEvent) => recbook.userId === userStore.my._id)
console.log('bookedevent', bookedevent)
if (bookedevent) {
bookEventForm.value._id = bookedevent._id
bookEventForm.value.numpeople = bookedevent.numpeople
bookEventForm.value.numpeopleLunch = bookedevent.numpeopleLunch
bookEventForm.value.numpeopleDinner = bookedevent.numpeopleDinner
bookEventForm.value.numpeopleDinnerShared = bookedevent.numpeopleDinnerShared
bookEventForm.value.infoevent = bookedevent.infoevent
bookEventForm.value.msgbooking = bookedevent.msgbooking
bookEventForm.value.booked = bookedevent.booked
bookEventForm.value.datebooked = bookedevent.datebooked
bookEventpage.value.state = EState.Modifying
} else {
bookEventpage.value.state = EState.Creating
}
bookEventpage.value.bookedevent = bookedevent
bookEventpage.value.show = show
}
async function BookEvent(eventparam: IBookedEvent) {
const ris = await calendarStore.BookEvent(eventparam)
load()
return ris
}
function saveBookEvent(myevent: IEvents) {
if (true) {
// close the dialog
bookEventpage.value.show = false
// bookEventForm.value.booked = bookEventForm.value.bookedcheck
const data: IBookedEvent = {
userId: userStore.my._id,
username: userStore.my.username,
id_bookedevent: myrec.value._id,
tableType: shared_consts.TABLETYPE.MyBachecas,
numpeople: bookEventForm.value.numpeople,
numpeopleLunch: bookEventForm.value.numpeopleLunch,
numpeopleDinner: bookEventForm.value.numpeopleDinner,
numpeopleDinnerShared: bookEventForm.value.numpeopleDinnerShared,
infoevent: tools.gettextevent(myrec.value),
msgbooking: bookEventForm.value.msgbooking,
booked: bookEventForm.value.booked,
datebooked: tools.getDateNow(),
modified: (bookEventpage.value.state !== EState.Creating)
}
BookEvent(data).then((ris) => {
if (ris)
tools.showPositiveNotif($q, t('cal.booked') + ' ' + t('cal.event') + ' "' + myrec.value.descr + '"')
else
tools.showNegativeNotif($q, t('cal.booked_error'))
})
contextDay.value = null
}
}
function executefunc(mythisq: any, table: string, func: number, par: IParamDialog) {
if (func === lists.MenuAction.DELETE) {
// console.log('param1', par.param1)
calendarStore.CancelBookingEvent({
ideventbook: par.param1,
notify: par.param2 === true ? '1' : '0',
}).then((ris: any) => {
if (ris) {
tools.showPositiveNotif(mythisq, t('cal.canceledbooking') + ' "' + par.param3 + '"')
if (bookEventpage.value)
bookEventpage.value.show = false
} else {
tools.showNegativeNotif(mythisq, t('cal.cancelederrorbooking'))
}
})
}
}
function CancelBookingEvent(mythisq: any, bookeventid: string, notify: boolean, mythis?: any) {
const mytitle = translate('cal.titlebooking')
const mytext = translate('cal.cancelbooking') + ' ' + tools.gettextevent(myrec.value) + '?'
const ok = translate('dialog.yes')
const funcok = lists.MenuAction.DELETE
const table = ''
const funccancel = 0
const par = {
param1: bookeventid,
param2: notify,
param3: myrec.value.descr,
}
// console.log('CancelBookingEvent ', myrec.value)
return $q.dialog({
message: mytext,
html: true,
ok: {
label: ok,
push: true,
},
title: mytitle,
cancel: true,
persistent: false,
}).onOk(() => {
// console.log('OK')
executefunc($q, table, funcok, par)
return true
}).onCancel(() => {
// console.log('CANCEL')
executefunc($q, table, funccancel, par)
return false
})
}
function sendMsg(info: boolean) {
askInfopage.value.show = false
const data: IMessage = {
source: {
event_id: myrec.value._id,
infoevent: tools.gettextevent(myrec.value)
},
origin: userStore.my.username,
dest: myrec.value.username,
message: info ? askInfoForm.value.message : bookEventForm.value.msgbooking
}
messageStore.SendMsgEvent(data).then((ris) => {
contextDay.value = null
if (ris)
tools.showPositiveNotif($q, t('cal.sendmsg_sent'))
else
tools.showNegativeNotif($q, t('cal.sendmsg_error'))
})
}
function isAlreadyBooked() {
// const calendarStore = useCalendarStore()
// return calendarStore.findEventBooked(myrec.value._id, true)
arrbookings.value.find((recbook: IBookedEvent) => recbook.userId === userStore.my._id && recbook.booked)
}
onMounted(mounted)
return {
@@ -189,6 +452,7 @@ export default defineComponent({
myrec,
shared_consts,
globalStore,
site: globalStore.site,
showPic,
userStore,
t,
@@ -203,9 +467,24 @@ export default defineComponent({
getSectorByRec,
getRecGoodSkillByRec,
usersList,
bookedList,
clicca,
naviga,
getTypeHosps,
bookEventpage,
hasModifiedBooking,
checkseinviaMsg,
getTitleBtnBooking,
askInfoForm,
EState,
saveBookEvent,
EditBookEvent,
CancelBookingEvent,
sendMsg,
askInfopage,
isAlreadyBooked,
bookEventForm,
loading,
}
}
})

View File

@@ -10,13 +10,35 @@
</CGalleryImages>
<q-card-actions align="right">
<div class="">
<div v-if="table === shared_consts.TABLES_MYBACHECAS" class="">
<q-btn
flat
round
color="blue"
icon="far fa-eye"
color="green"
:icon="
calendarStore.isPartecipero(myrec._id, table)
? 'fas fa-user-check'
: 'far fa-check-circle'
"
@click="EditBookEvent(true)"
>
<q-badge
v-if="myrec.mybookings"
color="primary"
:label="
calendarStore.getNumParticipants(
myrec,
true,
tools.peopleWhere.participants
)
"
floating
transparent
/>
</q-btn>
</div>
<div class="">
<q-btn flat round color="blue" icon="far fa-eye">
<q-badge
v-if="myrec.myseen"
color="primary"
@@ -31,7 +53,11 @@
flat
round
color="red"
:icon="userStore.isFavorite(myrec._id, table) ? 'favorite' : 'far fa-heart'"
:icon="
userStore.isFavorite(myrec._id, table)
? 'favorite'
: 'far fa-heart'
"
@click="clicca(costanti.TIPOFAVBOOK.FAVORITE, true, '')"
>
<q-badge
@@ -48,7 +74,11 @@
flat
round
color="teal"
:icon="userStore.isBookmarked(myrec._id, table) ? 'bookmark' : 'far fa-bookmark'"
:icon="
userStore.isBookmarked(myrec._id, table)
? 'bookmark'
: 'far fa-bookmark'
"
@click="clicca(costanti.TIPOFAVBOOK.BOOKMARK, true, '')"
>
<q-badge
@@ -82,7 +112,16 @@
<q-icon color="blue" name="far fa-comment" />
</q-item-section>
<q-item-section>
<a :href="tools.getHttpForTelegram(myrec.profile.username_telegram)" target="_blank">{{ $t('dialog.contact') }} - {{tools.getNomeUtenteByRecUser(myrec)}}</a>
<a
:href="
tools.getHttpForTelegram(
myrec.profile.username_telegram
)
"
target="_blank"
>{{ $t('dialog.contact') }} -
{{ tools.getNomeUtenteByRecUser(myrec) }}</a
>
</q-item-section>
</q-item>
<q-item
@@ -106,15 +145,21 @@
clicca(
costanti.TIPOFAVBOOK.SEEN,
false,
$t('cmd.seen', {num: myrec.myseen ? myrec.myseen.length : 0})
$t('cmd.seen', {
num: myrec.myseen ? myrec.myseen.length : 0,
})
)
"
>
<q-item-section avatar>
<q-icon color="blue" name="fas fa-eye" />
<q-icon color="blue" name="far fa-eye" />
</q-item-section>
<q-item-section>
{{ $t('cmd.seen', {num: myrec.myseen ? myrec.myseen.length : 0}) }}
{{
$t('cmd.seen', {
num: myrec.myseen ? myrec.myseen.length : 0,
})
}}
</q-item-section>
</q-item>
<q-item
@@ -124,7 +169,9 @@
clicca(
costanti.TIPOFAVBOOK.FAVORITE,
false,
$t('cmd.favorite', {num: myrec.myfav ? myrec.myfav.length : 0})
$t('cmd.favorite', {
num: myrec.myfav ? myrec.myfav.length : 0,
})
)
"
>
@@ -132,7 +179,43 @@
<q-icon color="red" name="favorite" />
</q-item-section>
<q-item-section>
{{ $t('cmd.favorite', {num: myrec.myfav ? myrec.myfav.length : 0}) }}
{{
$t('cmd.favorite', {
num: myrec.myfav ? myrec.myfav.length : 0,
})
}}
</q-item-section>
</q-item>
<q-item
clickable
v-close-popup
@click="
clicca(
costanti.TIPOFAVBOOK.ATTEND,
false,
$t('cmd.attend', {
num: calendarStore.getNumParticipants(
myrec,
true,
tools.peopleWhere.participants
),
})
)
"
>
<q-item-section avatar>
<q-icon color="green" name="fas fa-user-check" />
</q-item-section>
<q-item-section>
{{
$t('cmd.attend', {
num: calendarStore.getNumParticipants(
myrec,
true,
tools.peopleWhere.participants
),
})
}}
</q-item-section>
</q-item>
<q-item
@@ -142,7 +225,9 @@
clicca(
costanti.TIPOFAVBOOK.BOOKMARK,
false,
$t('cmd.bookmark', {num: myrec.mybook ? myrec.mybook.length : 0})
$t('cmd.bookmark', {
num: myrec.mybook ? myrec.mybook.length : 0,
})
)
"
>
@@ -150,7 +235,11 @@
<q-icon color="teal" name="bookmark" />
</q-item-section>
<q-item-section>
{{ $t('cmd.bookmark', {num: myrec.mybook ? myrec.mybook.length : 0}) }}
{{
$t('cmd.bookmark', {
num: myrec.mybook ? myrec.mybook.length : 0,
})
}}
</q-item-section>
</q-item>
</q-list>
@@ -195,7 +284,9 @@
<q-item-section>
<q-item-label>
<span>{{tools.getstrDateMonthTimeLong(myrec.dateTimeStart)}}</span>
<span>{{
tools.getstrDateMonthTimeLong(myrec.dateTimeStart)
}}</span>
</q-item-label>
</q-item-section>
</q-item>
@@ -206,7 +297,9 @@
<q-item-section>
<q-item-label>
<span>{{tools.getstrDateMonthTimeLong(myrec.dateTimeEnd)}}</span>
<span>{{
tools.getstrDateMonthTimeLong(myrec.dateTimeEnd)
}}</span>
</q-item-label>
</q-item-section>
</q-item>
@@ -305,7 +398,35 @@
><div v-html="myrec.note" class="clBorderService"></div
></q-item-label>
<q-card class="my-card clBorderUser" bordered>
<q-item clickable v-if="table === 'mybachecas'">
<q-item-section avatar>
<q-icon color="green" name="fas fa-house-user" />
</q-item-section>
<q-item-section>
<q-item-label lines="1">
{{ $t('event.organisedBy') }}: {{ myrec.organisedBy }}
</q-item-label>
</q-item-section>
</q-item>
<q-card
v-if="
table === 'mybachecas' && myrec.mygrp && myrec.mygrp.groupname
"
class="my-card clBorderUser"
bordered
@click="
naviga(tools.getPathByGroup(myrec.mygrp, toolsext.TABMYGROUPS))
"
>
<CMyGroup
:mygrp="myrec.mygrp"
:visu="costanti.USER_GROUPS"
:noaut="true"
>
</CMyGroup>
</q-card>
<q-card v-else class="my-card clBorderUser" bordered>
<CMyUser
:mycontact="myrec"
:visu="costanti.FIND_PEOPLE"
@@ -313,12 +434,52 @@
>
</CMyUser>
</q-card>
<q-item
clickable
v-if="table === 'mybachecas' && myrec.contact_phone"
>
<q-item-section avatar>
<q-icon color="green" name="fas fa-phone" />
</q-item-section>
<q-item-section>
<q-item-label lines="1">
<CLabel
v-bind="$attrs"
:copy="true"
:value="myrec.contact_phone"
:label="$t('event.contact_phone')"
/>
</q-item-label>
</q-item-section>
</q-item>
<q-item
clickable
v-if="table === 'mybachecas' && myrec.contact_telegram"
>
<q-item-section avatar>
<q-icon color="blue" name="fab fa-telegram" />
</q-item-section>
<q-item-section>
<q-item-label lines="1">
<a
:href="tools.getHttpForTelegram(myrec.contact_telegram)"
target="_blank"
>{{ $t('msgs.telegrammsg') }}: @{{ myrec.contact_telegram }}
</a>
</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="myrec.mycities[0].comune">
<q-item-section avatar>
<q-icon color="amber" name="fas fa-map-marker-alt" />
</q-item-section>
<q-item-section>
<q-item-label>
<div v-if="myrec.address">
{{ myrec.address }}
</div>
<span v-for="(city, index) in myrec.mycities" :key="index">
<span v-if="city.comune">
{{ city.comune }} ({{ city.prov }})</span
@@ -330,6 +491,20 @@
}}</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-if="myrec.link_maplocation">
<q-item-section avatar>
<q-icon color="blue" name="fas fa-map-marker-alt" />
</q-item-section>
<q-item-section>
<q-item-label lines="1">
<span
v-html="
tools.getlinkhref(myrec.link_maplocation, 'Apri Mappa')
"
/></q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-if="myrec.website">
<q-item-section avatar>
<q-icon color="blue" name="fas fa-globe" />
@@ -344,18 +519,66 @@
/></q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-if="myrec.link_maplocation">
<q-item clickable v-if="table === 'mybachecas'">
<q-item-section avatar>
<q-icon color="blue" name="fas fa-map-marker-alt" />
<q-icon color="blue" name="fas fa-user-check" />
</q-item-section>
<q-item-section>
<q-item-label lines="1" v-if="myrec.myattend">
<q-btn
v-if="table === shared_consts.TABLES_MYBACHECAS"
rounded
color="primary"
:label="
$t('cmd.attend', {
num: calendarStore.getNumParticipants(
myrec,
true,
tools.peopleWhere.participants
),
})
"
@click="
clicca(
costanti.TIPOFAVBOOK.ATTEND,
false,
$t('cmd.attend', {
num: calendarStore.getNumParticipants(
myrec,
true,
tools.peopleWhere.participants
),
})
)
"
>
</q-btn>
</q-item-label>
</q-item-section>
</q-item>
<q-item
clickable
v-if="
table === 'mybachecas' &&
(myrec.min_partecip || myrec.max_partecip)
"
>
<q-item-section avatar>
<q-icon color="blue" name="fas fa-users" />
</q-item-section>
<q-item-section>
<q-item-label lines="1">
<span
v-html="
tools.getlinkhref(myrec.link_maplocation, 'Apri Mappa')
"
/></q-item-label>
<span v-if="myrec.min_partecip"
>{{ $t('event.min_partecip') }}:
{{ myrec.min_partecip }}</span
><br />
<span v-if="myrec.max_partecip"
>{{ $t('event.max_partecip') }}:
{{ myrec.max_partecip }}</span
>
</q-item-label>
</q-item-section>
</q-item>
<q-item v-if="myrec.idContribType && myrec.idContribType.length > 0">
@@ -377,6 +600,9 @@
{{ calendarStore.getContribtypeById(reccontr) }}
</q-chip>
</span>
<span v-if="myrec.contribstr"
><br />{{ myrec.contribstr }}</span
>
</q-item-label>
</q-item-section>
</q-item>
@@ -386,14 +612,23 @@
</q-item-section>
<q-item-section>
<q-item-label
><span v-if="myrec.date_updated">{{
<q-item-label>
{{ $t('reg.pub_updated') }}
<span v-if="myrec.date_updated">{{
tools.getstrDateMonthLong(myrec.date_updated)
}}</span
><span v-else>{{
tools.getstrDateMonthLong(myrec.date_created)
}}</span></q-item-label
>
}}</span>
<span v-if="myrec.organisedBy"
><br />{{ $t('reg.who_updated') }}
<span class="text-bold"
><a :href="'my/' + myrec.username">{{
tools.getNomeUtenteByRecUser(myrec)
}}</a></span
></span
>
</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-if="false">
@@ -409,42 +644,16 @@
</q-list>
<q-separator />
<div class="q-mb-xl"></div>
<q-card-actions
v-if="$q.screen.gt.sm || nopopup"
class="text-center justify-center"
>
<q-btn
v-if="myrec.profile.username_telegram"
:label="$t('dialog.contact')"
color="primary"
icon="far fa-comment"
target="_blank"
:type="tools.isUserOk() ? 'a' : 'btn'"
size="md"
rounded
:href="
tools.isUserOk()
? tools.getHttpForTelegram(myrec.profile.username_telegram)
: null
"
/>
<q-btn
v-if="!nopopup"
rounded
outline
:label="$t('dialog.close')"
color="primary"
icon="close"
v-close-popup
/>
</q-card-actions>
<div v-if="table === shared_consts.TABLES_MYBACHECAS" class="q-mb-sm">
&nbsp;
</div>
</q-card>
<div
v-if="!$q.screen.gt.sm && !nopopup"
v-if="(!$q.screen.gt.sm && !nopopup) || true"
class="row absolute-bottom text-shadow custom-caption q-px-md buttons_bottom"
>
<q-btn
v-if="myrec.profile.username_telegram"
v-if="myrec.profile.username_telegram || myrec.contact_telegram"
:label="$t('dialog.contact')"
color="primary"
icon="far fa-comment"
@@ -453,13 +662,37 @@
size="md"
rounded
:href="
tools.isUserOk()
? tools.getHttpForTelegram(myrec.profile.username_telegram)
: null
myrec.contact_telegram
? tools.getHttpForTelegram(myrec.contact_telegram)
: tools.getHttpForTelegram(myrec.profile.username_telegram)
"
/>
<q-btn
v-if="!nopopup"
v-if="table === shared_consts.TABLES_MYBACHECAS"
rounded
:color="
calendarStore.isPartecipero(myrec._id, table) ? 'green' : 'grey'
"
:label="$t('event.attend')"
:icon="
calendarStore.isPartecipero(myrec._id, table)
? 'fas fa-user-check'
: 'far fa-check-circle'
"
@click="EditBookEvent(true)"
>
</q-btn>
<q-btn
rounded
outline
class="q-ma-sm"
v-if="isAlreadyBooked() && site.confpages.bookingEvents"
text-color="red"
@click="EditBookEvent(true)"
:label="$t('cal.modifybooking')"
>
</q-btn>
<q-btn
rounded
outline
:label="$t('dialog.close')"
@@ -468,6 +701,12 @@
v-close-popup
/>
</div>
<q-inner-loading
:showing="loading"
label="attendere..."
label-class="text-teal"
label-style="font-size: 1.1em"
/>
</div>
</div>
<q-dialog v-model="usersList.show">
@@ -491,6 +730,212 @@
</q-card-section>
</q-card>
</q-dialog>
<q-dialog v-model="bookedList.show">
<q-card v-if="bookedList" class="dialog_card">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
{{ bookedList.title }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="q-pa-xs inset-shadow">
<div v-for="(eventbook, index) in bookedList.list" :key="index">
<CMyUser
:mycontact="{ username: eventbook.username }"
:visu="costanti.FIND_PEOPLE"
@setCmd="tools.setCmd"
>
</CMyUser>
<div>
{{ tools.getstrshortDateTime(eventbook.datebooked) }}
<span v-if="eventbook.msgbooking">{{ $t('sendmsg.write') }}: </span>
<q-separator />
</div>
{{ eventbook.msgbooking }}
<div>
<span v-if="eventbook.numpeople > 0"
>Partecipanti: {{ eventbook.numpeople }}<br
/></span>
<span v-if="eventbook.numpeopleLunch > 0"
>Pranzo: {{ eventbook.numpeopleLunch }}<br
/></span>
<span v-if="eventbook.numpeopleDinner > 0"
>Cena: {{ eventbook.numpeopleDinner }}<br
/></span>
<span v-if="eventbook.numpeopleDinnerShared > 0"
>C.Cond: {{ eventbook.numpeopleDinnerShared }}<br
/></span>
</div>
<div>
<div class="text-center">
<q-btn
v-if="myrec.userId === userStore.my._id"
rounded
color="red"
label="Elimina"
icon="fas fa-trash-alt"
@click="
tools.CancelBookingEvent($q, myrec, eventbook._id, false)
"
></q-btn>
</div>
</div>
</div>
<br />
<div class="text-center">
<q-btn
outlined
rounded
:label="$t('dialog.close')"
color="primary"
icon="close"
v-close-popup
></q-btn>
</div>
</q-card-section>
</q-card>
</q-dialog>
<q-dialog v-model="askInfopage.show" no-backdrop-dismiss>
<q-card v-if="askInfopage.show" class="dialog_card">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
{{ $t('cal.booking') }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<q-card-section class="inset-shadow">
<div style="margin-top: 150px">
<q-chip class="shadow-5 q-mb-md" dense>
{{ myrec.descr }}
</q-chip>
<div v-if="myrec.dateTimeStart" class="cal__when">
<span class="cal__where-title"
>{{ $t('cal.when') }}:
<span v-html="tools.getstrDateTimeEvent($t, myrec, true)"></span>
</span>
</div>
<div class="q-pa-xs">
<q-card class="text-white windowcol">
<q-card-section>
<q-input
v-model="askInfoForm.message"
:label="$t('cal.writemsg') + ':'"
autofocus
debounce="500"
type="textarea"
input-class="myinput-area"
>
</q-input>
</q-card-section>
</q-card>
</div>
</div>
</q-card-section>
<q-card-actions align="right">
<q-btn
flat
:label="$t('dialog.sendmsg')"
color="primary"
@click="sendMsg(true)"
></q-btn>
<q-btn
flat
:label="$t('dialog.cancel')"
color="primary"
v-close-popup
></q-btn>
</q-card-actions>
</q-card>
</q-dialog>
<q-dialog v-model="bookEventpage.show" no-backdrop-dismiss>
<q-card v-if="bookEventpage.show" class="dialog_card">
<q-toolbar class="bg-primary text-white">
<q-toolbar-title>
{{ $t('cal.booking') }}
</q-toolbar-title>
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
</q-toolbar>
<div class="q-pa-xs">
<q-card class="text-white windowcol" style="display: block">
<q-card-section class="q-pa-xs">
<div style="display: inline-flex" class="q-px-xs centermydiv">
<q-checkbox
style="color: black"
v-model="bookEventForm.booked"
:label="$t('cal.bookingtextdefault')"
color="green"
>
</q-checkbox>
<div
v-if="bookEventForm.booked"
class="q-gutter-xs q-mx-xs"
style="min-width: 140px"
>
<q-select
v-if="table === shared_consts.TABLES_MYBACHECAS"
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
rounded
style="max-width: 150px"
outlined
v-model="bookEventForm.numpeople"
:options="tools.SelectListNumPeople"
:label="$t('statusreg.reg')"
emit-value
map-options
>
</q-select>
</div>
</div>
<q-input
v-model="bookEventForm.msgbooking"
:label="$t('cal.writemsg') + ':'"
type="textarea"
debounce="500"
input-class="myinput-area"
>
</q-input>
</q-card-section>
</q-card>
</div>
<q-card-actions align="right">
<q-btn
v-if="bookEventpage.state === EState.Modifying"
flat
:label="$t('cal.cancelbooking')"
color="negative"
@click="CancelBookingEvent($q, bookEventForm._id, true)"
></q-btn>
<q-btn
v-if="checkseinviaMsg()"
flat
:label="$t('dialog.sendonlymsg')"
color="primary"
@click="sendMsg(false)"
></q-btn>
<q-btn
v-else-if="bookEventForm.booked"
:label="getTitleBtnBooking()"
color="primary"
@click="saveBookEvent()"
:disable="
!(bookEventpage.state === EState.Creating || hasModifiedBooking)
"
></q-btn>
<q-btn
flat
:label="$t('dialog.cancel')"
color="primary"
v-close-popup
></q-btn>
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script lang="ts" src="./CMyCardService.ts">