- L'utente entra direttamente sul circuito, con fido a zero.
++Abilitazione Fido utente (per admin).
This commit is contained in:
@@ -630,7 +630,7 @@ export const colmyMovement = [
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuits/contocomfrom.path',
|
||||
link: '/circuit/contocomfrom.path',
|
||||
noshowlabel: true,
|
||||
extrafield: 'movement.fromCCom',
|
||||
tipoconto: costanti.AccountType.COMMUNITY_ACCOUNT,
|
||||
@@ -670,7 +670,7 @@ export const colmyMovement = [
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuits/contocomto.path',
|
||||
link: '/circuit/contocomto.path',
|
||||
noshowlabel: true,
|
||||
extrafield: 'movement.toCCom',
|
||||
tipoconto: costanti.AccountType.COMMUNITY_ACCOUNT,
|
||||
@@ -718,7 +718,7 @@ export const colmyMovementTable = [
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuits/contocomfrom.path',
|
||||
link: '/circuit/contocomfrom.path',
|
||||
tipoconto: costanti.AccountType.COMMUNITY_ACCOUNT,
|
||||
required: true,
|
||||
}),
|
||||
@@ -755,7 +755,7 @@ export const colmyMovementTable = [
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuits/contocomto.path',
|
||||
link: '/circuit/contocomto.path',
|
||||
tipoconto: costanti.AccountType.COMMUNITY_ACCOUNT,
|
||||
required: true,
|
||||
}),
|
||||
@@ -3181,7 +3181,7 @@ export const colmyUserCircuit = [
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuits/contocom',
|
||||
link: '/circuit/contocom',
|
||||
noshowlabel: true,
|
||||
tipoconto: costanti.AccountType.COMMUNITY_ACCOUNT,
|
||||
}),
|
||||
@@ -3192,7 +3192,7 @@ export const colmyUserCircuit = [
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuits/groupname',
|
||||
link: '/circuit/groupname',
|
||||
noshowlabel: true,
|
||||
tipoconto: costanti.AccountType.COLLECTIVE_ACCOUNT,
|
||||
}),
|
||||
@@ -3212,16 +3212,40 @@ export const colTableNotifCoins = [
|
||||
AddCol({ name: 'datenotif', label_trans: 'sendnotifs.datenotif', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({
|
||||
name: 'extrarec.dest',
|
||||
label_trans: 'reg.username',
|
||||
field: 'extrarec',
|
||||
subfield: 'dest',
|
||||
label_trans: 'reg.username',
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/my/extrarec.dest',
|
||||
noshowlabel: true,
|
||||
extrafield: 'movement.to',
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
|
||||
tipoconto: costanti.AccountType.USER,
|
||||
}),
|
||||
|
||||
AddCol({
|
||||
name: 'extrarec.groupdest',
|
||||
label_trans: 'extrarec.groupname',
|
||||
field: 'extrarec',
|
||||
subfield: 'groupdest',
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/grp/extrarec.groupdest',
|
||||
noshowlabel: true,
|
||||
tipoconto: costanti.AccountType.COLLECTIVE_ACCOUNT,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'extrarec.contoComDest',
|
||||
label_trans: 'groups.groupname',
|
||||
field: 'extrarec',
|
||||
subfield: 'contoComDest',
|
||||
foredit: false,
|
||||
tipovisu: costanti.TipoVisu.LINK,
|
||||
fieldtype: costanti.FieldType.username_chip,
|
||||
link: '/circuit/extrarec.contoComDest',
|
||||
noshowlabel: true,
|
||||
tipoconto: costanti.AccountType.COMMUNITY_ACCOUNT,
|
||||
}),
|
||||
AddCol({ name: 'extrarec.qty', field: 'extrarec', subfield: 'qty', label_trans: 'movement.amount', fieldtype: costanti.FieldType.currency }),
|
||||
AddCol({ name: 'extrarec.causal', field: 'extrarec', subfield: 'causal', label_trans: 'movement.causal', tipovisu: costanti.TipoVisu.TESTO_BORDATO }),
|
||||
|
||||
@@ -3818,7 +3818,7 @@ export const tools = {
|
||||
,
|
||||
gettextevent(myevent: any) {
|
||||
// return '"' + myevent.title + '" (' + func_tools.getDateStr(myevent.date) + ') - ' + myevent.time
|
||||
return '"' + (myevent.title ? myevent.title : (myevent.descr ? myevent.descr: '')) + '" (' + this.getstrDateEmailTime(myevent.dateTimeStart) + ')'
|
||||
return '"' + (myevent.title ? myevent.title : (myevent.descr ? myevent.descr : '')) + '" (' + this.getstrDateEmailTime(myevent.dateTimeStart) + ')'
|
||||
},
|
||||
|
||||
getlangforQuasar(mylang: string) {
|
||||
@@ -5756,6 +5756,66 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
addFidoToMyCircuits($q: any, username: string, circuitname: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
$q.dialog({
|
||||
message: t('db.domanda_addfidotocircuit', { username, circuitname }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.SETFIDO, true)
|
||||
.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.addedfidocircuit', { circuitname }))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
addFidoGroupToMyCircuits($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.SETFIDO, 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.addedfidocircuit', { circuitname }))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
addToMyGroups($q: any, username: string, groupnameDest: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -6276,44 +6336,32 @@ export const tools = {
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
let msg = ''
|
||||
if (value) {
|
||||
msg = t('circuit.domanda_ask', { circuitname })
|
||||
} else {
|
||||
msg = t('circuit.domanda_revoke', { circuitname })
|
||||
}
|
||||
|
||||
$q.dialog({
|
||||
message: msg,
|
||||
ok: {
|
||||
label: t('dialog.yes'),
|
||||
push: true
|
||||
},
|
||||
cancel: {
|
||||
label: t('dialog.cancel')
|
||||
},
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REQ, value, { groupname })
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
if (value) {
|
||||
// ADD to req
|
||||
userStore.my.profile.asked_circuits.push(res.circuit)
|
||||
tools.showPositiveNotif($q, t('circuit.askedto', { circuitname }))
|
||||
} else {
|
||||
// REMOVE to req
|
||||
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
tools.showPositiveNotif($q, t('circuit.revoketo', { circuitname }))
|
||||
}
|
||||
|
||||
this.updateMyData(res)
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REQ, value, { groupname })
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
if (value) {
|
||||
// ADD to req
|
||||
userStore.my.profile.asked_circuits.push(res.circuit)
|
||||
tools.showPositiveNotif($q, t('circuit.askedto', { circuitname }))
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
// REMOVE to req
|
||||
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
tools.showPositiveNotif($q, t('circuit.revoketo', { circuitname }))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
this.updateMyData(res)
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getDestStrByExtraRec(extrarec: any) {
|
||||
return extrarec.groupdest ? extrarec.groupdest : (extrarec.contoComDest ? extrarec.contoComDest : extrarec.dest)
|
||||
},
|
||||
|
||||
getOrigStrBySendNotif(extrarec: any) {
|
||||
return extrarec.grouporig ? extrarec.grouporig : (extrarec.contoComOrig ? extrarec.contoComOrig : extrarec.sender)
|
||||
},
|
||||
|
||||
async sendCoinsByCircuit($q: any, circuit: ICircuit, sendcoinrec: ISendCoin) {
|
||||
@@ -6523,6 +6571,10 @@ export const tools = {
|
||||
|
||||
let risultato = false
|
||||
|
||||
if (userStore.isAdmin) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (userStore.my.profile.manage_mycircuits) {
|
||||
const ris = userStore.my.profile.manage_mycircuits.find((circuit: ICircuit) => {
|
||||
if (circuit.name === circuitname) {
|
||||
@@ -6622,6 +6674,9 @@ export const tools = {
|
||||
isUserAdminGroup(groupname: string, username: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
if (userStore.my.username === username && userStore.isAdmin) {
|
||||
return true
|
||||
}
|
||||
let risultato = false
|
||||
|
||||
if (userStore.my.profile.manage_mygroups) {
|
||||
@@ -6664,6 +6719,10 @@ export const tools = {
|
||||
isUserTheCreatorOfTheCircuit(name: string, username: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
if (userStore.my.username === username && userStore.isAdmin) {
|
||||
return true
|
||||
}
|
||||
|
||||
let risultato = false
|
||||
|
||||
if (userStore.my.profile.manage_mycircuits) {
|
||||
@@ -6684,6 +6743,10 @@ export const tools = {
|
||||
isUserAdminCircuit(name: string, username: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
if (userStore.my.username === username && userStore.isAdmin) {
|
||||
return true
|
||||
}
|
||||
|
||||
let risultato = false
|
||||
|
||||
if (userStore.my.profile.manage_mycircuits) {
|
||||
|
||||
Reference in New Issue
Block a user