- aggiornata la grafica della Home di RISO
- Profilo Completition - Email Verificata - Invita un Amico (invio di email)
This commit is contained in:
@@ -187,9 +187,9 @@ export const Api = {
|
||||
throw err2 || { status: serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN };
|
||||
}
|
||||
} else if (
|
||||
status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN ||
|
||||
status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_PERMESSI ||
|
||||
statuscode2 === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN
|
||||
// status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN ||
|
||||
status === serv_constants.RIS_CODE__HTTP_FORBIDDEN_PERMESSI
|
||||
// || statuscode2 === serv_constants.RIS_CODE__HTTP_FORBIDDEN_INVALID_TOKEN
|
||||
) {
|
||||
userStore.setAuth('', '');
|
||||
const $router = useRouter();
|
||||
|
||||
@@ -4024,151 +4024,6 @@ export const colTableIscrittiConacreis = [
|
||||
AddCol(DuplicateRec),
|
||||
];
|
||||
|
||||
export const colTableIscrittiArcadei = [
|
||||
AddCol({
|
||||
name: 'annoTesseramento',
|
||||
label_trans: 'reg.annoTesseramento',
|
||||
fieldtype: costanti.FieldType.number,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'numTesseraInterna',
|
||||
label_trans: 'reg.numTesseraInterna',
|
||||
fieldtype: costanti.FieldType.number,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'metodo_pagamento',
|
||||
label_trans: 'reg.metodo_pagamento',
|
||||
fieldtype: costanti.FieldType.select,
|
||||
jointable: 'metodo_pagamento',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'ha_pagato',
|
||||
label_trans: 'reg.ha_pagato',
|
||||
fieldtype: costanti.FieldType.boolean,
|
||||
}),
|
||||
AddCol({ name: 'name', label_trans: 'reg.name', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({
|
||||
name: 'surname',
|
||||
label_trans: 'reg.surname',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'dateofreg',
|
||||
label_trans: 'reg.dateofreg',
|
||||
fieldtype: costanti.FieldType.onlydate,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'dateofapproved',
|
||||
label_trans: 'reg.dateofapproved',
|
||||
fieldtype: costanti.FieldType.onlydate,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'email',
|
||||
label_trans: 'reg.email',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'email2',
|
||||
label_trans: 'reg.email2',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
// AddCol({ name: 'fiscalcode', label_trans: 'reg.fiscalcode', fieldtype: costanti.FieldType.string }),
|
||||
AddCol({
|
||||
name: 'residency_address',
|
||||
label_trans: 'reg.residency_address',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'residency_city',
|
||||
label_trans: 'reg.residency_city',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'residency_province',
|
||||
label_trans: 'reg.residency_province',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'residency_country',
|
||||
label_trans: 'reg.residency_country',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'residency_zipcode',
|
||||
label_trans: 'reg.residency_zipcode',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'dateofbirth',
|
||||
label_trans: 'reg.dateofbirth',
|
||||
fieldtype: costanti.FieldType.onlydate,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'born_city',
|
||||
label_trans: 'reg.born_city',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'born_province',
|
||||
label_trans: 'reg.born_province',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'born_country',
|
||||
label_trans: 'reg.born_country',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'cell_phone',
|
||||
label_trans: 'reg.cell_phone',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'cell_phone2',
|
||||
label_trans: 'reg.cell_phone2',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'doctype',
|
||||
label_trans: 'reg.doctype',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'documentnumber',
|
||||
label_trans: 'reg.documentnumber',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'quota_versata',
|
||||
label_trans: 'reg.quota_versata',
|
||||
fieldtype: costanti.FieldType.number,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'categorie_interesse',
|
||||
label_trans: 'reg.categorie_interesse',
|
||||
fieldtype: costanti.FieldType.multiselect,
|
||||
jointable: 'cat_interesse_arcadei',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'altre_comunicazioni',
|
||||
label_trans: 'reg.altre_comunicazioni',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'come_ci_hai_conosciuto',
|
||||
label_trans: 'reg.come_ci_hai_conosciuto',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'iscrizione_compilata',
|
||||
label_trans: 'reg.iscrizione_compilata',
|
||||
fieldtype: costanti.FieldType.boolean,
|
||||
}),
|
||||
AddCol({ name: 'note', label_trans: 'reg.note', fieldtype: costanti.FieldType.string }),
|
||||
AddCol(DeleteRec),
|
||||
AddCol(DuplicateRec),
|
||||
];
|
||||
|
||||
export const colTableGestoreOrdini = [
|
||||
AddCol({ name: 'name', label_trans: 'products.name' }),
|
||||
AddCol({
|
||||
@@ -7610,14 +7465,6 @@ export const fieldsTable = {
|
||||
collabel: 'label',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'cat_interesse_arcadei',
|
||||
label: "Categorie d'Interesse Arcadei",
|
||||
columns: colTableGeneric,
|
||||
colkey: 'value',
|
||||
collabel: 'label',
|
||||
noshow: true,
|
||||
},
|
||||
{
|
||||
value: 'lang',
|
||||
label: 'Lingua',
|
||||
|
||||
@@ -2717,6 +2717,17 @@ export const tools = {
|
||||
return result;
|
||||
},
|
||||
|
||||
getUserEmail() {
|
||||
const userStore = useUserStore();
|
||||
return userStore.my?.email;
|
||||
},
|
||||
|
||||
getEmailSupport() {
|
||||
const globalStore = useGlobalStore();
|
||||
const site = globalStore.site;
|
||||
return this.getemailto(site?.contacts.email)
|
||||
},
|
||||
|
||||
visumenu(elem: IListRoutes) {
|
||||
// : IListRoutes
|
||||
|
||||
@@ -5631,11 +5642,19 @@ export const tools = {
|
||||
getLinkBotTelegram(aportador_solidario: string, regexpire: string): string {
|
||||
let mylink = '';
|
||||
const sep = '-';
|
||||
if (tools.isTest() && !import.meta.env.DEV) {
|
||||
/*if (tools.isTest() && !import.meta.env.DEV) {
|
||||
mylink = tools.getValDb('TELEG_BOT_LINK_TEST', false);
|
||||
} else {
|
||||
mylink = tools.getValDb('TELEG_BOT_LINK', false);
|
||||
}*/
|
||||
const globalStore = useGlobalStore();
|
||||
const site = globalStore.site;
|
||||
if (tools.isTest() && !import.meta.env.DEV) {
|
||||
mylink = 'https://t.me/' + site.telegram_bot_name_test
|
||||
} else {
|
||||
mylink = 'https://t.me/' + site.telegram_bot_name
|
||||
}
|
||||
|
||||
let add = '';
|
||||
if (aportador_solidario) {
|
||||
add = '?start=inv' + sep + aportador_solidario + sep + 'ex' + sep + regexpire;
|
||||
@@ -6356,6 +6375,33 @@ export const tools = {
|
||||
});
|
||||
},
|
||||
|
||||
verifyUser($q: any, username: string, usernameDest: string) {
|
||||
// Segnala Profilo
|
||||
const userStore = useUserStore();
|
||||
//T_TOLTO
|
||||
$q.dialog({
|
||||
message: t('db.domanda_verifyuser', { username: usernameDest }),
|
||||
ok: { label: t('dialog.yes'), push: true },
|
||||
cancel: { label: t('dialog.cancel') },
|
||||
title: t('db.domanda'),
|
||||
}).onOk(() => {
|
||||
userStore
|
||||
.setFriendsCmd(
|
||||
$q,
|
||||
t,
|
||||
username,
|
||||
usernameDest,
|
||||
shared_consts.FRIENDSCMD.SETTRUST,
|
||||
true
|
||||
)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
tools.showPositiveNotif($q, t('db.trusted', {username: usernameDest}));
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
refuseReqFriends($q: any, username: string, usernameDest: string) {
|
||||
//T_TOLTO
|
||||
const userStore = useUserStore();
|
||||
@@ -7705,7 +7751,10 @@ export const tools = {
|
||||
|
||||
let risultato = false;
|
||||
|
||||
if (userStore.isAdmin || shared_consts.USER_ADMIN_CIRCUITS.includes(userStore.my.username)) {
|
||||
if (
|
||||
userStore.isAdmin ||
|
||||
shared_consts.USER_ADMIN_CIRCUITS.includes(userStore.my.username)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8250,7 +8299,9 @@ export const tools = {
|
||||
return {
|
||||
idSector: tools.getSelectionByTable('sectors', 0, true),
|
||||
idSkill: tools.getSelectionByTable('skills', 0, true),
|
||||
idStatusSkill: tools.getSelectionByTable('statusSkills', [shared_consts.STATUSSKILL_DI_PERSONA]),
|
||||
idStatusSkill: tools.getSelectionByTable('statusSkills', [
|
||||
shared_consts.STATUSSKILL_DI_PERSONA,
|
||||
]),
|
||||
idContribType: tools.getSelectionByTable('contribtypes', []),
|
||||
dateTimeStart: tools.getDateTomorrowByTime(21),
|
||||
dateTimeEnd: null,
|
||||
@@ -8644,7 +8695,7 @@ export const tools = {
|
||||
? ris.last_my_transactions
|
||||
: [];
|
||||
|
||||
userStore.my.profile.total_transactions = ris.total_transactions
|
||||
userStore.my.profile.total_transactions = ris.total_transactions;
|
||||
return [{ userId: userStore.my._id }];
|
||||
}
|
||||
});
|
||||
@@ -11061,7 +11112,7 @@ export const tools = {
|
||||
}
|
||||
},
|
||||
|
||||
addstrCookie(table): string {
|
||||
addstrCookie(table: string): string {
|
||||
let addstr = '_' + table;
|
||||
return addstr;
|
||||
},
|
||||
@@ -11193,19 +11244,26 @@ export const tools = {
|
||||
return Math.ceil((pastDaysOfYear + startOfYear.getDay() + 1) / 7);
|
||||
},
|
||||
|
||||
getmenuByPath(path: string) {
|
||||
const myroutes = static_data.routes;
|
||||
getmenuByPath(path: string): IListRoutes | undefined {
|
||||
if (!path) return undefined;
|
||||
const normalizedPath = tools.norm(path);
|
||||
|
||||
const norm = path
|
||||
? (path.startsWith('/') ? path : `/${path}`).trim().toLowerCase()
|
||||
: undefined;
|
||||
function searchMenu(routes: IListRoutes[]): IListRoutes | undefined {
|
||||
for (const route of routes) {
|
||||
if (!route) continue;
|
||||
|
||||
const mymenus = myroutes.find((menu: any) => menu.path === norm);
|
||||
if (tools.norm(route.path) === normalizedPath) return route;
|
||||
if (Array.isArray(route.routes2)) {
|
||||
const found = searchMenu(route.routes2);
|
||||
if (found) return found;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// console.log('mymenus', mymenus, 'path', path, 'norm', norm);
|
||||
|
||||
return mymenus;
|
||||
return searchMenu(static_data.routes);
|
||||
},
|
||||
|
||||
norm(path?: string): string | undefined {
|
||||
return typeof path === 'string'
|
||||
? path
|
||||
@@ -11219,7 +11277,7 @@ export const tools = {
|
||||
try {
|
||||
return /Telegram/.test(navigator.userAgent);
|
||||
} catch (e) {
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
},
|
||||
// FINE !
|
||||
|
||||
@@ -13,7 +13,6 @@ import type {
|
||||
IAccount,
|
||||
IColGridTable,
|
||||
ISignupIscrizioneConacreisOptions,
|
||||
ISignupIscrizioneArcadeiOptions,
|
||||
IMovQuery,
|
||||
} from '@src/model';
|
||||
import { IFriends, ISettings } from '@src/model';
|
||||
@@ -825,7 +824,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
return false;
|
||||
// return this.my.verified_email! && this.isTelegIdOk() && this.my.verified_by_aportador!
|
||||
},
|
||||
|
||||
@@ -1063,8 +1062,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
async addNewSite(paramquery: any) {
|
||||
console.log(paramquery);
|
||||
|
||||
@@ -1214,27 +1211,45 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return await this.execDbOpUser({ mydata });
|
||||
}
|
||||
},
|
||||
async savenoCircuit(val: boolean) {
|
||||
async setSkipTelegramVerif(val: boolean) {
|
||||
const mydata = {
|
||||
_id: this.my._id,
|
||||
dbop: 'noCircuit',
|
||||
dbop: 'telegram_verification_skipped',
|
||||
value: val,
|
||||
};
|
||||
if (this.my.profile.noCircuit !== val) {
|
||||
this.my.profile.noCircuit = val;
|
||||
if (this.my.profile.telegram_verification_skipped !== val) {
|
||||
this.my.profile.telegram_verification_skipped = val;
|
||||
return await this.execDbOpUser({ mydata });
|
||||
}
|
||||
},
|
||||
async savenoCircIta(val: boolean) {
|
||||
async savenoCircuit(val: boolean, userId?: string) {
|
||||
const mydata = {
|
||||
_id: this.my._id,
|
||||
_id: userId ? userId : this.my._id,
|
||||
dbop: 'noCircuit',
|
||||
value: val,
|
||||
};
|
||||
|
||||
if (userId) {
|
||||
} else {
|
||||
if (this.my.profile.noCircuit !== val) {
|
||||
this.my.profile.noCircuit = val;
|
||||
}
|
||||
}
|
||||
return await this.execDbOpUser({ mydata });
|
||||
},
|
||||
async savenoCircIta(val: boolean, userId?: string) {
|
||||
const mydata = {
|
||||
_id: userId ? userId : this.my._id,
|
||||
dbop: 'noCircIta',
|
||||
value: val,
|
||||
};
|
||||
if (this.my.profile.noCircIta !== val) {
|
||||
this.my.profile.noCircIta = val;
|
||||
return await this.execDbOpUser({ mydata });
|
||||
if (userId) {
|
||||
} else {
|
||||
if (this.my.profile.noCircIta !== val) {
|
||||
this.my.profile.noCircIta = val;
|
||||
}
|
||||
}
|
||||
return await this.execDbOpUser({ mydata });
|
||||
},
|
||||
async savenoFoto(val: boolean) {
|
||||
const mydata = {
|
||||
@@ -1356,7 +1371,12 @@ export const useUserStore = defineStore('UserStore', {
|
||||
this.my.perm,
|
||||
shared_consts.Permissions.Grafico.value
|
||||
);
|
||||
this.isCollaboratore = this.isGrafico || this.isCommerciale || this.isEditor || this.isAdmin || this.isManager
|
||||
this.isCollaboratore =
|
||||
this.isGrafico ||
|
||||
this.isCommerciale ||
|
||||
this.isEditor ||
|
||||
this.isAdmin ||
|
||||
this.isManager;
|
||||
|
||||
this.my.tokens = [];
|
||||
this.resetArrToken(this.my.tokens);
|
||||
@@ -1521,7 +1541,9 @@ export const useUserStore = defineStore('UserStore', {
|
||||
data_login: tools.getDateNow(),
|
||||
};
|
||||
|
||||
const index = this.my.tokens.findIndex((token) => token.access === 'auth' && token.token === x_auth_token);
|
||||
const index = this.my.tokens.findIndex(
|
||||
(token) => token.access === 'auth' && token.token === x_auth_token
|
||||
);
|
||||
if (index === -1) {
|
||||
this.my.tokens.push(newToken);
|
||||
} else {
|
||||
@@ -1579,28 +1601,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
});
|
||||
},
|
||||
|
||||
async iscrivitiArcadei(authData: ISignupIscrizioneArcadeiOptions) {
|
||||
console.log('iscrivitiArcadei');
|
||||
|
||||
this.setServerCode(tools.CALLING);
|
||||
|
||||
authData.userId = this.my._id;
|
||||
|
||||
return Api.SendReq('/iscritti_arcadei', 'POST', authData)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
return { code: serv_constants.RIS_ISCRIZIONE_OK, msg: '' };
|
||||
} else {
|
||||
return { code: toolsext.ERR_GENERICO, msg: '' };
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('Err', error);
|
||||
this.setErrorCatch(error);
|
||||
return { code: this.getServerCode, msg: this.getMsg };
|
||||
});
|
||||
},
|
||||
|
||||
async signin(router: Router, authData: ISigninOptions) {
|
||||
// console.log('LOGIN signin')
|
||||
const globalStore = useGlobalStore();
|
||||
@@ -1718,7 +1718,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
async setGlobal(router: Router, isLogged: boolean) {
|
||||
const globalStore = useGlobalStore();
|
||||
|
||||
@@ -2550,5 +2549,18 @@ export const useUserStore = defineStore('UserStore', {
|
||||
}
|
||||
return this.lista_referenti;
|
||||
},
|
||||
|
||||
async refreshUserData(response: any) {
|
||||
if (response) {
|
||||
this.my.profile.username_telegram = response?.username_telegram;
|
||||
this.my.profile.teleg_id = response?.teleg_id;
|
||||
}
|
||||
},
|
||||
|
||||
async resendEmailVerifyRegistration() {
|
||||
return Api.SendReq('/sendmailreg', 'POST', {}).then((ris: any) => {
|
||||
return ris.data;
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2579,8 +2579,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
else if (table === 'confpages_lang') myarr = costanti.ArrLang;
|
||||
else if (table === 'bottype') myarr = shared_consts.BotType;
|
||||
else if (table === 'visibility') myarr = shared_consts.Visibility;
|
||||
else if (table === 'cat_interesse_arcadei')
|
||||
myarr = shared_consts.Cat_Interesse_Arcadei;
|
||||
else if (table === 'pub_to_share') myarr = shared_consts.Pub_to_Share;
|
||||
else if (table === 'visibilGroup') myarr = shared_consts.VisibilGroup;
|
||||
else if (table === 'statuscircuit') myarr = shared_consts.StatusCircuit;
|
||||
@@ -2666,23 +2664,27 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
getMsgServerError() {
|
||||
if (this.serverError) {
|
||||
if (this.serverMsgError) {
|
||||
let mymsg = this.serverMsgError.msgerr || this.serverMsgError.data!.msgerr || this.serverMsgError.msgerr!.message
|
||||
if (this.serverMsgError.status === 500) {
|
||||
return 'Errore Interno del Server';
|
||||
} else if (mymsg === '') {
|
||||
return 'Codice Errore ' + this.serverMsgError.status;
|
||||
}
|
||||
try {
|
||||
return mymsg
|
||||
} catch (e) {
|
||||
return this.serverMsgError.msgerr;
|
||||
try {
|
||||
if (this.serverError) {
|
||||
if (this.serverMsgError) {
|
||||
let mymsg = this.serverMsgError!.msgerr || this.serverMsgError.data!.msgerr || this.serverMsgError.msgerr!.message || this.serverMsgError
|
||||
if (this.serverMsgError.status === 500) {
|
||||
return 'Errore Interno del Server';
|
||||
} else if (mymsg === '') {
|
||||
return 'Codice Errore ' + this.serverMsgError.status;
|
||||
}
|
||||
try {
|
||||
return mymsg
|
||||
} catch (e) {
|
||||
return this.serverMsgError.msgerr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
return '';
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
|
||||
getTableJoinLabelValueByName(col: IColGridTable) {
|
||||
@@ -3520,5 +3522,9 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
this.inStampa = value;
|
||||
// console.log('inStampa', this.inStampa)
|
||||
},
|
||||
|
||||
async sendInviteEmail(email: string) {
|
||||
// ...
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user