From dafee01e20bbd4c8aacd3f65ff3345d5e12a588f Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Wed, 4 May 2022 00:26:30 +0200 Subject: [PATCH] Nuovo Sistema di registrazione: tramite il BOT, viene memorizzato l'username telegram e si usa quello come username per la APP, e l'ID telegram viene passato direttamente, senza chiedere la verifica. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ospitalità (inizio). --- _ALL_SITES/riso.app/db/static_data.ts | 2 +- src/common/shared_vuejs.ts | 28 ++-- src/components/CFinder/CFinder.ts | 174 ++++++++++++++++++++++ src/components/CSignUp/CSignUp.ts | 16 +- src/components/CSignUp/CSignUp.vue | 38 ++--- src/components/CSkill/CSkill.ts | 2 + src/db/i18n_website.js | 1 + src/db/static_data.ts | 24 ++- src/model/GlobalStore.ts | 21 +++ src/root/hosp/hosp.scss | 0 src/root/hosp/hosp.ts | 36 +++++ src/root/hosp/hosp.vue | 32 ++++ src/statics/lang/es.js | 1 + src/statics/lang/it.js | 5 +- src/store/Modules/costanti.ts | 4 +- src/store/Modules/fieldsTable.ts | 159 ++++++++++++++++++++ src/store/Modules/tools.ts | 28 ++++ src/store/Modules/toolsext.ts | 1 + src/views/user/mypagehosp/mypagehosp.scss | 18 +++ src/views/user/mypagehosp/mypagehosp.ts | 31 ++++ src/views/user/mypagehosp/mypagehosp.vue | 30 ++++ 21 files changed, 607 insertions(+), 44 deletions(-) create mode 100755 src/root/hosp/hosp.scss create mode 100755 src/root/hosp/hosp.ts create mode 100755 src/root/hosp/hosp.vue create mode 100755 src/views/user/mypagehosp/mypagehosp.scss create mode 100755 src/views/user/mypagehosp/mypagehosp.ts create mode 100755 src/views/user/mypagehosp/mypagehosp.vue diff --git a/_ALL_SITES/riso.app/db/static_data.ts b/_ALL_SITES/riso.app/db/static_data.ts index 9a93d52f..93c4da02 100755 --- a/_ALL_SITES/riso.app/db/static_data.ts +++ b/_ALL_SITES/riso.app/db/static_data.ts @@ -596,7 +596,7 @@ const baseroutes: IListRoutes[] = [ { active: functionality.ENABLE_REGISTRATION, order: 1000, - path: '/signup/:invited', + path: '/signup/:un/:tid', materialIcon: 'how_to_reg', name: 'pages.SignUp', component: () => import('@/views/login/signup/signup.vue'), diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 2414c605..d2839e37 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -87,33 +87,29 @@ export const shared_consts = { TABLES_MYSKILLS: 'myskills', TABLES_MYBACHECAS: 'mybachecas', + TABLES_MYHOSPS: 'myhosps', TABLES_MYGOODS: 'mygoods', - TABLES_ENABLE_GETREC_BYID: ['mybachecas'], + TABLES_ENABLE_GETREC_BYID: ['mybachecas', 'myhosps'], TABLES_USER_INCLUDE_MY: ['mygroups'], - TABLES_GETCOMPLETEREC: ['myskills', 'mybachecas', 'mygoods'], + TABLES_GETCOMPLETEREC: ['myskills', 'mybachecas', 'myhosps', 'mygoods'], TABLES_WITH_FILTER_FIELD: ['caldate'], - TABLES_WITH_DATE: ['mybachecas'], - TABLES_WITH_SORTING: ['mybachecas'], - TABLES_PERM_NEWREC: ['skills', 'goods', 'subskills', 'mygroups'], - TABLES_REC_ID: ['skills', 'goods', 'subskills', 'myskills', 'mybachecas', 'mygoods'], + TABLES_WITH_DATE: ['mybachecas', 'myhosps'], + TABLES_WITH_SORTING: ['mybachecas', 'myhosps'], + TABLES_REC_ID: ['skills', 'goods', 'subskills', 'myskills', 'mybachecas', 'myhosps', 'mygoods'], // costanti.VISUTABLE_SCHEDA_USER, VISUTABLE_SCHEDA_GROUP, VISUTABLE_USER_TABGROUP VERTIC_SHOW_GRID: [-1, 2, -3, -4], - TABLES_ID_NUMBER: ['permissions', 'levels', 'adtypes', 'adtypegoods', 'statusSkills', 'sectors', 'sectorgoods', 'catgrps', 'skills', 'subskills', 'cities', 'provinces', - 'myskills', 'mybachecas', 'mygoods', 'mygroups'], - TABLES_USER_ID: ['mygroups', 'myskills', 'mybachecas', 'mygoods'], - TABLES_UPDATE_LASTIFIED: ['myskills', 'mybachecas', 'mygoods', 'mybots'], - TABLES_FINDER: ['myskills', 'mybachecas', 'mygoods', 'mygroups'], - TABLES_VISU_CMYSRECCARD: ['myskills', 'mybachecas', 'mygoods', 'mygroups'], - TABLES_SHOW_ADTYPE: ['myskills', 'mygoods'], + TABLES_UPDATE_LASTIFIED: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mybots'], + TABLES_FINDER: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups'], + TABLES_VISU_CMYSRECCARD: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups'], + TABLES_SHOW_ADTYPE: ['myskills', 'mygoods', 'myhosps'], - TABLES_PERM_CHANGE_FOR_USERS: ['myskills', 'mybachecas', 'mygoods'], - TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'mygoods', 'users'], + TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'users'], - TABLES_VISU_IMG: ['myskills', 'mybachecas', 'mygoods', 'mygroups'], + TABLES_VISU_IMG: ['myskills', 'mybachecas', 'myhosps', 'mygoods', 'mygroups'], TABLES_DIRECTORY_A_PARTE: ['mygroups'], VISIB_ALL: 0, diff --git a/src/components/CFinder/CFinder.ts b/src/components/CFinder/CFinder.ts index 0d0b3265..a2828450 100755 --- a/src/components/CFinder/CFinder.ts +++ b/src/components/CFinder/CFinder.ts @@ -50,6 +50,7 @@ export default defineComponent({ const searchList_Beni = ref([]) const searchList_MyGroups = ref([]) const searchList_Events = ref([]) + const searchList_Hosp = ref([]) const search = ref('') const myrecfiltertoggle = ref(tools.FILTER_ALL) @@ -118,6 +119,8 @@ export default defineComponent({ return searchList_MyGroups.value else if (props.table === toolsext.TABMYBACHECAS) return searchList_Events.value + else if (props.table === toolsext.TABMYHOSPS) + return searchList_Hosp.value return searchList_Servizi.value }) @@ -142,6 +145,8 @@ export default defineComponent({ return 'nome del Gruppo da cercare' else if (props.table === toolsext.TABMYBACHECAS) return 'nome dell\'Evento da cercare' + else if (props.table === toolsext.TABMYHOSPS) + return 'nome dell\'Ospitalità da cercare' return 'nome da cercare' }) @@ -168,6 +173,8 @@ export default defineComponent({ return 'Nessun Gruppo trovato con i filtri selezionati' else if (props.table === toolsext.TABMYBACHECAS) return 'Nessun Evento trovato con i filtri selezionati' + else if (props.table === toolsext.TABMYHOSPS) + return 'Nessuna Ospitalità trovata con i filtri selezionati' return 'Nessun dato trovato con i filtri selezionati' }) @@ -496,6 +503,108 @@ export default defineComponent({ ] + searchList_Hosp.value = [ + { + label: 'Stato', + table: 'statusSkills', + key: 'idStatusSkill', + value: 0, + arrvalue: tools.getCookie(tools.COOK_SEARCH + 'statusSkills', []), + type: costanti.FieldType.multiselect, + filter: null, + useinput: false, + icon: 'mood', + filteradv: false, + }, + { + label: 'Regione', + table: 'regions', + key: 'idReg', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + 'regions', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: null, + useinput: false, + icon: 'fas fa-globe-europe' + }, + { + label: 'Provincia', + table: 'provinces', + key: 'idProvince', + type: costanti.FieldType.select, + value: tools.getCookie(tools.COOK_SEARCH + 'provinces', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + filter: getFilterProvinceByRegion, + useinput: true, + icon: 'flag', + }, + { + label: 'Comune', + table: 'cities', + key: 'idCity', + type: costanti.FieldType.select_by_server, + value: tools.getCookie(tools.COOK_SEARCH + 'cities', costanti.FILTER_TUTTI), + addall: true, + arrvalue: [], + useinput: true, + filter: null, + // filter: getFilterCitiesByProvince, + // param1: shared_consts.PARAM_SHOW_PROVINCE, + tablesel: 'cities', + }, + { + label: 'Data Inizio', + table: 'caldate', + key: 'dateTimeStart', + value: 2, + arrvalue: [], + type: costanti.FieldType.select, + addall: true, + filter: null, + useinput: false, + }, + { + label: 'Settore', + table: toolsext.TABSECTORS, + key: 'idSector', + value: tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, 0), + arrvalue: [], + type: costanti.FieldType.select, + filter: null, + addall: true, + notinsearch: true, + useinput: false, + }, + { + label: 'Categoria', + table: 'skills', + key: 'idSkill', + value: tools.getCookie(tools.COOK_SEARCH + 'skills' + '_' + tools.getCookie(tools.COOK_SEARCH + toolsext.TABSECTORS, costanti.FILTER_TUTTI), costanti.FILTER_TUTTI), + arrvalue: [], + type: costanti.FieldType.select, + addall: true, + filter: getFilterSkills, + showcount: true, + useinput: false, + }, + { + label: 'In cambio di', + table: 'contribtypes', + key: 'idContribType', + value: 0, + arrvalue: tools.getCookie(tools.COOK_SEARCH + 'contribtypes', []), + type: costanti.FieldType.multiselect, + filter: null, + useinput: false, + icon: 'fas fa-hand-holding', + filteradv: false, + //icon: 'swap_horizontal_circle', + }, + + ] + searchList_Beni.value = [ { label: 'Regione', @@ -926,6 +1035,69 @@ export default defineComponent({ }, } + } else if (props.table === toolsext.TABMYHOSPS) { + 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: { + recSkill: 1, + sector: 1, + idSector: 1, + idSkill: 1, + // idSubSkill: 1, + myskill: 1, + idStatusSkill: 1, + idContribType: 1, + idCity: 1, + dateTimeStart: 1, + dateTimeEnd: 1, + numLevel: 1, + adType: 1, + photos: 1, + note: 1, + website: 1, + //**ADDFIELD_MYSKILL + descr: 1, + date_created: 1, + date_updated: 1, + userId: 1, + username: 1, + name: 1, + surname: 1, + comune: 1, + mycities: 1, + 'profile.img': 1, + 'profile.qualifica': 1, + } + }, + lookup3: { + lk_tab: toolsext.TABSECTORS, + lk_LF: 'recSkill.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: '', + }, + } + } else { return { // Servizi @@ -994,6 +1166,8 @@ export default defineComponent({ return tools.getdefaultnewrec_MySkill() } else if (props.table === toolsext.TABMYBACHECAS) { return tools.getdefaultnewrec_MyBacheca() + } else if (props.table === toolsext.TABMYHOSPS) { + return tools.getdefaultnewrec_MyHosp() } else if (props.table === toolsext.TABMYGOODS) { return tools.getdefaultnewrec_MyGoods() } else if (props.table === toolsext.TABMYGROUPS) { diff --git a/src/components/CSignUp/CSignUp.ts b/src/components/CSignUp/CSignUp.ts index baa53660..503c8a64 100755 --- a/src/components/CSignUp/CSignUp.ts +++ b/src/components/CSignUp/CSignUp.ts @@ -2,7 +2,7 @@ import { tools } from '@store/Modules/tools' import { ISignupOptions } from 'model' -import { Logo } from '../../components/logo' +import { Logo } from '@/components/logo' // import 'vue-country-code/dist/vue-country-code.css' @@ -133,6 +133,8 @@ export default defineComponent({ const v$ = useVuelidate(validations, signup) const invited = ref($route.params.invited) + const usernameteleg = ref($route.params.usernameteleg) + const idteleg = ref($route.params.idteleg) watch(() => invited, (to: any, from: any) => { if (props.showaportador) { @@ -240,8 +242,12 @@ export default defineComponent({ console.log('$route.params', $route.params) - // @ts-ignore - signup.aportador_solidario = $route.params.invited + signup.aportador_solidario = !!$route.params.invited ? $route.params.invited.toString() : '' + signup.username = !!$route.params.usernameteleg ? $route.params.usernameteleg.toString() : '' + signup.profile.username_telegram = signup.username + if (!!$route.params.idteleg) { + signup.profile.teleg_id = $route.params.idteleg ? parseInt($route.params.idteleg.toString()) : 0 + } console.log('1) aportador_solidario', signup.aportador_solidario) @@ -253,6 +259,10 @@ export default defineComponent({ } console.log('signup.aportador_solidario', signup.aportador_solidario) + + if (!signup.username || !signup.profile.teleg_id) { + window.location.href = tools.getLinkBotTelegram() + } } function myRuleEmail(val: string) { diff --git a/src/components/CSignUp/CSignUp.vue b/src/components/CSignUp/CSignUp.vue index 868818d4..c8926bbc 100755 --- a/src/components/CSignUp/CSignUp.vue +++ b/src/components/CSignUp/CSignUp.vue @@ -79,6 +79,25 @@ --> + + + + + + - - - - - -
import('@/root/hosp/hosp.vue'), + meta: { requiresAuth: true }, + inmenu: true, + infooter: true, + }, { active: true, order: 20, @@ -611,7 +622,7 @@ const baseroutes: IListRoutes[] = [ { active: functionality.ENABLE_REGISTRATION, order: 1000, - path: '/signup/:invited', + path: '/signup/:invited/:usernameteleg/:idteleg', materialIcon: 'how_to_reg', name: 'pages.SignUp', component: () => import('@/views/login/signup/signup.vue'), @@ -619,6 +630,17 @@ const baseroutes: IListRoutes[] = [ infooter: false, separator: false }, + { + active: true, + order: 1001, + path: '/signup/:invited', + materialIcon: 'how_to_reg', + name: 'pages.SignUp2', + component: () => import('@/views/login/signup/signup.vue'), + inmenu: false, + infooter: false, + separator: false + }, { active: functionality.ENABLE_REGISTRATION, order: 2000, diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index f6d5ba1e..4a41cada 100755 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -831,3 +831,24 @@ export interface IMyBacheca { } +export interface IMyHosp { + _id: number + idSector: number + idSkill: number + // idSubSkill: number[] + idStatusSkill: number[] + idContribType: string[] + dateTimeStart: Date + dateTimeEnd: Date + idCity: number[] + photos: IGallery[] + NumLevel: number + adType: number + note: string + website: string + descr: string + date_created?: Date, + date_updated?: Date, +} + + diff --git a/src/root/hosp/hosp.scss b/src/root/hosp/hosp.scss new file mode 100755 index 00000000..e69de29b diff --git a/src/root/hosp/hosp.ts b/src/root/hosp/hosp.ts new file mode 100755 index 00000000..a8f92451 --- /dev/null +++ b/src/root/hosp/hosp.ts @@ -0,0 +1,36 @@ +import { + defineComponent, ref, computed, +} from 'vue' + +import { tools } from '@src/store/Modules/tools' +import { toolsext } from '@src/store/Modules/toolsext' +import { CSkill } from '@/components/CSkill' +import { CFinder } from '@/components/CFinder' +import { Footer } from '@/components/Footer' +import { CDashboard } from '@/components/CDashboard' +import { CChartMap } from '@src/components/CChartMap' +import { CUserNonVerif } from '@/components/CUserNonVerif' +import { CTitlePage } from '@/components/CTitlePage' +import { CMapsEsempio } from '@src/components/CMapsEsempio' +import { CVerifyEmail } from '@src/components/CVerifyEmail' +import { CVerifyTelegram } from '@src/components/CVerifyTelegram' +import { useGlobalStore } from '@store/globalStore' +import { useUserStore } from '@store/UserStore' +import { static_data } from '@/db/static_data' +import MixinBase from '@/mixins/mixin-base' +import MixinUsers from '@/mixins/mixin-users' + +import { colmyHosp } from '@store/Modules/fieldsTable' + +export default defineComponent({ + name: 'hosp', + components: { CSkill, CChartMap, CMapsEsempio, CFinder, CVerifyEmail, CVerifyTelegram, CDashboard, CUserNonVerif, CTitlePage, Footer }, + setup() { + return { + colmyHosp, + tools, + toolsext, + static_data, + } + }, +}) diff --git a/src/root/hosp/hosp.vue b/src/root/hosp/hosp.vue new file mode 100755 index 00000000..8039f01b --- /dev/null +++ b/src/root/hosp/hosp.vue @@ -0,0 +1,32 @@ + + + diff --git a/src/statics/lang/es.js b/src/statics/lang/es.js index 8ed28d50..ce71a3eb 100755 --- a/src/statics/lang/es.js +++ b/src/statics/lang/es.js @@ -800,6 +800,7 @@ const msg_es = { friends: 'Amici', bacheca: 'Bacheca', services: 'Servizi', + hosp: 'Scambio Ospitalità', events: 'Eventi', goods: 'Beni', test: 'Test', diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index 1086928e..1505650b 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -458,8 +458,8 @@ const msg_it = { deleted: 'Nascosto', sospeso: 'Sospeso', username: 'Username', - username_reg: 'Scegli il tuo Username', - username_hint: 'caratteri consentiti: tratteggio (_), meno (-) e il punto (.)', + username_reg: 'Username', + username_hint: 'caratteri consentiti: tratteggio (_)', username_pseudonimo: 'Username (Pseudonimo)', username_short: 'Username', name: 'Nome', @@ -897,6 +897,7 @@ const msg_it = { friends: 'Amici', bacheca: 'Bacheca', services: 'Servizi', + hosp: 'Scambio Ospitalità', events: 'Eventi', goods: 'Beni', test: 'Test', diff --git a/src/store/Modules/costanti.ts b/src/store/Modules/costanti.ts index 7f2ecc89..f504f995 100755 --- a/src/store/Modules/costanti.ts +++ b/src/store/Modules/costanti.ts @@ -57,8 +57,8 @@ export const costanti = { }, { visible: true, - title: 'Mobilità', - strsingolo: 'Mobilità', + title: 'Scambio Ospitalità', + strsingolo: 'Scambio Ospitalità', to: '/places', icon: 'fas fa-taxi', color: 'lime-6', diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index c56232bd..f6b593b3 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -943,6 +943,156 @@ export const colmySkills = [ AddCol(DeleteRec), ] +export const colmyHosp = [ + AddCol({ + name: 'idStatusSkill', + label_trans: 'statusSkill.name', + fieldtype: costanti.FieldType.multiselect, + jointable: 'statusSkills', + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + noshowlabel: true, + icon: 'mood', + isadvanced_field: true, + sortable: false, + }), + + AddCol({ + name: 'username', + label_trans: 'reg.username', + foredit: false, + tipovisu: costanti.TipoVisu.LINK, + fieldtype: costanti.FieldType.username_chip, + link: '/my/username', + noshowlabel: true, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView, + sortable: false, + }), + AddCol({ + name: 'idCity', + label_trans: 'skill.city', + fieldtype: costanti.FieldType.multiselect_by_server, + jointable: 'cities', + tablesel: 'cities', + noshowlabel: true, + icon: 'fas fa-map-marker-alt', + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + remote_table: 'mycities', + remote_key: '_id', + remote_field: 'comune', + sortable: false, + required: true, + }), + AddCol( + { + name: 'dateTimeStart', + label_trans: 'event.dateTimeStart', + // jointable: toolsext.TABCALALLDATE, + fieldtype: costanti.FieldType.date, + // fieldtype: costanti.FieldType.select, + // fieldtype_real: costanti.FieldType.onlydate, + // fieldtype: costanti.FieldType.onlydate, + icon: 'fas fa-calendar-day', + }), + AddCol( + { + name: 'dateTimeEnd', + label_trans: 'event.dateTimeEnd', + fieldtype: costanti.FieldType.date, + // jointable: toolsext.TABCALALLDATE, + // fieldtype: costanti.FieldType.select, + // fieldtype_real: costanti.FieldType.onlydate, + icon: 'fas fa-calendar-day', + sortable: false, + }), + AddCol({ + name: 'descr', + label_trans: 'proj.shortdescr', + fieldtype: costanti.FieldType.string, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + noshowlabel: true, + maxlength: 120, + required: true, + sortable: false, + }), + AddCol({ + name: 'idSector', + label_trans: 'sectors.name', + fieldtype: costanti.FieldType.select, + required: true, + jointable: toolsext.TABSECTORS, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + visible: true, + icon: 'category', + sortable: false, + }), + AddCol({ + name: 'idSkill', + label_trans: 'skill.name', + fieldtype: costanti.FieldType.select, + jointable: 'skills', + addnone: true, + filter_table: toolsext.TABSECTORS, + filter_field: 'idSector', + noshowlabel: true, + icon: 'engineering', + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView, + allowNewValue: false, + required: false, + sortable: false, + }), + AddCol({ + name: 'idContribType', + label_trans: 'contribtype.name', + fieldtype: costanti.FieldType.multiselect, + jointable: 'contribtypes', + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + noshowlabel: true, + icon: 'fas fa-hand-holding', + //icon: 'fas fa-hands-helping', + isadvanced_field: false, + sortable: false, + }), + /*AddCol({ + name: '', + fieldtype: costanti.FieldType.separator, + required: false, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit, + visible: false, + sortable: false, + }),*/ + AddCol({ name: 'date_created', label_trans: 'event.dateCreated', fieldtype: costanti.FieldType.onlydate, + required: false, + visible: false, + sortable: true, + showWhen: 0}), + AddCol({ + name: 'photos', + label_trans: 'skill.photos', + fieldtype: costanti.FieldType.listimages, + jointable: '', + showpicprofile_ifnotset: true, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView, + isadvanced_field: true, + sortable: false, + }), + AddCol({ + name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '', + isadvanced_field: true, + sortable: false, + }), + //**ADDFIELD_MYBACHECAS + AddCol({ + name: 'website', label_trans: 'reg.website', isadvanced_field: true, fieldtype: costanti.FieldType.link, + showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, + sortable: false, + }), + AddCol(DuplicateRec), + AddCol(ModifRec), + AddCol(DeleteRec), +] + export const colmyBachecas = [ AddCol({ name: 'idStatusSkill', @@ -2276,6 +2426,7 @@ export const fieldsTable = { 'myskills', 'mygoods', 'mybachecas', + 'myhosp', ], tableRemotePickup: [ @@ -2288,6 +2439,7 @@ export const fieldsTable = { 'myskills', 'mygoods', 'mybachecas', + 'myhosp', ], userlist() { @@ -2588,6 +2740,13 @@ export const fieldsTable = { colkey: '_id', collabel: (rec: any) => `${rec.descr}`, }, + { + value: toolsext.TABMYHOSPS, + label: 'Ospitalità', + columns: colmyHosp, + colkey: '_id', + collabel: (rec: any) => `${rec.descr}`, + }, { value: toolsext.TABMYGOODS, label: 'Beni', diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index a44d716e..e76faa2f 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -5071,6 +5071,11 @@ export const tools = { obj.col_title = 'descr' obj.col_footer = 'idCity' obj.col_tabfooter = 'mycities' + } else if (table === toolsext.TABMYHOSPS) { + obj.prop_colkey = 'idHosp' + obj.col_title = 'descr' + obj.col_footer = 'idCity' + obj.col_tabfooter = 'mycities' } return obj @@ -5201,11 +5206,34 @@ export const tools = { } }, + getdefaultnewrec_MyHosp(): any { + return { + _id: 0, + idSector: tools.getSelectionByTable('sectors', 0), + idHosp: tools.getSelectionByTable('hosps', 0), + idStatusSkill: tools.getSelectionByTable('statusSkills', []), + idContribType: tools.getSelectionByTable('contribtypes', []), + dateTimeStart: new Date(), + dateTimeEnd: new Date(), + idCity: this.getCitySel(), + NumLevel: 0, + adType: tools.getSelectionByTable('adtypes', costanti.AdType.OFFRO), + photos: [], + note: '', + //**ADDFIELD_MYBACHECAS + website: '', + descr: '', + + } + }, + getDirectoryByTable(table: string) { if (table === toolsext.TABMYSKILLS) { return 'myservice' } else if (table === toolsext.TABMYBACHECAS) { return 'mypage' + } else if (table === toolsext.TABMYHOSPS) { + return 'myhosps' } else if (table === toolsext.TABMYGOODS) { return 'mygood' } else if (table === toolsext.TABMYGROUPS) { diff --git a/src/store/Modules/toolsext.ts b/src/store/Modules/toolsext.ts index 51925c22..9d1b1653 100755 --- a/src/store/Modules/toolsext.ts +++ b/src/store/Modules/toolsext.ts @@ -68,6 +68,7 @@ export const toolsext = { TABMYSKILLS: 'myskills', TABMYGOODS: 'mygoods', TABMYBACHECAS: 'mybachecas', + TABMYHOSPS: 'myhosps', TABCALDATE: 'caldate', TABCALALLDATE: 'calalldate', TABNAVI: 'navi', diff --git a/src/views/user/mypagehosp/mypagehosp.scss b/src/views/user/mypagehosp/mypagehosp.scss new file mode 100755 index 00000000..558a623b --- /dev/null +++ b/src/views/user/mypagehosp/mypagehosp.scss @@ -0,0 +1,18 @@ +.profile { + width: 100%; + margin: 0 auto; + max-width: 450px; +} + +.myrow{ + display: flex; + @media (max-width: 600px) { + flex-flow: column; + } +} + +.qualifica{ + border: solid 2px #4198ef; + border-radius: 1rem; + padding: 5px; +} diff --git a/src/views/user/mypagehosp/mypagehosp.ts b/src/views/user/mypagehosp/mypagehosp.ts new file mode 100755 index 00000000..4a83a2b3 --- /dev/null +++ b/src/views/user/mypagehosp/mypagehosp.ts @@ -0,0 +1,31 @@ +import { computed, defineComponent, onMounted, ref, watch } from 'vue' +import { useUserStore } from '@store/UserStore' +import { useRoute, useRouter } from 'vue-router' +import { useI18n } from '@/boot/i18n' +import { useQuasar } from 'quasar' +import { CMyCardPopup } from '@/components/CMyCardPopup' +import { CMyPage } from '@/components/CMyPage' +import { CCheckIfIsLogged } from '@/components/CCheckIfIsLogged' +import { toolsext } from '@store/Modules/toolsext' +import { tools } from '@store/Modules/tools' + +export default defineComponent({ + name: 'mypagehosp', + components: { CMyCardPopup, CMyPage, CCheckIfIsLogged }, + props: {}, + setup() { + const userStore = useUserStore() + const $route = useRoute() + const $q = useQuasar() + const { t } = useI18n() + + const idHosp = computed(() => $route.params.idHosp ? $route.params.idHosp.toString() : 0) + + return { + t, + idHosp, + toolsext, + tools, + } + } +}) diff --git a/src/views/user/mypagehosp/mypagehosp.vue b/src/views/user/mypagehosp/mypagehosp.vue new file mode 100755 index 00000000..230b5e4d --- /dev/null +++ b/src/views/user/mypagehosp/mypagehosp.vue @@ -0,0 +1,30 @@ + + + + + +