diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 761df2b6..9263f00f 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -96,6 +96,9 @@ export const shared_consts = { TABLES_PERM_NEWREC: ['skills', 'goods', 'subskills', 'mygroups'], TABLES_REC_ID: ['skills', 'goods', 'subskills'], + // 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'], @@ -107,6 +110,9 @@ export const shared_consts = { TABLES_PERM_CHANGE_FOR_USERS: ['myskills', 'mybachecas', 'mygoods'], TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'mygoods', 'users'], + TABLES_VISU_IMG: ['myskills', 'mybachecas', 'mygoods', 'mygroups'], + TABLES_DIRECTORY_A_PARTE: ['mygroups'], + VISIB_ALL: 0, VISIB_ONLYIF_VERIFIED: 1, VISIB_ONLY_MANAGER: 2, diff --git a/src/components/CFinder/CFinder.ts b/src/components/CFinder/CFinder.ts index 60a92c5e..e8f02e55 100755 --- a/src/components/CFinder/CFinder.ts +++ b/src/components/CFinder/CFinder.ts @@ -734,6 +734,29 @@ export default defineComponent({ } }, lookup2: { + lk_tab: 'catgrps', + lk_LF: 'idCatGrp', + lk_FF: '_id', + lk_as: 'recCatGrp', + lk_proj: { + groupname: 1, + title: 1, + descr: 1, + img: 1, + visibility: 1, + admins: 1, + idCatGrp: 1, + photos: 1, + idCity: 1, + note: 1, + website: 1, + comune: 1, + mycities: 1, + sector: 1, + recCatGrp: 1, + } + }, + lookup3: { lk_tab: 'cities', lk_LF: 'idCity', lk_FF: '_id', @@ -753,6 +776,7 @@ export default defineComponent({ website: 1, comune: 1, mycities: 1, + recCatGrp: 1, } }, diff --git a/src/components/CGridTableRec/CGridTableRec.ts b/src/components/CGridTableRec/CGridTableRec.ts index 1e2e5f7e..e4fa69bf 100755 --- a/src/components/CGridTableRec/CGridTableRec.ts +++ b/src/components/CGridTableRec/CGridTableRec.ts @@ -24,6 +24,7 @@ import { CMyUser } from '../CMyUser' import { CMyGroups } from '../CMyGroups' import { CMyFieldDb } from '../CMyFieldDb' import { CMyRecCard } from '../CMyRecCard' +import { CMyRecGrpCard } from '../CMyRecGrpCard' import { CMySelect } from '../CMySelect' import { CTitleBanner } from '../CTitleBanner' @@ -34,6 +35,7 @@ import { costanti } from '@costanti' import translate from '@/globalroutines/util' import { toolsext } from '@store/Modules/toolsext' import { CMyCardPopup } from '@/components/CMyCardPopup' +import { CMyCardGrpPopup } from '@/components/CMyCardGrpPopup' export default defineComponent({ name: 'CGridTableRec', @@ -208,7 +210,7 @@ export default defineComponent({ default: '', }, }, - components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups, CMyUser, CMyRecCard, CMyCardPopup }, + components: { CMyPopupEdit, CTitleBanner, CMyFieldDb, CMySelect, CMyFriends, CMyGroups, CMyUser, CMyRecCard, CMyCardPopup, CMyRecGrpCard, CMyCardGrpPopup }, setup(props, { emit }) { const $q = useQuasar() const { t } = useI18n() @@ -341,33 +343,6 @@ export default defineComponent({ refresh() } - function canModifyThisRec(rec: any) { - // console.log('rec', rec) - - if (tablesel.value === 'mygroups') { - // is Admin ? - if (rec.admins) { - const trovato = rec.admins.find((myuser: any) => myuser.username === userStore.my.username) - if (trovato) { - return !!trovato - } - } - } - - if (rec.hasOwnProperty('userId')) { - let userId = rec.userId - if (userId === userStore.my._id) { - // E' il mio, quindi modificalo - return true - } else { - return false - } - } else { - return false - } - if (userStore.isAdmin || userStore.isManager) - return true - } // emulate 'SELECT count(*) FROM ...WHERE...' function getRowsNumberCount(myfilter?: any) { @@ -1628,7 +1603,6 @@ export default defineComponent({ globalStore, searchList, searchval, - canModifyThisRec, checkIfShowRec, valoriopt, labelcombo, diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index f4f86789..9aea1f1e 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -35,8 +35,8 @@
+ v-if="showType === costanti.SHOW_MYCARD || (myvertical !== costanti.VISUTABLE_USER_TABGROUP && myvertical === costanti.VISUTABLE_LISTA && shared_consts.TABLES_VISU_CMYSRECCARD.includes(tablesel)) ">
@@ -364,7 +364,15 @@
+ +
+ -
@@ -421,7 +420,7 @@ - + {{ fieldsTable.getValByTabAndId(tablesel, 'adType', props.row['adType']) }} @@ -430,11 +429,11 @@ @@ -467,7 +466,7 @@ + + + @@ -522,7 +528,7 @@ , + required: false, + default: null, + }, + idRec: { + type: Number, + required: false, + default: 0 + } + }, + setup(props) { + + const userStore = useUserStore() + const globalStore = useGlobalStore() + const $q = useQuasar() + const { t } = useI18n() + + const showPic = ref(false) + + const myrec = ref({}) + const col = ref({}) + + function profile() { + return userStore.my.profile + } + + function load() { + // Carica il profilo di quest'utente + if (props.idRec > 0) { + userStore.loadGeneric(props.table, props.idRec).then((ris) => { + myrec.value = ris + }) + + } else { + myrec.value = props.prop_myrec + } + + col.value = fieldsTable.getArrColsByTable(props.table) + } + + watch(() => props.idRec, (to: any, from: any) => { + load() + }) + + function mounted() { + load() + } + + onMounted(mounted) + + return { + profile, + tools, + costanti, + myrec, + shared_consts, + globalStore, + showPic, + userStore, + t, + fieldsTable, + colCitys, + toolsext, + col, + } + } +}) diff --git a/src/components/CMyCardGrpPopup/CMyCardGrpPopup.vue b/src/components/CMyCardGrpPopup/CMyCardGrpPopup.vue new file mode 100644 index 00000000..6e814224 --- /dev/null +++ b/src/components/CMyCardGrpPopup/CMyCardGrpPopup.vue @@ -0,0 +1,87 @@ + + + + + + diff --git a/src/components/CMyCardGrpPopup/index.ts b/src/components/CMyCardGrpPopup/index.ts new file mode 100644 index 00000000..0a9e5753 --- /dev/null +++ b/src/components/CMyCardGrpPopup/index.ts @@ -0,0 +1 @@ +export { default as CMyCardGrpPopup } from './CMyCardGrpPopup.vue' diff --git a/src/components/CMyCardPopup/CMyCardPopup.vue b/src/components/CMyCardPopup/CMyCardPopup.vue index fcfc778b..7ca829b2 100644 --- a/src/components/CMyCardPopup/CMyCardPopup.vue +++ b/src/components/CMyCardPopup/CMyCardPopup.vue @@ -1,4 +1,5 @@