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:42 +02:00
parent d8aa8e546e
commit c3b0a1f417
17 changed files with 170 additions and 52 deletions

View File

@@ -48,6 +48,9 @@ const MySkillSchema = new Schema({
{
type: Number,
}],
pub_to_share: {
type: Number, // PUB_TO_SHARE_ALL, PUB_TO_SHARE_ONLY_GROUPS_FOLLOW
},
numLevel: {
type: Number,
default: 0,
@@ -134,8 +137,7 @@ MySkillSchema.statics.getFieldsLastForSearch = function() {
];
};
MySkillSchema.statics.executeQueryTable = function(idapp, params) {
MySkillSchema.statics.executeQueryTable = function(idapp, params, user) {
params.fieldsearch = this.getFieldsForSearch();
params.fieldsearch_last = this.getFieldsLastForSearch();
@@ -153,6 +155,7 @@ MySkillSchema.statics.executeQueryTable = function(idapp, params) {
idStatusSkill: 1,
idContribType: 1,
idCity: 1,
pub_to_share: 1,
numLevel: 1,
adType: 1,
photos: 1,
@@ -167,6 +170,7 @@ MySkillSchema.statics.executeQueryTable = function(idapp, params) {
name: 1,
surname: 1,
'profile.img': 1,
"profile.mygroups": 1,
'profile.qualifica': 1,
},
},
@@ -174,7 +178,7 @@ MySkillSchema.statics.executeQueryTable = function(idapp, params) {
params = {...params, ...otherparams};
return tools.executeQueryTable(this, idapp, params);
return tools.executeQueryTable(this, idapp, params, user);
};
MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
@@ -240,6 +244,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'idStatusSkill': 1,
'idContribType': 1,
'idCity': 1,
pub_to_share: 1,
'numLevel': 1,
adType: 1,
'photos': 1,
@@ -256,6 +261,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'comune': 1,
'mycities': 1,
'profile.img': 1,
"profile.mygroups": 1,
'profile.qualifica': 1,
},
},
@@ -292,6 +298,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'idStatusSkill': 1,
'idContribType': 1,
'idCity': 1,
pub_to_share: 1,
'numLevel': 1,
adType: 1,
'photos': 1,
@@ -308,6 +315,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'comune': 1,
'mycities': 1,
'profile.img': 1,
"profile.mygroups": 1,
'profile.qualifica': 1,
},
},
@@ -344,6 +352,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'idStatusSkill': 1,
'idContribType': 1,
'idCity': 1,
pub_to_share: 1,
'numLevel': 1,
adType: 1,
'photos': 1,
@@ -360,6 +369,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'comune': 1,
'mycities': 1,
'profile.img': 1,
"profile.mygroups": 1,
'profile.qualifica': 1,
},
},
@@ -398,6 +408,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'idStatusSkill': 1,
'idContribType': 1,
'idCity': 1,
pub_to_share: 1,
'numLevel': 1,
adType: 1,
'photos': 1,
@@ -414,6 +425,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'comune': 1,
'mycities': 1,
'profile.img': 1,
"profile.mygroups": 1,
'profile.qualifica': 1,
},
},
@@ -450,6 +462,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'idStatusSkill': 1,
'idContribType': 1,
'idCity': 1,
pub_to_share: 1,
'numLevel': 1,
adType: 1,
'photos': 1,
@@ -466,6 +479,7 @@ MySkillSchema.statics.getMyRecById = function(idapp, idSkill) {
'comune': 1,
'mycities': 1,
'profile.img': 1,
"profile.mygroups": 1,
'profile.qualifica': 1,
},
},
@@ -483,7 +497,6 @@ MySkillSchema.statics.getCompleteRecord = function(idapp, id) {
};
const MySkill = mongoose.model('MySkill', MySkillSchema);
module.exports = {MySkill};