Lista Richieste e Rifiutati dei Conti Collettivi
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -435,7 +435,7 @@
|
||||
:circuitname="circuitname"
|
||||
:finder="false"
|
||||
:mygrp="row"
|
||||
:visu="costanti.FIND_GROUP"
|
||||
:visu="visufind ? visufind : costanti.FIND_GROUP"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -461,6 +461,60 @@
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
<q-item-label v-else-if="visu === costanti.REQ_ADD_GROUP_TO_CIRCUIT">
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
tools.addGroupToMyCircuits($q, grp.groupname, circuitname)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
{{ $t('circuit.accept') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
tools.refuseReqCircuit($q, myusername(), circuitname, grp.groupname)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{
|
||||
$t('shared.refuse_ask')
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
tools.cancelReqCircuit($q, myusername(), circuitname, grp.groupname)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus" />
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{
|
||||
$t('shared.cancel_ask_short')
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -220,9 +220,7 @@
|
||||
icon="fas fa-user-friends"
|
||||
></q-tab>
|
||||
<q-tab
|
||||
v-if="
|
||||
costanti.ENABLE_CONTI_COLLETTIVI
|
||||
"
|
||||
v-if="costanti.ENABLE_CONTI_COLLETTIVI"
|
||||
:label="t('circuit.conticollettivi')"
|
||||
name="gruppicollettivi"
|
||||
icon="fas fa-users"
|
||||
@@ -242,128 +240,220 @@
|
||||
</q-tabs>
|
||||
|
||||
<q-tab-panels v-model="tabcircuit" animated>
|
||||
<q-tab-panel name="gruppicollettivi">
|
||||
<div class="row justify-center">
|
||||
<q-btn rounded icon="fas fa-user-plus" class="text-center">
|
||||
<q-menu>
|
||||
<q-item> Chiedi di Entrare nei Circuiti: </q-item>
|
||||
<q-list
|
||||
v-for="(group, ind) of groupsListAdmin"
|
||||
:key="ind"
|
||||
class="q-pa-sm"
|
||||
>
|
||||
<q-item v-if="!userStore.IsMyCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)">
|
||||
<q-item-section>
|
||||
<q-btn
|
||||
v-if="
|
||||
userStore.IsMyCircuitByName(circuit.name) &&
|
||||
group.groupname &&
|
||||
!circuitStore.IsAskedCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
) &&
|
||||
!userStore.IsMyCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)
|
||||
"
|
||||
icon="fas fa-user-plus"
|
||||
color="primary"
|
||||
:label="group.groupname"
|
||||
@click="
|
||||
requestToEnterCircuit = true;
|
||||
groupnameSel = group;
|
||||
"
|
||||
/>
|
||||
<q-btn
|
||||
v-else-if="
|
||||
group.groupname &&
|
||||
circuitStore.IsAskedCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
) &&
|
||||
!userStore.IsMyCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)
|
||||
"
|
||||
icon="fas fa-user-minus"
|
||||
flat
|
||||
:label="$t('shared.cancel_ask_short')"
|
||||
@click="
|
||||
tools.cancelReqCircuit(
|
||||
$q,
|
||||
userStore.my.username,
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)
|
||||
"
|
||||
/>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
|
||||
<q-list>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
tools.setCmd(
|
||||
$q,
|
||||
shared_consts.GROUPSCMD.REQGROUP,
|
||||
myusername(),
|
||||
true,
|
||||
grp.groupname
|
||||
)
|
||||
"
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<CTitleSec :title="$t('circuit.listaconticollettivi')" />
|
||||
|
||||
<CGridTableRec
|
||||
v-if="!loading"
|
||||
ref="tabGroups"
|
||||
prop_mytable="mygroups"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="
|
||||
showsaldi ? colmyUserPeopleSaldi : colmyUserPeople
|
||||
"
|
||||
prop_colkey="_id"
|
||||
col_title="groupname"
|
||||
:vertical="costanti.VISUTABLE_GROUP_CIRCUIT"
|
||||
nodataLabel="Nessun Gruppo Comunitario"
|
||||
:prop_search="true"
|
||||
hint="gruppo da trovare"
|
||||
:finder="false"
|
||||
:choose_visutype="true"
|
||||
:finder_noNull="false"
|
||||
:options="shared_consts.OPTIONS_SEARCH_USER_ALL_WORDS"
|
||||
:butt_modif_new="false"
|
||||
noresultLabel="gruppo non trovato"
|
||||
:arrfilters="arrfilterand"
|
||||
:filtercustom="filtercustom"
|
||||
:filterextra="filterextra_group"
|
||||
:filterextra2="filterextra2"
|
||||
:prop_searchList="searchList"
|
||||
:showType="costanti.SHOW_GROUPINFO"
|
||||
:showCol="false"
|
||||
:circuitname="circuit.name"
|
||||
extraparams=""
|
||||
:visufind="
|
||||
tools.iAmAdminCircuit(circuit.name)
|
||||
? costanti.REQ_REMOVE_USER_TO_CIRCUIT
|
||||
: costanti.FIND_PEOPLE
|
||||
"
|
||||
<q-tab-panel
|
||||
name="gruppicollettivi"
|
||||
style="max-width: 500px"
|
||||
v-if="tools.iCanShowCircuitsMember(circuit)"
|
||||
>
|
||||
<q-tabs
|
||||
v-show="tools.iAmAdminCircuit(circuit.name)"
|
||||
v-model="tabmembers"
|
||||
class="text-blue"
|
||||
>
|
||||
</CGridTableRec>
|
||||
<q-tab label="Iscritti" name="all" icon="fas fa-users"></q-tab>
|
||||
<q-tab
|
||||
v-if="tools.iAmAdminCircuit(circuit.name)"
|
||||
label="Richieste"
|
||||
name="rich"
|
||||
icon="fas fa-user-plus"
|
||||
></q-tab>
|
||||
<q-tab
|
||||
v-if="tools.iAmAdminCircuit(circuit.name)"
|
||||
label="Rifiutati"
|
||||
name="refused"
|
||||
icon="fas fa-user-minus"
|
||||
></q-tab>
|
||||
</q-tabs>
|
||||
|
||||
<q-tab-panels v-model="tabmembers" animated>
|
||||
<q-tab-panel name="all">
|
||||
<div class="row justify-center">
|
||||
<q-btn rounded icon="fas fa-user-plus" class="text-center">
|
||||
<q-menu>
|
||||
<q-item> Chiedi di Entrare nei Circuiti: </q-item>
|
||||
<q-list
|
||||
v-for="(group, ind) of groupsListAdmin"
|
||||
:key="ind"
|
||||
class="q-pa-sm"
|
||||
>
|
||||
<q-item
|
||||
v-if="
|
||||
!userStore.IsMyCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-btn
|
||||
v-if="
|
||||
userStore.IsMyCircuitByName(circuit.name) &&
|
||||
group.groupname &&
|
||||
!circuitStore.IsAskedCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
) &&
|
||||
!userStore.IsMyCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)
|
||||
"
|
||||
icon="fas fa-user-plus"
|
||||
color="primary"
|
||||
:label="group.groupname"
|
||||
@click="
|
||||
requestToEnterCircuit = true;
|
||||
groupnameSel = group;
|
||||
"
|
||||
/>
|
||||
<q-btn
|
||||
v-else-if="
|
||||
group.groupname &&
|
||||
circuitStore.IsAskedCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
) &&
|
||||
!userStore.IsMyCircuitByNameAndGroup(
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)
|
||||
"
|
||||
icon="fas fa-user-minus"
|
||||
flat
|
||||
:label="$t('shared.cancel_ask_short')"
|
||||
@click="
|
||||
tools.cancelReqCircuit(
|
||||
$q,
|
||||
userStore.my.username,
|
||||
circuit.name,
|
||||
group.groupname
|
||||
)
|
||||
"
|
||||
/>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
|
||||
<q-list>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
tools.setCmd(
|
||||
$q,
|
||||
shared_consts.GROUPSCMD.REQGROUP,
|
||||
myusername(),
|
||||
true,
|
||||
grp.groupname
|
||||
)
|
||||
"
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<CTitleSec :title="$t('circuit.listaconticollettivi')" />
|
||||
|
||||
<CGridTableRec
|
||||
v-if="!loading"
|
||||
ref="tabGroups"
|
||||
prop_mytable="mygroups"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="
|
||||
showsaldi ? colmyUserPeopleSaldi : colmyUserPeople
|
||||
"
|
||||
prop_colkey="_id"
|
||||
col_title="groupname"
|
||||
:vertical="costanti.VISUTABLE_GROUP_CIRCUIT"
|
||||
nodataLabel="Nessun Gruppo Comunitario"
|
||||
:prop_search="true"
|
||||
hint="gruppo da trovare"
|
||||
:finder="false"
|
||||
:choose_visutype="true"
|
||||
:finder_noNull="false"
|
||||
:options="shared_consts.OPTIONS_SEARCH_USER_ALL_WORDS"
|
||||
:butt_modif_new="false"
|
||||
noresultLabel="gruppo non trovato"
|
||||
:arrfilters="arrfilterand"
|
||||
:filtercustom="filtercustom"
|
||||
:filterextra="filterextra_group"
|
||||
:filterextra2="filterextra2"
|
||||
:prop_searchList="searchList"
|
||||
:showType="costanti.SHOW_GROUPINFO"
|
||||
:showCol="false"
|
||||
:circuitname="circuit.name"
|
||||
extraparams=""
|
||||
:visufind="
|
||||
tools.iAmAdminCircuit(circuit.name)
|
||||
? costanti.REQ_REMOVE_USER_TO_CIRCUIT
|
||||
: costanti.FIND_PEOPLE
|
||||
"
|
||||
>
|
||||
</CGridTableRec>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="rich">
|
||||
<CGridTableRec
|
||||
v-if="!loading"
|
||||
prop_mytable="circuits"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="colmyUserGroup"
|
||||
prop_colkey="_id"
|
||||
col_title=""
|
||||
:vertical="costanti.VISUTABLE_GROUP_CIRCUIT"
|
||||
nodataLabel="Nessuna Richiesta Collettiva in sospeso"
|
||||
:prop_search="false"
|
||||
hint="Username da trovare"
|
||||
:finder="false"
|
||||
:choose_visutype="false"
|
||||
:finder_noNull="false"
|
||||
:options="shared_consts.OPTIONS_SEARCH_USER_ALL_WORDS"
|
||||
:butt_modif_new="false"
|
||||
noresultLabel="Gruppo non trovato"
|
||||
:arrfilters="arrfilterand"
|
||||
:filterextra2="filterextra2"
|
||||
:filtercustom="filtercustom_rich"
|
||||
:prop_searchList="searchList"
|
||||
:showType="costanti.SHOW_GROUPINFO"
|
||||
:showCol="false"
|
||||
:extraparams="extraparams_rich_groups()"
|
||||
:circuitname="circuit.name"
|
||||
:visufind="costanti.REQ_ADD_GROUP_TO_CIRCUIT"
|
||||
>
|
||||
</CGridTableRec>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="refused">
|
||||
<CGridTableRec
|
||||
v-if="!loading"
|
||||
prop_mytable="circuits"
|
||||
prop_mytitle=""
|
||||
:prop_mycolumns="colmyUserGroup"
|
||||
prop_colkey="_id"
|
||||
col_title=""
|
||||
:vertical="costanti.VISUTABLE_GROUP_CIRCUIT"
|
||||
nodataLabel="Nessun Conto Collettivo Rifiutato"
|
||||
:prop_search="false"
|
||||
hint="Gruppo da trovare"
|
||||
:finder="false"
|
||||
:choose_visutype="false"
|
||||
:finder_noNull="false"
|
||||
:options="shared_consts.OPTIONS_SEARCH_USER_ALL_WORDS"
|
||||
:butt_modif_new="false"
|
||||
noresultLabel="Conto Collettivo non trovato"
|
||||
:arrfilters="arrfilterand"
|
||||
:filtercustom="filtercustom_rich"
|
||||
:filterextra2="filterextra2"
|
||||
:prop_searchList="searchList"
|
||||
:showType="costanti.SHOW_GROUPINFO"
|
||||
:showCol="false"
|
||||
:extraparams="extraparams_refused_groups()"
|
||||
:circuitname="circuit.name"
|
||||
:visufind="costanti.REQ_ADD_GROUP_TO_CIRCUIT"
|
||||
>
|
||||
</CGridTableRec>
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-tab-panel>
|
||||
<q-tab-panel name="mov">
|
||||
<q-toggle
|
||||
|
||||
Reference in New Issue
Block a user