aktre modifiche sistemando...

This commit is contained in:
Surya Paolo
2023-04-07 21:48:33 +02:00
parent 32b2eb4755
commit 5789567cd2
24 changed files with 401 additions and 163 deletions

View File

@@ -12,7 +12,7 @@ import {
ITodo,
IUserFields,
Privacy,
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin, IMovement, IMovVisu, INotif, IMyElem, IMyCard, ILabelValue, ILabelValueStr, IAnim, ILang, IGroupShort, IPagination,
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin, IMovement, IMovVisu, INotif, IMyElem, IMyCard, ILabelValue, ILabelValueStr, IAnim, ILang, IGroupShort, IPagination, IFavorite, IBookmark,
} from '@model'
import { fieldsTable } from '@store/Modules/fieldsTable'
@@ -116,7 +116,19 @@ export const tools = {
'teal',
'lime',
'orange',
'deeporange',
'deep-orange',
'yellow',
'blue',
'green',
'purple',
'deep-purple',
'indigo',
'light-blue',
'cyan',
'teal',
'lime',
'orange',
'deep-orange',
'yellow',
],
@@ -3103,10 +3115,16 @@ export const tools = {
${$t('cal.endtime')} ${this.getstrTime(myevent.dateTimeEnd)}`
}
} else {
if (withhtml) {
mystr = `<span class="cal__where-content">${this.getstrDateLong(myevent.dateTimeStart)}</span>
<span class="cal__hours-content">${$t('cal.starttime')} ${this.getstrTime(myevent.dateTimeStart)} </span>
${$t('cal.enddate')} ${this.getstrDateLong(myevent.dateTimeEnd)}
<span class="cal__hours-content">${$t('cal.endtime')} ${this.getstrTime(myevent.dateTimeEnd)} </span>`
} else {
mystr = `${this.getstrDateLong(myevent.dateTimeStart)}
${$t('cal.starttime')} ${this.getstrTime(myevent.dateTimeStart)}
${this.getstrDateLong(myevent.dateTimeEnd)}: ${$t('cal.endtime')} ${this.getstrTime(myevent.dateTimeEnd)}`
}
}
if (myevent.infoextra) {
@@ -4192,7 +4210,7 @@ export const tools = {
},
scrollToTopAll() {
window.scrollTo(0,0);
window.scrollTo(0, 0);
},
scrollToTop() {
const element = document.getElementById('mypage')
@@ -4512,7 +4530,16 @@ export const tools = {
},
getlinkhref(mylink: string, text: string) {
return '<a href="' + mylink + '" target="_blank">' + text + '</a>'
if (mylink) {
if (!mylink.startsWith('http')) {
mylink = 'https://' + mylink
}
return '<a href="' + mylink + '" target="_blank">' + text + '</a>'
} else {
return ''
}
},
getNationsByNationality(nat: string) {
@@ -5015,7 +5042,7 @@ export const tools = {
}
let add = ''
if (aportador_solidario) {
add = '?start=inv_' + aportador_solidario + '_ex_' + regexpire
add = '?start=inv#' + aportador_solidario + '#ex#' + regexpire
}
return mylink + add
@@ -6344,7 +6371,7 @@ export const tools = {
title: t('db.domanda')
}).onOk(() => {
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, null, {groupname}).then((res) => {
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, null, { groupname }).then((res) => {
if (res && res.result) {
if (userStore.my.profile.mycircuits && username === userStore.my.username) {
userStore.my.profile.mycircuits = userStore.my.profile.mycircuits.filter((rec: IMyCircuit) => rec.circuitname !== circuitname)
@@ -6943,10 +6970,10 @@ export const tools = {
visibile: true,
typeHosp: tools.getSelectionByTable(toolsext.TABTYPEHOSP, 2),
idContribType: tools.getSelectionByTable('contribtypes', []),
accomodation: [],
idCity: this.getCitySel(),
pub_to_share: tools.getSelectionByTable('pub_to_share', shared_consts.PUBTOSHARE.ALL, true),
photos: [],
accomodation: [],
descr: '',
note: '',
website: '',
@@ -7037,6 +7064,7 @@ export const tools = {
},
getPathByTableAndRec(table: string, rec: any) {
if (shared_consts.TABLES_REC_ID.includes(table)) {
return '/' + tools.getDirectoryByTable(table) + '/' + rec['_id']
} else if (table === toolsext.TABMYGROUPS) {
@@ -7730,7 +7758,7 @@ export const tools = {
await userStore.setUserReceiveRIS(username, '').then((data) => {
if (data.code === serv_constants.RIS_CODE_OK) {
this.showPositiveNotif($q, t('circuit.coins_requestedris', {username}), 6000)
this.showPositiveNotif($q, t('circuit.coins_requestedris', { username }), 6000)
} else {
this.showNegativeNotif($q, t('db.recfailed'))
}
@@ -7744,7 +7772,7 @@ export const tools = {
await userStore.setUserReceiveRIS('', groupname).then((data) => {
if (data.code === serv_constants.RIS_CODE_OK) {
this.showPositiveNotif($q, t('circuit.coins_requestedrisgroup', {groupname}), 6000)
this.showPositiveNotif($q, t('circuit.coins_requestedrisgroup', { groupname }), 6000)
} else {
this.showNegativeNotif($q, t('db.recfailed'))
}
@@ -7758,7 +7786,8 @@ export const tools = {
},
getNumTabByTable(table: string) {
return shared_consts.MYTABS.findIndex((rec: any) => rec.table === table)
const myrec = shared_consts.MYTABS.find((rec: any) => rec.table === table)
return myrec ? myrec.id : -1
},
removeItemOnce(arr: any, value: any) {
@@ -7767,7 +7796,39 @@ export const tools = {
arr.splice(index, 1)
}
return arr;
}
},
indexOfObject(arr: any, obj: any) {
let l = arr.length, i, k, ok;
for (let i = 0; i < l; i++) {
ok = true;
for (k in obj) if (obj.hasOwnProperty(k)) {
if (arr[i][k] !== obj[k]) {
ok = false;
break;
}
}
if (ok) return i;
}
return -1; // no match
},
removeIObjectOnce(arr: any, obj: IBookmark | IFavorite) {
const index = this.indexOfObject(arr, obj)
if (index > -1) {
arr.splice(index, 1)
}
return arr;
},
optionsTable(table: string) {
if (shared_consts.TABLES_FAVORITE_BOOKMARK.includes(table))
return shared_consts.OPTIONS_ADD_COUNT_FAVORITE
return 0
},
// FINE !