diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index 88678de0..2831907f 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -64,6 +64,8 @@ export const shared_consts = { QUERYTYPE_REFUSED_USER_CIRCUIT: 12, QUERYTYPE_LIST_MOVEMENTS: 15, QUERYTYPE_LIST_ALLMOVEMENTS: 16, + QUERYTYPE_GROUP_CIRCUIT: 20, + QUERYTYPE_REFUSED_GROUP_CIRCUIT: 22, FILTER_EXTRALIST_NOT_REGISTERED: 1, FILTER_EXTRALIST_NOT_CONTACTED: 2, diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index 667d6bb5..89312b20 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -435,7 +435,7 @@ :circuitname="circuitname" :finder="false" :mygrp="row" - :visu="costanti.FIND_GROUP" + :visu="visufind ? visufind : costanti.FIND_GROUP" /> diff --git a/src/components/CMyGroup/CMyGroup.vue b/src/components/CMyGroup/CMyGroup.vue index 51a880f8..a2a7c65a 100755 --- a/src/components/CMyGroup/CMyGroup.vue +++ b/src/components/CMyGroup/CMyGroup.vue @@ -461,6 +461,60 @@ + + + + + + + + + + {{ $t('circuit.accept') }} + + + + + + + + + + {{ + $t('shared.refuse_ask') + }} + + + + + + + {{ + $t('shared.cancel_ask_short') + }} + + + + + diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index 44eca0dd..a1a145b6 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -232,6 +232,7 @@ const msg_it = { both_fiducia: 'Fiducia reciproca tra te e {username}', domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?', domanda_addtocircuit: 'Aggiungi {username} al Circuito {circuitname}?', + domanda_addgrouptocircuit: 'Aggiungi il Conto Collettivo {groupname} al Circuito {circuitname}?', addedfriend: 'Aggiunto alla lista di Amici', addedhandshake: 'Aggiunto alla lista Strette di Mano', addedgroup: 'Aggiunto al Gruppo', diff --git a/src/store/Modules/costanti.ts b/src/store/Modules/costanti.ts index 7ab253e8..f1439b2b 100755 --- a/src/store/Modules/costanti.ts +++ b/src/store/Modules/costanti.ts @@ -277,6 +277,8 @@ export const costanti = { REQ_REMOVE_USER_TO_GROUP: 101, REQ_ADD_USER_TO_CIRCUIT: 110, REQ_REMOVE_USER_TO_CIRCUIT: 111, + REQ_ADD_GROUP_TO_CIRCUIT: 120, + REQ_REMOVE_GROUP_TO_CIRCUIT: 121, FILTER_NESSUNO: 0, FILTER_TUTTI: -100, diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index b56f69c8..15c9c6ba 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -5632,6 +5632,38 @@ export const tools = { }) }, + addGroupToMyCircuits($q: any, groupname: string, circuitname: string) { + + const userStore = useUserStore() + const notifStore = useNotifStore() + $q.dialog({ + message: t('db.domanda_addgrouptocircuit', { groupname, circuitname }), + ok: { label: t('dialog.yes'), push: true }, + cancel: { label: t('dialog.cancel') }, + title: t('db.domanda') + }).onOk(() => { + + let extrarec = { + groupname, + } + + userStore.setCircuitCmd($q, t, userStore.my.username, circuitname, shared_consts.CIRCUITCMD.SET, true, extrarec) + .then((res: any) => { + if (res && res.result) { + this.updateMyData(res) + notifStore.updateNotification = true + if (res.circuit) { + if (userStore.my.profile.mycircuits) + userStore.my.profile.mycircuits = [...userStore.my.profile.mycircuits, res.circuit] + else + userStore.my.profile.mycircuits = [res] + } + tools.showPositiveNotif($q, t('db.addedcircuit', { circuitname })) + } + }) + }) + }, + addToMyGroups($q: any, username: string, groupnameDest: string) { const userStore = useUserStore() diff --git a/src/views/user/mycircuit/mycircuit.ts b/src/views/user/mycircuit/mycircuit.ts index 00d558c1..f9265135 100755 --- a/src/views/user/mycircuit/mycircuit.ts +++ b/src/views/user/mycircuit/mycircuit.ts @@ -23,7 +23,7 @@ import { CNotifAtTop } from '@src/components/CNotifAtTop' import { costanti } from '@costanti' import { ICity, IFriends, ICircuit, ISearchList, IUserFields, IAccount, IMyGroup } from 'model' import { shared_consts } from '@/common/shared_vuejs' -import { colmyUserPeople, colmyUserPeopleSaldi, colmyUserCircuit, colmyMovement, colmyMovementTable } from '@store/Modules/fieldsTable' +import { colmyUserPeople, colmyUserPeopleSaldi, colmyUserCircuit, colmyMovement, colmyMovementTable, colmyUserGroup } from '@store/Modules/fieldsTable' import { useNotifStore } from '@store/NotifStore' import { useCircuitStore } from '@store/CircuitStore' @@ -368,6 +368,13 @@ export default defineComponent({ } } + function extraparams_rich_groups() { + return { + querytype: shared_consts.QUERYTYPE_GROUP_CIRCUIT, + myid: circuit.value ? circuit.value._id : '', + } + } + const extraparams_movs = (() => { if (showonlymine.value) { return { @@ -390,6 +397,12 @@ export default defineComponent({ myid: circuit.value ? circuit.value._id : '', } } +function extraparams_refused_groups() { + return { + querytype: shared_consts.QUERYTYPE_REFUSED_GROUP_CIRCUIT, + myid: circuit.value ? circuit.value._id : '', + } + } function numUsers() { return users_in_circuit.value ? users_in_circuit.value.length : 0 @@ -431,6 +444,7 @@ export default defineComponent({ colmyUserPeople, colmyUserPeopleSaldi, colmyUserCircuit, + colmyUserGroup, extraparams, extraparams_rich, extraparams_refused, @@ -460,6 +474,8 @@ export default defineComponent({ showsendCoinTo, showrules, loadCircuit, + extraparams_rich_groups, + extraparams_refused_groups, } } }) diff --git a/src/views/user/mycircuit/mycircuit.vue b/src/views/user/mycircuit/mycircuit.vue index 61c7e328..c3ba189a 100755 --- a/src/views/user/mycircuit/mycircuit.vue +++ b/src/views/user/mycircuit/mycircuit.vue @@ -220,9 +220,7 @@ icon="fas fa-user-friends" > - - - - - Chiedi di Entrare nei Circuiti: - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + Chiedi di Entrare nei Circuiti: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +