Mostrare il Bene, Servizio, solo ai Propri Gruppi.

Nella pagina profilo, i "Gruppi" personali non si vedevano !
This commit is contained in:
Paolo Arena
2022-06-16 20:34:17 +02:00
parent bb2604d430
commit f1c89483ff
62 changed files with 1249 additions and 431 deletions

View File

@@ -116,15 +116,27 @@ export const costanti = {
disable: true,
small: true,
},
{
visible: true,
title: 'Sostieni il Progetto',
to: '/fundraising',
icon: 'fas fa-hand-holding-heart',
color: 'purple',
hint: '',
disable: false,
small: false,
link: true,
},
{
visible: true,
title: 'Help (Faq)',
to: '/faq',
icon: 'fas fa-users',
color: 'green-6',
icon: 'fas fa-question',
color: 'yellow',
hint: '',
disable: false,
small: true,
link: true,
},
{
visible: false,
@@ -136,20 +148,10 @@ export const costanti = {
disable: true,
small: true,
},
{
visible: true,
title: 'Per sostienere il Progetto?',
to: '/fundraising',
icon: 'fas fa-hand-holding',
color: 'blue-6',
hint: '',
disable: false,
small: false,
},
{
visible: false,
title: 'Gruppi',
to: '',
to: '/groups',
table: 'mygroups',
icon: 'fas fa-users',
color: 'blue-6',
@@ -186,6 +188,7 @@ export const costanti = {
ASK_SENT_GROUP: 16,
FIND_GROUP: 20,
MY_GROUPS: 21,
USER_GROUPS: 22,
CREATE_GROUP: 30,
MANAGE_GROUPS: 31,

View File

@@ -189,7 +189,7 @@ export const colmybot = [
name: 'visibility',
label_trans: 'bot.visibility',
fieldtype: costanti.FieldType.binary,
jointable: 'visibility'
jointable: 'visibility',
}),
AddCol({ name: 'date_updated', label_trans: 'bot.date_updated', fieldtype: costanti.FieldType.date }),
AddCol(DeleteRec),
@@ -659,6 +659,14 @@ export const colmyGoods = [
remote_field: 'comune',
required: true,
}),
AddCol({
name: 'pub_to_share',
label_trans: 'skill.pub_to_share',
fieldtype: costanti.FieldType.select,
jointable: 'pub_to_share',
icon: 'fas fa-users',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
}),
AddCol({
name: 'adType',
label_trans: 'adTypes.name',
@@ -828,6 +836,14 @@ export const colmySkills = [
remote_field: 'comune',
required: true,
}),
AddCol({
name: 'pub_to_share',
label_trans: 'skill.pub_to_share',
fieldtype: costanti.FieldType.select,
jointable: 'pub_to_share',
icon: 'fas fa-users',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
}),
AddCol({
name: 'adType',
label_trans: 'adTypes.name',
@@ -1030,6 +1046,14 @@ export const colmyHosp = [
sortable: false,
required: true,
}),
AddCol({
name: 'pub_to_share',
label_trans: 'skill.pub_to_share',
fieldtype: costanti.FieldType.select,
jointable: 'pub_to_share',
icon: 'fas fa-users',
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
}),
AddCol({
name: 'idContribType',
label_trans: 'contribtype.name',
@@ -1131,6 +1155,13 @@ export const colmyBachecas = [
sortable: false,
required: true,
}),
AddCol({
name: 'pub_to_share',
label_trans: 'skill.pub_to_share',
fieldtype: costanti.FieldType.select,
icon: 'fas fa-users',
jointable: 'pub_to_share',
}),
AddCol(
{
name: 'dateTimeStart',
@@ -1896,6 +1927,7 @@ export const colTableUsers = [
name: 'profile.myshares',
field: 'profile',
subfield: 'myshares',
icon: 'fas fa-users',
label_trans: 'reg.myshares',
}),
AddCol({
@@ -2323,6 +2355,7 @@ export const colTableSubCashCategory = [
]
export const colTableCircuit = [
AddCol({ name: 'Num', label_trans: 'circuit.num', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'name', label_trans: 'circuit.name' }),
AddCol({ name: 'subname', label_trans: 'circuit.subname' }),
AddCol({ name: 'descr', label_trans: 'circuit.descr' }),
@@ -2705,6 +2738,15 @@ export const fieldsTable = {
colicon: 'icon',
noshow: true,
},
{
value: 'pub_to_share',
label: 'Visibilità',
columns: colTablePermission,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
{
value: 'visibilGroup',
label: 'Visibilità',

View File

@@ -5027,7 +5027,7 @@ export const tools = {
setCmd($q: any, cmd: number, username: string, value: any, dest: string) {
console.log('setcmd', cmd)
if (cmd === shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP) {
tools.removeFromMyGroups($q, username, dest)
tools.removeFromMyGroups($q, username, dest, t('db.domanda_exit_fromgroup', { username }))
} else if (cmd === shared_consts.GROUPSCMD.BLOCK_GROUP) {
tools.blockGroup($q, username, dest)
} else if (cmd === shared_consts.GROUPSCMD.SETGROUP) {
@@ -5144,17 +5144,23 @@ export const tools = {
getSelectionByTable(table: string, mydef: any) {
const arrtable = ['sectors', 'statusSkills', 'contribtypes', 'adtypes', 'sectorgoods', 'otherfilters', 'shippings']
const arrtable = ['sectors', 'statusSkills', 'contribtypes', 'adtypes', 'sectorgoods', 'otherfilters', 'shippings', 'pub_to_share']
const arrmultisel_tab = ['skills', 'goods']
const arrmultisel = [
{ table: 'skills', join: 'sectors' },
{ table: 'goods', join: 'sectorgoods' }
]
let convertiint = false
if (table === 'pub_to_share') {
convertiint = true
}
let ris = mydef
if (arrtable.includes(table)) {
ris = tools.getCookie(tools.COOK_SEARCH + table, mydef)
ris = tools.getCookie(tools.COOK_SEARCH + table, mydef, convertiint)
} else if (arrmultisel_tab.includes(table)) {
const rec = arrmultisel.find((rec) => rec.table === table)
if (rec) {
@@ -5180,6 +5186,7 @@ export const tools = {
idCity: this.getCitySel(),
NumLevel: 0,
adType: tools.getSelectionByTable('adtypes', costanti.AdType.OFFRO),
pub_to_share: tools.getSelectionByTable('pub_to_share', shared_consts.PUBTOSHARE.ALL),
photos: [],
note: '',
//**ADDFIELD_MYSKILL
@@ -5210,6 +5217,7 @@ export const tools = {
adType: tools.getSelectionByTable('adtypes', costanti.AdType.OFFRO),
idShipping: tools.getSelectionByTable('shippings', []),
otherfilters: tools.getSelectionByTable('otherfilters', []),
pub_to_share: tools.getSelectionByTable('pub_to_share', shared_consts.PUBTOSHARE.ALL),
photos: [],
note: '',
//**ADDFIELD_MYSKILL
@@ -5245,6 +5253,7 @@ export const tools = {
idCity: this.getCitySel(),
NumLevel: 0,
adType: tools.getSelectionByTable('adtypes', costanti.AdType.OFFRO),
pub_to_share: tools.getSelectionByTable('pub_to_share', shared_consts.PUBTOSHARE.ALL),
photos: [],
note: '',
//**ADDFIELD_MYBACHECAS
@@ -5261,6 +5270,7 @@ export const tools = {
typeHosp: tools.getSelectionByTable(toolsext.TABTYPEHOSP, 2),
idContribType: tools.getSelectionByTable('contribtypes', []),
idCity: this.getCitySel(),
pub_to_share: tools.getSelectionByTable('pub_to_share', shared_consts.PUBTOSHARE.ALL),
photos: [],
descr: '',
note: '',
@@ -5361,14 +5371,18 @@ export const tools = {
},
getbackgroundGradient(color: string, degree: number) {
const mycol = tools.colourNameToHex(color)
const arrcol = color.split('-')
let newcol = arrcol[0] + '-4'
const mycolchiaro = tools.colourNameToHex(newcol)
if (color !== '-1') {
const mycol = tools.colourNameToHex(color)
const arrcol = color.split('-')
let newcol = arrcol[0] + '-4'
const mycolchiaro = tools.colourNameToHex(newcol)
return 'background: ' + mycol +
' background: -webkit-linear-gradient(' + degree + 'deg, ' + mycol + ', ' + mycolchiaro + ') !important; ' +
' background: linear-gradient(' + degree + 'deg, ' + mycol + ', ' + mycolchiaro + ') !important;'
return 'background: ' + mycol +
' background: -webkit-linear-gradient(' + degree + 'deg, ' + mycol + ', ' + mycolchiaro + ') !important; ' +
' background: linear-gradient(' + degree + 'deg, ' + mycol + ', ' + mycolchiaro + ') !important;'
} else {
return ''
}
},
getCurrentUrl() {
@@ -5435,6 +5449,27 @@ export const tools = {
return this.getConfSiteOptionEnabled(shared_consts.ConfSite.Need_Aportador_On_DataReg_To_Verify_Reg)
},
async loadGroupsByUsername(username: string) {
const userStore = useUserStore()
// Carica il profilo di quest'utente
if (username) {
await userStore.loadGroups(username).then((ris) => {
// console.log('ris', ris)
if (ris) {
userStore.my.profile.mygroups = ris.mygroups ? ris.mygroups : []
userStore.my.profile.list_usersgroup = ris.listUsersGroup ? ris.listUsersGroup : []
userStore.groups = ris.listgroups ? ris.listgroups : []
userStore.my.profile.asked_groups = ris.listSentRequestGroups ? ris.listSentRequestGroups : []
return [{ userId: userStore.my._id }]
}
})
}
return []
},
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {