ver. 0.2.12
Sistemare i Gruppi : cardGruppo
This commit is contained in:
@@ -98,6 +98,7 @@ export const costanti = {
|
||||
VISUTABLE_LISTA: 2,
|
||||
VISUTABLE_SCHEDA_USER: -1,
|
||||
VISUTABLE_SCHEDA_GROUP: -3,
|
||||
VISUTABLE_USER_TABGROUP: -4,
|
||||
|
||||
DIR_UPLOAD: 'upload/', // upload/
|
||||
|
||||
|
||||
@@ -522,7 +522,20 @@ export const colmyUserGroup = [
|
||||
allowchar: costanti.ALLOWCHAR_CODE,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit,
|
||||
}),
|
||||
AddCol({ name: 'title', label_trans: 'reg.name', required: true, noshowlabel: true, }),
|
||||
AddCol({ name: 'title', label_trans: 'reg.name', required: true, noshowlabel: true, maxlength: 40 }),
|
||||
AddCol({
|
||||
name: 'idCity',
|
||||
label_trans: 'skill.city',
|
||||
fieldtype: costanti.FieldType.multiselect_by_server,
|
||||
jointable: 'cities',
|
||||
tablesel: 'cities',
|
||||
noshowlabel: true,
|
||||
icon: 'fas fa-map-marker-alt',
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
|
||||
remote_table: 'mycities',
|
||||
remote_key: '_id',
|
||||
remote_field: 'comune',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idCatGrp',
|
||||
label_trans: 'catgrps.name',
|
||||
@@ -537,7 +550,7 @@ export const colmyUserGroup = [
|
||||
{
|
||||
name: 'descr', label_trans: 'proj.longdescr', required: true,
|
||||
noshowlabel: true,
|
||||
maxlength: 40
|
||||
maxlength: 100
|
||||
}
|
||||
),
|
||||
AddCol({
|
||||
@@ -571,25 +584,6 @@ export const colmyUserGroup = [
|
||||
jointable: '',
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'idCity',
|
||||
label_trans: 'skill.city',
|
||||
fieldtype: costanti.FieldType.multiselect_by_server,
|
||||
jointable: 'cities',
|
||||
tablesel: 'cities',
|
||||
noshowlabel: true,
|
||||
icon: 'fas fa-map-marker-alt',
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView,
|
||||
remote_table: 'mycities',
|
||||
remote_key: '_id',
|
||||
remote_field: 'comune',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'date_created', label_trans: 'reg.date_created', fieldtype: costanti.FieldType.onlydate,
|
||||
showWhen: costanti.showWhen.InPage + costanti.showWhen.InView_OnlyifExist,
|
||||
visible: false,
|
||||
required: false,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.longdescr', fieldtype: costanti.FieldType.html,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'groupname', subfield_extra1: ''
|
||||
|
||||
@@ -5028,13 +5028,56 @@ export const tools = {
|
||||
return ''
|
||||
},
|
||||
|
||||
getFullFileName(arrimage: IImgGallery[], table: string, username: string) {
|
||||
if (arrimage && arrimage.length > 0) {
|
||||
return 'upload/profile/' + username + '/' + table + '/' + arrimage[0].imagefile
|
||||
getFullFileName(arrimage: IImgGallery[], table: string, username: string, groupname: string) {
|
||||
if (shared_consts.TABLES_DIRECTORY_A_PARTE.includes(table)) {
|
||||
return `upload/${table}/` + groupname + '/' + arrimage[0].imagefile
|
||||
} else {
|
||||
return ''
|
||||
if (arrimage && arrimage.length > 0) {
|
||||
return 'upload/profile/' + username + '/' + table + '/' + arrimage[0].imagefile
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
},
|
||||
canModifyThisRec(rec: any, tablesel: string) {
|
||||
// console.log('rec', rec)
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
if (tablesel === toolsext.TABMYGROUPS) {
|
||||
// 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
|
||||
},
|
||||
|
||||
getToByCol(col: IColGridTable, table: string, rec: any) {
|
||||
if (shared_consts.TABLES_REC_ID.includes(table)) {
|
||||
return '/' + tools.getDirectoryByTable(table) + '/' + rec['_id']
|
||||
} else if (table === toolsext.TABMYGROUPS) {
|
||||
return '/grp/' + rec.groupname
|
||||
}
|
||||
|
||||
return ''
|
||||
},
|
||||
|
||||
|
||||
// getLocale() {
|
||||
|
||||
Reference in New Issue
Block a user