- Booking not available if is in the past

- Delete record only if "Active Edit" is on
- Image stretch width reduced.
- Signin more dense
This commit is contained in:
Paolo Arena
2019-10-16 15:27:49 +02:00
parent 9462f6ef24
commit 35b360bf9a
14 changed files with 160 additions and 76 deletions

View File

@@ -858,4 +858,17 @@ export default class CEventsCalendar extends Vue {
get mythis() { get mythis() {
return this 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')
if (myevent.days) {
dateEvent = tools.addDays(dateEvent, myevent.days)
}
return (dateEvent >= datenow)
}
} }

View File

@@ -90,7 +90,7 @@ $t('
</q-card-section> </q-card-section>
<q-card-actions align="right"> <q-card-actions align="right">
<q-btn rounded v-if="!myevent.nobookable && static_data.functionality.BOOKING_EVENTS" <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')"> :label="$t('cal.booking')">
</q-btn> </q-btn>
<q-btn v-else :label="$t('dialog.ok')" color="primary" v-close-popup></q-btn> <q-btn v-else :label="$t('dialog.ok')" color="primary" v-close-popup></q-btn>
@@ -258,7 +258,7 @@ $t('
<div class="q-pa-xs"> <div class="q-pa-xs">
<q-card class="text-white windowcol"> <q-card class="text-white windowcol">
<q-card-section> <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> </q-checkbox>
<div v-if="bookEventForm.booked" class="q-gutter-md centermydiv" style="max-width: 150px; margin-top:10px;"> <div v-if="bookEventForm.booked" class="q-gutter-md centermydiv" style="max-width: 150px; margin-top:10px;">
@@ -550,7 +550,7 @@ $t('
<q-btn rounded outline <q-btn rounded outline
v-if="!event.nobookable && !isAlreadyBooked(event) && static_data.functionality.BOOKING_EVENTS" v-if="!event.nobookable && !isAlreadyBooked(event) && static_data.functionality.BOOKING_EVENTS"
color="primary" @click="addBookEventMenu(event)" color="primary" @click="addBookEventMenu(event)"
:label="$t('cal.booking')"> :label="$t('cal.booking')" :disable="!isEventEnabled(event)">
</q-btn> </q-btn>
<q-btn rounded outline <q-btn rounded outline
v-if="!event.nobookable && isAlreadyBooked(event) && static_data.functionality.BOOKING_EVENTS" v-if="!event.nobookable && isAlreadyBooked(event) && static_data.functionality.BOOKING_EVENTS"

View File

@@ -16,6 +16,8 @@ export default class CGridTableRec extends Vue {
@Prop({ required: true }) public mytitle: string @Prop({ required: true }) public mytitle: string
@Prop({ required: true }) public mycolumns: any[] @Prop({ required: true }) public mycolumns: any[]
@Prop({ required: true }) public colkey: string @Prop({ required: true }) public colkey: string
@Prop({ required: false, default: '' }) public nodataLabel: string
@Prop({ required: false, default: '' }) public noresultLabel: string
public $q public $q
public $t public $t
public loading: boolean = false public loading: boolean = false
@@ -42,6 +44,7 @@ export default class CGridTableRec extends Vue {
public returnedData public returnedData
public returnedCount public returnedCount
public colVisib: any[] = [] public colVisib: any[] = []
public colExtra: any[] = []
get canEdit() { get canEdit() {
return this.funcActivated.includes(lists.MenuAction.CAN_EDIT_TABLE) return this.funcActivated.includes(lists.MenuAction.CAN_EDIT_TABLE)
@@ -101,8 +104,12 @@ export default class CGridTableRec extends Vue {
public created() { public created() {
// this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }] // this.serverData = this.mylist.slice() // [{ chiave: 'chiave1', valore: 'valore 1' }]
this.mycolumns.forEach((elem) => { this.mycolumns.forEach((elem) => {
if (elem.field) if (elem.field !== '')
this.colVisib.push(elem.field) this.colVisib.push(elem.field)
if (elem.visible && elem.field === '')
this.colExtra.push(elem.name)
}) })
} }
@@ -253,7 +260,8 @@ export default class CGridTableRec extends Vue {
public mounted() { public mounted() {
this.mycolumns.forEach((rec: IColGridTable) => { this.mycolumns.forEach((rec: IColGridTable) => {
rec.label = this.$t(rec.label_trans) if (rec.label_trans)
rec.label = this.$t(rec.label_trans)
}) })
this.onRequest({ this.onRequest({
@@ -274,4 +282,24 @@ export default class CGridTableRec extends Vue {
} }
} }
public visCol(col) {
if (col.visuonlyEditVal) {
if (this.canEdit) {
return col.visuonlyEditVal
} else {
return false
}
} else {
return true
}
}
public visuValByType(col, val) {
if (col.isdate) {
return tools.getstrDateTime(val)
} else {
return val
}
}
} }

View File

@@ -10,6 +10,8 @@
@request="onRequest" @request="onRequest"
binary-state-sort binary-state-sort
:visible-columns="colVisib" :visible-columns="colVisib"
:no-data-label="nodataLabel"
:no-results-label="noresultLabel"
> >
@@ -20,7 +22,7 @@
v-if="colVisib.includes(col.field)" v-if="colVisib.includes(col.field)"
:key="col.name" :key="col.name"
:props="props" :props="props"
class="text-italic text-red text-weight-bold" class="text-italic text-weight-bold"
> >
{{ col.label }} {{ col.label }}
</q-th> </q-th>
@@ -45,7 +47,7 @@
borderless borderless
dense dense
options-dense options-dense
display-value="Colonne" :display-value="$t('grid.columns')"
emit-value emit-value
map-options map-options
:options="mycolumns" :options="mycolumns"
@@ -57,14 +59,9 @@
</template> </template>
<q-tr slot="body" slot-scope="props" :props="props"> <q-tr 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)"> <q-td v-for="col in mycolumns" :key="col.name" :props="props" v-if="colVisib.includes(col.field)">
<div v-if="col.action"> <div :class="getclassCol(col)">
<q-btn flat round color="red" icon="fas fa-trash-alt" {{ visuValByType(col, props.row[col.name]) }}
@click="clickFunz(props.row, col)"></q-btn>
</div>
<div v-else :class="getclassCol(col)">
{{ props.row[col.name] }}
<q-popup-edit v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable" <q-popup-edit v-if="canEdit" v-model="props.row[col.name]" :disable="col.disable"
:title="col.title" buttons :title="col.title" buttons
@save="SaveValue" @show="selItem(props.row, col.field)"> @save="SaveValue" @show="selItem(props.row, col.field)">
@@ -73,6 +70,12 @@
</q-popup-edit> </q-popup-edit>
</div> </div>
</q-td> </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> </q-tr>
<!-- <!--
<q-btn <q-btn

View File

@@ -48,6 +48,7 @@
@media (max-width: 800px) { @media (max-width: 800px) {
.myclimg { .myclimg {
max-height: 400px !important; max-height: 400px !important;
width: 100%;
} }
} }

View File

@@ -12,7 +12,7 @@
<q-input <q-input
v-model="signin.username" v-model="signin.username"
rounded outlined rounded outlined dense
@blur="$v.signin.username.$touch" @blur="$v.signin.username.$touch"
:error="$v.signin.username.$error" :error="$v.signin.username.$error"
:error-message="`${errorMsg('username', $v.signin.username)}`" :error-message="`${errorMsg('username', $v.signin.username)}`"
@@ -27,7 +27,7 @@
<q-input <q-input
v-model="signin.password" v-model="signin.password"
type="password" type="password"
rounded outlined rounded outlined dense
@blur="$v.signin.password.$touch" @blur="$v.signin.password.$touch"
:error="$v.signin.password.$error" :error="$v.signin.password.$error"
:error-message="`${errorMsg('password', $v.signin.password)}`" :error-message="`${errorMsg('password', $v.signin.password)}`"
@@ -37,27 +37,26 @@
</template> </template>
</q-input> </q-input>
<div> <div class="text-center" style="margin-bottom: 10px;">
<a :href="getlinkforgetpwd">{{$t('reg.forgetpassword')}}</a> <a :href="getlinkforgetpwd" style="color:gray;">{{$t('reg.forgetpassword')}}</a>
</div> </div>
<br>
<q-card class="flex flex-center"> <!--<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')"/>--> <!--&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.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-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> <!--</q-card>-->
<div align="center"> <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')}} :disable="$v.$error || iswaitingforRes">{{$t('login.enter')}}
</q-btn> </q-btn>
</div> </div>
<div align="center" style="margin-top:10px;"> <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> </q-btn>
</div> </div>

View File

@@ -7,7 +7,7 @@ import { CSignIn } from '../../components/CSignIn'
import { GlobalStore, UserStore } from '@modules' import { GlobalStore, UserStore } from '@modules'
// import { StateConnection } from '../../model' // import { StateConnection } from '../../model'
import { Watch } from 'vue-property-decorator' import { Prop, Watch } from 'vue-property-decorator'
import { tools } from '../../store/Modules/tools' import { tools } from '../../store/Modules/tools'
import { toolsext } from '@src/store/Modules/toolsext' import { toolsext } from '@src/store/Modules/toolsext'
@@ -24,6 +24,7 @@ import globalroutines from '../../globalroutines'
}) })
export default class Header extends Vue { export default class Header extends Vue {
@Prop({ required: false, default: '' }) public extraContent: string
public $t public $t
public $v public $v
public $q public $q

View File

@@ -108,7 +108,7 @@
@click="right = !right"> @click="right = !right">
</q-btn> </q-btn>
<q-btn v-if="static_data.functionality.SHOW_USER_MENU && isLogged" dense flat round <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="right = !right">
</q-btn> </q-btn>
</q-toolbar> </q-toolbar>
@@ -136,12 +136,13 @@
<div class="absolute-top bg-transparent text-black center_img" style="margin-top: 10px;"> <div class="absolute-top bg-transparent text-black center_img" style="margin-top: 10px;">
<q-avatar class="q-mb-sm center_img"> <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-avatar>
<q-btn class="absolute-top-right" style="margin-right: 10px; color: white;" <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="right = !right">
</q-btn> </q-btn>
<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-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"> <div v-else class="text-user text-italic bg-red">
{{ $t('user.loggati') }} {{ $t('user.loggati') }}
</div> </div>
@@ -172,8 +173,11 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="isLogged" class="q-mt-lg"><br><br></div>
<slot></slot>
</q-drawer> </q-drawer>
</div> </div>
</template> </template>

View File

@@ -17,3 +17,4 @@ export * from './BannerCookies'
export * from './PagePolicy' export * from './PagePolicy'
export * from './FormNewsletter' export * from './FormNewsletter'
export * from './CGridTableRec' export * from './CGridTableRec'
export * from './Shen/CTesseraElettronica'

View File

@@ -222,6 +222,9 @@ export interface IColGridTable {
sortable?: boolean sortable?: boolean
disable?: boolean disable?: boolean
titlepopupedit?: string titlepopupedit?: string
visible?: boolean
icon?: string icon?: string
action?: any action?: any
foredit?: boolean
isdate?: boolean
} }

View File

@@ -4,12 +4,13 @@ const msgglobal = {
it: { it: {
grid: { grid: {
editvalues: 'Modifica Valori', editvalues: 'Modifica Valori',
showprevedit: 'Mostra Eventi Passati' showprevedit: 'Mostra Eventi Passati',
columns: 'Colonne',
}, },
otherpages: { otherpages: {
admin : { admin : {
menu: 'Amministrazione', menu: 'Amministrazione',
eventlist: 'Prenotazioni', eventlist: 'Le tue Prenotazioni',
usereventlist: 'Prenotazioni Utenti', usereventlist: 'Prenotazioni Utenti',
userlist: 'Lista Utenti', userlist: 'Lista Utenti',
}, },
@@ -59,7 +60,7 @@ const msgglobal = {
verify_email: 'Verifica la tua email', verify_email: 'Verifica la tua email',
go_login: 'Torna al Login', go_login: 'Torna al Login',
incorrect_input: 'Inserimento incorretto.', 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'
} }
} }
}, },
@@ -96,7 +97,7 @@ const msgglobal = {
email: 'inserire una email valida', email: 'inserire una email valida',
errore_generico: 'Si prega di compilare correttamente i campi', errore_generico: 'Si prega di compilare correttamente i campi',
atleast: 'dev\'essere lungo almeno di', 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', notmore: 'non dev\'essere lungo più di',
char: 'caratteri', char: 'caratteri',
terms: 'Devi accettare le condizioni, per continuare.', terms: 'Devi accettare le condizioni, per continuare.',
@@ -214,6 +215,7 @@ const msgglobal = {
bookingtextdefault_of: 'di', bookingtextdefault_of: 'di',
data: 'Data', data: 'Data',
teachertitle: 'Insegnante', teachertitle: 'Insegnante',
peoplebooked: 'Prenotaz.',
}, },
newsletter: { newsletter: {
title: 'Desideri ricevere la nostra Newsletter?', title: 'Desideri ricevere la nostra Newsletter?',
@@ -235,12 +237,13 @@ const msgglobal = {
es: { es: {
grid: { grid: {
editvalues: 'Cambiar valores', editvalues: 'Cambiar valores',
showprevedit: 'Mostrar eventos pasados' showprevedit: 'Mostrar eventos pasados',
columns: 'Columnas',
}, },
otherpages: { otherpages: {
admin : { admin : {
menu: 'Administración', menu: 'Administración',
eventlist: 'Reserva', eventlist: 'Sus Reservas',
usereventlist: 'Reserva Usuarios', usereventlist: 'Reserva Usuarios',
userlist: 'Lista de usuarios', userlist: 'Lista de usuarios',
}, },
@@ -290,7 +293,7 @@ const msgglobal = {
verify_email: 'Revisa tu email', verify_email: 'Revisa tu email',
go_login: 'Vuelve al Login', go_login: 'Vuelve al Login',
incorrect_input: 'Entrada correcta.', 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'
} }
} }
}, },
@@ -327,7 +330,7 @@ const msgglobal = {
email: 'Debe ser una email válida.', email: 'Debe ser una email válida.',
errore_generico: 'Por favor, rellene los campos correctamente', errore_generico: 'Por favor, rellene los campos correctamente',
atleast: 'debe ser al menos largo', 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', notmore: 'no tiene que ser más largo que',
char: 'caracteres', char: 'caracteres',
terms: 'Debes aceptar las condiciones, para continuar..', terms: 'Debes aceptar las condiciones, para continuar..',
@@ -439,6 +442,7 @@ const msgglobal = {
bookingtextdefault_of: 'de', bookingtextdefault_of: 'de',
data: 'Fecha', data: 'Fecha',
teachertitle: 'Maestro', teachertitle: 'Maestro',
peoplebooked: 'Reserv.',
}, },
newsletter: { newsletter: {
title: '¿Desea recibir nuestro boletín informativo?', title: '¿Desea recibir nuestro boletín informativo?',
@@ -460,12 +464,13 @@ const msgglobal = {
fr: { fr: {
grid: { grid: {
editvalues: 'Changer les valeurs', editvalues: 'Changer les valeurs',
showprevedit: 'Afficher les événements passés' showprevedit: 'Afficher les événements passés',
columns: 'Colonnes',
}, },
otherpages: { otherpages: {
admin : { admin : {
menu: 'Administration', menu: 'Administration',
eventlist: 'Réservation', eventlist: 'Vos réservations',
usereventlist: 'Réservation Utilisateur', usereventlist: 'Réservation Utilisateur',
userlist: 'Liste d\'utilisateurs', userlist: 'Liste d\'utilisateurs',
}, },
@@ -515,7 +520,7 @@ const msgglobal = {
verify_email: 'Vérifiez votre email', verify_email: 'Vérifiez votre email',
go_login: 'Retour à la connexion', go_login: 'Retour à la connexion',
incorrect_input: 'Entrée correcte.', 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'
} }
} }
}, },
@@ -551,7 +556,7 @@ const msgglobal = {
email: 'Ce doit être un email valide.', email: 'Ce doit être un email valide.',
errore_generico: 'S\'il vous plaît remplir les champs correctement', errore_generico: 'S\'il vous plaît remplir les champs correctement',
atleast: 'ça doit être au moins long', 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', notmore: 'il ne doit pas être plus long que',
char: 'caractères', char: 'caractères',
terms: 'Vous devez accepter les conditions, pour continuer..', terms: 'Vous devez accepter les conditions, pour continuer..',
@@ -663,6 +668,7 @@ const msgglobal = {
bookingtextdefault_of: 'du', bookingtextdefault_of: 'du',
data: 'Date', data: 'Date',
teachertitle: 'Professeur', teachertitle: 'Professeur',
peoplebooked: 'Réserv.',
}, },
newsletter: { newsletter: {
title: 'Souhaitez-vous recevoir notre newsletter?', title: 'Souhaitez-vous recevoir notre newsletter?',
@@ -684,12 +690,13 @@ const msgglobal = {
enUs: { enUs: {
grid: { grid: {
editvalues: 'Edit Values', editvalues: 'Edit Values',
showprevedit: 'Show Past Events' showprevedit: 'Show Past Events',
columns: 'Columns',
}, },
otherpages: { otherpages: {
admin : { admin : {
menu: 'Administration', menu: 'Administration',
eventlist: 'Booking', eventlist: 'Your Booking',
usereventlist: 'Users Booking', usereventlist: 'Users Booking',
userlist: 'Users List', userlist: 'Users List',
}, },
@@ -739,7 +746,7 @@ const msgglobal = {
verify_email: 'Verify your email', verify_email: 'Verify your email',
go_login: 'Back to Login', go_login: 'Back to Login',
incorrect_input: 'Incorrect input.', 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'
} }
} }
}, },
@@ -775,7 +782,7 @@ const msgglobal = {
email: 'must be a valid email', email: 'must be a valid email',
errore_generico: 'Please review fields again', errore_generico: 'Please review fields again',
atleast: 'must be at least', 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', notmore: 'must not be more than',
char: 'characters long', char: 'characters long',
terms: 'You need to agree with the terms & conditions.', terms: 'You need to agree with the terms & conditions.',
@@ -886,6 +893,7 @@ const msgglobal = {
bookingtextdefault_of: 'of', bookingtextdefault_of: 'of',
data: 'Date', data: 'Date',
teachertitle: 'Teacher', teachertitle: 'Teacher',
peoplebooked: 'Booked',
}, },
newsletter: { newsletter: {
title: 'Would you like to receive our Newsletter?', title: 'Would you like to receive our Newsletter?',
@@ -907,12 +915,13 @@ const msgglobal = {
de: { de: {
grid: { grid: {
editvalues: 'Edit Values', editvalues: 'Edit Values',
showprevedit: 'Show Past Events' showprevedit: 'Show Past Events',
columns: 'Columns',
}, },
otherpages: { otherpages: {
admin : { admin : {
menu: 'Administration', menu: 'Administration',
eventlist: 'Booking', eventlist: 'Your Booking',
usereventlist: 'Users Booking', usereventlist: 'Users Booking',
userlist: 'Users List', userlist: 'Users List',
}, },
@@ -962,7 +971,7 @@ const msgglobal = {
verify_email: 'Verify your email', verify_email: 'Verify your email',
go_login: 'Back to Login', go_login: 'Back to Login',
incorrect_input: 'Incorrect input.', 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'
} }
} }
}, },
@@ -999,7 +1008,7 @@ const msgglobal = {
email: 'must be a valid email', email: 'must be a valid email',
errore_generico: 'Please review fields again', errore_generico: 'Please review fields again',
atleast: 'must be at least', 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', notmore: 'must not be more than',
char: 'characters long', char: 'characters long',
terms: 'You need to agree with the terms & conditions.', terms: 'You need to agree with the terms & conditions.',
@@ -1111,6 +1120,7 @@ const msgglobal = {
bookingtextdefault_of: 'of', bookingtextdefault_of: 'of',
data: 'Date', data: 'Date',
teachertitle: 'Teacher', teachertitle: 'Teacher',
peoplebooked: 'Booked',
}, },
newsletter: { newsletter: {
title: 'Would you like to receive our Newsletter?', title: 'Would you like to receive our Newsletter?',

View File

@@ -105,7 +105,7 @@ namespace Actions {
let ris = null 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) ris = await Api.SendReq('/booking/' + UserStore.state.userId + '/' + process.env.APP_ID + '/' + showall, 'GET', null)
.then((res) => { .then((res) => {

View File

@@ -112,6 +112,10 @@ namespace Getters {
}, 'IsMyGroup') }, 'IsMyGroup')
const getUserByUserId = b.read((mystate: IUserState) => (userId): IUserState => { 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) return mystate.usersList.find((item) => item._id === userId)
}, 'getUserByUserId') }, 'getUserByUserId')

View File

@@ -1317,7 +1317,10 @@ export const tools = {
executefunc(myself: any, table, func: number, par: IParamDialog) { executefunc(myself: any, table, func: number, par: IParamDialog) {
if (func === lists.MenuAction.DELETE) { if (func === lists.MenuAction.DELETE) {
console.log('param1', par.param1) 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) { if (ris) {
tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param1.title + '"') tools.showPositiveNotif(myself.$q, myself.$t('cal.canceledbooking') + ' "' + par.param1.title + '"')
if (myself.bookEventpage) if (myself.bookEventpage)
@@ -1327,7 +1330,7 @@ export const tools = {
}) })
} else if (func === lists.MenuAction.DELETE_RECTABLE) { } else if (func === lists.MenuAction.DELETE_RECTABLE) {
console.log('param1', par.param1) console.log('param1', par.param1)
GlobalStore.actions.DeleteRec({table, id: par.param1}).then((ris) => { GlobalStore.actions.DeleteRec({ table, id: par.param1 }).then((ris) => {
if (ris) { if (ris) {
myself.ActionAfterYes(func, par.param2) myself.ActionAfterYes(func, par.param2)
tools.showPositiveNotif(myself.$q, myself.$t('db.deletedrecord')) tools.showPositiveNotif(myself.$q, myself.$t('db.deletedrecord'))
@@ -1622,8 +1625,15 @@ export const tools = {
return date.formatDate(mytimestamp, 'DD/MM/YYYY') return date.formatDate(mytimestamp, 'DD/MM/YYYY')
else else
return '' return ''
} },
,
getstrDateTime(mytimestamp) {
// console.log('getstrDate', mytimestamp)
if (!!mytimestamp)
return date.formatDate(mytimestamp, 'DD/MM/YYYY HH:MM')
else
return ''
},
getstrMMMDate(mytimestamp) { getstrMMMDate(mytimestamp) {
// console.log('getstrDate', mytimestamp) // console.log('getstrDate', mytimestamp)
if (!!mytimestamp) if (!!mytimestamp)
@@ -1825,13 +1835,25 @@ export const tools = {
}, },
heightgallery() { heightgallery() {
return tools.heightGallVal().toString() + 'px'
},
heightGallVal() {
let maxh2 = 0
if (Screen.width < 400) { if (Screen.width < 400) {
return '200px' maxh2 = 350
} else if (Screen.width < 600) { } else if (Screen.width < 600) {
return '300px' maxh2 = 400
} else if (Screen.width < 800) {
maxh2 = 450
} else if (Screen.width < 1000) {
maxh2 = 500
} else { } else {
return '500px' maxh2 = 600
} }
return maxh2
}, },
myheight_imgtitle(myheight?, myheightmobile?) { myheight_imgtitle(myheight?, myheightmobile?) {
@@ -1849,18 +1871,7 @@ export const tools = {
maxheight = 500 maxheight = 500
} }
let maxh2 = 0 const maxh2 = this.heightGallVal()
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
}
console.log('maxh2', maxh2) console.log('maxh2', maxh2)
console.log('maxheight', maxheight) console.log('maxheight', maxheight)
@@ -2223,7 +2234,7 @@ export const tools = {
} else if (riscode === tools.OK) { } else if (riscode === tools.OK) {
mythis.$router.push('/signin') mythis.$router.push('/signin')
tools.showNotif(mythis.$q, mythis.$t('components.authentication.email_verification.link_sent'), { tools.showNotif(mythis.$q, mythis.$t('components.authentication.email_verification.link_sent'), {
color: 'warning', color: 'info',
textColor: 'black' textColor: 'black'
}) })
} else { } else {
@@ -2250,11 +2261,17 @@ export const tools = {
}, },
CancelBookingEvent(mythis, eventparam: IEvents, bookeventid: string, notify: boolean) { CancelBookingEvent(mythis, eventparam: IEvents, bookeventid: string, notify: boolean) {
console.log('CancelBookingEvent ', eventparam) 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
})
}, },
ActionRecTable(mythis, action, table, id, item?) { ActionRecTable(mythis, action, table, id, item?) {
console.log('CancelRecTable', id) 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 }) 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) { isBitActive(bit, whattofind) {
return ((bit & whattofind) === whattofind) return ((bit & whattofind) === whattofind)