Site Configuration by Server Params (confsites and confpages)

This commit is contained in:
Surya Paolo
2022-11-28 14:00:15 +01:00
parent fab0dbbb72
commit 58dc1dfdcc
76 changed files with 2504 additions and 5004 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,
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin, IMovement, IMovVisu, INotif, IMyElem, IMyCard, ILabelValue, ILabelValueStr, IAnim, ILang,
} from '@model'
import { fieldsTable } from '@store/Modules/fieldsTable'
@@ -2713,6 +2713,10 @@ export const tools = {
return true
},
getLangUsed() {
return static_data.lang_available.map((m: ILang) => m.value)
},
checkLangPassed($q: any, $router: Router, mylangpass: string) {
// console.log('checkLangPassed ', mylang)
const userStore = useUserStore()
@@ -2744,6 +2748,7 @@ export const tools = {
}
console.log('static_data.arrLangUsed', static_data.arrLangUsed, 'mylang', mylang)
if (!(static_data.arrLangUsed.includes(mylang))) {
// console.log('non incluso ', mylang)
// mylang = static_data.arrLangUsed[0]
@@ -4738,7 +4743,7 @@ export const tools = {
let ris = true
const online = this.getValDb('SITO_ONLINE', false, true)
ris = userStore.isAdmin && !pertutti ? true : online
console.log('sito_online', ris)
// console.log('sito_online', ris)
return ris
},
@@ -4964,7 +4969,10 @@ export const tools = {
},
isVerified(): boolean {
if (static_data.functionality.ENABLE_REG_NEED_TELEGRAM) {
const globalStore = useGlobalStore()
const site = globalStore.site
if (site.confpages.enabledRegNeedTelegram) {
return tools.TelegVerificato()
} else {
return this.isEmailVerified()
@@ -6445,19 +6453,24 @@ export const tools = {
}
},
getValueByRemoteField(col: IColGridTable, row: any, value: any, col_tabfooter: string) {
getValueByRemoteField(col: IColGridTable, row: any) {
if (col) {
if (col.remote_table && col.remote_key && col.remote_field && col_tabfooter) {
if (col.remote_table && col.remote_key && col.remote_field) {
const myarrremote = row[col.remote_table]
let myarr: any = []
for (const myrec of myarrremote) {
let myval = myrec[col.remote_field]
myarr.push(myval)
if (myarrremote) {
for (const myrec of myarrremote) {
let myval = myrec[col.remote_field]
myarr.push(myval)
}
}
console.log('myarrremote', myarrremote)
// console.log('myarr', myarr)
return myarr ? myarr.join(' - ') : ''
}
@@ -6507,6 +6520,11 @@ export const tools = {
obj.col_title = 'descr'
obj.col_footer = 'idCity'
obj.col_tabfooter = 'mycities'
} else if (table === 'cities') {
obj.prop_colkey = '_id'
obj.col_title = 'comune'
obj.col_footer = 'comune'
obj.col_tabfooter = 'mycities'
}
return obj
@@ -6860,6 +6878,25 @@ export const tools = {
return false
},
isLangEnabled(lang: number): any {
const globalStore = useGlobalStore()
if (globalStore.site) {
if (globalStore.site.confpages.hasOwnProperty('lang')) {
return this.isBitActive(globalStore.site.confpages.lang, lang)
}
if (!globalStore.site.confpages.hasOwnProperty('lang') || globalStore.site.confpages.lang === 0) {
if (lang === costanti.Lang.IT) {
return true
}
}
}
return false
},
getAskToVerifyReg(): boolean {
return this.getConfSiteOptionEnabled(shared_consts.ConfSite.Need_Aportador_On_DataReg_To_Verify_Reg)
},
@@ -7242,9 +7279,9 @@ export const tools = {
let mycl = ''
if (myanim)
mycl = (!!myanim.name ? myanim.name : '') +
' ' + (!!myanim.clduration ? myanim.clduration : '') +
' ' + (!!myanim.cldelay ? myanim.cldelay : '') +
' ' + (!!myanim.timingtype ? myanim.timingtype : '')
' ' + (!!myanim.clduration ? myanim.clduration : '') +
' ' + (!!myanim.cldelay ? myanim.cldelay : '') +
' ' + (!!myanim.timingtype ? myanim.timingtype : '')
else
mycl = ''
@@ -7255,6 +7292,20 @@ export const tools = {
},
getLabelFooterByRow(row: any, field: string, tablesel: string) {
if (field) {
const mycol = fieldsTable.getColByTable(tablesel, field)
if (mycol) {
console.log('remote_table = ', mycol.remote_table, 'remote_key', mycol.remote_key)
console.log('ROW', row)
return tools.getValueByRemoteField(mycol, row)
}
}
return ''
},
// getLocale() {
// if (navigator.languages && navigator.languages.length > 0) {
// return navigator.languages[0]