Lista Navi
This commit is contained in:
@@ -267,6 +267,14 @@ UserSchema.statics.isManager = function (perm) {
|
||||
}
|
||||
};
|
||||
|
||||
UserSchema.statics.isTutor = function (perm) {
|
||||
try {
|
||||
return ((perm & shared_consts.Permissions.Tutor) === shared_consts.Permissions.Tutor);
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
};
|
||||
|
||||
UserSchema.statics.findByToken = function (token, typeaccess) {
|
||||
const User = this;
|
||||
let decoded;
|
||||
@@ -962,8 +970,8 @@ UserSchema.statics.getUsersListByParams = function (params) {
|
||||
|
||||
UserSchema.statics.getFieldsForSearch = function () {
|
||||
return [{field: 'username', type: tools.FieldType.string},
|
||||
{filed: 'name', type: tools.FieldType.string },
|
||||
{filed: 'ind_order', type: tools.FieldType.number },
|
||||
{field: 'name', type: tools.FieldType.string },
|
||||
{field: 'ind_order', type: tools.FieldType.number },
|
||||
{field: 'surname', type: tools.FieldType.string },
|
||||
{field: 'email', type: tools.FieldType.string },
|
||||
{field: 'profile.cell', type: tools.FieldType.string},
|
||||
@@ -1029,7 +1037,7 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
||||
}
|
||||
}
|
||||
|
||||
dashboard.arrnavi = await Nave.getArrPosizioniByIndOrder(idapp, dashboard.myself.ind_order);
|
||||
dashboard.arrposizioni = await Nave.getArrPosizioniByIndOrder(idapp, dashboard.myself.ind_order);
|
||||
|
||||
dashboard.navi_partenza = await NavePersistente.getListaNavi(idapp);
|
||||
|
||||
@@ -1037,9 +1045,8 @@ UserSchema.statics.getDashboard = async function (idapp, aportador_solidario, us
|
||||
// dashboard.navi_partenza.push(await Nave.getPrimaNaveByRiga(idapp, indriga));
|
||||
//}
|
||||
|
||||
for (let mynave of dashboard.arrnavi) {
|
||||
mynave._doc.rec = await Nave.getNaveByRigaCol(idapp, mynave.riga, mynave.col);
|
||||
mynave._doc.listadonatoridelsognatore = await Nave.getDonatoridelSognatore(idapp, mynave.riga, mynave.col);
|
||||
for (let mypos of dashboard.arrposizioni) {
|
||||
mypos._doc.rec = await Nave.getNaveByRigaCol(idapp, mypos.riga, mypos.col);
|
||||
}
|
||||
|
||||
// console.table(dashboard.arrnavi);
|
||||
|
||||
Reference in New Issue
Block a user